1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Provides further details for the reason behind the bad request. For reason type <code>CODE_ERROR</code>, the detail will contain a list of code errors.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct BadRequestDetail {
/// <p>Contains the list of errors in the request.</p>
#[doc(hidden)]
pub code_errors: std::option::Option<std::vec::Vec<crate::model::CodeError>>,
}
impl BadRequestDetail {
/// <p>Contains the list of errors in the request.</p>
pub fn code_errors(&self) -> std::option::Option<&[crate::model::CodeError]> {
self.code_errors.as_deref()
}
}
/// See [`BadRequestDetail`](crate::model::BadRequestDetail).
pub mod bad_request_detail {
/// A builder for [`BadRequestDetail`](crate::model::BadRequestDetail).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) code_errors: std::option::Option<std::vec::Vec<crate::model::CodeError>>,
}
impl Builder {
/// Appends an item to `code_errors`.
///
/// To override the contents of this collection use [`set_code_errors`](Self::set_code_errors).
///
/// <p>Contains the list of errors in the request.</p>
pub fn code_errors(mut self, input: crate::model::CodeError) -> Self {
let mut v = self.code_errors.unwrap_or_default();
v.push(input);
self.code_errors = Some(v);
self
}
/// <p>Contains the list of errors in the request.</p>
pub fn set_code_errors(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::CodeError>>,
) -> Self {
self.code_errors = input;
self
}
/// Consumes the builder and constructs a [`BadRequestDetail`](crate::model::BadRequestDetail).
pub fn build(self) -> crate::model::BadRequestDetail {
crate::model::BadRequestDetail {
code_errors: self.code_errors,
}
}
}
}
impl BadRequestDetail {
/// Creates a new builder-style object to manufacture [`BadRequestDetail`](crate::model::BadRequestDetail).
pub fn builder() -> crate::model::bad_request_detail::Builder {
crate::model::bad_request_detail::Builder::default()
}
}
/// <p>Describes an AppSync error.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CodeError {
/// <p>The type of code error. </p>
/// <p>Examples include, but aren't limited to: <code>LINT_ERROR</code>, <code>PARSER_ERROR</code>.</p>
#[doc(hidden)]
pub error_type: std::option::Option<std::string::String>,
/// <p>A user presentable error.</p>
/// <p>Examples include, but aren't limited to: <code>Parsing error: Unterminated string literal</code>.</p>
#[doc(hidden)]
pub value: std::option::Option<std::string::String>,
/// <p>The line, column, and span location of the error in the code.</p>
#[doc(hidden)]
pub location: std::option::Option<crate::model::CodeErrorLocation>,
}
impl CodeError {
/// <p>The type of code error. </p>
/// <p>Examples include, but aren't limited to: <code>LINT_ERROR</code>, <code>PARSER_ERROR</code>.</p>
pub fn error_type(&self) -> std::option::Option<&str> {
self.error_type.as_deref()
}
/// <p>A user presentable error.</p>
/// <p>Examples include, but aren't limited to: <code>Parsing error: Unterminated string literal</code>.</p>
pub fn value(&self) -> std::option::Option<&str> {
self.value.as_deref()
}
/// <p>The line, column, and span location of the error in the code.</p>
pub fn location(&self) -> std::option::Option<&crate::model::CodeErrorLocation> {
self.location.as_ref()
}
}
/// See [`CodeError`](crate::model::CodeError).
pub mod code_error {
/// A builder for [`CodeError`](crate::model::CodeError).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) error_type: std::option::Option<std::string::String>,
pub(crate) value: std::option::Option<std::string::String>,
pub(crate) location: std::option::Option<crate::model::CodeErrorLocation>,
}
impl Builder {
/// <p>The type of code error. </p>
/// <p>Examples include, but aren't limited to: <code>LINT_ERROR</code>, <code>PARSER_ERROR</code>.</p>
pub fn error_type(mut self, input: impl Into<std::string::String>) -> Self {
self.error_type = Some(input.into());
self
}
/// <p>The type of code error. </p>
/// <p>Examples include, but aren't limited to: <code>LINT_ERROR</code>, <code>PARSER_ERROR</code>.</p>
pub fn set_error_type(mut self, input: std::option::Option<std::string::String>) -> Self {
self.error_type = input;
self
}
/// <p>A user presentable error.</p>
/// <p>Examples include, but aren't limited to: <code>Parsing error: Unterminated string literal</code>.</p>
pub fn value(mut self, input: impl Into<std::string::String>) -> Self {
self.value = Some(input.into());
self
}
/// <p>A user presentable error.</p>
/// <p>Examples include, but aren't limited to: <code>Parsing error: Unterminated string literal</code>.</p>
pub fn set_value(mut self, input: std::option::Option<std::string::String>) -> Self {
self.value = input;
self
}
/// <p>The line, column, and span location of the error in the code.</p>
pub fn location(mut self, input: crate::model::CodeErrorLocation) -> Self {
self.location = Some(input);
self
}
/// <p>The line, column, and span location of the error in the code.</p>
pub fn set_location(
mut self,
input: std::option::Option<crate::model::CodeErrorLocation>,
) -> Self {
self.location = input;
self
}
/// Consumes the builder and constructs a [`CodeError`](crate::model::CodeError).
pub fn build(self) -> crate::model::CodeError {
crate::model::CodeError {
error_type: self.error_type,
value: self.value,
location: self.location,
}
}
}
}
impl CodeError {
/// Creates a new builder-style object to manufacture [`CodeError`](crate::model::CodeError).
pub fn builder() -> crate::model::code_error::Builder {
crate::model::code_error::Builder::default()
}
}
/// <p>Describes the location of the error in a code sample.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CodeErrorLocation {
/// <p>The line number in the code. Defaults to <code>0</code> if unknown.</p>
#[doc(hidden)]
pub line: i32,
/// <p>The column number in the code. Defaults to <code>0</code> if unknown.</p>
#[doc(hidden)]
pub column: i32,
/// <p>The span/length of the error. Defaults to <code>-1</code> if unknown.</p>
#[doc(hidden)]
pub span: i32,
}
impl CodeErrorLocation {
/// <p>The line number in the code. Defaults to <code>0</code> if unknown.</p>
pub fn line(&self) -> i32 {
self.line
}
/// <p>The column number in the code. Defaults to <code>0</code> if unknown.</p>
pub fn column(&self) -> i32 {
self.column
}
/// <p>The span/length of the error. Defaults to <code>-1</code> if unknown.</p>
pub fn span(&self) -> i32 {
self.span
}
}
/// See [`CodeErrorLocation`](crate::model::CodeErrorLocation).
pub mod code_error_location {
/// A builder for [`CodeErrorLocation`](crate::model::CodeErrorLocation).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) line: std::option::Option<i32>,
pub(crate) column: std::option::Option<i32>,
pub(crate) span: std::option::Option<i32>,
}
impl Builder {
/// <p>The line number in the code. Defaults to <code>0</code> if unknown.</p>
pub fn line(mut self, input: i32) -> Self {
self.line = Some(input);
self
}
/// <p>The line number in the code. Defaults to <code>0</code> if unknown.</p>
pub fn set_line(mut self, input: std::option::Option<i32>) -> Self {
self.line = input;
self
}
/// <p>The column number in the code. Defaults to <code>0</code> if unknown.</p>
pub fn column(mut self, input: i32) -> Self {
self.column = Some(input);
self
}
/// <p>The column number in the code. Defaults to <code>0</code> if unknown.</p>
pub fn set_column(mut self, input: std::option::Option<i32>) -> Self {
self.column = input;
self
}
/// <p>The span/length of the error. Defaults to <code>-1</code> if unknown.</p>
pub fn span(mut self, input: i32) -> Self {
self.span = Some(input);
self
}
/// <p>The span/length of the error. Defaults to <code>-1</code> if unknown.</p>
pub fn set_span(mut self, input: std::option::Option<i32>) -> Self {
self.span = input;
self
}
/// Consumes the builder and constructs a [`CodeErrorLocation`](crate::model::CodeErrorLocation).
pub fn build(self) -> crate::model::CodeErrorLocation {
crate::model::CodeErrorLocation {
line: self.line.unwrap_or_default(),
column: self.column.unwrap_or_default(),
span: self.span.unwrap_or_default(),
}
}
}
}
impl CodeErrorLocation {
/// Creates a new builder-style object to manufacture [`CodeErrorLocation`](crate::model::CodeErrorLocation).
pub fn builder() -> crate::model::code_error_location::Builder {
crate::model::code_error_location::Builder::default()
}
}
/// When writing a match expression against `BadRequestReason`, it is important to ensure
/// your code is forward-compatible. That is, if a match arm handles a case for a
/// feature that is supported by the service but has not been represented as an enum
/// variant in a current version of SDK, your code should continue to work when you
/// upgrade SDK to a future version in which the enum does include a variant for that
/// feature.
///
/// Here is an example of how you can make a match expression forward-compatible:
///
/// ```text
/// # let badrequestreason = unimplemented!();
/// match badrequestreason {
/// BadRequestReason::CodeError => { /* ... */ },
/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
/// _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `badrequestreason` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `BadRequestReason::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `BadRequestReason::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
/// and calling `as_str` on it yields `"NewFeature"`.
/// This match expression is forward-compatible when executed with a newer
/// version of SDK where the variant `BadRequestReason::NewFeature` is defined.
/// Specifically, when `badrequestreason` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `BadRequestReason::NewFeature` also yielding `"NewFeature"`.
///
/// Explicitly matching on the `Unknown` variant should
/// be avoided for two reasons:
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
/// - It might inadvertently shadow other intended match arms.
/// <p>Provides context for the cause of the bad request. The only supported value is
/// <code>CODE_ERROR</code>.</p>
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum BadRequestReason {
#[allow(missing_docs)] // documentation missing in model
CodeError,
/// `Unknown` contains new variants that have been added since this code was generated.
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for BadRequestReason {
fn from(s: &str) -> Self {
match s {
"CODE_ERROR" => BadRequestReason::CodeError,
other => BadRequestReason::Unknown(crate::types::UnknownVariantValue(other.to_owned())),
}
}
}
impl std::str::FromStr for BadRequestReason {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(BadRequestReason::from(s))
}
}
impl BadRequestReason {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
BadRequestReason::CodeError => "CODE_ERROR",
BadRequestReason::Unknown(value) => value.as_str(),
}
}
/// Returns all the `&str` values of the enum members.
pub const fn values() -> &'static [&'static str] {
&["CODE_ERROR"]
}
}
impl AsRef<str> for BadRequestReason {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>Describes a type.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Type {
/// <p>The type name.</p>
#[doc(hidden)]
pub name: std::option::Option<std::string::String>,
/// <p>The type description.</p>
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
/// <p>The type Amazon Resource Name (ARN).</p>
#[doc(hidden)]
pub arn: std::option::Option<std::string::String>,
/// <p>The type definition.</p>
#[doc(hidden)]
pub definition: std::option::Option<std::string::String>,
/// <p>The type format: SDL or JSON.</p>
#[doc(hidden)]
pub format: std::option::Option<crate::model::TypeDefinitionFormat>,
}
impl Type {
/// <p>The type name.</p>
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
/// <p>The type description.</p>
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
/// <p>The type Amazon Resource Name (ARN).</p>
pub fn arn(&self) -> std::option::Option<&str> {
self.arn.as_deref()
}
/// <p>The type definition.</p>
pub fn definition(&self) -> std::option::Option<&str> {
self.definition.as_deref()
}
/// <p>The type format: SDL or JSON.</p>
pub fn format(&self) -> std::option::Option<&crate::model::TypeDefinitionFormat> {
self.format.as_ref()
}
}
/// See [`Type`](crate::model::Type).
pub mod r#type {
/// A builder for [`Type`](crate::model::Type).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) arn: std::option::Option<std::string::String>,
pub(crate) definition: std::option::Option<std::string::String>,
pub(crate) format: std::option::Option<crate::model::TypeDefinitionFormat>,
}
impl Builder {
/// <p>The type name.</p>
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
/// <p>The type name.</p>
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
/// <p>The type description.</p>
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
/// <p>The type description.</p>
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
/// <p>The type Amazon Resource Name (ARN).</p>
pub fn arn(mut self, input: impl Into<std::string::String>) -> Self {
self.arn = Some(input.into());
self
}
/// <p>The type Amazon Resource Name (ARN).</p>
pub fn set_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.arn = input;
self
}
/// <p>The type definition.</p>
pub fn definition(mut self, input: impl Into<std::string::String>) -> Self {
self.definition = Some(input.into());
self
}
/// <p>The type definition.</p>
pub fn set_definition(mut self, input: std::option::Option<std::string::String>) -> Self {
self.definition = input;
self
}
/// <p>The type format: SDL or JSON.</p>
pub fn format(mut self, input: crate::model::TypeDefinitionFormat) -> Self {
self.format = Some(input);
self
}
/// <p>The type format: SDL or JSON.</p>
pub fn set_format(
mut self,
input: std::option::Option<crate::model::TypeDefinitionFormat>,
) -> Self {
self.format = input;
self
}
/// Consumes the builder and constructs a [`Type`](crate::model::Type).
pub fn build(self) -> crate::model::Type {
crate::model::Type {
name: self.name,
description: self.description,
arn: self.arn,
definition: self.definition,
format: self.format,
}
}
}
}
impl Type {
/// Creates a new builder-style object to manufacture [`Type`](crate::model::Type).
pub fn builder() -> crate::model::r#type::Builder {
crate::model::r#type::Builder::default()
}
}
/// When writing a match expression against `TypeDefinitionFormat`, it is important to ensure
/// your code is forward-compatible. That is, if a match arm handles a case for a
/// feature that is supported by the service but has not been represented as an enum
/// variant in a current version of SDK, your code should continue to work when you
/// upgrade SDK to a future version in which the enum does include a variant for that
/// feature.
///
/// Here is an example of how you can make a match expression forward-compatible:
///
/// ```text
/// # let typedefinitionformat = unimplemented!();
/// match typedefinitionformat {
/// TypeDefinitionFormat::Json => { /* ... */ },
/// TypeDefinitionFormat::Sdl => { /* ... */ },
/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
/// _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `typedefinitionformat` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `TypeDefinitionFormat::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `TypeDefinitionFormat::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
/// and calling `as_str` on it yields `"NewFeature"`.
/// This match expression is forward-compatible when executed with a newer
/// version of SDK where the variant `TypeDefinitionFormat::NewFeature` is defined.
/// Specifically, when `typedefinitionformat` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `TypeDefinitionFormat::NewFeature` also yielding `"NewFeature"`.
///
/// Explicitly matching on the `Unknown` variant should
/// be avoided for two reasons:
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
/// - It might inadvertently shadow other intended match arms.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum TypeDefinitionFormat {
#[allow(missing_docs)] // documentation missing in model
Json,
#[allow(missing_docs)] // documentation missing in model
Sdl,
/// `Unknown` contains new variants that have been added since this code was generated.
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for TypeDefinitionFormat {
fn from(s: &str) -> Self {
match s {
"JSON" => TypeDefinitionFormat::Json,
"SDL" => TypeDefinitionFormat::Sdl,
other => {
TypeDefinitionFormat::Unknown(crate::types::UnknownVariantValue(other.to_owned()))
}
}
}
}
impl std::str::FromStr for TypeDefinitionFormat {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(TypeDefinitionFormat::from(s))
}
}
impl TypeDefinitionFormat {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
TypeDefinitionFormat::Json => "JSON",
TypeDefinitionFormat::Sdl => "SDL",
TypeDefinitionFormat::Unknown(value) => value.as_str(),
}
}
/// Returns all the `&str` values of the enum members.
pub const fn values() -> &'static [&'static str] {
&["JSON", "SDL"]
}
}
impl AsRef<str> for TypeDefinitionFormat {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>Describes a resolver.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Resolver {
/// <p>The resolver type name.</p>
#[doc(hidden)]
pub type_name: std::option::Option<std::string::String>,
/// <p>The resolver field name.</p>
#[doc(hidden)]
pub field_name: std::option::Option<std::string::String>,
/// <p>The resolver data source name.</p>
#[doc(hidden)]
pub data_source_name: std::option::Option<std::string::String>,
/// <p>The resolver Amazon Resource Name (ARN).</p>
#[doc(hidden)]
pub resolver_arn: std::option::Option<std::string::String>,
/// <p>The request mapping template.</p>
#[doc(hidden)]
pub request_mapping_template: std::option::Option<std::string::String>,
/// <p>The response mapping template.</p>
#[doc(hidden)]
pub response_mapping_template: std::option::Option<std::string::String>,
/// <p>The resolver type.</p>
/// <ul>
/// <li> <p> <b>UNIT</b>: A UNIT resolver type. A UNIT resolver is the default resolver type. You can use a UNIT resolver to run a GraphQL query against a single data source.</p> </li>
/// <li> <p> <b>PIPELINE</b>: A PIPELINE resolver type. You can use a PIPELINE resolver to invoke a series of <code>Function</code> objects in a serial manner. You can use a pipeline resolver to run a GraphQL query against multiple data sources.</p> </li>
/// </ul>
#[doc(hidden)]
pub kind: std::option::Option<crate::model::ResolverKind>,
/// <p>The <code>PipelineConfig</code>.</p>
#[doc(hidden)]
pub pipeline_config: std::option::Option<crate::model::PipelineConfig>,
/// <p>The <code>SyncConfig</code> for a resolver attached to a versioned data source.</p>
#[doc(hidden)]
pub sync_config: std::option::Option<crate::model::SyncConfig>,
/// <p>The caching configuration for the resolver.</p>
#[doc(hidden)]
pub caching_config: std::option::Option<crate::model::CachingConfig>,
/// <p>The maximum batching size for a resolver.</p>
#[doc(hidden)]
pub max_batch_size: i32,
/// <p>Describes a runtime used by an Amazon Web Services AppSync pipeline resolver or Amazon Web Services AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.</p>
#[doc(hidden)]
pub runtime: std::option::Option<crate::model::AppSyncRuntime>,
/// <p>The <code>resolver</code> code that contains the request and response functions. When code is used, the <code>runtime</code> is required. The <code>runtime</code> value must be <code>APPSYNC_JS</code>.</p>
#[doc(hidden)]
pub code: std::option::Option<std::string::String>,
}
impl Resolver {
/// <p>The resolver type name.</p>
pub fn type_name(&self) -> std::option::Option<&str> {
self.type_name.as_deref()
}
/// <p>The resolver field name.</p>
pub fn field_name(&self) -> std::option::Option<&str> {
self.field_name.as_deref()
}
/// <p>The resolver data source name.</p>
pub fn data_source_name(&self) -> std::option::Option<&str> {
self.data_source_name.as_deref()
}
/// <p>The resolver Amazon Resource Name (ARN).</p>
pub fn resolver_arn(&self) -> std::option::Option<&str> {
self.resolver_arn.as_deref()
}
/// <p>The request mapping template.</p>
pub fn request_mapping_template(&self) -> std::option::Option<&str> {
self.request_mapping_template.as_deref()
}
/// <p>The response mapping template.</p>
pub fn response_mapping_template(&self) -> std::option::Option<&str> {
self.response_mapping_template.as_deref()
}
/// <p>The resolver type.</p>
/// <ul>
/// <li> <p> <b>UNIT</b>: A UNIT resolver type. A UNIT resolver is the default resolver type. You can use a UNIT resolver to run a GraphQL query against a single data source.</p> </li>
/// <li> <p> <b>PIPELINE</b>: A PIPELINE resolver type. You can use a PIPELINE resolver to invoke a series of <code>Function</code> objects in a serial manner. You can use a pipeline resolver to run a GraphQL query against multiple data sources.</p> </li>
/// </ul>
pub fn kind(&self) -> std::option::Option<&crate::model::ResolverKind> {
self.kind.as_ref()
}
/// <p>The <code>PipelineConfig</code>.</p>
pub fn pipeline_config(&self) -> std::option::Option<&crate::model::PipelineConfig> {
self.pipeline_config.as_ref()
}
/// <p>The <code>SyncConfig</code> for a resolver attached to a versioned data source.</p>
pub fn sync_config(&self) -> std::option::Option<&crate::model::SyncConfig> {
self.sync_config.as_ref()
}
/// <p>The caching configuration for the resolver.</p>
pub fn caching_config(&self) -> std::option::Option<&crate::model::CachingConfig> {
self.caching_config.as_ref()
}
/// <p>The maximum batching size for a resolver.</p>
pub fn max_batch_size(&self) -> i32 {
self.max_batch_size
}
/// <p>Describes a runtime used by an Amazon Web Services AppSync pipeline resolver or Amazon Web Services AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.</p>
pub fn runtime(&self) -> std::option::Option<&crate::model::AppSyncRuntime> {
self.runtime.as_ref()
}
/// <p>The <code>resolver</code> code that contains the request and response functions. When code is used, the <code>runtime</code> is required. The <code>runtime</code> value must be <code>APPSYNC_JS</code>.</p>
pub fn code(&self) -> std::option::Option<&str> {
self.code.as_deref()
}
}
/// See [`Resolver`](crate::model::Resolver).
pub mod resolver {
/// A builder for [`Resolver`](crate::model::Resolver).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) type_name: std::option::Option<std::string::String>,
pub(crate) field_name: std::option::Option<std::string::String>,
pub(crate) data_source_name: std::option::Option<std::string::String>,
pub(crate) resolver_arn: std::option::Option<std::string::String>,
pub(crate) request_mapping_template: std::option::Option<std::string::String>,
pub(crate) response_mapping_template: std::option::Option<std::string::String>,
pub(crate) kind: std::option::Option<crate::model::ResolverKind>,
pub(crate) pipeline_config: std::option::Option<crate::model::PipelineConfig>,
pub(crate) sync_config: std::option::Option<crate::model::SyncConfig>,
pub(crate) caching_config: std::option::Option<crate::model::CachingConfig>,
pub(crate) max_batch_size: std::option::Option<i32>,
pub(crate) runtime: std::option::Option<crate::model::AppSyncRuntime>,
pub(crate) code: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The resolver type name.</p>
pub fn type_name(mut self, input: impl Into<std::string::String>) -> Self {
self.type_name = Some(input.into());
self
}
/// <p>The resolver type name.</p>
pub fn set_type_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.type_name = input;
self
}
/// <p>The resolver field name.</p>
pub fn field_name(mut self, input: impl Into<std::string::String>) -> Self {
self.field_name = Some(input.into());
self
}
/// <p>The resolver field name.</p>
pub fn set_field_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.field_name = input;
self
}
/// <p>The resolver data source name.</p>
pub fn data_source_name(mut self, input: impl Into<std::string::String>) -> Self {
self.data_source_name = Some(input.into());
self
}
/// <p>The resolver data source name.</p>
pub fn set_data_source_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.data_source_name = input;
self
}
/// <p>The resolver Amazon Resource Name (ARN).</p>
pub fn resolver_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.resolver_arn = Some(input.into());
self
}
/// <p>The resolver Amazon Resource Name (ARN).</p>
pub fn set_resolver_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.resolver_arn = input;
self
}
/// <p>The request mapping template.</p>
pub fn request_mapping_template(mut self, input: impl Into<std::string::String>) -> Self {
self.request_mapping_template = Some(input.into());
self
}
/// <p>The request mapping template.</p>
pub fn set_request_mapping_template(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.request_mapping_template = input;
self
}
/// <p>The response mapping template.</p>
pub fn response_mapping_template(mut self, input: impl Into<std::string::String>) -> Self {
self.response_mapping_template = Some(input.into());
self
}
/// <p>The response mapping template.</p>
pub fn set_response_mapping_template(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.response_mapping_template = input;
self
}
/// <p>The resolver type.</p>
/// <ul>
/// <li> <p> <b>UNIT</b>: A UNIT resolver type. A UNIT resolver is the default resolver type. You can use a UNIT resolver to run a GraphQL query against a single data source.</p> </li>
/// <li> <p> <b>PIPELINE</b>: A PIPELINE resolver type. You can use a PIPELINE resolver to invoke a series of <code>Function</code> objects in a serial manner. You can use a pipeline resolver to run a GraphQL query against multiple data sources.</p> </li>
/// </ul>
pub fn kind(mut self, input: crate::model::ResolverKind) -> Self {
self.kind = Some(input);
self
}
/// <p>The resolver type.</p>
/// <ul>
/// <li> <p> <b>UNIT</b>: A UNIT resolver type. A UNIT resolver is the default resolver type. You can use a UNIT resolver to run a GraphQL query against a single data source.</p> </li>
/// <li> <p> <b>PIPELINE</b>: A PIPELINE resolver type. You can use a PIPELINE resolver to invoke a series of <code>Function</code> objects in a serial manner. You can use a pipeline resolver to run a GraphQL query against multiple data sources.</p> </li>
/// </ul>
pub fn set_kind(mut self, input: std::option::Option<crate::model::ResolverKind>) -> Self {
self.kind = input;
self
}
/// <p>The <code>PipelineConfig</code>.</p>
pub fn pipeline_config(mut self, input: crate::model::PipelineConfig) -> Self {
self.pipeline_config = Some(input);
self
}
/// <p>The <code>PipelineConfig</code>.</p>
pub fn set_pipeline_config(
mut self,
input: std::option::Option<crate::model::PipelineConfig>,
) -> Self {
self.pipeline_config = input;
self
}
/// <p>The <code>SyncConfig</code> for a resolver attached to a versioned data source.</p>
pub fn sync_config(mut self, input: crate::model::SyncConfig) -> Self {
self.sync_config = Some(input);
self
}
/// <p>The <code>SyncConfig</code> for a resolver attached to a versioned data source.</p>
pub fn set_sync_config(
mut self,
input: std::option::Option<crate::model::SyncConfig>,
) -> Self {
self.sync_config = input;
self
}
/// <p>The caching configuration for the resolver.</p>
pub fn caching_config(mut self, input: crate::model::CachingConfig) -> Self {
self.caching_config = Some(input);
self
}
/// <p>The caching configuration for the resolver.</p>
pub fn set_caching_config(
mut self,
input: std::option::Option<crate::model::CachingConfig>,
) -> Self {
self.caching_config = input;
self
}
/// <p>The maximum batching size for a resolver.</p>
pub fn max_batch_size(mut self, input: i32) -> Self {
self.max_batch_size = Some(input);
self
}
/// <p>The maximum batching size for a resolver.</p>
pub fn set_max_batch_size(mut self, input: std::option::Option<i32>) -> Self {
self.max_batch_size = input;
self
}
/// <p>Describes a runtime used by an Amazon Web Services AppSync pipeline resolver or Amazon Web Services AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.</p>
pub fn runtime(mut self, input: crate::model::AppSyncRuntime) -> Self {
self.runtime = Some(input);
self
}
/// <p>Describes a runtime used by an Amazon Web Services AppSync pipeline resolver or Amazon Web Services AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.</p>
pub fn set_runtime(
mut self,
input: std::option::Option<crate::model::AppSyncRuntime>,
) -> Self {
self.runtime = input;
self
}
/// <p>The <code>resolver</code> code that contains the request and response functions. When code is used, the <code>runtime</code> is required. The <code>runtime</code> value must be <code>APPSYNC_JS</code>.</p>
pub fn code(mut self, input: impl Into<std::string::String>) -> Self {
self.code = Some(input.into());
self
}
/// <p>The <code>resolver</code> code that contains the request and response functions. When code is used, the <code>runtime</code> is required. The <code>runtime</code> value must be <code>APPSYNC_JS</code>.</p>
pub fn set_code(mut self, input: std::option::Option<std::string::String>) -> Self {
self.code = input;
self
}
/// Consumes the builder and constructs a [`Resolver`](crate::model::Resolver).
pub fn build(self) -> crate::model::Resolver {
crate::model::Resolver {
type_name: self.type_name,
field_name: self.field_name,
data_source_name: self.data_source_name,
resolver_arn: self.resolver_arn,
request_mapping_template: self.request_mapping_template,
response_mapping_template: self.response_mapping_template,
kind: self.kind,
pipeline_config: self.pipeline_config,
sync_config: self.sync_config,
caching_config: self.caching_config,
max_batch_size: self.max_batch_size.unwrap_or_default(),
runtime: self.runtime,
code: self.code,
}
}
}
}
impl Resolver {
/// Creates a new builder-style object to manufacture [`Resolver`](crate::model::Resolver).
pub fn builder() -> crate::model::resolver::Builder {
crate::model::resolver::Builder::default()
}
}
/// <p>Describes a runtime used by an Amazon Web Services AppSync pipeline resolver or Amazon Web Services AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct AppSyncRuntime {
/// <p>The <code>name</code> of the runtime to use. Currently, the only allowed value is <code>APPSYNC_JS</code>.</p>
#[doc(hidden)]
pub name: std::option::Option<crate::model::RuntimeName>,
/// <p>The <code>version</code> of the runtime to use. Currently, the only allowed version is <code>1.0.0</code>.</p>
#[doc(hidden)]
pub runtime_version: std::option::Option<std::string::String>,
}
impl AppSyncRuntime {
/// <p>The <code>name</code> of the runtime to use. Currently, the only allowed value is <code>APPSYNC_JS</code>.</p>
pub fn name(&self) -> std::option::Option<&crate::model::RuntimeName> {
self.name.as_ref()
}
/// <p>The <code>version</code> of the runtime to use. Currently, the only allowed version is <code>1.0.0</code>.</p>
pub fn runtime_version(&self) -> std::option::Option<&str> {
self.runtime_version.as_deref()
}
}
/// See [`AppSyncRuntime`](crate::model::AppSyncRuntime).
pub mod app_sync_runtime {
/// A builder for [`AppSyncRuntime`](crate::model::AppSyncRuntime).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) name: std::option::Option<crate::model::RuntimeName>,
pub(crate) runtime_version: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The <code>name</code> of the runtime to use. Currently, the only allowed value is <code>APPSYNC_JS</code>.</p>
pub fn name(mut self, input: crate::model::RuntimeName) -> Self {
self.name = Some(input);
self
}
/// <p>The <code>name</code> of the runtime to use. Currently, the only allowed value is <code>APPSYNC_JS</code>.</p>
pub fn set_name(mut self, input: std::option::Option<crate::model::RuntimeName>) -> Self {
self.name = input;
self
}
/// <p>The <code>version</code> of the runtime to use. Currently, the only allowed version is <code>1.0.0</code>.</p>
pub fn runtime_version(mut self, input: impl Into<std::string::String>) -> Self {
self.runtime_version = Some(input.into());
self
}
/// <p>The <code>version</code> of the runtime to use. Currently, the only allowed version is <code>1.0.0</code>.</p>
pub fn set_runtime_version(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.runtime_version = input;
self
}
/// Consumes the builder and constructs a [`AppSyncRuntime`](crate::model::AppSyncRuntime).
pub fn build(self) -> crate::model::AppSyncRuntime {
crate::model::AppSyncRuntime {
name: self.name,
runtime_version: self.runtime_version,
}
}
}
}
impl AppSyncRuntime {
/// Creates a new builder-style object to manufacture [`AppSyncRuntime`](crate::model::AppSyncRuntime).
pub fn builder() -> crate::model::app_sync_runtime::Builder {
crate::model::app_sync_runtime::Builder::default()
}
}
/// When writing a match expression against `RuntimeName`, it is important to ensure
/// your code is forward-compatible. That is, if a match arm handles a case for a
/// feature that is supported by the service but has not been represented as an enum
/// variant in a current version of SDK, your code should continue to work when you
/// upgrade SDK to a future version in which the enum does include a variant for that
/// feature.
///
/// Here is an example of how you can make a match expression forward-compatible:
///
/// ```text
/// # let runtimename = unimplemented!();
/// match runtimename {
/// RuntimeName::AppsyncJs => { /* ... */ },
/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
/// _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `runtimename` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `RuntimeName::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `RuntimeName::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
/// and calling `as_str` on it yields `"NewFeature"`.
/// This match expression is forward-compatible when executed with a newer
/// version of SDK where the variant `RuntimeName::NewFeature` is defined.
/// Specifically, when `runtimename` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `RuntimeName::NewFeature` also yielding `"NewFeature"`.
///
/// Explicitly matching on the `Unknown` variant should
/// be avoided for two reasons:
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
/// - It might inadvertently shadow other intended match arms.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum RuntimeName {
#[allow(missing_docs)] // documentation missing in model
AppsyncJs,
/// `Unknown` contains new variants that have been added since this code was generated.
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for RuntimeName {
fn from(s: &str) -> Self {
match s {
"APPSYNC_JS" => RuntimeName::AppsyncJs,
other => RuntimeName::Unknown(crate::types::UnknownVariantValue(other.to_owned())),
}
}
}
impl std::str::FromStr for RuntimeName {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(RuntimeName::from(s))
}
}
impl RuntimeName {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
RuntimeName::AppsyncJs => "APPSYNC_JS",
RuntimeName::Unknown(value) => value.as_str(),
}
}
/// Returns all the `&str` values of the enum members.
pub const fn values() -> &'static [&'static str] {
&["APPSYNC_JS"]
}
}
impl AsRef<str> for RuntimeName {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>The caching configuration for a resolver that has caching activated.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CachingConfig {
/// <p>The TTL in seconds for a resolver that has caching activated.</p>
/// <p>Valid values are 1–3,600 seconds.</p>
#[doc(hidden)]
pub ttl: i64,
/// <p>The caching keys for a resolver that has caching activated.</p>
/// <p>Valid values are entries from the <code>$context.arguments</code>, <code>$context.source</code>, and <code>$context.identity</code> maps.</p>
#[doc(hidden)]
pub caching_keys: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl CachingConfig {
/// <p>The TTL in seconds for a resolver that has caching activated.</p>
/// <p>Valid values are 1–3,600 seconds.</p>
pub fn ttl(&self) -> i64 {
self.ttl
}
/// <p>The caching keys for a resolver that has caching activated.</p>
/// <p>Valid values are entries from the <code>$context.arguments</code>, <code>$context.source</code>, and <code>$context.identity</code> maps.</p>
pub fn caching_keys(&self) -> std::option::Option<&[std::string::String]> {
self.caching_keys.as_deref()
}
}
/// See [`CachingConfig`](crate::model::CachingConfig).
pub mod caching_config {
/// A builder for [`CachingConfig`](crate::model::CachingConfig).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) ttl: std::option::Option<i64>,
pub(crate) caching_keys: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl Builder {
/// <p>The TTL in seconds for a resolver that has caching activated.</p>
/// <p>Valid values are 1–3,600 seconds.</p>
pub fn ttl(mut self, input: i64) -> Self {
self.ttl = Some(input);
self
}
/// <p>The TTL in seconds for a resolver that has caching activated.</p>
/// <p>Valid values are 1–3,600 seconds.</p>
pub fn set_ttl(mut self, input: std::option::Option<i64>) -> Self {
self.ttl = input;
self
}
/// Appends an item to `caching_keys`.
///
/// To override the contents of this collection use [`set_caching_keys`](Self::set_caching_keys).
///
/// <p>The caching keys for a resolver that has caching activated.</p>
/// <p>Valid values are entries from the <code>$context.arguments</code>, <code>$context.source</code>, and <code>$context.identity</code> maps.</p>
pub fn caching_keys(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.caching_keys.unwrap_or_default();
v.push(input.into());
self.caching_keys = Some(v);
self
}
/// <p>The caching keys for a resolver that has caching activated.</p>
/// <p>Valid values are entries from the <code>$context.arguments</code>, <code>$context.source</code>, and <code>$context.identity</code> maps.</p>
pub fn set_caching_keys(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.caching_keys = input;
self
}
/// Consumes the builder and constructs a [`CachingConfig`](crate::model::CachingConfig).
pub fn build(self) -> crate::model::CachingConfig {
crate::model::CachingConfig {
ttl: self.ttl.unwrap_or_default(),
caching_keys: self.caching_keys,
}
}
}
}
impl CachingConfig {
/// Creates a new builder-style object to manufacture [`CachingConfig`](crate::model::CachingConfig).
pub fn builder() -> crate::model::caching_config::Builder {
crate::model::caching_config::Builder::default()
}
}
/// <p>Describes a Sync configuration for a resolver.</p>
/// <p>Specifies which Conflict Detection strategy and Resolution strategy to use when the resolver is invoked.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct SyncConfig {
/// <p>The Conflict Resolution strategy to perform in the event of a conflict.</p>
/// <ul>
/// <li> <p> <b>OPTIMISTIC_CONCURRENCY</b>: Resolve conflicts by rejecting mutations when versions don't match the latest version at the server.</p> </li>
/// <li> <p> <b>AUTOMERGE</b>: Resolve conflicts with the Automerge conflict resolution strategy.</p> </li>
/// <li> <p> <b>LAMBDA</b>: Resolve conflicts with an Lambda function supplied in the <code>LambdaConflictHandlerConfig</code>.</p> </li>
/// </ul>
#[doc(hidden)]
pub conflict_handler: std::option::Option<crate::model::ConflictHandlerType>,
/// <p>The Conflict Detection strategy to use.</p>
/// <ul>
/// <li> <p> <b>VERSION</b>: Detect conflicts based on object versions for this resolver.</p> </li>
/// <li> <p> <b>NONE</b>: Do not detect conflicts when invoking this resolver.</p> </li>
/// </ul>
#[doc(hidden)]
pub conflict_detection: std::option::Option<crate::model::ConflictDetectionType>,
/// <p>The <code>LambdaConflictHandlerConfig</code> when configuring <code>LAMBDA</code> as the Conflict Handler.</p>
#[doc(hidden)]
pub lambda_conflict_handler_config:
std::option::Option<crate::model::LambdaConflictHandlerConfig>,
}
impl SyncConfig {
/// <p>The Conflict Resolution strategy to perform in the event of a conflict.</p>
/// <ul>
/// <li> <p> <b>OPTIMISTIC_CONCURRENCY</b>: Resolve conflicts by rejecting mutations when versions don't match the latest version at the server.</p> </li>
/// <li> <p> <b>AUTOMERGE</b>: Resolve conflicts with the Automerge conflict resolution strategy.</p> </li>
/// <li> <p> <b>LAMBDA</b>: Resolve conflicts with an Lambda function supplied in the <code>LambdaConflictHandlerConfig</code>.</p> </li>
/// </ul>
pub fn conflict_handler(&self) -> std::option::Option<&crate::model::ConflictHandlerType> {
self.conflict_handler.as_ref()
}
/// <p>The Conflict Detection strategy to use.</p>
/// <ul>
/// <li> <p> <b>VERSION</b>: Detect conflicts based on object versions for this resolver.</p> </li>
/// <li> <p> <b>NONE</b>: Do not detect conflicts when invoking this resolver.</p> </li>
/// </ul>
pub fn conflict_detection(&self) -> std::option::Option<&crate::model::ConflictDetectionType> {
self.conflict_detection.as_ref()
}
/// <p>The <code>LambdaConflictHandlerConfig</code> when configuring <code>LAMBDA</code> as the Conflict Handler.</p>
pub fn lambda_conflict_handler_config(
&self,
) -> std::option::Option<&crate::model::LambdaConflictHandlerConfig> {
self.lambda_conflict_handler_config.as_ref()
}
}
/// See [`SyncConfig`](crate::model::SyncConfig).
pub mod sync_config {
/// A builder for [`SyncConfig`](crate::model::SyncConfig).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) conflict_handler: std::option::Option<crate::model::ConflictHandlerType>,
pub(crate) conflict_detection: std::option::Option<crate::model::ConflictDetectionType>,
pub(crate) lambda_conflict_handler_config:
std::option::Option<crate::model::LambdaConflictHandlerConfig>,
}
impl Builder {
/// <p>The Conflict Resolution strategy to perform in the event of a conflict.</p>
/// <ul>
/// <li> <p> <b>OPTIMISTIC_CONCURRENCY</b>: Resolve conflicts by rejecting mutations when versions don't match the latest version at the server.</p> </li>
/// <li> <p> <b>AUTOMERGE</b>: Resolve conflicts with the Automerge conflict resolution strategy.</p> </li>
/// <li> <p> <b>LAMBDA</b>: Resolve conflicts with an Lambda function supplied in the <code>LambdaConflictHandlerConfig</code>.</p> </li>
/// </ul>
pub fn conflict_handler(mut self, input: crate::model::ConflictHandlerType) -> Self {
self.conflict_handler = Some(input);
self
}
/// <p>The Conflict Resolution strategy to perform in the event of a conflict.</p>
/// <ul>
/// <li> <p> <b>OPTIMISTIC_CONCURRENCY</b>: Resolve conflicts by rejecting mutations when versions don't match the latest version at the server.</p> </li>
/// <li> <p> <b>AUTOMERGE</b>: Resolve conflicts with the Automerge conflict resolution strategy.</p> </li>
/// <li> <p> <b>LAMBDA</b>: Resolve conflicts with an Lambda function supplied in the <code>LambdaConflictHandlerConfig</code>.</p> </li>
/// </ul>
pub fn set_conflict_handler(
mut self,
input: std::option::Option<crate::model::ConflictHandlerType>,
) -> Self {
self.conflict_handler = input;
self
}
/// <p>The Conflict Detection strategy to use.</p>
/// <ul>
/// <li> <p> <b>VERSION</b>: Detect conflicts based on object versions for this resolver.</p> </li>
/// <li> <p> <b>NONE</b>: Do not detect conflicts when invoking this resolver.</p> </li>
/// </ul>
pub fn conflict_detection(mut self, input: crate::model::ConflictDetectionType) -> Self {
self.conflict_detection = Some(input);
self
}
/// <p>The Conflict Detection strategy to use.</p>
/// <ul>
/// <li> <p> <b>VERSION</b>: Detect conflicts based on object versions for this resolver.</p> </li>
/// <li> <p> <b>NONE</b>: Do not detect conflicts when invoking this resolver.</p> </li>
/// </ul>
pub fn set_conflict_detection(
mut self,
input: std::option::Option<crate::model::ConflictDetectionType>,
) -> Self {
self.conflict_detection = input;
self
}
/// <p>The <code>LambdaConflictHandlerConfig</code> when configuring <code>LAMBDA</code> as the Conflict Handler.</p>
pub fn lambda_conflict_handler_config(
mut self,
input: crate::model::LambdaConflictHandlerConfig,
) -> Self {
self.lambda_conflict_handler_config = Some(input);
self
}
/// <p>The <code>LambdaConflictHandlerConfig</code> when configuring <code>LAMBDA</code> as the Conflict Handler.</p>
pub fn set_lambda_conflict_handler_config(
mut self,
input: std::option::Option<crate::model::LambdaConflictHandlerConfig>,
) -> Self {
self.lambda_conflict_handler_config = input;
self
}
/// Consumes the builder and constructs a [`SyncConfig`](crate::model::SyncConfig).
pub fn build(self) -> crate::model::SyncConfig {
crate::model::SyncConfig {
conflict_handler: self.conflict_handler,
conflict_detection: self.conflict_detection,
lambda_conflict_handler_config: self.lambda_conflict_handler_config,
}
}
}
}
impl SyncConfig {
/// Creates a new builder-style object to manufacture [`SyncConfig`](crate::model::SyncConfig).
pub fn builder() -> crate::model::sync_config::Builder {
crate::model::sync_config::Builder::default()
}
}
/// <p>The <code>LambdaConflictHandlerConfig</code> object when configuring <code>LAMBDA</code> as the Conflict Handler.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct LambdaConflictHandlerConfig {
/// <p>The Amazon Resource Name (ARN) for the Lambda function to use as the Conflict Handler.</p>
#[doc(hidden)]
pub lambda_conflict_handler_arn: std::option::Option<std::string::String>,
}
impl LambdaConflictHandlerConfig {
/// <p>The Amazon Resource Name (ARN) for the Lambda function to use as the Conflict Handler.</p>
pub fn lambda_conflict_handler_arn(&self) -> std::option::Option<&str> {
self.lambda_conflict_handler_arn.as_deref()
}
}
/// See [`LambdaConflictHandlerConfig`](crate::model::LambdaConflictHandlerConfig).
pub mod lambda_conflict_handler_config {
/// A builder for [`LambdaConflictHandlerConfig`](crate::model::LambdaConflictHandlerConfig).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) lambda_conflict_handler_arn: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The Amazon Resource Name (ARN) for the Lambda function to use as the Conflict Handler.</p>
pub fn lambda_conflict_handler_arn(
mut self,
input: impl Into<std::string::String>,
) -> Self {
self.lambda_conflict_handler_arn = Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) for the Lambda function to use as the Conflict Handler.</p>
pub fn set_lambda_conflict_handler_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.lambda_conflict_handler_arn = input;
self
}
/// Consumes the builder and constructs a [`LambdaConflictHandlerConfig`](crate::model::LambdaConflictHandlerConfig).
pub fn build(self) -> crate::model::LambdaConflictHandlerConfig {
crate::model::LambdaConflictHandlerConfig {
lambda_conflict_handler_arn: self.lambda_conflict_handler_arn,
}
}
}
}
impl LambdaConflictHandlerConfig {
/// Creates a new builder-style object to manufacture [`LambdaConflictHandlerConfig`](crate::model::LambdaConflictHandlerConfig).
pub fn builder() -> crate::model::lambda_conflict_handler_config::Builder {
crate::model::lambda_conflict_handler_config::Builder::default()
}
}
/// When writing a match expression against `ConflictDetectionType`, it is important to ensure
/// your code is forward-compatible. That is, if a match arm handles a case for a
/// feature that is supported by the service but has not been represented as an enum
/// variant in a current version of SDK, your code should continue to work when you
/// upgrade SDK to a future version in which the enum does include a variant for that
/// feature.
///
/// Here is an example of how you can make a match expression forward-compatible:
///
/// ```text
/// # let conflictdetectiontype = unimplemented!();
/// match conflictdetectiontype {
/// ConflictDetectionType::None => { /* ... */ },
/// ConflictDetectionType::Version => { /* ... */ },
/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
/// _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `conflictdetectiontype` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `ConflictDetectionType::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `ConflictDetectionType::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
/// and calling `as_str` on it yields `"NewFeature"`.
/// This match expression is forward-compatible when executed with a newer
/// version of SDK where the variant `ConflictDetectionType::NewFeature` is defined.
/// Specifically, when `conflictdetectiontype` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `ConflictDetectionType::NewFeature` also yielding `"NewFeature"`.
///
/// Explicitly matching on the `Unknown` variant should
/// be avoided for two reasons:
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
/// - It might inadvertently shadow other intended match arms.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum ConflictDetectionType {
#[allow(missing_docs)] // documentation missing in model
None,
#[allow(missing_docs)] // documentation missing in model
Version,
/// `Unknown` contains new variants that have been added since this code was generated.
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for ConflictDetectionType {
fn from(s: &str) -> Self {
match s {
"NONE" => ConflictDetectionType::None,
"VERSION" => ConflictDetectionType::Version,
other => {
ConflictDetectionType::Unknown(crate::types::UnknownVariantValue(other.to_owned()))
}
}
}
}
impl std::str::FromStr for ConflictDetectionType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(ConflictDetectionType::from(s))
}
}
impl ConflictDetectionType {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
ConflictDetectionType::None => "NONE",
ConflictDetectionType::Version => "VERSION",
ConflictDetectionType::Unknown(value) => value.as_str(),
}
}
/// Returns all the `&str` values of the enum members.
pub const fn values() -> &'static [&'static str] {
&["NONE", "VERSION"]
}
}
impl AsRef<str> for ConflictDetectionType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// When writing a match expression against `ConflictHandlerType`, it is important to ensure
/// your code is forward-compatible. That is, if a match arm handles a case for a
/// feature that is supported by the service but has not been represented as an enum
/// variant in a current version of SDK, your code should continue to work when you
/// upgrade SDK to a future version in which the enum does include a variant for that
/// feature.
///
/// Here is an example of how you can make a match expression forward-compatible:
///
/// ```text
/// # let conflicthandlertype = unimplemented!();
/// match conflicthandlertype {
/// ConflictHandlerType::Automerge => { /* ... */ },
/// ConflictHandlerType::Lambda => { /* ... */ },
/// ConflictHandlerType::None => { /* ... */ },
/// ConflictHandlerType::OptimisticConcurrency => { /* ... */ },
/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
/// _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `conflicthandlertype` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `ConflictHandlerType::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `ConflictHandlerType::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
/// and calling `as_str` on it yields `"NewFeature"`.
/// This match expression is forward-compatible when executed with a newer
/// version of SDK where the variant `ConflictHandlerType::NewFeature` is defined.
/// Specifically, when `conflicthandlertype` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `ConflictHandlerType::NewFeature` also yielding `"NewFeature"`.
///
/// Explicitly matching on the `Unknown` variant should
/// be avoided for two reasons:
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
/// - It might inadvertently shadow other intended match arms.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum ConflictHandlerType {
#[allow(missing_docs)] // documentation missing in model
Automerge,
#[allow(missing_docs)] // documentation missing in model
Lambda,
#[allow(missing_docs)] // documentation missing in model
None,
#[allow(missing_docs)] // documentation missing in model
OptimisticConcurrency,
/// `Unknown` contains new variants that have been added since this code was generated.
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for ConflictHandlerType {
fn from(s: &str) -> Self {
match s {
"AUTOMERGE" => ConflictHandlerType::Automerge,
"LAMBDA" => ConflictHandlerType::Lambda,
"NONE" => ConflictHandlerType::None,
"OPTIMISTIC_CONCURRENCY" => ConflictHandlerType::OptimisticConcurrency,
other => {
ConflictHandlerType::Unknown(crate::types::UnknownVariantValue(other.to_owned()))
}
}
}
}
impl std::str::FromStr for ConflictHandlerType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(ConflictHandlerType::from(s))
}
}
impl ConflictHandlerType {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
ConflictHandlerType::Automerge => "AUTOMERGE",
ConflictHandlerType::Lambda => "LAMBDA",
ConflictHandlerType::None => "NONE",
ConflictHandlerType::OptimisticConcurrency => "OPTIMISTIC_CONCURRENCY",
ConflictHandlerType::Unknown(value) => value.as_str(),
}
}
/// Returns all the `&str` values of the enum members.
pub const fn values() -> &'static [&'static str] {
&["AUTOMERGE", "LAMBDA", "NONE", "OPTIMISTIC_CONCURRENCY"]
}
}
impl AsRef<str> for ConflictHandlerType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>The pipeline configuration for a resolver of kind <code>PIPELINE</code>.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct PipelineConfig {
/// <p>A list of <code>Function</code> objects.</p>
#[doc(hidden)]
pub functions: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl PipelineConfig {
/// <p>A list of <code>Function</code> objects.</p>
pub fn functions(&self) -> std::option::Option<&[std::string::String]> {
self.functions.as_deref()
}
}
/// See [`PipelineConfig`](crate::model::PipelineConfig).
pub mod pipeline_config {
/// A builder for [`PipelineConfig`](crate::model::PipelineConfig).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) functions: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl Builder {
/// Appends an item to `functions`.
///
/// To override the contents of this collection use [`set_functions`](Self::set_functions).
///
/// <p>A list of <code>Function</code> objects.</p>
pub fn functions(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.functions.unwrap_or_default();
v.push(input.into());
self.functions = Some(v);
self
}
/// <p>A list of <code>Function</code> objects.</p>
pub fn set_functions(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.functions = input;
self
}
/// Consumes the builder and constructs a [`PipelineConfig`](crate::model::PipelineConfig).
pub fn build(self) -> crate::model::PipelineConfig {
crate::model::PipelineConfig {
functions: self.functions,
}
}
}
}
impl PipelineConfig {
/// Creates a new builder-style object to manufacture [`PipelineConfig`](crate::model::PipelineConfig).
pub fn builder() -> crate::model::pipeline_config::Builder {
crate::model::pipeline_config::Builder::default()
}
}
/// When writing a match expression against `ResolverKind`, it is important to ensure
/// your code is forward-compatible. That is, if a match arm handles a case for a
/// feature that is supported by the service but has not been represented as an enum
/// variant in a current version of SDK, your code should continue to work when you
/// upgrade SDK to a future version in which the enum does include a variant for that
/// feature.
///
/// Here is an example of how you can make a match expression forward-compatible:
///
/// ```text
/// # let resolverkind = unimplemented!();
/// match resolverkind {
/// ResolverKind::Pipeline => { /* ... */ },
/// ResolverKind::Unit => { /* ... */ },
/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
/// _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `resolverkind` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `ResolverKind::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `ResolverKind::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
/// and calling `as_str` on it yields `"NewFeature"`.
/// This match expression is forward-compatible when executed with a newer
/// version of SDK where the variant `ResolverKind::NewFeature` is defined.
/// Specifically, when `resolverkind` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `ResolverKind::NewFeature` also yielding `"NewFeature"`.
///
/// Explicitly matching on the `Unknown` variant should
/// be avoided for two reasons:
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
/// - It might inadvertently shadow other intended match arms.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum ResolverKind {
#[allow(missing_docs)] // documentation missing in model
Pipeline,
#[allow(missing_docs)] // documentation missing in model
Unit,
/// `Unknown` contains new variants that have been added since this code was generated.
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for ResolverKind {
fn from(s: &str) -> Self {
match s {
"PIPELINE" => ResolverKind::Pipeline,
"UNIT" => ResolverKind::Unit,
other => ResolverKind::Unknown(crate::types::UnknownVariantValue(other.to_owned())),
}
}
}
impl std::str::FromStr for ResolverKind {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(ResolverKind::from(s))
}
}
impl ResolverKind {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
ResolverKind::Pipeline => "PIPELINE",
ResolverKind::Unit => "UNIT",
ResolverKind::Unknown(value) => value.as_str(),
}
}
/// Returns all the `&str` values of the enum members.
pub const fn values() -> &'static [&'static str] {
&["PIPELINE", "UNIT"]
}
}
impl AsRef<str> for ResolverKind {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>Describes a GraphQL API.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GraphqlApi {
/// <p>The API name.</p>
#[doc(hidden)]
pub name: std::option::Option<std::string::String>,
/// <p>The API ID.</p>
#[doc(hidden)]
pub api_id: std::option::Option<std::string::String>,
/// <p>The authentication type.</p>
#[doc(hidden)]
pub authentication_type: std::option::Option<crate::model::AuthenticationType>,
/// <p>The Amazon CloudWatch Logs configuration.</p>
#[doc(hidden)]
pub log_config: std::option::Option<crate::model::LogConfig>,
/// <p>The Amazon Cognito user pool configuration.</p>
#[doc(hidden)]
pub user_pool_config: std::option::Option<crate::model::UserPoolConfig>,
/// <p>The OpenID Connect configuration.</p>
#[doc(hidden)]
pub open_id_connect_config: std::option::Option<crate::model::OpenIdConnectConfig>,
/// <p>The Amazon Resource Name (ARN).</p>
#[doc(hidden)]
pub arn: std::option::Option<std::string::String>,
/// <p>The URIs.</p>
#[doc(hidden)]
pub uris:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
/// <p>The tags.</p>
#[doc(hidden)]
pub tags:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
/// <p>A list of additional authentication providers for the <code>GraphqlApi</code> API.</p>
#[doc(hidden)]
pub additional_authentication_providers:
std::option::Option<std::vec::Vec<crate::model::AdditionalAuthenticationProvider>>,
/// <p>A flag indicating whether to use X-Ray tracing for this <code>GraphqlApi</code>.</p>
#[doc(hidden)]
pub xray_enabled: bool,
/// <p>The ARN of the WAF access control list (ACL) associated with this <code>GraphqlApi</code>, if one exists.</p>
#[doc(hidden)]
pub waf_web_acl_arn: std::option::Option<std::string::String>,
/// <p>Configuration for Lambda function authorization.</p>
#[doc(hidden)]
pub lambda_authorizer_config: std::option::Option<crate::model::LambdaAuthorizerConfig>,
}
impl GraphqlApi {
/// <p>The API name.</p>
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
/// <p>The API ID.</p>
pub fn api_id(&self) -> std::option::Option<&str> {
self.api_id.as_deref()
}
/// <p>The authentication type.</p>
pub fn authentication_type(&self) -> std::option::Option<&crate::model::AuthenticationType> {
self.authentication_type.as_ref()
}
/// <p>The Amazon CloudWatch Logs configuration.</p>
pub fn log_config(&self) -> std::option::Option<&crate::model::LogConfig> {
self.log_config.as_ref()
}
/// <p>The Amazon Cognito user pool configuration.</p>
pub fn user_pool_config(&self) -> std::option::Option<&crate::model::UserPoolConfig> {
self.user_pool_config.as_ref()
}
/// <p>The OpenID Connect configuration.</p>
pub fn open_id_connect_config(
&self,
) -> std::option::Option<&crate::model::OpenIdConnectConfig> {
self.open_id_connect_config.as_ref()
}
/// <p>The Amazon Resource Name (ARN).</p>
pub fn arn(&self) -> std::option::Option<&str> {
self.arn.as_deref()
}
/// <p>The URIs.</p>
pub fn uris(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.uris.as_ref()
}
/// <p>The tags.</p>
pub fn tags(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.tags.as_ref()
}
/// <p>A list of additional authentication providers for the <code>GraphqlApi</code> API.</p>
pub fn additional_authentication_providers(
&self,
) -> std::option::Option<&[crate::model::AdditionalAuthenticationProvider]> {
self.additional_authentication_providers.as_deref()
}
/// <p>A flag indicating whether to use X-Ray tracing for this <code>GraphqlApi</code>.</p>
pub fn xray_enabled(&self) -> bool {
self.xray_enabled
}
/// <p>The ARN of the WAF access control list (ACL) associated with this <code>GraphqlApi</code>, if one exists.</p>
pub fn waf_web_acl_arn(&self) -> std::option::Option<&str> {
self.waf_web_acl_arn.as_deref()
}
/// <p>Configuration for Lambda function authorization.</p>
pub fn lambda_authorizer_config(
&self,
) -> std::option::Option<&crate::model::LambdaAuthorizerConfig> {
self.lambda_authorizer_config.as_ref()
}
}
/// See [`GraphqlApi`](crate::model::GraphqlApi).
pub mod graphql_api {
/// A builder for [`GraphqlApi`](crate::model::GraphqlApi).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) api_id: std::option::Option<std::string::String>,
pub(crate) authentication_type: std::option::Option<crate::model::AuthenticationType>,
pub(crate) log_config: std::option::Option<crate::model::LogConfig>,
pub(crate) user_pool_config: std::option::Option<crate::model::UserPoolConfig>,
pub(crate) open_id_connect_config: std::option::Option<crate::model::OpenIdConnectConfig>,
pub(crate) arn: std::option::Option<std::string::String>,
pub(crate) uris: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
pub(crate) tags: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
pub(crate) additional_authentication_providers:
std::option::Option<std::vec::Vec<crate::model::AdditionalAuthenticationProvider>>,
pub(crate) xray_enabled: std::option::Option<bool>,
pub(crate) waf_web_acl_arn: std::option::Option<std::string::String>,
pub(crate) lambda_authorizer_config:
std::option::Option<crate::model::LambdaAuthorizerConfig>,
}
impl Builder {
/// <p>The API name.</p>
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
/// <p>The API name.</p>
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
/// <p>The API ID.</p>
pub fn api_id(mut self, input: impl Into<std::string::String>) -> Self {
self.api_id = Some(input.into());
self
}
/// <p>The API ID.</p>
pub fn set_api_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.api_id = input;
self
}
/// <p>The authentication type.</p>
pub fn authentication_type(mut self, input: crate::model::AuthenticationType) -> Self {
self.authentication_type = Some(input);
self
}
/// <p>The authentication type.</p>
pub fn set_authentication_type(
mut self,
input: std::option::Option<crate::model::AuthenticationType>,
) -> Self {
self.authentication_type = input;
self
}
/// <p>The Amazon CloudWatch Logs configuration.</p>
pub fn log_config(mut self, input: crate::model::LogConfig) -> Self {
self.log_config = Some(input);
self
}
/// <p>The Amazon CloudWatch Logs configuration.</p>
pub fn set_log_config(
mut self,
input: std::option::Option<crate::model::LogConfig>,
) -> Self {
self.log_config = input;
self
}
/// <p>The Amazon Cognito user pool configuration.</p>
pub fn user_pool_config(mut self, input: crate::model::UserPoolConfig) -> Self {
self.user_pool_config = Some(input);
self
}
/// <p>The Amazon Cognito user pool configuration.</p>
pub fn set_user_pool_config(
mut self,
input: std::option::Option<crate::model::UserPoolConfig>,
) -> Self {
self.user_pool_config = input;
self
}
/// <p>The OpenID Connect configuration.</p>
pub fn open_id_connect_config(mut self, input: crate::model::OpenIdConnectConfig) -> Self {
self.open_id_connect_config = Some(input);
self
}
/// <p>The OpenID Connect configuration.</p>
pub fn set_open_id_connect_config(
mut self,
input: std::option::Option<crate::model::OpenIdConnectConfig>,
) -> Self {
self.open_id_connect_config = input;
self
}
/// <p>The Amazon Resource Name (ARN).</p>
pub fn arn(mut self, input: impl Into<std::string::String>) -> Self {
self.arn = Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN).</p>
pub fn set_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.arn = input;
self
}
/// Adds a key-value pair to `uris`.
///
/// To override the contents of this collection use [`set_uris`](Self::set_uris).
///
/// <p>The URIs.</p>
pub fn uris(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.uris.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.uris = Some(hash_map);
self
}
/// <p>The URIs.</p>
pub fn set_uris(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.uris = input;
self
}
/// Adds a key-value pair to `tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <p>The tags.</p>
pub fn tags(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.tags.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.tags = Some(hash_map);
self
}
/// <p>The tags.</p>
pub fn set_tags(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.tags = input;
self
}
/// Appends an item to `additional_authentication_providers`.
///
/// To override the contents of this collection use [`set_additional_authentication_providers`](Self::set_additional_authentication_providers).
///
/// <p>A list of additional authentication providers for the <code>GraphqlApi</code> API.</p>
pub fn additional_authentication_providers(
mut self,
input: crate::model::AdditionalAuthenticationProvider,
) -> Self {
let mut v = self.additional_authentication_providers.unwrap_or_default();
v.push(input);
self.additional_authentication_providers = Some(v);
self
}
/// <p>A list of additional authentication providers for the <code>GraphqlApi</code> API.</p>
pub fn set_additional_authentication_providers(
mut self,
input: std::option::Option<
std::vec::Vec<crate::model::AdditionalAuthenticationProvider>,
>,
) -> Self {
self.additional_authentication_providers = input;
self
}
/// <p>A flag indicating whether to use X-Ray tracing for this <code>GraphqlApi</code>.</p>
pub fn xray_enabled(mut self, input: bool) -> Self {
self.xray_enabled = Some(input);
self
}
/// <p>A flag indicating whether to use X-Ray tracing for this <code>GraphqlApi</code>.</p>
pub fn set_xray_enabled(mut self, input: std::option::Option<bool>) -> Self {
self.xray_enabled = input;
self
}
/// <p>The ARN of the WAF access control list (ACL) associated with this <code>GraphqlApi</code>, if one exists.</p>
pub fn waf_web_acl_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.waf_web_acl_arn = Some(input.into());
self
}
/// <p>The ARN of the WAF access control list (ACL) associated with this <code>GraphqlApi</code>, if one exists.</p>
pub fn set_waf_web_acl_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.waf_web_acl_arn = input;
self
}
/// <p>Configuration for Lambda function authorization.</p>
pub fn lambda_authorizer_config(
mut self,
input: crate::model::LambdaAuthorizerConfig,
) -> Self {
self.lambda_authorizer_config = Some(input);
self
}
/// <p>Configuration for Lambda function authorization.</p>
pub fn set_lambda_authorizer_config(
mut self,
input: std::option::Option<crate::model::LambdaAuthorizerConfig>,
) -> Self {
self.lambda_authorizer_config = input;
self
}
/// Consumes the builder and constructs a [`GraphqlApi`](crate::model::GraphqlApi).
pub fn build(self) -> crate::model::GraphqlApi {
crate::model::GraphqlApi {
name: self.name,
api_id: self.api_id,
authentication_type: self.authentication_type,
log_config: self.log_config,
user_pool_config: self.user_pool_config,
open_id_connect_config: self.open_id_connect_config,
arn: self.arn,
uris: self.uris,
tags: self.tags,
additional_authentication_providers: self.additional_authentication_providers,
xray_enabled: self.xray_enabled.unwrap_or_default(),
waf_web_acl_arn: self.waf_web_acl_arn,
lambda_authorizer_config: self.lambda_authorizer_config,
}
}
}
}
impl GraphqlApi {
/// Creates a new builder-style object to manufacture [`GraphqlApi`](crate::model::GraphqlApi).
pub fn builder() -> crate::model::graphql_api::Builder {
crate::model::graphql_api::Builder::default()
}
}
/// <p>A <code>LambdaAuthorizerConfig</code> specifies how to authorize AppSync API access when using the <code>AWS_LAMBDA</code> authorizer mode. Be aware that an AppSync API can have only one Lambda authorizer configured at a time.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct LambdaAuthorizerConfig {
/// <p>The number of seconds a response should be cached for. The default is 5 minutes (300 seconds). The Lambda function can override this by returning a <code>ttlOverride</code> key in its response. A value of 0 disables caching of responses.</p>
#[doc(hidden)]
pub authorizer_result_ttl_in_seconds: i32,
/// <p>The Amazon Resource Name (ARN) of the Lambda function to be called for authorization. This can be a standard Lambda ARN, a version ARN (<code>.../v3</code>), or an alias ARN. </p>
/// <p> <b>Note</b>: This Lambda function must have the following resource-based policy assigned to it. When configuring Lambda authorizers in the console, this is done for you. To use the Command Line Interface (CLI), run the following:</p>
/// <p> <code>aws lambda add-permission --function-name "arn:aws:lambda:us-east-2:111122223333:function:my-function" --statement-id "appsync" --principal appsync.amazonaws.com --action lambda:InvokeFunction</code> </p>
#[doc(hidden)]
pub authorizer_uri: std::option::Option<std::string::String>,
/// <p>A regular expression for validation of tokens before the Lambda function is called.</p>
#[doc(hidden)]
pub identity_validation_expression: std::option::Option<std::string::String>,
}
impl LambdaAuthorizerConfig {
/// <p>The number of seconds a response should be cached for. The default is 5 minutes (300 seconds). The Lambda function can override this by returning a <code>ttlOverride</code> key in its response. A value of 0 disables caching of responses.</p>
pub fn authorizer_result_ttl_in_seconds(&self) -> i32 {
self.authorizer_result_ttl_in_seconds
}
/// <p>The Amazon Resource Name (ARN) of the Lambda function to be called for authorization. This can be a standard Lambda ARN, a version ARN (<code>.../v3</code>), or an alias ARN. </p>
/// <p> <b>Note</b>: This Lambda function must have the following resource-based policy assigned to it. When configuring Lambda authorizers in the console, this is done for you. To use the Command Line Interface (CLI), run the following:</p>
/// <p> <code>aws lambda add-permission --function-name "arn:aws:lambda:us-east-2:111122223333:function:my-function" --statement-id "appsync" --principal appsync.amazonaws.com --action lambda:InvokeFunction</code> </p>
pub fn authorizer_uri(&self) -> std::option::Option<&str> {
self.authorizer_uri.as_deref()
}
/// <p>A regular expression for validation of tokens before the Lambda function is called.</p>
pub fn identity_validation_expression(&self) -> std::option::Option<&str> {
self.identity_validation_expression.as_deref()
}
}
/// See [`LambdaAuthorizerConfig`](crate::model::LambdaAuthorizerConfig).
pub mod lambda_authorizer_config {
/// A builder for [`LambdaAuthorizerConfig`](crate::model::LambdaAuthorizerConfig).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) authorizer_result_ttl_in_seconds: std::option::Option<i32>,
pub(crate) authorizer_uri: std::option::Option<std::string::String>,
pub(crate) identity_validation_expression: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The number of seconds a response should be cached for. The default is 5 minutes (300 seconds). The Lambda function can override this by returning a <code>ttlOverride</code> key in its response. A value of 0 disables caching of responses.</p>
pub fn authorizer_result_ttl_in_seconds(mut self, input: i32) -> Self {
self.authorizer_result_ttl_in_seconds = Some(input);
self
}
/// <p>The number of seconds a response should be cached for. The default is 5 minutes (300 seconds). The Lambda function can override this by returning a <code>ttlOverride</code> key in its response. A value of 0 disables caching of responses.</p>
pub fn set_authorizer_result_ttl_in_seconds(
mut self,
input: std::option::Option<i32>,
) -> Self {
self.authorizer_result_ttl_in_seconds = input;
self
}
/// <p>The Amazon Resource Name (ARN) of the Lambda function to be called for authorization. This can be a standard Lambda ARN, a version ARN (<code>.../v3</code>), or an alias ARN. </p>
/// <p> <b>Note</b>: This Lambda function must have the following resource-based policy assigned to it. When configuring Lambda authorizers in the console, this is done for you. To use the Command Line Interface (CLI), run the following:</p>
/// <p> <code>aws lambda add-permission --function-name "arn:aws:lambda:us-east-2:111122223333:function:my-function" --statement-id "appsync" --principal appsync.amazonaws.com --action lambda:InvokeFunction</code> </p>
pub fn authorizer_uri(mut self, input: impl Into<std::string::String>) -> Self {
self.authorizer_uri = Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the Lambda function to be called for authorization. This can be a standard Lambda ARN, a version ARN (<code>.../v3</code>), or an alias ARN. </p>
/// <p> <b>Note</b>: This Lambda function must have the following resource-based policy assigned to it. When configuring Lambda authorizers in the console, this is done for you. To use the Command Line Interface (CLI), run the following:</p>
/// <p> <code>aws lambda add-permission --function-name "arn:aws:lambda:us-east-2:111122223333:function:my-function" --statement-id "appsync" --principal appsync.amazonaws.com --action lambda:InvokeFunction</code> </p>
pub fn set_authorizer_uri(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.authorizer_uri = input;
self
}
/// <p>A regular expression for validation of tokens before the Lambda function is called.</p>
pub fn identity_validation_expression(
mut self,
input: impl Into<std::string::String>,
) -> Self {
self.identity_validation_expression = Some(input.into());
self
}
/// <p>A regular expression for validation of tokens before the Lambda function is called.</p>
pub fn set_identity_validation_expression(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.identity_validation_expression = input;
self
}
/// Consumes the builder and constructs a [`LambdaAuthorizerConfig`](crate::model::LambdaAuthorizerConfig).
pub fn build(self) -> crate::model::LambdaAuthorizerConfig {
crate::model::LambdaAuthorizerConfig {
authorizer_result_ttl_in_seconds: self
.authorizer_result_ttl_in_seconds
.unwrap_or_default(),
authorizer_uri: self.authorizer_uri,
identity_validation_expression: self.identity_validation_expression,
}
}
}
}
impl LambdaAuthorizerConfig {
/// Creates a new builder-style object to manufacture [`LambdaAuthorizerConfig`](crate::model::LambdaAuthorizerConfig).
pub fn builder() -> crate::model::lambda_authorizer_config::Builder {
crate::model::lambda_authorizer_config::Builder::default()
}
}
/// <p>Describes an additional authentication provider.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct AdditionalAuthenticationProvider {
/// <p>The authentication type: API key, Identity and Access Management (IAM), OpenID Connect (OIDC), Amazon Cognito user pools, or Lambda.</p>
#[doc(hidden)]
pub authentication_type: std::option::Option<crate::model::AuthenticationType>,
/// <p>The OIDC configuration.</p>
#[doc(hidden)]
pub open_id_connect_config: std::option::Option<crate::model::OpenIdConnectConfig>,
/// <p>The Amazon Cognito user pool configuration.</p>
#[doc(hidden)]
pub user_pool_config: std::option::Option<crate::model::CognitoUserPoolConfig>,
/// <p>Configuration for Lambda function authorization.</p>
#[doc(hidden)]
pub lambda_authorizer_config: std::option::Option<crate::model::LambdaAuthorizerConfig>,
}
impl AdditionalAuthenticationProvider {
/// <p>The authentication type: API key, Identity and Access Management (IAM), OpenID Connect (OIDC), Amazon Cognito user pools, or Lambda.</p>
pub fn authentication_type(&self) -> std::option::Option<&crate::model::AuthenticationType> {
self.authentication_type.as_ref()
}
/// <p>The OIDC configuration.</p>
pub fn open_id_connect_config(
&self,
) -> std::option::Option<&crate::model::OpenIdConnectConfig> {
self.open_id_connect_config.as_ref()
}
/// <p>The Amazon Cognito user pool configuration.</p>
pub fn user_pool_config(&self) -> std::option::Option<&crate::model::CognitoUserPoolConfig> {
self.user_pool_config.as_ref()
}
/// <p>Configuration for Lambda function authorization.</p>
pub fn lambda_authorizer_config(
&self,
) -> std::option::Option<&crate::model::LambdaAuthorizerConfig> {
self.lambda_authorizer_config.as_ref()
}
}
/// See [`AdditionalAuthenticationProvider`](crate::model::AdditionalAuthenticationProvider).
pub mod additional_authentication_provider {
/// A builder for [`AdditionalAuthenticationProvider`](crate::model::AdditionalAuthenticationProvider).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) authentication_type: std::option::Option<crate::model::AuthenticationType>,
pub(crate) open_id_connect_config: std::option::Option<crate::model::OpenIdConnectConfig>,
pub(crate) user_pool_config: std::option::Option<crate::model::CognitoUserPoolConfig>,
pub(crate) lambda_authorizer_config:
std::option::Option<crate::model::LambdaAuthorizerConfig>,
}
impl Builder {
/// <p>The authentication type: API key, Identity and Access Management (IAM), OpenID Connect (OIDC), Amazon Cognito user pools, or Lambda.</p>
pub fn authentication_type(mut self, input: crate::model::AuthenticationType) -> Self {
self.authentication_type = Some(input);
self
}
/// <p>The authentication type: API key, Identity and Access Management (IAM), OpenID Connect (OIDC), Amazon Cognito user pools, or Lambda.</p>
pub fn set_authentication_type(
mut self,
input: std::option::Option<crate::model::AuthenticationType>,
) -> Self {
self.authentication_type = input;
self
}
/// <p>The OIDC configuration.</p>
pub fn open_id_connect_config(mut self, input: crate::model::OpenIdConnectConfig) -> Self {
self.open_id_connect_config = Some(input);
self
}
/// <p>The OIDC configuration.</p>
pub fn set_open_id_connect_config(
mut self,
input: std::option::Option<crate::model::OpenIdConnectConfig>,
) -> Self {
self.open_id_connect_config = input;
self
}
/// <p>The Amazon Cognito user pool configuration.</p>
pub fn user_pool_config(mut self, input: crate::model::CognitoUserPoolConfig) -> Self {
self.user_pool_config = Some(input);
self
}
/// <p>The Amazon Cognito user pool configuration.</p>
pub fn set_user_pool_config(
mut self,
input: std::option::Option<crate::model::CognitoUserPoolConfig>,
) -> Self {
self.user_pool_config = input;
self
}
/// <p>Configuration for Lambda function authorization.</p>
pub fn lambda_authorizer_config(
mut self,
input: crate::model::LambdaAuthorizerConfig,
) -> Self {
self.lambda_authorizer_config = Some(input);
self
}
/// <p>Configuration for Lambda function authorization.</p>
pub fn set_lambda_authorizer_config(
mut self,
input: std::option::Option<crate::model::LambdaAuthorizerConfig>,
) -> Self {
self.lambda_authorizer_config = input;
self
}
/// Consumes the builder and constructs a [`AdditionalAuthenticationProvider`](crate::model::AdditionalAuthenticationProvider).
pub fn build(self) -> crate::model::AdditionalAuthenticationProvider {
crate::model::AdditionalAuthenticationProvider {
authentication_type: self.authentication_type,
open_id_connect_config: self.open_id_connect_config,
user_pool_config: self.user_pool_config,
lambda_authorizer_config: self.lambda_authorizer_config,
}
}
}
}
impl AdditionalAuthenticationProvider {
/// Creates a new builder-style object to manufacture [`AdditionalAuthenticationProvider`](crate::model::AdditionalAuthenticationProvider).
pub fn builder() -> crate::model::additional_authentication_provider::Builder {
crate::model::additional_authentication_provider::Builder::default()
}
}
/// <p>Describes an Amazon Cognito user pool configuration.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CognitoUserPoolConfig {
/// <p>The user pool ID.</p>
#[doc(hidden)]
pub user_pool_id: std::option::Option<std::string::String>,
/// <p>The Amazon Web Services Region in which the user pool was created.</p>
#[doc(hidden)]
pub aws_region: std::option::Option<std::string::String>,
/// <p>A regular expression for validating the incoming Amazon Cognito user pool app client ID. If this value isn't set, no filtering is applied.</p>
#[doc(hidden)]
pub app_id_client_regex: std::option::Option<std::string::String>,
}
impl CognitoUserPoolConfig {
/// <p>The user pool ID.</p>
pub fn user_pool_id(&self) -> std::option::Option<&str> {
self.user_pool_id.as_deref()
}
/// <p>The Amazon Web Services Region in which the user pool was created.</p>
pub fn aws_region(&self) -> std::option::Option<&str> {
self.aws_region.as_deref()
}
/// <p>A regular expression for validating the incoming Amazon Cognito user pool app client ID. If this value isn't set, no filtering is applied.</p>
pub fn app_id_client_regex(&self) -> std::option::Option<&str> {
self.app_id_client_regex.as_deref()
}
}
/// See [`CognitoUserPoolConfig`](crate::model::CognitoUserPoolConfig).
pub mod cognito_user_pool_config {
/// A builder for [`CognitoUserPoolConfig`](crate::model::CognitoUserPoolConfig).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) user_pool_id: std::option::Option<std::string::String>,
pub(crate) aws_region: std::option::Option<std::string::String>,
pub(crate) app_id_client_regex: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The user pool ID.</p>
pub fn user_pool_id(mut self, input: impl Into<std::string::String>) -> Self {
self.user_pool_id = Some(input.into());
self
}
/// <p>The user pool ID.</p>
pub fn set_user_pool_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.user_pool_id = input;
self
}
/// <p>The Amazon Web Services Region in which the user pool was created.</p>
pub fn aws_region(mut self, input: impl Into<std::string::String>) -> Self {
self.aws_region = Some(input.into());
self
}
/// <p>The Amazon Web Services Region in which the user pool was created.</p>
pub fn set_aws_region(mut self, input: std::option::Option<std::string::String>) -> Self {
self.aws_region = input;
self
}
/// <p>A regular expression for validating the incoming Amazon Cognito user pool app client ID. If this value isn't set, no filtering is applied.</p>
pub fn app_id_client_regex(mut self, input: impl Into<std::string::String>) -> Self {
self.app_id_client_regex = Some(input.into());
self
}
/// <p>A regular expression for validating the incoming Amazon Cognito user pool app client ID. If this value isn't set, no filtering is applied.</p>
pub fn set_app_id_client_regex(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.app_id_client_regex = input;
self
}
/// Consumes the builder and constructs a [`CognitoUserPoolConfig`](crate::model::CognitoUserPoolConfig).
pub fn build(self) -> crate::model::CognitoUserPoolConfig {
crate::model::CognitoUserPoolConfig {
user_pool_id: self.user_pool_id,
aws_region: self.aws_region,
app_id_client_regex: self.app_id_client_regex,
}
}
}
}
impl CognitoUserPoolConfig {
/// Creates a new builder-style object to manufacture [`CognitoUserPoolConfig`](crate::model::CognitoUserPoolConfig).
pub fn builder() -> crate::model::cognito_user_pool_config::Builder {
crate::model::cognito_user_pool_config::Builder::default()
}
}
/// <p>Describes an OpenID Connect (OIDC) configuration.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct OpenIdConnectConfig {
/// <p>The issuer for the OIDC configuration. The issuer returned by discovery must exactly match the value of <code>iss</code> in the ID token.</p>
#[doc(hidden)]
pub issuer: std::option::Option<std::string::String>,
/// <p>The client identifier of the relying party at the OpenID identity provider. This identifier is typically obtained when the relying party is registered with the OpenID identity provider. You can specify a regular expression so that AppSync can validate against multiple client identifiers at a time.</p>
#[doc(hidden)]
pub client_id: std::option::Option<std::string::String>,
/// <p>The number of milliseconds that a token is valid after it's issued to a user.</p>
#[doc(hidden)]
pub iat_ttl: i64,
/// <p>The number of milliseconds that a token is valid after being authenticated.</p>
#[doc(hidden)]
pub auth_ttl: i64,
}
impl OpenIdConnectConfig {
/// <p>The issuer for the OIDC configuration. The issuer returned by discovery must exactly match the value of <code>iss</code> in the ID token.</p>
pub fn issuer(&self) -> std::option::Option<&str> {
self.issuer.as_deref()
}
/// <p>The client identifier of the relying party at the OpenID identity provider. This identifier is typically obtained when the relying party is registered with the OpenID identity provider. You can specify a regular expression so that AppSync can validate against multiple client identifiers at a time.</p>
pub fn client_id(&self) -> std::option::Option<&str> {
self.client_id.as_deref()
}
/// <p>The number of milliseconds that a token is valid after it's issued to a user.</p>
pub fn iat_ttl(&self) -> i64 {
self.iat_ttl
}
/// <p>The number of milliseconds that a token is valid after being authenticated.</p>
pub fn auth_ttl(&self) -> i64 {
self.auth_ttl
}
}
/// See [`OpenIdConnectConfig`](crate::model::OpenIdConnectConfig).
pub mod open_id_connect_config {
/// A builder for [`OpenIdConnectConfig`](crate::model::OpenIdConnectConfig).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) issuer: std::option::Option<std::string::String>,
pub(crate) client_id: std::option::Option<std::string::String>,
pub(crate) iat_ttl: std::option::Option<i64>,
pub(crate) auth_ttl: std::option::Option<i64>,
}
impl Builder {
/// <p>The issuer for the OIDC configuration. The issuer returned by discovery must exactly match the value of <code>iss</code> in the ID token.</p>
pub fn issuer(mut self, input: impl Into<std::string::String>) -> Self {
self.issuer = Some(input.into());
self
}
/// <p>The issuer for the OIDC configuration. The issuer returned by discovery must exactly match the value of <code>iss</code> in the ID token.</p>
pub fn set_issuer(mut self, input: std::option::Option<std::string::String>) -> Self {
self.issuer = input;
self
}
/// <p>The client identifier of the relying party at the OpenID identity provider. This identifier is typically obtained when the relying party is registered with the OpenID identity provider. You can specify a regular expression so that AppSync can validate against multiple client identifiers at a time.</p>
pub fn client_id(mut self, input: impl Into<std::string::String>) -> Self {
self.client_id = Some(input.into());
self
}
/// <p>The client identifier of the relying party at the OpenID identity provider. This identifier is typically obtained when the relying party is registered with the OpenID identity provider. You can specify a regular expression so that AppSync can validate against multiple client identifiers at a time.</p>
pub fn set_client_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.client_id = input;
self
}
/// <p>The number of milliseconds that a token is valid after it's issued to a user.</p>
pub fn iat_ttl(mut self, input: i64) -> Self {
self.iat_ttl = Some(input);
self
}
/// <p>The number of milliseconds that a token is valid after it's issued to a user.</p>
pub fn set_iat_ttl(mut self, input: std::option::Option<i64>) -> Self {
self.iat_ttl = input;
self
}
/// <p>The number of milliseconds that a token is valid after being authenticated.</p>
pub fn auth_ttl(mut self, input: i64) -> Self {
self.auth_ttl = Some(input);
self
}
/// <p>The number of milliseconds that a token is valid after being authenticated.</p>
pub fn set_auth_ttl(mut self, input: std::option::Option<i64>) -> Self {
self.auth_ttl = input;
self
}
/// Consumes the builder and constructs a [`OpenIdConnectConfig`](crate::model::OpenIdConnectConfig).
pub fn build(self) -> crate::model::OpenIdConnectConfig {
crate::model::OpenIdConnectConfig {
issuer: self.issuer,
client_id: self.client_id,
iat_ttl: self.iat_ttl.unwrap_or_default(),
auth_ttl: self.auth_ttl.unwrap_or_default(),
}
}
}
}
impl OpenIdConnectConfig {
/// Creates a new builder-style object to manufacture [`OpenIdConnectConfig`](crate::model::OpenIdConnectConfig).
pub fn builder() -> crate::model::open_id_connect_config::Builder {
crate::model::open_id_connect_config::Builder::default()
}
}
/// When writing a match expression against `AuthenticationType`, it is important to ensure
/// your code is forward-compatible. That is, if a match arm handles a case for a
/// feature that is supported by the service but has not been represented as an enum
/// variant in a current version of SDK, your code should continue to work when you
/// upgrade SDK to a future version in which the enum does include a variant for that
/// feature.
///
/// Here is an example of how you can make a match expression forward-compatible:
///
/// ```text
/// # let authenticationtype = unimplemented!();
/// match authenticationtype {
/// AuthenticationType::AmazonCognitoUserPools => { /* ... */ },
/// AuthenticationType::ApiKey => { /* ... */ },
/// AuthenticationType::AwsIam => { /* ... */ },
/// AuthenticationType::AwsLambda => { /* ... */ },
/// AuthenticationType::OpenidConnect => { /* ... */ },
/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
/// _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `authenticationtype` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `AuthenticationType::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `AuthenticationType::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
/// and calling `as_str` on it yields `"NewFeature"`.
/// This match expression is forward-compatible when executed with a newer
/// version of SDK where the variant `AuthenticationType::NewFeature` is defined.
/// Specifically, when `authenticationtype` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `AuthenticationType::NewFeature` also yielding `"NewFeature"`.
///
/// Explicitly matching on the `Unknown` variant should
/// be avoided for two reasons:
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
/// - It might inadvertently shadow other intended match arms.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum AuthenticationType {
#[allow(missing_docs)] // documentation missing in model
AmazonCognitoUserPools,
#[allow(missing_docs)] // documentation missing in model
ApiKey,
#[allow(missing_docs)] // documentation missing in model
AwsIam,
#[allow(missing_docs)] // documentation missing in model
AwsLambda,
#[allow(missing_docs)] // documentation missing in model
OpenidConnect,
/// `Unknown` contains new variants that have been added since this code was generated.
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for AuthenticationType {
fn from(s: &str) -> Self {
match s {
"AMAZON_COGNITO_USER_POOLS" => AuthenticationType::AmazonCognitoUserPools,
"API_KEY" => AuthenticationType::ApiKey,
"AWS_IAM" => AuthenticationType::AwsIam,
"AWS_LAMBDA" => AuthenticationType::AwsLambda,
"OPENID_CONNECT" => AuthenticationType::OpenidConnect,
other => {
AuthenticationType::Unknown(crate::types::UnknownVariantValue(other.to_owned()))
}
}
}
}
impl std::str::FromStr for AuthenticationType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(AuthenticationType::from(s))
}
}
impl AuthenticationType {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
AuthenticationType::AmazonCognitoUserPools => "AMAZON_COGNITO_USER_POOLS",
AuthenticationType::ApiKey => "API_KEY",
AuthenticationType::AwsIam => "AWS_IAM",
AuthenticationType::AwsLambda => "AWS_LAMBDA",
AuthenticationType::OpenidConnect => "OPENID_CONNECT",
AuthenticationType::Unknown(value) => value.as_str(),
}
}
/// Returns all the `&str` values of the enum members.
pub const fn values() -> &'static [&'static str] {
&[
"AMAZON_COGNITO_USER_POOLS",
"API_KEY",
"AWS_IAM",
"AWS_LAMBDA",
"OPENID_CONNECT",
]
}
}
impl AsRef<str> for AuthenticationType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>Describes an Amazon Cognito user pool configuration.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UserPoolConfig {
/// <p>The user pool ID.</p>
#[doc(hidden)]
pub user_pool_id: std::option::Option<std::string::String>,
/// <p>The Amazon Web Services Region in which the user pool was created.</p>
#[doc(hidden)]
pub aws_region: std::option::Option<std::string::String>,
/// <p>The action that you want your GraphQL API to take when a request that uses Amazon Cognito user pool authentication doesn't match the Amazon Cognito user pool configuration.</p>
#[doc(hidden)]
pub default_action: std::option::Option<crate::model::DefaultAction>,
/// <p>A regular expression for validating the incoming Amazon Cognito user pool app client ID. If this value isn't set, no filtering is applied.</p>
#[doc(hidden)]
pub app_id_client_regex: std::option::Option<std::string::String>,
}
impl UserPoolConfig {
/// <p>The user pool ID.</p>
pub fn user_pool_id(&self) -> std::option::Option<&str> {
self.user_pool_id.as_deref()
}
/// <p>The Amazon Web Services Region in which the user pool was created.</p>
pub fn aws_region(&self) -> std::option::Option<&str> {
self.aws_region.as_deref()
}
/// <p>The action that you want your GraphQL API to take when a request that uses Amazon Cognito user pool authentication doesn't match the Amazon Cognito user pool configuration.</p>
pub fn default_action(&self) -> std::option::Option<&crate::model::DefaultAction> {
self.default_action.as_ref()
}
/// <p>A regular expression for validating the incoming Amazon Cognito user pool app client ID. If this value isn't set, no filtering is applied.</p>
pub fn app_id_client_regex(&self) -> std::option::Option<&str> {
self.app_id_client_regex.as_deref()
}
}
/// See [`UserPoolConfig`](crate::model::UserPoolConfig).
pub mod user_pool_config {
/// A builder for [`UserPoolConfig`](crate::model::UserPoolConfig).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) user_pool_id: std::option::Option<std::string::String>,
pub(crate) aws_region: std::option::Option<std::string::String>,
pub(crate) default_action: std::option::Option<crate::model::DefaultAction>,
pub(crate) app_id_client_regex: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The user pool ID.</p>
pub fn user_pool_id(mut self, input: impl Into<std::string::String>) -> Self {
self.user_pool_id = Some(input.into());
self
}
/// <p>The user pool ID.</p>
pub fn set_user_pool_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.user_pool_id = input;
self
}
/// <p>The Amazon Web Services Region in which the user pool was created.</p>
pub fn aws_region(mut self, input: impl Into<std::string::String>) -> Self {
self.aws_region = Some(input.into());
self
}
/// <p>The Amazon Web Services Region in which the user pool was created.</p>
pub fn set_aws_region(mut self, input: std::option::Option<std::string::String>) -> Self {
self.aws_region = input;
self
}
/// <p>The action that you want your GraphQL API to take when a request that uses Amazon Cognito user pool authentication doesn't match the Amazon Cognito user pool configuration.</p>
pub fn default_action(mut self, input: crate::model::DefaultAction) -> Self {
self.default_action = Some(input);
self
}
/// <p>The action that you want your GraphQL API to take when a request that uses Amazon Cognito user pool authentication doesn't match the Amazon Cognito user pool configuration.</p>
pub fn set_default_action(
mut self,
input: std::option::Option<crate::model::DefaultAction>,
) -> Self {
self.default_action = input;
self
}
/// <p>A regular expression for validating the incoming Amazon Cognito user pool app client ID. If this value isn't set, no filtering is applied.</p>
pub fn app_id_client_regex(mut self, input: impl Into<std::string::String>) -> Self {
self.app_id_client_regex = Some(input.into());
self
}
/// <p>A regular expression for validating the incoming Amazon Cognito user pool app client ID. If this value isn't set, no filtering is applied.</p>
pub fn set_app_id_client_regex(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.app_id_client_regex = input;
self
}
/// Consumes the builder and constructs a [`UserPoolConfig`](crate::model::UserPoolConfig).
pub fn build(self) -> crate::model::UserPoolConfig {
crate::model::UserPoolConfig {
user_pool_id: self.user_pool_id,
aws_region: self.aws_region,
default_action: self.default_action,
app_id_client_regex: self.app_id_client_regex,
}
}
}
}
impl UserPoolConfig {
/// Creates a new builder-style object to manufacture [`UserPoolConfig`](crate::model::UserPoolConfig).
pub fn builder() -> crate::model::user_pool_config::Builder {
crate::model::user_pool_config::Builder::default()
}
}
/// When writing a match expression against `DefaultAction`, it is important to ensure
/// your code is forward-compatible. That is, if a match arm handles a case for a
/// feature that is supported by the service but has not been represented as an enum
/// variant in a current version of SDK, your code should continue to work when you
/// upgrade SDK to a future version in which the enum does include a variant for that
/// feature.
///
/// Here is an example of how you can make a match expression forward-compatible:
///
/// ```text
/// # let defaultaction = unimplemented!();
/// match defaultaction {
/// DefaultAction::Allow => { /* ... */ },
/// DefaultAction::Deny => { /* ... */ },
/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
/// _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `defaultaction` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `DefaultAction::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `DefaultAction::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
/// and calling `as_str` on it yields `"NewFeature"`.
/// This match expression is forward-compatible when executed with a newer
/// version of SDK where the variant `DefaultAction::NewFeature` is defined.
/// Specifically, when `defaultaction` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `DefaultAction::NewFeature` also yielding `"NewFeature"`.
///
/// Explicitly matching on the `Unknown` variant should
/// be avoided for two reasons:
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
/// - It might inadvertently shadow other intended match arms.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum DefaultAction {
#[allow(missing_docs)] // documentation missing in model
Allow,
#[allow(missing_docs)] // documentation missing in model
Deny,
/// `Unknown` contains new variants that have been added since this code was generated.
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for DefaultAction {
fn from(s: &str) -> Self {
match s {
"ALLOW" => DefaultAction::Allow,
"DENY" => DefaultAction::Deny,
other => DefaultAction::Unknown(crate::types::UnknownVariantValue(other.to_owned())),
}
}
}
impl std::str::FromStr for DefaultAction {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(DefaultAction::from(s))
}
}
impl DefaultAction {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
DefaultAction::Allow => "ALLOW",
DefaultAction::Deny => "DENY",
DefaultAction::Unknown(value) => value.as_str(),
}
}
/// Returns all the `&str` values of the enum members.
pub const fn values() -> &'static [&'static str] {
&["ALLOW", "DENY"]
}
}
impl AsRef<str> for DefaultAction {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>The Amazon CloudWatch Logs configuration.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct LogConfig {
/// <p>The field logging level. Values can be NONE, ERROR, or ALL.</p>
/// <ul>
/// <li> <p> <b>NONE</b>: No field-level logs are captured.</p> </li>
/// <li> <p> <b>ERROR</b>: Logs the following information only for the fields that are in error:</p>
/// <ul>
/// <li> <p>The error section in the server response.</p> </li>
/// <li> <p>Field-level errors.</p> </li>
/// <li> <p>The generated request/response functions that got resolved for error fields.</p> </li>
/// </ul> </li>
/// <li> <p> <b>ALL</b>: The following information is logged for all fields in the query:</p>
/// <ul>
/// <li> <p>Field-level tracing information.</p> </li>
/// <li> <p>The generated request/response functions that got resolved for each field.</p> </li>
/// </ul> </li>
/// </ul>
#[doc(hidden)]
pub field_log_level: std::option::Option<crate::model::FieldLogLevel>,
/// <p>The service role that AppSync assumes to publish to CloudWatch logs in your account.</p>
#[doc(hidden)]
pub cloud_watch_logs_role_arn: std::option::Option<std::string::String>,
/// <p>Set to TRUE to exclude sections that contain information such as headers, context, and evaluated mapping templates, regardless of logging level.</p>
#[doc(hidden)]
pub exclude_verbose_content: bool,
}
impl LogConfig {
/// <p>The field logging level. Values can be NONE, ERROR, or ALL.</p>
/// <ul>
/// <li> <p> <b>NONE</b>: No field-level logs are captured.</p> </li>
/// <li> <p> <b>ERROR</b>: Logs the following information only for the fields that are in error:</p>
/// <ul>
/// <li> <p>The error section in the server response.</p> </li>
/// <li> <p>Field-level errors.</p> </li>
/// <li> <p>The generated request/response functions that got resolved for error fields.</p> </li>
/// </ul> </li>
/// <li> <p> <b>ALL</b>: The following information is logged for all fields in the query:</p>
/// <ul>
/// <li> <p>Field-level tracing information.</p> </li>
/// <li> <p>The generated request/response functions that got resolved for each field.</p> </li>
/// </ul> </li>
/// </ul>
pub fn field_log_level(&self) -> std::option::Option<&crate::model::FieldLogLevel> {
self.field_log_level.as_ref()
}
/// <p>The service role that AppSync assumes to publish to CloudWatch logs in your account.</p>
pub fn cloud_watch_logs_role_arn(&self) -> std::option::Option<&str> {
self.cloud_watch_logs_role_arn.as_deref()
}
/// <p>Set to TRUE to exclude sections that contain information such as headers, context, and evaluated mapping templates, regardless of logging level.</p>
pub fn exclude_verbose_content(&self) -> bool {
self.exclude_verbose_content
}
}
/// See [`LogConfig`](crate::model::LogConfig).
pub mod log_config {
/// A builder for [`LogConfig`](crate::model::LogConfig).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) field_log_level: std::option::Option<crate::model::FieldLogLevel>,
pub(crate) cloud_watch_logs_role_arn: std::option::Option<std::string::String>,
pub(crate) exclude_verbose_content: std::option::Option<bool>,
}
impl Builder {
/// <p>The field logging level. Values can be NONE, ERROR, or ALL.</p>
/// <ul>
/// <li> <p> <b>NONE</b>: No field-level logs are captured.</p> </li>
/// <li> <p> <b>ERROR</b>: Logs the following information only for the fields that are in error:</p>
/// <ul>
/// <li> <p>The error section in the server response.</p> </li>
/// <li> <p>Field-level errors.</p> </li>
/// <li> <p>The generated request/response functions that got resolved for error fields.</p> </li>
/// </ul> </li>
/// <li> <p> <b>ALL</b>: The following information is logged for all fields in the query:</p>
/// <ul>
/// <li> <p>Field-level tracing information.</p> </li>
/// <li> <p>The generated request/response functions that got resolved for each field.</p> </li>
/// </ul> </li>
/// </ul>
pub fn field_log_level(mut self, input: crate::model::FieldLogLevel) -> Self {
self.field_log_level = Some(input);
self
}
/// <p>The field logging level. Values can be NONE, ERROR, or ALL.</p>
/// <ul>
/// <li> <p> <b>NONE</b>: No field-level logs are captured.</p> </li>
/// <li> <p> <b>ERROR</b>: Logs the following information only for the fields that are in error:</p>
/// <ul>
/// <li> <p>The error section in the server response.</p> </li>
/// <li> <p>Field-level errors.</p> </li>
/// <li> <p>The generated request/response functions that got resolved for error fields.</p> </li>
/// </ul> </li>
/// <li> <p> <b>ALL</b>: The following information is logged for all fields in the query:</p>
/// <ul>
/// <li> <p>Field-level tracing information.</p> </li>
/// <li> <p>The generated request/response functions that got resolved for each field.</p> </li>
/// </ul> </li>
/// </ul>
pub fn set_field_log_level(
mut self,
input: std::option::Option<crate::model::FieldLogLevel>,
) -> Self {
self.field_log_level = input;
self
}
/// <p>The service role that AppSync assumes to publish to CloudWatch logs in your account.</p>
pub fn cloud_watch_logs_role_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.cloud_watch_logs_role_arn = Some(input.into());
self
}
/// <p>The service role that AppSync assumes to publish to CloudWatch logs in your account.</p>
pub fn set_cloud_watch_logs_role_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.cloud_watch_logs_role_arn = input;
self
}
/// <p>Set to TRUE to exclude sections that contain information such as headers, context, and evaluated mapping templates, regardless of logging level.</p>
pub fn exclude_verbose_content(mut self, input: bool) -> Self {
self.exclude_verbose_content = Some(input);
self
}
/// <p>Set to TRUE to exclude sections that contain information such as headers, context, and evaluated mapping templates, regardless of logging level.</p>
pub fn set_exclude_verbose_content(mut self, input: std::option::Option<bool>) -> Self {
self.exclude_verbose_content = input;
self
}
/// Consumes the builder and constructs a [`LogConfig`](crate::model::LogConfig).
pub fn build(self) -> crate::model::LogConfig {
crate::model::LogConfig {
field_log_level: self.field_log_level,
cloud_watch_logs_role_arn: self.cloud_watch_logs_role_arn,
exclude_verbose_content: self.exclude_verbose_content.unwrap_or_default(),
}
}
}
}
impl LogConfig {
/// Creates a new builder-style object to manufacture [`LogConfig`](crate::model::LogConfig).
pub fn builder() -> crate::model::log_config::Builder {
crate::model::log_config::Builder::default()
}
}
/// When writing a match expression against `FieldLogLevel`, it is important to ensure
/// your code is forward-compatible. That is, if a match arm handles a case for a
/// feature that is supported by the service but has not been represented as an enum
/// variant in a current version of SDK, your code should continue to work when you
/// upgrade SDK to a future version in which the enum does include a variant for that
/// feature.
///
/// Here is an example of how you can make a match expression forward-compatible:
///
/// ```text
/// # let fieldloglevel = unimplemented!();
/// match fieldloglevel {
/// FieldLogLevel::All => { /* ... */ },
/// FieldLogLevel::Error => { /* ... */ },
/// FieldLogLevel::None => { /* ... */ },
/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
/// _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `fieldloglevel` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `FieldLogLevel::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `FieldLogLevel::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
/// and calling `as_str` on it yields `"NewFeature"`.
/// This match expression is forward-compatible when executed with a newer
/// version of SDK where the variant `FieldLogLevel::NewFeature` is defined.
/// Specifically, when `fieldloglevel` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `FieldLogLevel::NewFeature` also yielding `"NewFeature"`.
///
/// Explicitly matching on the `Unknown` variant should
/// be avoided for two reasons:
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
/// - It might inadvertently shadow other intended match arms.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum FieldLogLevel {
#[allow(missing_docs)] // documentation missing in model
All,
#[allow(missing_docs)] // documentation missing in model
Error,
#[allow(missing_docs)] // documentation missing in model
None,
/// `Unknown` contains new variants that have been added since this code was generated.
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for FieldLogLevel {
fn from(s: &str) -> Self {
match s {
"ALL" => FieldLogLevel::All,
"ERROR" => FieldLogLevel::Error,
"NONE" => FieldLogLevel::None,
other => FieldLogLevel::Unknown(crate::types::UnknownVariantValue(other.to_owned())),
}
}
}
impl std::str::FromStr for FieldLogLevel {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(FieldLogLevel::from(s))
}
}
impl FieldLogLevel {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
FieldLogLevel::All => "ALL",
FieldLogLevel::Error => "ERROR",
FieldLogLevel::None => "NONE",
FieldLogLevel::Unknown(value) => value.as_str(),
}
}
/// Returns all the `&str` values of the enum members.
pub const fn values() -> &'static [&'static str] {
&["ALL", "ERROR", "NONE"]
}
}
impl AsRef<str> for FieldLogLevel {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>A function is a reusable entity. You can use multiple functions to compose the resolver logic.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct FunctionConfiguration {
/// <p>A unique ID representing the <code>Function</code> object.</p>
#[doc(hidden)]
pub function_id: std::option::Option<std::string::String>,
/// <p>The Amazon Resource Name (ARN) of the <code>Function</code> object.</p>
#[doc(hidden)]
pub function_arn: std::option::Option<std::string::String>,
/// <p>The name of the <code>Function</code> object.</p>
#[doc(hidden)]
pub name: std::option::Option<std::string::String>,
/// <p>The <code>Function</code> description.</p>
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
/// <p>The name of the <code>DataSource</code>.</p>
#[doc(hidden)]
pub data_source_name: std::option::Option<std::string::String>,
/// <p>The <code>Function</code> request mapping template. Functions support only the 2018-05-29 version of the request mapping template.</p>
#[doc(hidden)]
pub request_mapping_template: std::option::Option<std::string::String>,
/// <p>The <code>Function</code> response mapping template.</p>
#[doc(hidden)]
pub response_mapping_template: std::option::Option<std::string::String>,
/// <p>The version of the request mapping template. Currently, only the 2018-05-29 version of the template is supported.</p>
#[doc(hidden)]
pub function_version: std::option::Option<std::string::String>,
/// <p>Describes a Sync configuration for a resolver.</p>
/// <p>Specifies which Conflict Detection strategy and Resolution strategy to use when the resolver is invoked.</p>
#[doc(hidden)]
pub sync_config: std::option::Option<crate::model::SyncConfig>,
/// <p>The maximum batching size for a resolver.</p>
#[doc(hidden)]
pub max_batch_size: i32,
/// <p>Describes a runtime used by an Amazon Web Services AppSync pipeline resolver or Amazon Web Services AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.</p>
#[doc(hidden)]
pub runtime: std::option::Option<crate::model::AppSyncRuntime>,
/// <p>The <code>function</code> code that contains the request and response functions. When code is used, the <code>runtime</code> is required. The <code>runtime</code> value must be <code>APPSYNC_JS</code>.</p>
#[doc(hidden)]
pub code: std::option::Option<std::string::String>,
}
impl FunctionConfiguration {
/// <p>A unique ID representing the <code>Function</code> object.</p>
pub fn function_id(&self) -> std::option::Option<&str> {
self.function_id.as_deref()
}
/// <p>The Amazon Resource Name (ARN) of the <code>Function</code> object.</p>
pub fn function_arn(&self) -> std::option::Option<&str> {
self.function_arn.as_deref()
}
/// <p>The name of the <code>Function</code> object.</p>
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
/// <p>The <code>Function</code> description.</p>
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
/// <p>The name of the <code>DataSource</code>.</p>
pub fn data_source_name(&self) -> std::option::Option<&str> {
self.data_source_name.as_deref()
}
/// <p>The <code>Function</code> request mapping template. Functions support only the 2018-05-29 version of the request mapping template.</p>
pub fn request_mapping_template(&self) -> std::option::Option<&str> {
self.request_mapping_template.as_deref()
}
/// <p>The <code>Function</code> response mapping template.</p>
pub fn response_mapping_template(&self) -> std::option::Option<&str> {
self.response_mapping_template.as_deref()
}
/// <p>The version of the request mapping template. Currently, only the 2018-05-29 version of the template is supported.</p>
pub fn function_version(&self) -> std::option::Option<&str> {
self.function_version.as_deref()
}
/// <p>Describes a Sync configuration for a resolver.</p>
/// <p>Specifies which Conflict Detection strategy and Resolution strategy to use when the resolver is invoked.</p>
pub fn sync_config(&self) -> std::option::Option<&crate::model::SyncConfig> {
self.sync_config.as_ref()
}
/// <p>The maximum batching size for a resolver.</p>
pub fn max_batch_size(&self) -> i32 {
self.max_batch_size
}
/// <p>Describes a runtime used by an Amazon Web Services AppSync pipeline resolver or Amazon Web Services AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.</p>
pub fn runtime(&self) -> std::option::Option<&crate::model::AppSyncRuntime> {
self.runtime.as_ref()
}
/// <p>The <code>function</code> code that contains the request and response functions. When code is used, the <code>runtime</code> is required. The <code>runtime</code> value must be <code>APPSYNC_JS</code>.</p>
pub fn code(&self) -> std::option::Option<&str> {
self.code.as_deref()
}
}
/// See [`FunctionConfiguration`](crate::model::FunctionConfiguration).
pub mod function_configuration {
/// A builder for [`FunctionConfiguration`](crate::model::FunctionConfiguration).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) function_id: std::option::Option<std::string::String>,
pub(crate) function_arn: std::option::Option<std::string::String>,
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) data_source_name: std::option::Option<std::string::String>,
pub(crate) request_mapping_template: std::option::Option<std::string::String>,
pub(crate) response_mapping_template: std::option::Option<std::string::String>,
pub(crate) function_version: std::option::Option<std::string::String>,
pub(crate) sync_config: std::option::Option<crate::model::SyncConfig>,
pub(crate) max_batch_size: std::option::Option<i32>,
pub(crate) runtime: std::option::Option<crate::model::AppSyncRuntime>,
pub(crate) code: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>A unique ID representing the <code>Function</code> object.</p>
pub fn function_id(mut self, input: impl Into<std::string::String>) -> Self {
self.function_id = Some(input.into());
self
}
/// <p>A unique ID representing the <code>Function</code> object.</p>
pub fn set_function_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.function_id = input;
self
}
/// <p>The Amazon Resource Name (ARN) of the <code>Function</code> object.</p>
pub fn function_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.function_arn = Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the <code>Function</code> object.</p>
pub fn set_function_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.function_arn = input;
self
}
/// <p>The name of the <code>Function</code> object.</p>
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
/// <p>The name of the <code>Function</code> object.</p>
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
/// <p>The <code>Function</code> description.</p>
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
/// <p>The <code>Function</code> description.</p>
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
/// <p>The name of the <code>DataSource</code>.</p>
pub fn data_source_name(mut self, input: impl Into<std::string::String>) -> Self {
self.data_source_name = Some(input.into());
self
}
/// <p>The name of the <code>DataSource</code>.</p>
pub fn set_data_source_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.data_source_name = input;
self
}
/// <p>The <code>Function</code> request mapping template. Functions support only the 2018-05-29 version of the request mapping template.</p>
pub fn request_mapping_template(mut self, input: impl Into<std::string::String>) -> Self {
self.request_mapping_template = Some(input.into());
self
}
/// <p>The <code>Function</code> request mapping template. Functions support only the 2018-05-29 version of the request mapping template.</p>
pub fn set_request_mapping_template(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.request_mapping_template = input;
self
}
/// <p>The <code>Function</code> response mapping template.</p>
pub fn response_mapping_template(mut self, input: impl Into<std::string::String>) -> Self {
self.response_mapping_template = Some(input.into());
self
}
/// <p>The <code>Function</code> response mapping template.</p>
pub fn set_response_mapping_template(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.response_mapping_template = input;
self
}
/// <p>The version of the request mapping template. Currently, only the 2018-05-29 version of the template is supported.</p>
pub fn function_version(mut self, input: impl Into<std::string::String>) -> Self {
self.function_version = Some(input.into());
self
}
/// <p>The version of the request mapping template. Currently, only the 2018-05-29 version of the template is supported.</p>
pub fn set_function_version(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_version = input;
self
}
/// <p>Describes a Sync configuration for a resolver.</p>
/// <p>Specifies which Conflict Detection strategy and Resolution strategy to use when the resolver is invoked.</p>
pub fn sync_config(mut self, input: crate::model::SyncConfig) -> Self {
self.sync_config = Some(input);
self
}
/// <p>Describes a Sync configuration for a resolver.</p>
/// <p>Specifies which Conflict Detection strategy and Resolution strategy to use when the resolver is invoked.</p>
pub fn set_sync_config(
mut self,
input: std::option::Option<crate::model::SyncConfig>,
) -> Self {
self.sync_config = input;
self
}
/// <p>The maximum batching size for a resolver.</p>
pub fn max_batch_size(mut self, input: i32) -> Self {
self.max_batch_size = Some(input);
self
}
/// <p>The maximum batching size for a resolver.</p>
pub fn set_max_batch_size(mut self, input: std::option::Option<i32>) -> Self {
self.max_batch_size = input;
self
}
/// <p>Describes a runtime used by an Amazon Web Services AppSync pipeline resolver or Amazon Web Services AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.</p>
pub fn runtime(mut self, input: crate::model::AppSyncRuntime) -> Self {
self.runtime = Some(input);
self
}
/// <p>Describes a runtime used by an Amazon Web Services AppSync pipeline resolver or Amazon Web Services AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.</p>
pub fn set_runtime(
mut self,
input: std::option::Option<crate::model::AppSyncRuntime>,
) -> Self {
self.runtime = input;
self
}
/// <p>The <code>function</code> code that contains the request and response functions. When code is used, the <code>runtime</code> is required. The <code>runtime</code> value must be <code>APPSYNC_JS</code>.</p>
pub fn code(mut self, input: impl Into<std::string::String>) -> Self {
self.code = Some(input.into());
self
}
/// <p>The <code>function</code> code that contains the request and response functions. When code is used, the <code>runtime</code> is required. The <code>runtime</code> value must be <code>APPSYNC_JS</code>.</p>
pub fn set_code(mut self, input: std::option::Option<std::string::String>) -> Self {
self.code = input;
self
}
/// Consumes the builder and constructs a [`FunctionConfiguration`](crate::model::FunctionConfiguration).
pub fn build(self) -> crate::model::FunctionConfiguration {
crate::model::FunctionConfiguration {
function_id: self.function_id,
function_arn: self.function_arn,
name: self.name,
description: self.description,
data_source_name: self.data_source_name,
request_mapping_template: self.request_mapping_template,
response_mapping_template: self.response_mapping_template,
function_version: self.function_version,
sync_config: self.sync_config,
max_batch_size: self.max_batch_size.unwrap_or_default(),
runtime: self.runtime,
code: self.code,
}
}
}
}
impl FunctionConfiguration {
/// Creates a new builder-style object to manufacture [`FunctionConfiguration`](crate::model::FunctionConfiguration).
pub fn builder() -> crate::model::function_configuration::Builder {
crate::model::function_configuration::Builder::default()
}
}
/// <p>Describes a configuration for a custom domain.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DomainNameConfig {
/// <p>The domain name.</p>
#[doc(hidden)]
pub domain_name: std::option::Option<std::string::String>,
/// <p>A description of the <code>DomainName</code> configuration.</p>
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
/// <p>The Amazon Resource Name (ARN) of the certificate. This can be an Certificate Manager (ACM) certificate or an Identity and Access Management (IAM) server certificate.</p>
#[doc(hidden)]
pub certificate_arn: std::option::Option<std::string::String>,
/// <p>The domain name that AppSync provides.</p>
#[doc(hidden)]
pub appsync_domain_name: std::option::Option<std::string::String>,
/// <p>The ID of your Amazon Route 53 hosted zone.</p>
#[doc(hidden)]
pub hosted_zone_id: std::option::Option<std::string::String>,
}
impl DomainNameConfig {
/// <p>The domain name.</p>
pub fn domain_name(&self) -> std::option::Option<&str> {
self.domain_name.as_deref()
}
/// <p>A description of the <code>DomainName</code> configuration.</p>
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
/// <p>The Amazon Resource Name (ARN) of the certificate. This can be an Certificate Manager (ACM) certificate or an Identity and Access Management (IAM) server certificate.</p>
pub fn certificate_arn(&self) -> std::option::Option<&str> {
self.certificate_arn.as_deref()
}
/// <p>The domain name that AppSync provides.</p>
pub fn appsync_domain_name(&self) -> std::option::Option<&str> {
self.appsync_domain_name.as_deref()
}
/// <p>The ID of your Amazon Route 53 hosted zone.</p>
pub fn hosted_zone_id(&self) -> std::option::Option<&str> {
self.hosted_zone_id.as_deref()
}
}
/// See [`DomainNameConfig`](crate::model::DomainNameConfig).
pub mod domain_name_config {
/// A builder for [`DomainNameConfig`](crate::model::DomainNameConfig).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) domain_name: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) certificate_arn: std::option::Option<std::string::String>,
pub(crate) appsync_domain_name: std::option::Option<std::string::String>,
pub(crate) hosted_zone_id: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The domain name.</p>
pub fn domain_name(mut self, input: impl Into<std::string::String>) -> Self {
self.domain_name = Some(input.into());
self
}
/// <p>The domain name.</p>
pub fn set_domain_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.domain_name = input;
self
}
/// <p>A description of the <code>DomainName</code> configuration.</p>
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
/// <p>A description of the <code>DomainName</code> configuration.</p>
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
/// <p>The Amazon Resource Name (ARN) of the certificate. This can be an Certificate Manager (ACM) certificate or an Identity and Access Management (IAM) server certificate.</p>
pub fn certificate_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.certificate_arn = Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the certificate. This can be an Certificate Manager (ACM) certificate or an Identity and Access Management (IAM) server certificate.</p>
pub fn set_certificate_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.certificate_arn = input;
self
}
/// <p>The domain name that AppSync provides.</p>
pub fn appsync_domain_name(mut self, input: impl Into<std::string::String>) -> Self {
self.appsync_domain_name = Some(input.into());
self
}
/// <p>The domain name that AppSync provides.</p>
pub fn set_appsync_domain_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.appsync_domain_name = input;
self
}
/// <p>The ID of your Amazon Route 53 hosted zone.</p>
pub fn hosted_zone_id(mut self, input: impl Into<std::string::String>) -> Self {
self.hosted_zone_id = Some(input.into());
self
}
/// <p>The ID of your Amazon Route 53 hosted zone.</p>
pub fn set_hosted_zone_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.hosted_zone_id = input;
self
}
/// Consumes the builder and constructs a [`DomainNameConfig`](crate::model::DomainNameConfig).
pub fn build(self) -> crate::model::DomainNameConfig {
crate::model::DomainNameConfig {
domain_name: self.domain_name,
description: self.description,
certificate_arn: self.certificate_arn,
appsync_domain_name: self.appsync_domain_name,
hosted_zone_id: self.hosted_zone_id,
}
}
}
}
impl DomainNameConfig {
/// Creates a new builder-style object to manufacture [`DomainNameConfig`](crate::model::DomainNameConfig).
pub fn builder() -> crate::model::domain_name_config::Builder {
crate::model::domain_name_config::Builder::default()
}
}
/// <p>Describes a data source.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DataSource {
/// <p>The data source Amazon Resource Name (ARN).</p>
#[doc(hidden)]
pub data_source_arn: std::option::Option<std::string::String>,
/// <p>The name of the data source.</p>
#[doc(hidden)]
pub name: std::option::Option<std::string::String>,
/// <p>The description of the data source.</p>
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
/// <p>The type of the data source.</p>
/// <ul>
/// <li> <p> <b>AWS_LAMBDA</b>: The data source is an Lambda function.</p> </li>
/// <li> <p> <b>AMAZON_DYNAMODB</b>: The data source is an Amazon DynamoDB table.</p> </li>
/// <li> <p> <b>AMAZON_ELASTICSEARCH</b>: The data source is an Amazon OpenSearch Service domain.</p> </li>
/// <li> <p> <b>AMAZON_OPENSEARCH_SERVICE</b>: The data source is an Amazon OpenSearch Service domain.</p> </li>
/// <li> <p> <b>NONE</b>: There is no data source. Use this type when you want to invoke a GraphQL operation without connecting to a data source, such as when you're performing data transformation with resolvers or invoking a subscription from a mutation.</p> </li>
/// <li> <p> <b>HTTP</b>: The data source is an HTTP endpoint.</p> </li>
/// <li> <p> <b>RELATIONAL_DATABASE</b>: The data source is a relational database.</p> </li>
/// </ul>
#[doc(hidden)]
pub r#type: std::option::Option<crate::model::DataSourceType>,
/// <p>The Identity and Access Management (IAM) service role Amazon Resource Name (ARN) for the data source. The system assumes this role when accessing the data source.</p>
#[doc(hidden)]
pub service_role_arn: std::option::Option<std::string::String>,
/// <p>DynamoDB settings.</p>
#[doc(hidden)]
pub dynamodb_config: std::option::Option<crate::model::DynamodbDataSourceConfig>,
/// <p>Lambda settings.</p>
#[doc(hidden)]
pub lambda_config: std::option::Option<crate::model::LambdaDataSourceConfig>,
/// <p>Amazon OpenSearch Service settings.</p>
#[doc(hidden)]
pub elasticsearch_config: std::option::Option<crate::model::ElasticsearchDataSourceConfig>,
/// <p>Amazon OpenSearch Service settings.</p>
#[doc(hidden)]
pub open_search_service_config:
std::option::Option<crate::model::OpenSearchServiceDataSourceConfig>,
/// <p>HTTP endpoint settings.</p>
#[doc(hidden)]
pub http_config: std::option::Option<crate::model::HttpDataSourceConfig>,
/// <p>Relational database settings.</p>
#[doc(hidden)]
pub relational_database_config:
std::option::Option<crate::model::RelationalDatabaseDataSourceConfig>,
}
impl DataSource {
/// <p>The data source Amazon Resource Name (ARN).</p>
pub fn data_source_arn(&self) -> std::option::Option<&str> {
self.data_source_arn.as_deref()
}
/// <p>The name of the data source.</p>
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
/// <p>The description of the data source.</p>
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
/// <p>The type of the data source.</p>
/// <ul>
/// <li> <p> <b>AWS_LAMBDA</b>: The data source is an Lambda function.</p> </li>
/// <li> <p> <b>AMAZON_DYNAMODB</b>: The data source is an Amazon DynamoDB table.</p> </li>
/// <li> <p> <b>AMAZON_ELASTICSEARCH</b>: The data source is an Amazon OpenSearch Service domain.</p> </li>
/// <li> <p> <b>AMAZON_OPENSEARCH_SERVICE</b>: The data source is an Amazon OpenSearch Service domain.</p> </li>
/// <li> <p> <b>NONE</b>: There is no data source. Use this type when you want to invoke a GraphQL operation without connecting to a data source, such as when you're performing data transformation with resolvers or invoking a subscription from a mutation.</p> </li>
/// <li> <p> <b>HTTP</b>: The data source is an HTTP endpoint.</p> </li>
/// <li> <p> <b>RELATIONAL_DATABASE</b>: The data source is a relational database.</p> </li>
/// </ul>
pub fn r#type(&self) -> std::option::Option<&crate::model::DataSourceType> {
self.r#type.as_ref()
}
/// <p>The Identity and Access Management (IAM) service role Amazon Resource Name (ARN) for the data source. The system assumes this role when accessing the data source.</p>
pub fn service_role_arn(&self) -> std::option::Option<&str> {
self.service_role_arn.as_deref()
}
/// <p>DynamoDB settings.</p>
pub fn dynamodb_config(&self) -> std::option::Option<&crate::model::DynamodbDataSourceConfig> {
self.dynamodb_config.as_ref()
}
/// <p>Lambda settings.</p>
pub fn lambda_config(&self) -> std::option::Option<&crate::model::LambdaDataSourceConfig> {
self.lambda_config.as_ref()
}
/// <p>Amazon OpenSearch Service settings.</p>
pub fn elasticsearch_config(
&self,
) -> std::option::Option<&crate::model::ElasticsearchDataSourceConfig> {
self.elasticsearch_config.as_ref()
}
/// <p>Amazon OpenSearch Service settings.</p>
pub fn open_search_service_config(
&self,
) -> std::option::Option<&crate::model::OpenSearchServiceDataSourceConfig> {
self.open_search_service_config.as_ref()
}
/// <p>HTTP endpoint settings.</p>
pub fn http_config(&self) -> std::option::Option<&crate::model::HttpDataSourceConfig> {
self.http_config.as_ref()
}
/// <p>Relational database settings.</p>
pub fn relational_database_config(
&self,
) -> std::option::Option<&crate::model::RelationalDatabaseDataSourceConfig> {
self.relational_database_config.as_ref()
}
}
/// See [`DataSource`](crate::model::DataSource).
pub mod data_source {
/// A builder for [`DataSource`](crate::model::DataSource).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) data_source_arn: std::option::Option<std::string::String>,
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) r#type: std::option::Option<crate::model::DataSourceType>,
pub(crate) service_role_arn: std::option::Option<std::string::String>,
pub(crate) dynamodb_config: std::option::Option<crate::model::DynamodbDataSourceConfig>,
pub(crate) lambda_config: std::option::Option<crate::model::LambdaDataSourceConfig>,
pub(crate) elasticsearch_config:
std::option::Option<crate::model::ElasticsearchDataSourceConfig>,
pub(crate) open_search_service_config:
std::option::Option<crate::model::OpenSearchServiceDataSourceConfig>,
pub(crate) http_config: std::option::Option<crate::model::HttpDataSourceConfig>,
pub(crate) relational_database_config:
std::option::Option<crate::model::RelationalDatabaseDataSourceConfig>,
}
impl Builder {
/// <p>The data source Amazon Resource Name (ARN).</p>
pub fn data_source_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.data_source_arn = Some(input.into());
self
}
/// <p>The data source Amazon Resource Name (ARN).</p>
pub fn set_data_source_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.data_source_arn = input;
self
}
/// <p>The name of the data source.</p>
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
/// <p>The name of the data source.</p>
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
/// <p>The description of the data source.</p>
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
/// <p>The description of the data source.</p>
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
/// <p>The type of the data source.</p>
/// <ul>
/// <li> <p> <b>AWS_LAMBDA</b>: The data source is an Lambda function.</p> </li>
/// <li> <p> <b>AMAZON_DYNAMODB</b>: The data source is an Amazon DynamoDB table.</p> </li>
/// <li> <p> <b>AMAZON_ELASTICSEARCH</b>: The data source is an Amazon OpenSearch Service domain.</p> </li>
/// <li> <p> <b>AMAZON_OPENSEARCH_SERVICE</b>: The data source is an Amazon OpenSearch Service domain.</p> </li>
/// <li> <p> <b>NONE</b>: There is no data source. Use this type when you want to invoke a GraphQL operation without connecting to a data source, such as when you're performing data transformation with resolvers or invoking a subscription from a mutation.</p> </li>
/// <li> <p> <b>HTTP</b>: The data source is an HTTP endpoint.</p> </li>
/// <li> <p> <b>RELATIONAL_DATABASE</b>: The data source is a relational database.</p> </li>
/// </ul>
pub fn r#type(mut self, input: crate::model::DataSourceType) -> Self {
self.r#type = Some(input);
self
}
/// <p>The type of the data source.</p>
/// <ul>
/// <li> <p> <b>AWS_LAMBDA</b>: The data source is an Lambda function.</p> </li>
/// <li> <p> <b>AMAZON_DYNAMODB</b>: The data source is an Amazon DynamoDB table.</p> </li>
/// <li> <p> <b>AMAZON_ELASTICSEARCH</b>: The data source is an Amazon OpenSearch Service domain.</p> </li>
/// <li> <p> <b>AMAZON_OPENSEARCH_SERVICE</b>: The data source is an Amazon OpenSearch Service domain.</p> </li>
/// <li> <p> <b>NONE</b>: There is no data source. Use this type when you want to invoke a GraphQL operation without connecting to a data source, such as when you're performing data transformation with resolvers or invoking a subscription from a mutation.</p> </li>
/// <li> <p> <b>HTTP</b>: The data source is an HTTP endpoint.</p> </li>
/// <li> <p> <b>RELATIONAL_DATABASE</b>: The data source is a relational database.</p> </li>
/// </ul>
pub fn set_type(
mut self,
input: std::option::Option<crate::model::DataSourceType>,
) -> Self {
self.r#type = input;
self
}
/// <p>The Identity and Access Management (IAM) service role Amazon Resource Name (ARN) for the data source. The system assumes this role when accessing the data source.</p>
pub fn service_role_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.service_role_arn = Some(input.into());
self
}
/// <p>The Identity and Access Management (IAM) service role Amazon Resource Name (ARN) for the data source. The system assumes this role when accessing the data source.</p>
pub fn set_service_role_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.service_role_arn = input;
self
}
/// <p>DynamoDB settings.</p>
pub fn dynamodb_config(mut self, input: crate::model::DynamodbDataSourceConfig) -> Self {
self.dynamodb_config = Some(input);
self
}
/// <p>DynamoDB settings.</p>
pub fn set_dynamodb_config(
mut self,
input: std::option::Option<crate::model::DynamodbDataSourceConfig>,
) -> Self {
self.dynamodb_config = input;
self
}
/// <p>Lambda settings.</p>
pub fn lambda_config(mut self, input: crate::model::LambdaDataSourceConfig) -> Self {
self.lambda_config = Some(input);
self
}
/// <p>Lambda settings.</p>
pub fn set_lambda_config(
mut self,
input: std::option::Option<crate::model::LambdaDataSourceConfig>,
) -> Self {
self.lambda_config = input;
self
}
/// <p>Amazon OpenSearch Service settings.</p>
pub fn elasticsearch_config(
mut self,
input: crate::model::ElasticsearchDataSourceConfig,
) -> Self {
self.elasticsearch_config = Some(input);
self
}
/// <p>Amazon OpenSearch Service settings.</p>
pub fn set_elasticsearch_config(
mut self,
input: std::option::Option<crate::model::ElasticsearchDataSourceConfig>,
) -> Self {
self.elasticsearch_config = input;
self
}
/// <p>Amazon OpenSearch Service settings.</p>
pub fn open_search_service_config(
mut self,
input: crate::model::OpenSearchServiceDataSourceConfig,
) -> Self {
self.open_search_service_config = Some(input);
self
}
/// <p>Amazon OpenSearch Service settings.</p>
pub fn set_open_search_service_config(
mut self,
input: std::option::Option<crate::model::OpenSearchServiceDataSourceConfig>,
) -> Self {
self.open_search_service_config = input;
self
}
/// <p>HTTP endpoint settings.</p>
pub fn http_config(mut self, input: crate::model::HttpDataSourceConfig) -> Self {
self.http_config = Some(input);
self
}
/// <p>HTTP endpoint settings.</p>
pub fn set_http_config(
mut self,
input: std::option::Option<crate::model::HttpDataSourceConfig>,
) -> Self {
self.http_config = input;
self
}
/// <p>Relational database settings.</p>
pub fn relational_database_config(
mut self,
input: crate::model::RelationalDatabaseDataSourceConfig,
) -> Self {
self.relational_database_config = Some(input);
self
}
/// <p>Relational database settings.</p>
pub fn set_relational_database_config(
mut self,
input: std::option::Option<crate::model::RelationalDatabaseDataSourceConfig>,
) -> Self {
self.relational_database_config = input;
self
}
/// Consumes the builder and constructs a [`DataSource`](crate::model::DataSource).
pub fn build(self) -> crate::model::DataSource {
crate::model::DataSource {
data_source_arn: self.data_source_arn,
name: self.name,
description: self.description,
r#type: self.r#type,
service_role_arn: self.service_role_arn,
dynamodb_config: self.dynamodb_config,
lambda_config: self.lambda_config,
elasticsearch_config: self.elasticsearch_config,
open_search_service_config: self.open_search_service_config,
http_config: self.http_config,
relational_database_config: self.relational_database_config,
}
}
}
}
impl DataSource {
/// Creates a new builder-style object to manufacture [`DataSource`](crate::model::DataSource).
pub fn builder() -> crate::model::data_source::Builder {
crate::model::data_source::Builder::default()
}
}
/// <p>Describes a relational database data source configuration.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct RelationalDatabaseDataSourceConfig {
/// <p>Source type for the relational database.</p>
/// <ul>
/// <li> <p> <b>RDS_HTTP_ENDPOINT</b>: The relational database source type is an Amazon Relational Database Service (Amazon RDS) HTTP endpoint.</p> </li>
/// </ul>
#[doc(hidden)]
pub relational_database_source_type:
std::option::Option<crate::model::RelationalDatabaseSourceType>,
/// <p>Amazon RDS HTTP endpoint settings.</p>
#[doc(hidden)]
pub rds_http_endpoint_config: std::option::Option<crate::model::RdsHttpEndpointConfig>,
}
impl RelationalDatabaseDataSourceConfig {
/// <p>Source type for the relational database.</p>
/// <ul>
/// <li> <p> <b>RDS_HTTP_ENDPOINT</b>: The relational database source type is an Amazon Relational Database Service (Amazon RDS) HTTP endpoint.</p> </li>
/// </ul>
pub fn relational_database_source_type(
&self,
) -> std::option::Option<&crate::model::RelationalDatabaseSourceType> {
self.relational_database_source_type.as_ref()
}
/// <p>Amazon RDS HTTP endpoint settings.</p>
pub fn rds_http_endpoint_config(
&self,
) -> std::option::Option<&crate::model::RdsHttpEndpointConfig> {
self.rds_http_endpoint_config.as_ref()
}
}
/// See [`RelationalDatabaseDataSourceConfig`](crate::model::RelationalDatabaseDataSourceConfig).
pub mod relational_database_data_source_config {
/// A builder for [`RelationalDatabaseDataSourceConfig`](crate::model::RelationalDatabaseDataSourceConfig).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) relational_database_source_type:
std::option::Option<crate::model::RelationalDatabaseSourceType>,
pub(crate) rds_http_endpoint_config:
std::option::Option<crate::model::RdsHttpEndpointConfig>,
}
impl Builder {
/// <p>Source type for the relational database.</p>
/// <ul>
/// <li> <p> <b>RDS_HTTP_ENDPOINT</b>: The relational database source type is an Amazon Relational Database Service (Amazon RDS) HTTP endpoint.</p> </li>
/// </ul>
pub fn relational_database_source_type(
mut self,
input: crate::model::RelationalDatabaseSourceType,
) -> Self {
self.relational_database_source_type = Some(input);
self
}
/// <p>Source type for the relational database.</p>
/// <ul>
/// <li> <p> <b>RDS_HTTP_ENDPOINT</b>: The relational database source type is an Amazon Relational Database Service (Amazon RDS) HTTP endpoint.</p> </li>
/// </ul>
pub fn set_relational_database_source_type(
mut self,
input: std::option::Option<crate::model::RelationalDatabaseSourceType>,
) -> Self {
self.relational_database_source_type = input;
self
}
/// <p>Amazon RDS HTTP endpoint settings.</p>
pub fn rds_http_endpoint_config(
mut self,
input: crate::model::RdsHttpEndpointConfig,
) -> Self {
self.rds_http_endpoint_config = Some(input);
self
}
/// <p>Amazon RDS HTTP endpoint settings.</p>
pub fn set_rds_http_endpoint_config(
mut self,
input: std::option::Option<crate::model::RdsHttpEndpointConfig>,
) -> Self {
self.rds_http_endpoint_config = input;
self
}
/// Consumes the builder and constructs a [`RelationalDatabaseDataSourceConfig`](crate::model::RelationalDatabaseDataSourceConfig).
pub fn build(self) -> crate::model::RelationalDatabaseDataSourceConfig {
crate::model::RelationalDatabaseDataSourceConfig {
relational_database_source_type: self.relational_database_source_type,
rds_http_endpoint_config: self.rds_http_endpoint_config,
}
}
}
}
impl RelationalDatabaseDataSourceConfig {
/// Creates a new builder-style object to manufacture [`RelationalDatabaseDataSourceConfig`](crate::model::RelationalDatabaseDataSourceConfig).
pub fn builder() -> crate::model::relational_database_data_source_config::Builder {
crate::model::relational_database_data_source_config::Builder::default()
}
}
/// <p>The Amazon Relational Database Service (Amazon RDS) HTTP endpoint configuration.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct RdsHttpEndpointConfig {
/// <p>Amazon Web Services Region for Amazon RDS HTTP endpoint.</p>
#[doc(hidden)]
pub aws_region: std::option::Option<std::string::String>,
/// <p>Amazon RDS cluster Amazon Resource Name (ARN).</p>
#[doc(hidden)]
pub db_cluster_identifier: std::option::Option<std::string::String>,
/// <p>Logical database name.</p>
#[doc(hidden)]
pub database_name: std::option::Option<std::string::String>,
/// <p>Logical schema name.</p>
#[doc(hidden)]
pub schema: std::option::Option<std::string::String>,
/// <p>Amazon Web Services secret store Amazon Resource Name (ARN) for database credentials.</p>
#[doc(hidden)]
pub aws_secret_store_arn: std::option::Option<std::string::String>,
}
impl RdsHttpEndpointConfig {
/// <p>Amazon Web Services Region for Amazon RDS HTTP endpoint.</p>
pub fn aws_region(&self) -> std::option::Option<&str> {
self.aws_region.as_deref()
}
/// <p>Amazon RDS cluster Amazon Resource Name (ARN).</p>
pub fn db_cluster_identifier(&self) -> std::option::Option<&str> {
self.db_cluster_identifier.as_deref()
}
/// <p>Logical database name.</p>
pub fn database_name(&self) -> std::option::Option<&str> {
self.database_name.as_deref()
}
/// <p>Logical schema name.</p>
pub fn schema(&self) -> std::option::Option<&str> {
self.schema.as_deref()
}
/// <p>Amazon Web Services secret store Amazon Resource Name (ARN) for database credentials.</p>
pub fn aws_secret_store_arn(&self) -> std::option::Option<&str> {
self.aws_secret_store_arn.as_deref()
}
}
/// See [`RdsHttpEndpointConfig`](crate::model::RdsHttpEndpointConfig).
pub mod rds_http_endpoint_config {
/// A builder for [`RdsHttpEndpointConfig`](crate::model::RdsHttpEndpointConfig).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) aws_region: std::option::Option<std::string::String>,
pub(crate) db_cluster_identifier: std::option::Option<std::string::String>,
pub(crate) database_name: std::option::Option<std::string::String>,
pub(crate) schema: std::option::Option<std::string::String>,
pub(crate) aws_secret_store_arn: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>Amazon Web Services Region for Amazon RDS HTTP endpoint.</p>
pub fn aws_region(mut self, input: impl Into<std::string::String>) -> Self {
self.aws_region = Some(input.into());
self
}
/// <p>Amazon Web Services Region for Amazon RDS HTTP endpoint.</p>
pub fn set_aws_region(mut self, input: std::option::Option<std::string::String>) -> Self {
self.aws_region = input;
self
}
/// <p>Amazon RDS cluster Amazon Resource Name (ARN).</p>
pub fn db_cluster_identifier(mut self, input: impl Into<std::string::String>) -> Self {
self.db_cluster_identifier = Some(input.into());
self
}
/// <p>Amazon RDS cluster Amazon Resource Name (ARN).</p>
pub fn set_db_cluster_identifier(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.db_cluster_identifier = input;
self
}
/// <p>Logical database name.</p>
pub fn database_name(mut self, input: impl Into<std::string::String>) -> Self {
self.database_name = Some(input.into());
self
}
/// <p>Logical database name.</p>
pub fn set_database_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.database_name = input;
self
}
/// <p>Logical schema name.</p>
pub fn schema(mut self, input: impl Into<std::string::String>) -> Self {
self.schema = Some(input.into());
self
}
/// <p>Logical schema name.</p>
pub fn set_schema(mut self, input: std::option::Option<std::string::String>) -> Self {
self.schema = input;
self
}
/// <p>Amazon Web Services secret store Amazon Resource Name (ARN) for database credentials.</p>
pub fn aws_secret_store_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.aws_secret_store_arn = Some(input.into());
self
}
/// <p>Amazon Web Services secret store Amazon Resource Name (ARN) for database credentials.</p>
pub fn set_aws_secret_store_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.aws_secret_store_arn = input;
self
}
/// Consumes the builder and constructs a [`RdsHttpEndpointConfig`](crate::model::RdsHttpEndpointConfig).
pub fn build(self) -> crate::model::RdsHttpEndpointConfig {
crate::model::RdsHttpEndpointConfig {
aws_region: self.aws_region,
db_cluster_identifier: self.db_cluster_identifier,
database_name: self.database_name,
schema: self.schema,
aws_secret_store_arn: self.aws_secret_store_arn,
}
}
}
}
impl RdsHttpEndpointConfig {
/// Creates a new builder-style object to manufacture [`RdsHttpEndpointConfig`](crate::model::RdsHttpEndpointConfig).
pub fn builder() -> crate::model::rds_http_endpoint_config::Builder {
crate::model::rds_http_endpoint_config::Builder::default()
}
}
/// When writing a match expression against `RelationalDatabaseSourceType`, it is important to ensure
/// your code is forward-compatible. That is, if a match arm handles a case for a
/// feature that is supported by the service but has not been represented as an enum
/// variant in a current version of SDK, your code should continue to work when you
/// upgrade SDK to a future version in which the enum does include a variant for that
/// feature.
///
/// Here is an example of how you can make a match expression forward-compatible:
///
/// ```text
/// # let relationaldatabasesourcetype = unimplemented!();
/// match relationaldatabasesourcetype {
/// RelationalDatabaseSourceType::RdsHttpEndpoint => { /* ... */ },
/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
/// _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `relationaldatabasesourcetype` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `RelationalDatabaseSourceType::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `RelationalDatabaseSourceType::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
/// and calling `as_str` on it yields `"NewFeature"`.
/// This match expression is forward-compatible when executed with a newer
/// version of SDK where the variant `RelationalDatabaseSourceType::NewFeature` is defined.
/// Specifically, when `relationaldatabasesourcetype` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `RelationalDatabaseSourceType::NewFeature` also yielding `"NewFeature"`.
///
/// Explicitly matching on the `Unknown` variant should
/// be avoided for two reasons:
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
/// - It might inadvertently shadow other intended match arms.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum RelationalDatabaseSourceType {
#[allow(missing_docs)] // documentation missing in model
RdsHttpEndpoint,
/// `Unknown` contains new variants that have been added since this code was generated.
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for RelationalDatabaseSourceType {
fn from(s: &str) -> Self {
match s {
"RDS_HTTP_ENDPOINT" => RelationalDatabaseSourceType::RdsHttpEndpoint,
other => RelationalDatabaseSourceType::Unknown(crate::types::UnknownVariantValue(
other.to_owned(),
)),
}
}
}
impl std::str::FromStr for RelationalDatabaseSourceType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(RelationalDatabaseSourceType::from(s))
}
}
impl RelationalDatabaseSourceType {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
RelationalDatabaseSourceType::RdsHttpEndpoint => "RDS_HTTP_ENDPOINT",
RelationalDatabaseSourceType::Unknown(value) => value.as_str(),
}
}
/// Returns all the `&str` values of the enum members.
pub const fn values() -> &'static [&'static str] {
&["RDS_HTTP_ENDPOINT"]
}
}
impl AsRef<str> for RelationalDatabaseSourceType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>Describes an HTTP data source configuration.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct HttpDataSourceConfig {
/// <p>The HTTP URL endpoint. You can specify either the domain name or IP, and port combination, and the URL scheme must be HTTP or HTTPS. If you don't specify the port, AppSync uses the default port 80 for the HTTP endpoint and port 443 for HTTPS endpoints.</p>
#[doc(hidden)]
pub endpoint: std::option::Option<std::string::String>,
/// <p>The authorization configuration in case the HTTP endpoint requires authorization.</p>
#[doc(hidden)]
pub authorization_config: std::option::Option<crate::model::AuthorizationConfig>,
}
impl HttpDataSourceConfig {
/// <p>The HTTP URL endpoint. You can specify either the domain name or IP, and port combination, and the URL scheme must be HTTP or HTTPS. If you don't specify the port, AppSync uses the default port 80 for the HTTP endpoint and port 443 for HTTPS endpoints.</p>
pub fn endpoint(&self) -> std::option::Option<&str> {
self.endpoint.as_deref()
}
/// <p>The authorization configuration in case the HTTP endpoint requires authorization.</p>
pub fn authorization_config(&self) -> std::option::Option<&crate::model::AuthorizationConfig> {
self.authorization_config.as_ref()
}
}
/// See [`HttpDataSourceConfig`](crate::model::HttpDataSourceConfig).
pub mod http_data_source_config {
/// A builder for [`HttpDataSourceConfig`](crate::model::HttpDataSourceConfig).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) endpoint: std::option::Option<std::string::String>,
pub(crate) authorization_config: std::option::Option<crate::model::AuthorizationConfig>,
}
impl Builder {
/// <p>The HTTP URL endpoint. You can specify either the domain name or IP, and port combination, and the URL scheme must be HTTP or HTTPS. If you don't specify the port, AppSync uses the default port 80 for the HTTP endpoint and port 443 for HTTPS endpoints.</p>
pub fn endpoint(mut self, input: impl Into<std::string::String>) -> Self {
self.endpoint = Some(input.into());
self
}
/// <p>The HTTP URL endpoint. You can specify either the domain name or IP, and port combination, and the URL scheme must be HTTP or HTTPS. If you don't specify the port, AppSync uses the default port 80 for the HTTP endpoint and port 443 for HTTPS endpoints.</p>
pub fn set_endpoint(mut self, input: std::option::Option<std::string::String>) -> Self {
self.endpoint = input;
self
}
/// <p>The authorization configuration in case the HTTP endpoint requires authorization.</p>
pub fn authorization_config(mut self, input: crate::model::AuthorizationConfig) -> Self {
self.authorization_config = Some(input);
self
}
/// <p>The authorization configuration in case the HTTP endpoint requires authorization.</p>
pub fn set_authorization_config(
mut self,
input: std::option::Option<crate::model::AuthorizationConfig>,
) -> Self {
self.authorization_config = input;
self
}
/// Consumes the builder and constructs a [`HttpDataSourceConfig`](crate::model::HttpDataSourceConfig).
pub fn build(self) -> crate::model::HttpDataSourceConfig {
crate::model::HttpDataSourceConfig {
endpoint: self.endpoint,
authorization_config: self.authorization_config,
}
}
}
}
impl HttpDataSourceConfig {
/// Creates a new builder-style object to manufacture [`HttpDataSourceConfig`](crate::model::HttpDataSourceConfig).
pub fn builder() -> crate::model::http_data_source_config::Builder {
crate::model::http_data_source_config::Builder::default()
}
}
/// <p>The authorization configuration in case the HTTP endpoint requires authorization.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct AuthorizationConfig {
/// <p>The authorization type that the HTTP endpoint requires.</p>
/// <ul>
/// <li> <p> <b>AWS_IAM</b>: The authorization type is Signature Version 4 (SigV4).</p> </li>
/// </ul>
#[doc(hidden)]
pub authorization_type: std::option::Option<crate::model::AuthorizationType>,
/// <p>The Identity and Access Management (IAM) settings.</p>
#[doc(hidden)]
pub aws_iam_config: std::option::Option<crate::model::AwsIamConfig>,
}
impl AuthorizationConfig {
/// <p>The authorization type that the HTTP endpoint requires.</p>
/// <ul>
/// <li> <p> <b>AWS_IAM</b>: The authorization type is Signature Version 4 (SigV4).</p> </li>
/// </ul>
pub fn authorization_type(&self) -> std::option::Option<&crate::model::AuthorizationType> {
self.authorization_type.as_ref()
}
/// <p>The Identity and Access Management (IAM) settings.</p>
pub fn aws_iam_config(&self) -> std::option::Option<&crate::model::AwsIamConfig> {
self.aws_iam_config.as_ref()
}
}
/// See [`AuthorizationConfig`](crate::model::AuthorizationConfig).
pub mod authorization_config {
/// A builder for [`AuthorizationConfig`](crate::model::AuthorizationConfig).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) authorization_type: std::option::Option<crate::model::AuthorizationType>,
pub(crate) aws_iam_config: std::option::Option<crate::model::AwsIamConfig>,
}
impl Builder {
/// <p>The authorization type that the HTTP endpoint requires.</p>
/// <ul>
/// <li> <p> <b>AWS_IAM</b>: The authorization type is Signature Version 4 (SigV4).</p> </li>
/// </ul>
pub fn authorization_type(mut self, input: crate::model::AuthorizationType) -> Self {
self.authorization_type = Some(input);
self
}
/// <p>The authorization type that the HTTP endpoint requires.</p>
/// <ul>
/// <li> <p> <b>AWS_IAM</b>: The authorization type is Signature Version 4 (SigV4).</p> </li>
/// </ul>
pub fn set_authorization_type(
mut self,
input: std::option::Option<crate::model::AuthorizationType>,
) -> Self {
self.authorization_type = input;
self
}
/// <p>The Identity and Access Management (IAM) settings.</p>
pub fn aws_iam_config(mut self, input: crate::model::AwsIamConfig) -> Self {
self.aws_iam_config = Some(input);
self
}
/// <p>The Identity and Access Management (IAM) settings.</p>
pub fn set_aws_iam_config(
mut self,
input: std::option::Option<crate::model::AwsIamConfig>,
) -> Self {
self.aws_iam_config = input;
self
}
/// Consumes the builder and constructs a [`AuthorizationConfig`](crate::model::AuthorizationConfig).
pub fn build(self) -> crate::model::AuthorizationConfig {
crate::model::AuthorizationConfig {
authorization_type: self.authorization_type,
aws_iam_config: self.aws_iam_config,
}
}
}
}
impl AuthorizationConfig {
/// Creates a new builder-style object to manufacture [`AuthorizationConfig`](crate::model::AuthorizationConfig).
pub fn builder() -> crate::model::authorization_config::Builder {
crate::model::authorization_config::Builder::default()
}
}
/// <p>The Identity and Access Management (IAM) configuration.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct AwsIamConfig {
/// <p>The signing Amazon Web Services Region for IAM authorization.</p>
#[doc(hidden)]
pub signing_region: std::option::Option<std::string::String>,
/// <p>The signing service name for IAM authorization.</p>
#[doc(hidden)]
pub signing_service_name: std::option::Option<std::string::String>,
}
impl AwsIamConfig {
/// <p>The signing Amazon Web Services Region for IAM authorization.</p>
pub fn signing_region(&self) -> std::option::Option<&str> {
self.signing_region.as_deref()
}
/// <p>The signing service name for IAM authorization.</p>
pub fn signing_service_name(&self) -> std::option::Option<&str> {
self.signing_service_name.as_deref()
}
}
/// See [`AwsIamConfig`](crate::model::AwsIamConfig).
pub mod aws_iam_config {
/// A builder for [`AwsIamConfig`](crate::model::AwsIamConfig).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) signing_region: std::option::Option<std::string::String>,
pub(crate) signing_service_name: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The signing Amazon Web Services Region for IAM authorization.</p>
pub fn signing_region(mut self, input: impl Into<std::string::String>) -> Self {
self.signing_region = Some(input.into());
self
}
/// <p>The signing Amazon Web Services Region for IAM authorization.</p>
pub fn set_signing_region(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.signing_region = input;
self
}
/// <p>The signing service name for IAM authorization.</p>
pub fn signing_service_name(mut self, input: impl Into<std::string::String>) -> Self {
self.signing_service_name = Some(input.into());
self
}
/// <p>The signing service name for IAM authorization.</p>
pub fn set_signing_service_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.signing_service_name = input;
self
}
/// Consumes the builder and constructs a [`AwsIamConfig`](crate::model::AwsIamConfig).
pub fn build(self) -> crate::model::AwsIamConfig {
crate::model::AwsIamConfig {
signing_region: self.signing_region,
signing_service_name: self.signing_service_name,
}
}
}
}
impl AwsIamConfig {
/// Creates a new builder-style object to manufacture [`AwsIamConfig`](crate::model::AwsIamConfig).
pub fn builder() -> crate::model::aws_iam_config::Builder {
crate::model::aws_iam_config::Builder::default()
}
}
/// When writing a match expression against `AuthorizationType`, it is important to ensure
/// your code is forward-compatible. That is, if a match arm handles a case for a
/// feature that is supported by the service but has not been represented as an enum
/// variant in a current version of SDK, your code should continue to work when you
/// upgrade SDK to a future version in which the enum does include a variant for that
/// feature.
///
/// Here is an example of how you can make a match expression forward-compatible:
///
/// ```text
/// # let authorizationtype = unimplemented!();
/// match authorizationtype {
/// AuthorizationType::AwsIam => { /* ... */ },
/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
/// _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `authorizationtype` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `AuthorizationType::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `AuthorizationType::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
/// and calling `as_str` on it yields `"NewFeature"`.
/// This match expression is forward-compatible when executed with a newer
/// version of SDK where the variant `AuthorizationType::NewFeature` is defined.
/// Specifically, when `authorizationtype` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `AuthorizationType::NewFeature` also yielding `"NewFeature"`.
///
/// Explicitly matching on the `Unknown` variant should
/// be avoided for two reasons:
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
/// - It might inadvertently shadow other intended match arms.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum AuthorizationType {
#[allow(missing_docs)] // documentation missing in model
AwsIam,
/// `Unknown` contains new variants that have been added since this code was generated.
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for AuthorizationType {
fn from(s: &str) -> Self {
match s {
"AWS_IAM" => AuthorizationType::AwsIam,
other => {
AuthorizationType::Unknown(crate::types::UnknownVariantValue(other.to_owned()))
}
}
}
}
impl std::str::FromStr for AuthorizationType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(AuthorizationType::from(s))
}
}
impl AuthorizationType {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
AuthorizationType::AwsIam => "AWS_IAM",
AuthorizationType::Unknown(value) => value.as_str(),
}
}
/// Returns all the `&str` values of the enum members.
pub const fn values() -> &'static [&'static str] {
&["AWS_IAM"]
}
}
impl AsRef<str> for AuthorizationType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>Describes an OpenSearch data source configuration.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct OpenSearchServiceDataSourceConfig {
/// <p>The endpoint.</p>
#[doc(hidden)]
pub endpoint: std::option::Option<std::string::String>,
/// <p>The Amazon Web Services Region.</p>
#[doc(hidden)]
pub aws_region: std::option::Option<std::string::String>,
}
impl OpenSearchServiceDataSourceConfig {
/// <p>The endpoint.</p>
pub fn endpoint(&self) -> std::option::Option<&str> {
self.endpoint.as_deref()
}
/// <p>The Amazon Web Services Region.</p>
pub fn aws_region(&self) -> std::option::Option<&str> {
self.aws_region.as_deref()
}
}
/// See [`OpenSearchServiceDataSourceConfig`](crate::model::OpenSearchServiceDataSourceConfig).
pub mod open_search_service_data_source_config {
/// A builder for [`OpenSearchServiceDataSourceConfig`](crate::model::OpenSearchServiceDataSourceConfig).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) endpoint: std::option::Option<std::string::String>,
pub(crate) aws_region: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The endpoint.</p>
pub fn endpoint(mut self, input: impl Into<std::string::String>) -> Self {
self.endpoint = Some(input.into());
self
}
/// <p>The endpoint.</p>
pub fn set_endpoint(mut self, input: std::option::Option<std::string::String>) -> Self {
self.endpoint = input;
self
}
/// <p>The Amazon Web Services Region.</p>
pub fn aws_region(mut self, input: impl Into<std::string::String>) -> Self {
self.aws_region = Some(input.into());
self
}
/// <p>The Amazon Web Services Region.</p>
pub fn set_aws_region(mut self, input: std::option::Option<std::string::String>) -> Self {
self.aws_region = input;
self
}
/// Consumes the builder and constructs a [`OpenSearchServiceDataSourceConfig`](crate::model::OpenSearchServiceDataSourceConfig).
pub fn build(self) -> crate::model::OpenSearchServiceDataSourceConfig {
crate::model::OpenSearchServiceDataSourceConfig {
endpoint: self.endpoint,
aws_region: self.aws_region,
}
}
}
}
impl OpenSearchServiceDataSourceConfig {
/// Creates a new builder-style object to manufacture [`OpenSearchServiceDataSourceConfig`](crate::model::OpenSearchServiceDataSourceConfig).
pub fn builder() -> crate::model::open_search_service_data_source_config::Builder {
crate::model::open_search_service_data_source_config::Builder::default()
}
}
/// <p>Describes an OpenSearch data source configuration.</p>
/// <p>As of September 2021, Amazon Elasticsearch service is Amazon OpenSearch Service. This configuration is deprecated. For new data sources, use <code>OpenSearchServiceDataSourceConfig</code> to specify an OpenSearch data source.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ElasticsearchDataSourceConfig {
/// <p>The endpoint.</p>
#[doc(hidden)]
pub endpoint: std::option::Option<std::string::String>,
/// <p>The Amazon Web Services Region.</p>
#[doc(hidden)]
pub aws_region: std::option::Option<std::string::String>,
}
impl ElasticsearchDataSourceConfig {
/// <p>The endpoint.</p>
pub fn endpoint(&self) -> std::option::Option<&str> {
self.endpoint.as_deref()
}
/// <p>The Amazon Web Services Region.</p>
pub fn aws_region(&self) -> std::option::Option<&str> {
self.aws_region.as_deref()
}
}
/// See [`ElasticsearchDataSourceConfig`](crate::model::ElasticsearchDataSourceConfig).
pub mod elasticsearch_data_source_config {
/// A builder for [`ElasticsearchDataSourceConfig`](crate::model::ElasticsearchDataSourceConfig).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) endpoint: std::option::Option<std::string::String>,
pub(crate) aws_region: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The endpoint.</p>
pub fn endpoint(mut self, input: impl Into<std::string::String>) -> Self {
self.endpoint = Some(input.into());
self
}
/// <p>The endpoint.</p>
pub fn set_endpoint(mut self, input: std::option::Option<std::string::String>) -> Self {
self.endpoint = input;
self
}
/// <p>The Amazon Web Services Region.</p>
pub fn aws_region(mut self, input: impl Into<std::string::String>) -> Self {
self.aws_region = Some(input.into());
self
}
/// <p>The Amazon Web Services Region.</p>
pub fn set_aws_region(mut self, input: std::option::Option<std::string::String>) -> Self {
self.aws_region = input;
self
}
/// Consumes the builder and constructs a [`ElasticsearchDataSourceConfig`](crate::model::ElasticsearchDataSourceConfig).
pub fn build(self) -> crate::model::ElasticsearchDataSourceConfig {
crate::model::ElasticsearchDataSourceConfig {
endpoint: self.endpoint,
aws_region: self.aws_region,
}
}
}
}
impl ElasticsearchDataSourceConfig {
/// Creates a new builder-style object to manufacture [`ElasticsearchDataSourceConfig`](crate::model::ElasticsearchDataSourceConfig).
pub fn builder() -> crate::model::elasticsearch_data_source_config::Builder {
crate::model::elasticsearch_data_source_config::Builder::default()
}
}
/// <p>Describes an Lambda data source configuration.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct LambdaDataSourceConfig {
/// <p>The Amazon Resource Name (ARN) for the Lambda function.</p>
#[doc(hidden)]
pub lambda_function_arn: std::option::Option<std::string::String>,
}
impl LambdaDataSourceConfig {
/// <p>The Amazon Resource Name (ARN) for the Lambda function.</p>
pub fn lambda_function_arn(&self) -> std::option::Option<&str> {
self.lambda_function_arn.as_deref()
}
}
/// See [`LambdaDataSourceConfig`](crate::model::LambdaDataSourceConfig).
pub mod lambda_data_source_config {
/// A builder for [`LambdaDataSourceConfig`](crate::model::LambdaDataSourceConfig).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) lambda_function_arn: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The Amazon Resource Name (ARN) for the Lambda function.</p>
pub fn lambda_function_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.lambda_function_arn = Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) for the Lambda function.</p>
pub fn set_lambda_function_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.lambda_function_arn = input;
self
}
/// Consumes the builder and constructs a [`LambdaDataSourceConfig`](crate::model::LambdaDataSourceConfig).
pub fn build(self) -> crate::model::LambdaDataSourceConfig {
crate::model::LambdaDataSourceConfig {
lambda_function_arn: self.lambda_function_arn,
}
}
}
}
impl LambdaDataSourceConfig {
/// Creates a new builder-style object to manufacture [`LambdaDataSourceConfig`](crate::model::LambdaDataSourceConfig).
pub fn builder() -> crate::model::lambda_data_source_config::Builder {
crate::model::lambda_data_source_config::Builder::default()
}
}
/// <p>Describes an Amazon DynamoDB data source configuration.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DynamodbDataSourceConfig {
/// <p>The table name.</p>
#[doc(hidden)]
pub table_name: std::option::Option<std::string::String>,
/// <p>The Amazon Web Services Region.</p>
#[doc(hidden)]
pub aws_region: std::option::Option<std::string::String>,
/// <p>Set to TRUE to use Amazon Cognito credentials with this data source.</p>
#[doc(hidden)]
pub use_caller_credentials: bool,
/// <p>The <code>DeltaSyncConfig</code> for a versioned data source.</p>
#[doc(hidden)]
pub delta_sync_config: std::option::Option<crate::model::DeltaSyncConfig>,
/// <p>Set to TRUE to use Conflict Detection and Resolution with this data source.</p>
#[doc(hidden)]
pub versioned: bool,
}
impl DynamodbDataSourceConfig {
/// <p>The table name.</p>
pub fn table_name(&self) -> std::option::Option<&str> {
self.table_name.as_deref()
}
/// <p>The Amazon Web Services Region.</p>
pub fn aws_region(&self) -> std::option::Option<&str> {
self.aws_region.as_deref()
}
/// <p>Set to TRUE to use Amazon Cognito credentials with this data source.</p>
pub fn use_caller_credentials(&self) -> bool {
self.use_caller_credentials
}
/// <p>The <code>DeltaSyncConfig</code> for a versioned data source.</p>
pub fn delta_sync_config(&self) -> std::option::Option<&crate::model::DeltaSyncConfig> {
self.delta_sync_config.as_ref()
}
/// <p>Set to TRUE to use Conflict Detection and Resolution with this data source.</p>
pub fn versioned(&self) -> bool {
self.versioned
}
}
/// See [`DynamodbDataSourceConfig`](crate::model::DynamodbDataSourceConfig).
pub mod dynamodb_data_source_config {
/// A builder for [`DynamodbDataSourceConfig`](crate::model::DynamodbDataSourceConfig).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) table_name: std::option::Option<std::string::String>,
pub(crate) aws_region: std::option::Option<std::string::String>,
pub(crate) use_caller_credentials: std::option::Option<bool>,
pub(crate) delta_sync_config: std::option::Option<crate::model::DeltaSyncConfig>,
pub(crate) versioned: std::option::Option<bool>,
}
impl Builder {
/// <p>The table name.</p>
pub fn table_name(mut self, input: impl Into<std::string::String>) -> Self {
self.table_name = Some(input.into());
self
}
/// <p>The table name.</p>
pub fn set_table_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.table_name = input;
self
}
/// <p>The Amazon Web Services Region.</p>
pub fn aws_region(mut self, input: impl Into<std::string::String>) -> Self {
self.aws_region = Some(input.into());
self
}
/// <p>The Amazon Web Services Region.</p>
pub fn set_aws_region(mut self, input: std::option::Option<std::string::String>) -> Self {
self.aws_region = input;
self
}
/// <p>Set to TRUE to use Amazon Cognito credentials with this data source.</p>
pub fn use_caller_credentials(mut self, input: bool) -> Self {
self.use_caller_credentials = Some(input);
self
}
/// <p>Set to TRUE to use Amazon Cognito credentials with this data source.</p>
pub fn set_use_caller_credentials(mut self, input: std::option::Option<bool>) -> Self {
self.use_caller_credentials = input;
self
}
/// <p>The <code>DeltaSyncConfig</code> for a versioned data source.</p>
pub fn delta_sync_config(mut self, input: crate::model::DeltaSyncConfig) -> Self {
self.delta_sync_config = Some(input);
self
}
/// <p>The <code>DeltaSyncConfig</code> for a versioned data source.</p>
pub fn set_delta_sync_config(
mut self,
input: std::option::Option<crate::model::DeltaSyncConfig>,
) -> Self {
self.delta_sync_config = input;
self
}
/// <p>Set to TRUE to use Conflict Detection and Resolution with this data source.</p>
pub fn versioned(mut self, input: bool) -> Self {
self.versioned = Some(input);
self
}
/// <p>Set to TRUE to use Conflict Detection and Resolution with this data source.</p>
pub fn set_versioned(mut self, input: std::option::Option<bool>) -> Self {
self.versioned = input;
self
}
/// Consumes the builder and constructs a [`DynamodbDataSourceConfig`](crate::model::DynamodbDataSourceConfig).
pub fn build(self) -> crate::model::DynamodbDataSourceConfig {
crate::model::DynamodbDataSourceConfig {
table_name: self.table_name,
aws_region: self.aws_region,
use_caller_credentials: self.use_caller_credentials.unwrap_or_default(),
delta_sync_config: self.delta_sync_config,
versioned: self.versioned.unwrap_or_default(),
}
}
}
}
impl DynamodbDataSourceConfig {
/// Creates a new builder-style object to manufacture [`DynamodbDataSourceConfig`](crate::model::DynamodbDataSourceConfig).
pub fn builder() -> crate::model::dynamodb_data_source_config::Builder {
crate::model::dynamodb_data_source_config::Builder::default()
}
}
/// <p>Describes a Delta Sync configuration.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeltaSyncConfig {
/// <p>The number of minutes that an Item is stored in the data source.</p>
#[doc(hidden)]
pub base_table_ttl: i64,
/// <p>The Delta Sync table name.</p>
#[doc(hidden)]
pub delta_sync_table_name: std::option::Option<std::string::String>,
/// <p>The number of minutes that a Delta Sync log entry is stored in the Delta Sync table.</p>
#[doc(hidden)]
pub delta_sync_table_ttl: i64,
}
impl DeltaSyncConfig {
/// <p>The number of minutes that an Item is stored in the data source.</p>
pub fn base_table_ttl(&self) -> i64 {
self.base_table_ttl
}
/// <p>The Delta Sync table name.</p>
pub fn delta_sync_table_name(&self) -> std::option::Option<&str> {
self.delta_sync_table_name.as_deref()
}
/// <p>The number of minutes that a Delta Sync log entry is stored in the Delta Sync table.</p>
pub fn delta_sync_table_ttl(&self) -> i64 {
self.delta_sync_table_ttl
}
}
/// See [`DeltaSyncConfig`](crate::model::DeltaSyncConfig).
pub mod delta_sync_config {
/// A builder for [`DeltaSyncConfig`](crate::model::DeltaSyncConfig).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) base_table_ttl: std::option::Option<i64>,
pub(crate) delta_sync_table_name: std::option::Option<std::string::String>,
pub(crate) delta_sync_table_ttl: std::option::Option<i64>,
}
impl Builder {
/// <p>The number of minutes that an Item is stored in the data source.</p>
pub fn base_table_ttl(mut self, input: i64) -> Self {
self.base_table_ttl = Some(input);
self
}
/// <p>The number of minutes that an Item is stored in the data source.</p>
pub fn set_base_table_ttl(mut self, input: std::option::Option<i64>) -> Self {
self.base_table_ttl = input;
self
}
/// <p>The Delta Sync table name.</p>
pub fn delta_sync_table_name(mut self, input: impl Into<std::string::String>) -> Self {
self.delta_sync_table_name = Some(input.into());
self
}
/// <p>The Delta Sync table name.</p>
pub fn set_delta_sync_table_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.delta_sync_table_name = input;
self
}
/// <p>The number of minutes that a Delta Sync log entry is stored in the Delta Sync table.</p>
pub fn delta_sync_table_ttl(mut self, input: i64) -> Self {
self.delta_sync_table_ttl = Some(input);
self
}
/// <p>The number of minutes that a Delta Sync log entry is stored in the Delta Sync table.</p>
pub fn set_delta_sync_table_ttl(mut self, input: std::option::Option<i64>) -> Self {
self.delta_sync_table_ttl = input;
self
}
/// Consumes the builder and constructs a [`DeltaSyncConfig`](crate::model::DeltaSyncConfig).
pub fn build(self) -> crate::model::DeltaSyncConfig {
crate::model::DeltaSyncConfig {
base_table_ttl: self.base_table_ttl.unwrap_or_default(),
delta_sync_table_name: self.delta_sync_table_name,
delta_sync_table_ttl: self.delta_sync_table_ttl.unwrap_or_default(),
}
}
}
}
impl DeltaSyncConfig {
/// Creates a new builder-style object to manufacture [`DeltaSyncConfig`](crate::model::DeltaSyncConfig).
pub fn builder() -> crate::model::delta_sync_config::Builder {
crate::model::delta_sync_config::Builder::default()
}
}
/// When writing a match expression against `DataSourceType`, it is important to ensure
/// your code is forward-compatible. That is, if a match arm handles a case for a
/// feature that is supported by the service but has not been represented as an enum
/// variant in a current version of SDK, your code should continue to work when you
/// upgrade SDK to a future version in which the enum does include a variant for that
/// feature.
///
/// Here is an example of how you can make a match expression forward-compatible:
///
/// ```text
/// # let datasourcetype = unimplemented!();
/// match datasourcetype {
/// DataSourceType::AmazonDynamodb => { /* ... */ },
/// DataSourceType::AmazonElasticsearch => { /* ... */ },
/// DataSourceType::AmazonOpensearchService => { /* ... */ },
/// DataSourceType::AwsLambda => { /* ... */ },
/// DataSourceType::Http => { /* ... */ },
/// DataSourceType::None => { /* ... */ },
/// DataSourceType::RelationalDatabase => { /* ... */ },
/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
/// _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `datasourcetype` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `DataSourceType::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `DataSourceType::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
/// and calling `as_str` on it yields `"NewFeature"`.
/// This match expression is forward-compatible when executed with a newer
/// version of SDK where the variant `DataSourceType::NewFeature` is defined.
/// Specifically, when `datasourcetype` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `DataSourceType::NewFeature` also yielding `"NewFeature"`.
///
/// Explicitly matching on the `Unknown` variant should
/// be avoided for two reasons:
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
/// - It might inadvertently shadow other intended match arms.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum DataSourceType {
#[allow(missing_docs)] // documentation missing in model
AmazonDynamodb,
#[allow(missing_docs)] // documentation missing in model
AmazonElasticsearch,
#[allow(missing_docs)] // documentation missing in model
AmazonOpensearchService,
#[allow(missing_docs)] // documentation missing in model
AwsLambda,
#[allow(missing_docs)] // documentation missing in model
Http,
#[allow(missing_docs)] // documentation missing in model
None,
#[allow(missing_docs)] // documentation missing in model
RelationalDatabase,
/// `Unknown` contains new variants that have been added since this code was generated.
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for DataSourceType {
fn from(s: &str) -> Self {
match s {
"AMAZON_DYNAMODB" => DataSourceType::AmazonDynamodb,
"AMAZON_ELASTICSEARCH" => DataSourceType::AmazonElasticsearch,
"AMAZON_OPENSEARCH_SERVICE" => DataSourceType::AmazonOpensearchService,
"AWS_LAMBDA" => DataSourceType::AwsLambda,
"HTTP" => DataSourceType::Http,
"NONE" => DataSourceType::None,
"RELATIONAL_DATABASE" => DataSourceType::RelationalDatabase,
other => DataSourceType::Unknown(crate::types::UnknownVariantValue(other.to_owned())),
}
}
}
impl std::str::FromStr for DataSourceType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(DataSourceType::from(s))
}
}
impl DataSourceType {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
DataSourceType::AmazonDynamodb => "AMAZON_DYNAMODB",
DataSourceType::AmazonElasticsearch => "AMAZON_ELASTICSEARCH",
DataSourceType::AmazonOpensearchService => "AMAZON_OPENSEARCH_SERVICE",
DataSourceType::AwsLambda => "AWS_LAMBDA",
DataSourceType::Http => "HTTP",
DataSourceType::None => "NONE",
DataSourceType::RelationalDatabase => "RELATIONAL_DATABASE",
DataSourceType::Unknown(value) => value.as_str(),
}
}
/// Returns all the `&str` values of the enum members.
pub const fn values() -> &'static [&'static str] {
&[
"AMAZON_DYNAMODB",
"AMAZON_ELASTICSEARCH",
"AMAZON_OPENSEARCH_SERVICE",
"AWS_LAMBDA",
"HTTP",
"NONE",
"RELATIONAL_DATABASE",
]
}
}
impl AsRef<str> for DataSourceType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>Describes an API key.</p>
/// <p>Customers invoke AppSync GraphQL API operations with API keys as an identity mechanism. There are two key versions:</p>
/// <p> <b>da1</b>: We introduced this version at launch in November 2017. These keys always expire after 7 days. Amazon DynamoDB TTL manages key expiration. These keys ceased to be valid after February 21, 2018, and they should no longer be used.</p>
/// <ul>
/// <li> <p> <code>ListApiKeys</code> returns the expiration time in milliseconds.</p> </li>
/// <li> <p> <code>CreateApiKey</code> returns the expiration time in milliseconds.</p> </li>
/// <li> <p> <code>UpdateApiKey</code> is not available for this key version.</p> </li>
/// <li> <p> <code>DeleteApiKey</code> deletes the item from the table.</p> </li>
/// <li> <p>Expiration is stored in DynamoDB as milliseconds. This results in a bug where keys are not automatically deleted because DynamoDB expects the TTL to be stored in seconds. As a one-time action, we deleted these keys from the table on February 21, 2018.</p> </li>
/// </ul>
/// <p> <b>da2</b>: We introduced this version in February 2018 when AppSync added support to extend key expiration.</p>
/// <ul>
/// <li> <p> <code>ListApiKeys</code> returns the expiration time and deletion time in seconds.</p> </li>
/// <li> <p> <code>CreateApiKey</code> returns the expiration time and deletion time in seconds and accepts a user-provided expiration time in seconds.</p> </li>
/// <li> <p> <code>UpdateApiKey</code> returns the expiration time and and deletion time in seconds and accepts a user-provided expiration time in seconds. Expired API keys are kept for 60 days after the expiration time. You can update the key expiration time as long as the key isn't deleted.</p> </li>
/// <li> <p> <code>DeleteApiKey</code> deletes the item from the table.</p> </li>
/// <li> <p>Expiration is stored in DynamoDB as seconds. After the expiration time, using the key to authenticate will fail. However, you can reinstate the key before deletion.</p> </li>
/// <li> <p>Deletion is stored in DynamoDB as seconds. The key is deleted after deletion time.</p> </li>
/// </ul>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ApiKey {
/// <p>The API key ID.</p>
#[doc(hidden)]
pub id: std::option::Option<std::string::String>,
/// <p>A description of the purpose of the API key.</p>
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
/// <p>The time after which the API key expires. The date is represented as seconds since the epoch, rounded down to the nearest hour.</p>
#[doc(hidden)]
pub expires: i64,
/// <p>The time after which the API key is deleted. The date is represented as seconds since the epoch, rounded down to the nearest hour.</p>
#[doc(hidden)]
pub deletes: i64,
}
impl ApiKey {
/// <p>The API key ID.</p>
pub fn id(&self) -> std::option::Option<&str> {
self.id.as_deref()
}
/// <p>A description of the purpose of the API key.</p>
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
/// <p>The time after which the API key expires. The date is represented as seconds since the epoch, rounded down to the nearest hour.</p>
pub fn expires(&self) -> i64 {
self.expires
}
/// <p>The time after which the API key is deleted. The date is represented as seconds since the epoch, rounded down to the nearest hour.</p>
pub fn deletes(&self) -> i64 {
self.deletes
}
}
/// See [`ApiKey`](crate::model::ApiKey).
pub mod api_key {
/// A builder for [`ApiKey`](crate::model::ApiKey).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) id: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) expires: std::option::Option<i64>,
pub(crate) deletes: std::option::Option<i64>,
}
impl Builder {
/// <p>The API key ID.</p>
pub fn id(mut self, input: impl Into<std::string::String>) -> Self {
self.id = Some(input.into());
self
}
/// <p>The API key ID.</p>
pub fn set_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.id = input;
self
}
/// <p>A description of the purpose of the API key.</p>
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
/// <p>A description of the purpose of the API key.</p>
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
/// <p>The time after which the API key expires. The date is represented as seconds since the epoch, rounded down to the nearest hour.</p>
pub fn expires(mut self, input: i64) -> Self {
self.expires = Some(input);
self
}
/// <p>The time after which the API key expires. The date is represented as seconds since the epoch, rounded down to the nearest hour.</p>
pub fn set_expires(mut self, input: std::option::Option<i64>) -> Self {
self.expires = input;
self
}
/// <p>The time after which the API key is deleted. The date is represented as seconds since the epoch, rounded down to the nearest hour.</p>
pub fn deletes(mut self, input: i64) -> Self {
self.deletes = Some(input);
self
}
/// <p>The time after which the API key is deleted. The date is represented as seconds since the epoch, rounded down to the nearest hour.</p>
pub fn set_deletes(mut self, input: std::option::Option<i64>) -> Self {
self.deletes = input;
self
}
/// Consumes the builder and constructs a [`ApiKey`](crate::model::ApiKey).
pub fn build(self) -> crate::model::ApiKey {
crate::model::ApiKey {
id: self.id,
description: self.description,
expires: self.expires.unwrap_or_default(),
deletes: self.deletes.unwrap_or_default(),
}
}
}
}
impl ApiKey {
/// Creates a new builder-style object to manufacture [`ApiKey`](crate::model::ApiKey).
pub fn builder() -> crate::model::api_key::Builder {
crate::model::api_key::Builder::default()
}
}
/// <p>The <code>ApiCache</code> object.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ApiCache {
/// <p>TTL in seconds for cache entries.</p>
/// <p>Valid values are 1–3,600 seconds.</p>
#[doc(hidden)]
pub ttl: i64,
/// <p>Caching behavior.</p>
/// <ul>
/// <li> <p> <b>FULL_REQUEST_CACHING</b>: All requests are fully cached.</p> </li>
/// <li> <p> <b>PER_RESOLVER_CACHING</b>: Individual resolvers that you specify are cached.</p> </li>
/// </ul>
#[doc(hidden)]
pub api_caching_behavior: std::option::Option<crate::model::ApiCachingBehavior>,
/// <p>Transit encryption flag when connecting to cache. You cannot update this setting after creation.</p>
#[doc(hidden)]
pub transit_encryption_enabled: bool,
/// <p>At-rest encryption flag for cache. You cannot update this setting after creation.</p>
#[doc(hidden)]
pub at_rest_encryption_enabled: bool,
/// <p>The cache instance type. Valid values are </p>
/// <ul>
/// <li> <p> <code>SMALL</code> </p> </li>
/// <li> <p> <code>MEDIUM</code> </p> </li>
/// <li> <p> <code>LARGE</code> </p> </li>
/// <li> <p> <code>XLARGE</code> </p> </li>
/// <li> <p> <code>LARGE_2X</code> </p> </li>
/// <li> <p> <code>LARGE_4X</code> </p> </li>
/// <li> <p> <code>LARGE_8X</code> (not available in all regions)</p> </li>
/// <li> <p> <code>LARGE_12X</code> </p> </li>
/// </ul>
/// <p>Historically, instance types were identified by an EC2-style value. As of July 2020, this is deprecated, and the generic identifiers above should be used.</p>
/// <p>The following legacy instance types are available, but their use is discouraged:</p>
/// <ul>
/// <li> <p> <b>T2_SMALL</b>: A t2.small instance type.</p> </li>
/// <li> <p> <b>T2_MEDIUM</b>: A t2.medium instance type.</p> </li>
/// <li> <p> <b>R4_LARGE</b>: A r4.large instance type.</p> </li>
/// <li> <p> <b>R4_XLARGE</b>: A r4.xlarge instance type.</p> </li>
/// <li> <p> <b>R4_2XLARGE</b>: A r4.2xlarge instance type.</p> </li>
/// <li> <p> <b>R4_4XLARGE</b>: A r4.4xlarge instance type.</p> </li>
/// <li> <p> <b>R4_8XLARGE</b>: A r4.8xlarge instance type.</p> </li>
/// </ul>
#[doc(hidden)]
pub r#type: std::option::Option<crate::model::ApiCacheType>,
/// <p>The cache instance status.</p>
/// <ul>
/// <li> <p> <b>AVAILABLE</b>: The instance is available for use.</p> </li>
/// <li> <p> <b>CREATING</b>: The instance is currently creating.</p> </li>
/// <li> <p> <b>DELETING</b>: The instance is currently deleting.</p> </li>
/// <li> <p> <b>MODIFYING</b>: The instance is currently modifying.</p> </li>
/// <li> <p> <b>FAILED</b>: The instance has failed creation.</p> </li>
/// </ul>
#[doc(hidden)]
pub status: std::option::Option<crate::model::ApiCacheStatus>,
}
impl ApiCache {
/// <p>TTL in seconds for cache entries.</p>
/// <p>Valid values are 1–3,600 seconds.</p>
pub fn ttl(&self) -> i64 {
self.ttl
}
/// <p>Caching behavior.</p>
/// <ul>
/// <li> <p> <b>FULL_REQUEST_CACHING</b>: All requests are fully cached.</p> </li>
/// <li> <p> <b>PER_RESOLVER_CACHING</b>: Individual resolvers that you specify are cached.</p> </li>
/// </ul>
pub fn api_caching_behavior(&self) -> std::option::Option<&crate::model::ApiCachingBehavior> {
self.api_caching_behavior.as_ref()
}
/// <p>Transit encryption flag when connecting to cache. You cannot update this setting after creation.</p>
pub fn transit_encryption_enabled(&self) -> bool {
self.transit_encryption_enabled
}
/// <p>At-rest encryption flag for cache. You cannot update this setting after creation.</p>
pub fn at_rest_encryption_enabled(&self) -> bool {
self.at_rest_encryption_enabled
}
/// <p>The cache instance type. Valid values are </p>
/// <ul>
/// <li> <p> <code>SMALL</code> </p> </li>
/// <li> <p> <code>MEDIUM</code> </p> </li>
/// <li> <p> <code>LARGE</code> </p> </li>
/// <li> <p> <code>XLARGE</code> </p> </li>
/// <li> <p> <code>LARGE_2X</code> </p> </li>
/// <li> <p> <code>LARGE_4X</code> </p> </li>
/// <li> <p> <code>LARGE_8X</code> (not available in all regions)</p> </li>
/// <li> <p> <code>LARGE_12X</code> </p> </li>
/// </ul>
/// <p>Historically, instance types were identified by an EC2-style value. As of July 2020, this is deprecated, and the generic identifiers above should be used.</p>
/// <p>The following legacy instance types are available, but their use is discouraged:</p>
/// <ul>
/// <li> <p> <b>T2_SMALL</b>: A t2.small instance type.</p> </li>
/// <li> <p> <b>T2_MEDIUM</b>: A t2.medium instance type.</p> </li>
/// <li> <p> <b>R4_LARGE</b>: A r4.large instance type.</p> </li>
/// <li> <p> <b>R4_XLARGE</b>: A r4.xlarge instance type.</p> </li>
/// <li> <p> <b>R4_2XLARGE</b>: A r4.2xlarge instance type.</p> </li>
/// <li> <p> <b>R4_4XLARGE</b>: A r4.4xlarge instance type.</p> </li>
/// <li> <p> <b>R4_8XLARGE</b>: A r4.8xlarge instance type.</p> </li>
/// </ul>
pub fn r#type(&self) -> std::option::Option<&crate::model::ApiCacheType> {
self.r#type.as_ref()
}
/// <p>The cache instance status.</p>
/// <ul>
/// <li> <p> <b>AVAILABLE</b>: The instance is available for use.</p> </li>
/// <li> <p> <b>CREATING</b>: The instance is currently creating.</p> </li>
/// <li> <p> <b>DELETING</b>: The instance is currently deleting.</p> </li>
/// <li> <p> <b>MODIFYING</b>: The instance is currently modifying.</p> </li>
/// <li> <p> <b>FAILED</b>: The instance has failed creation.</p> </li>
/// </ul>
pub fn status(&self) -> std::option::Option<&crate::model::ApiCacheStatus> {
self.status.as_ref()
}
}
/// See [`ApiCache`](crate::model::ApiCache).
pub mod api_cache {
/// A builder for [`ApiCache`](crate::model::ApiCache).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) ttl: std::option::Option<i64>,
pub(crate) api_caching_behavior: std::option::Option<crate::model::ApiCachingBehavior>,
pub(crate) transit_encryption_enabled: std::option::Option<bool>,
pub(crate) at_rest_encryption_enabled: std::option::Option<bool>,
pub(crate) r#type: std::option::Option<crate::model::ApiCacheType>,
pub(crate) status: std::option::Option<crate::model::ApiCacheStatus>,
}
impl Builder {
/// <p>TTL in seconds for cache entries.</p>
/// <p>Valid values are 1–3,600 seconds.</p>
pub fn ttl(mut self, input: i64) -> Self {
self.ttl = Some(input);
self
}
/// <p>TTL in seconds for cache entries.</p>
/// <p>Valid values are 1–3,600 seconds.</p>
pub fn set_ttl(mut self, input: std::option::Option<i64>) -> Self {
self.ttl = input;
self
}
/// <p>Caching behavior.</p>
/// <ul>
/// <li> <p> <b>FULL_REQUEST_CACHING</b>: All requests are fully cached.</p> </li>
/// <li> <p> <b>PER_RESOLVER_CACHING</b>: Individual resolvers that you specify are cached.</p> </li>
/// </ul>
pub fn api_caching_behavior(mut self, input: crate::model::ApiCachingBehavior) -> Self {
self.api_caching_behavior = Some(input);
self
}
/// <p>Caching behavior.</p>
/// <ul>
/// <li> <p> <b>FULL_REQUEST_CACHING</b>: All requests are fully cached.</p> </li>
/// <li> <p> <b>PER_RESOLVER_CACHING</b>: Individual resolvers that you specify are cached.</p> </li>
/// </ul>
pub fn set_api_caching_behavior(
mut self,
input: std::option::Option<crate::model::ApiCachingBehavior>,
) -> Self {
self.api_caching_behavior = input;
self
}
/// <p>Transit encryption flag when connecting to cache. You cannot update this setting after creation.</p>
pub fn transit_encryption_enabled(mut self, input: bool) -> Self {
self.transit_encryption_enabled = Some(input);
self
}
/// <p>Transit encryption flag when connecting to cache. You cannot update this setting after creation.</p>
pub fn set_transit_encryption_enabled(mut self, input: std::option::Option<bool>) -> Self {
self.transit_encryption_enabled = input;
self
}
/// <p>At-rest encryption flag for cache. You cannot update this setting after creation.</p>
pub fn at_rest_encryption_enabled(mut self, input: bool) -> Self {
self.at_rest_encryption_enabled = Some(input);
self
}
/// <p>At-rest encryption flag for cache. You cannot update this setting after creation.</p>
pub fn set_at_rest_encryption_enabled(mut self, input: std::option::Option<bool>) -> Self {
self.at_rest_encryption_enabled = input;
self
}
/// <p>The cache instance type. Valid values are </p>
/// <ul>
/// <li> <p> <code>SMALL</code> </p> </li>
/// <li> <p> <code>MEDIUM</code> </p> </li>
/// <li> <p> <code>LARGE</code> </p> </li>
/// <li> <p> <code>XLARGE</code> </p> </li>
/// <li> <p> <code>LARGE_2X</code> </p> </li>
/// <li> <p> <code>LARGE_4X</code> </p> </li>
/// <li> <p> <code>LARGE_8X</code> (not available in all regions)</p> </li>
/// <li> <p> <code>LARGE_12X</code> </p> </li>
/// </ul>
/// <p>Historically, instance types were identified by an EC2-style value. As of July 2020, this is deprecated, and the generic identifiers above should be used.</p>
/// <p>The following legacy instance types are available, but their use is discouraged:</p>
/// <ul>
/// <li> <p> <b>T2_SMALL</b>: A t2.small instance type.</p> </li>
/// <li> <p> <b>T2_MEDIUM</b>: A t2.medium instance type.</p> </li>
/// <li> <p> <b>R4_LARGE</b>: A r4.large instance type.</p> </li>
/// <li> <p> <b>R4_XLARGE</b>: A r4.xlarge instance type.</p> </li>
/// <li> <p> <b>R4_2XLARGE</b>: A r4.2xlarge instance type.</p> </li>
/// <li> <p> <b>R4_4XLARGE</b>: A r4.4xlarge instance type.</p> </li>
/// <li> <p> <b>R4_8XLARGE</b>: A r4.8xlarge instance type.</p> </li>
/// </ul>
pub fn r#type(mut self, input: crate::model::ApiCacheType) -> Self {
self.r#type = Some(input);
self
}
/// <p>The cache instance type. Valid values are </p>
/// <ul>
/// <li> <p> <code>SMALL</code> </p> </li>
/// <li> <p> <code>MEDIUM</code> </p> </li>
/// <li> <p> <code>LARGE</code> </p> </li>
/// <li> <p> <code>XLARGE</code> </p> </li>
/// <li> <p> <code>LARGE_2X</code> </p> </li>
/// <li> <p> <code>LARGE_4X</code> </p> </li>
/// <li> <p> <code>LARGE_8X</code> (not available in all regions)</p> </li>
/// <li> <p> <code>LARGE_12X</code> </p> </li>
/// </ul>
/// <p>Historically, instance types were identified by an EC2-style value. As of July 2020, this is deprecated, and the generic identifiers above should be used.</p>
/// <p>The following legacy instance types are available, but their use is discouraged:</p>
/// <ul>
/// <li> <p> <b>T2_SMALL</b>: A t2.small instance type.</p> </li>
/// <li> <p> <b>T2_MEDIUM</b>: A t2.medium instance type.</p> </li>
/// <li> <p> <b>R4_LARGE</b>: A r4.large instance type.</p> </li>
/// <li> <p> <b>R4_XLARGE</b>: A r4.xlarge instance type.</p> </li>
/// <li> <p> <b>R4_2XLARGE</b>: A r4.2xlarge instance type.</p> </li>
/// <li> <p> <b>R4_4XLARGE</b>: A r4.4xlarge instance type.</p> </li>
/// <li> <p> <b>R4_8XLARGE</b>: A r4.8xlarge instance type.</p> </li>
/// </ul>
pub fn set_type(mut self, input: std::option::Option<crate::model::ApiCacheType>) -> Self {
self.r#type = input;
self
}
/// <p>The cache instance status.</p>
/// <ul>
/// <li> <p> <b>AVAILABLE</b>: The instance is available for use.</p> </li>
/// <li> <p> <b>CREATING</b>: The instance is currently creating.</p> </li>
/// <li> <p> <b>DELETING</b>: The instance is currently deleting.</p> </li>
/// <li> <p> <b>MODIFYING</b>: The instance is currently modifying.</p> </li>
/// <li> <p> <b>FAILED</b>: The instance has failed creation.</p> </li>
/// </ul>
pub fn status(mut self, input: crate::model::ApiCacheStatus) -> Self {
self.status = Some(input);
self
}
/// <p>The cache instance status.</p>
/// <ul>
/// <li> <p> <b>AVAILABLE</b>: The instance is available for use.</p> </li>
/// <li> <p> <b>CREATING</b>: The instance is currently creating.</p> </li>
/// <li> <p> <b>DELETING</b>: The instance is currently deleting.</p> </li>
/// <li> <p> <b>MODIFYING</b>: The instance is currently modifying.</p> </li>
/// <li> <p> <b>FAILED</b>: The instance has failed creation.</p> </li>
/// </ul>
pub fn set_status(
mut self,
input: std::option::Option<crate::model::ApiCacheStatus>,
) -> Self {
self.status = input;
self
}
/// Consumes the builder and constructs a [`ApiCache`](crate::model::ApiCache).
pub fn build(self) -> crate::model::ApiCache {
crate::model::ApiCache {
ttl: self.ttl.unwrap_or_default(),
api_caching_behavior: self.api_caching_behavior,
transit_encryption_enabled: self.transit_encryption_enabled.unwrap_or_default(),
at_rest_encryption_enabled: self.at_rest_encryption_enabled.unwrap_or_default(),
r#type: self.r#type,
status: self.status,
}
}
}
}
impl ApiCache {
/// Creates a new builder-style object to manufacture [`ApiCache`](crate::model::ApiCache).
pub fn builder() -> crate::model::api_cache::Builder {
crate::model::api_cache::Builder::default()
}
}
/// When writing a match expression against `ApiCacheStatus`, it is important to ensure
/// your code is forward-compatible. That is, if a match arm handles a case for a
/// feature that is supported by the service but has not been represented as an enum
/// variant in a current version of SDK, your code should continue to work when you
/// upgrade SDK to a future version in which the enum does include a variant for that
/// feature.
///
/// Here is an example of how you can make a match expression forward-compatible:
///
/// ```text
/// # let apicachestatus = unimplemented!();
/// match apicachestatus {
/// ApiCacheStatus::Available => { /* ... */ },
/// ApiCacheStatus::Creating => { /* ... */ },
/// ApiCacheStatus::Deleting => { /* ... */ },
/// ApiCacheStatus::Failed => { /* ... */ },
/// ApiCacheStatus::Modifying => { /* ... */ },
/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
/// _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `apicachestatus` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `ApiCacheStatus::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `ApiCacheStatus::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
/// and calling `as_str` on it yields `"NewFeature"`.
/// This match expression is forward-compatible when executed with a newer
/// version of SDK where the variant `ApiCacheStatus::NewFeature` is defined.
/// Specifically, when `apicachestatus` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `ApiCacheStatus::NewFeature` also yielding `"NewFeature"`.
///
/// Explicitly matching on the `Unknown` variant should
/// be avoided for two reasons:
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
/// - It might inadvertently shadow other intended match arms.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum ApiCacheStatus {
#[allow(missing_docs)] // documentation missing in model
Available,
#[allow(missing_docs)] // documentation missing in model
Creating,
#[allow(missing_docs)] // documentation missing in model
Deleting,
#[allow(missing_docs)] // documentation missing in model
Failed,
#[allow(missing_docs)] // documentation missing in model
Modifying,
/// `Unknown` contains new variants that have been added since this code was generated.
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for ApiCacheStatus {
fn from(s: &str) -> Self {
match s {
"AVAILABLE" => ApiCacheStatus::Available,
"CREATING" => ApiCacheStatus::Creating,
"DELETING" => ApiCacheStatus::Deleting,
"FAILED" => ApiCacheStatus::Failed,
"MODIFYING" => ApiCacheStatus::Modifying,
other => ApiCacheStatus::Unknown(crate::types::UnknownVariantValue(other.to_owned())),
}
}
}
impl std::str::FromStr for ApiCacheStatus {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(ApiCacheStatus::from(s))
}
}
impl ApiCacheStatus {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
ApiCacheStatus::Available => "AVAILABLE",
ApiCacheStatus::Creating => "CREATING",
ApiCacheStatus::Deleting => "DELETING",
ApiCacheStatus::Failed => "FAILED",
ApiCacheStatus::Modifying => "MODIFYING",
ApiCacheStatus::Unknown(value) => value.as_str(),
}
}
/// Returns all the `&str` values of the enum members.
pub const fn values() -> &'static [&'static str] {
&["AVAILABLE", "CREATING", "DELETING", "FAILED", "MODIFYING"]
}
}
impl AsRef<str> for ApiCacheStatus {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// When writing a match expression against `ApiCacheType`, it is important to ensure
/// your code is forward-compatible. That is, if a match arm handles a case for a
/// feature that is supported by the service but has not been represented as an enum
/// variant in a current version of SDK, your code should continue to work when you
/// upgrade SDK to a future version in which the enum does include a variant for that
/// feature.
///
/// Here is an example of how you can make a match expression forward-compatible:
///
/// ```text
/// # let apicachetype = unimplemented!();
/// match apicachetype {
/// ApiCacheType::Large => { /* ... */ },
/// ApiCacheType::Large12X => { /* ... */ },
/// ApiCacheType::Large2X => { /* ... */ },
/// ApiCacheType::Large4X => { /* ... */ },
/// ApiCacheType::Large8X => { /* ... */ },
/// ApiCacheType::Medium => { /* ... */ },
/// ApiCacheType::R42Xlarge => { /* ... */ },
/// ApiCacheType::R44Xlarge => { /* ... */ },
/// ApiCacheType::R48Xlarge => { /* ... */ },
/// ApiCacheType::R4Large => { /* ... */ },
/// ApiCacheType::R4Xlarge => { /* ... */ },
/// ApiCacheType::Small => { /* ... */ },
/// ApiCacheType::T2Medium => { /* ... */ },
/// ApiCacheType::T2Small => { /* ... */ },
/// ApiCacheType::Xlarge => { /* ... */ },
/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
/// _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `apicachetype` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `ApiCacheType::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `ApiCacheType::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
/// and calling `as_str` on it yields `"NewFeature"`.
/// This match expression is forward-compatible when executed with a newer
/// version of SDK where the variant `ApiCacheType::NewFeature` is defined.
/// Specifically, when `apicachetype` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `ApiCacheType::NewFeature` also yielding `"NewFeature"`.
///
/// Explicitly matching on the `Unknown` variant should
/// be avoided for two reasons:
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
/// - It might inadvertently shadow other intended match arms.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum ApiCacheType {
#[allow(missing_docs)] // documentation missing in model
Large,
#[allow(missing_docs)] // documentation missing in model
Large12X,
#[allow(missing_docs)] // documentation missing in model
Large2X,
#[allow(missing_docs)] // documentation missing in model
Large4X,
#[allow(missing_docs)] // documentation missing in model
Large8X,
#[allow(missing_docs)] // documentation missing in model
Medium,
#[allow(missing_docs)] // documentation missing in model
R42Xlarge,
#[allow(missing_docs)] // documentation missing in model
R44Xlarge,
#[allow(missing_docs)] // documentation missing in model
R48Xlarge,
#[allow(missing_docs)] // documentation missing in model
R4Large,
#[allow(missing_docs)] // documentation missing in model
R4Xlarge,
#[allow(missing_docs)] // documentation missing in model
Small,
#[allow(missing_docs)] // documentation missing in model
T2Medium,
#[allow(missing_docs)] // documentation missing in model
T2Small,
#[allow(missing_docs)] // documentation missing in model
Xlarge,
/// `Unknown` contains new variants that have been added since this code was generated.
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for ApiCacheType {
fn from(s: &str) -> Self {
match s {
"LARGE" => ApiCacheType::Large,
"LARGE_12X" => ApiCacheType::Large12X,
"LARGE_2X" => ApiCacheType::Large2X,
"LARGE_4X" => ApiCacheType::Large4X,
"LARGE_8X" => ApiCacheType::Large8X,
"MEDIUM" => ApiCacheType::Medium,
"R4_2XLARGE" => ApiCacheType::R42Xlarge,
"R4_4XLARGE" => ApiCacheType::R44Xlarge,
"R4_8XLARGE" => ApiCacheType::R48Xlarge,
"R4_LARGE" => ApiCacheType::R4Large,
"R4_XLARGE" => ApiCacheType::R4Xlarge,
"SMALL" => ApiCacheType::Small,
"T2_MEDIUM" => ApiCacheType::T2Medium,
"T2_SMALL" => ApiCacheType::T2Small,
"XLARGE" => ApiCacheType::Xlarge,
other => ApiCacheType::Unknown(crate::types::UnknownVariantValue(other.to_owned())),
}
}
}
impl std::str::FromStr for ApiCacheType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(ApiCacheType::from(s))
}
}
impl ApiCacheType {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
ApiCacheType::Large => "LARGE",
ApiCacheType::Large12X => "LARGE_12X",
ApiCacheType::Large2X => "LARGE_2X",
ApiCacheType::Large4X => "LARGE_4X",
ApiCacheType::Large8X => "LARGE_8X",
ApiCacheType::Medium => "MEDIUM",
ApiCacheType::R42Xlarge => "R4_2XLARGE",
ApiCacheType::R44Xlarge => "R4_4XLARGE",
ApiCacheType::R48Xlarge => "R4_8XLARGE",
ApiCacheType::R4Large => "R4_LARGE",
ApiCacheType::R4Xlarge => "R4_XLARGE",
ApiCacheType::Small => "SMALL",
ApiCacheType::T2Medium => "T2_MEDIUM",
ApiCacheType::T2Small => "T2_SMALL",
ApiCacheType::Xlarge => "XLARGE",
ApiCacheType::Unknown(value) => value.as_str(),
}
}
/// Returns all the `&str` values of the enum members.
pub const fn values() -> &'static [&'static str] {
&[
"LARGE",
"LARGE_12X",
"LARGE_2X",
"LARGE_4X",
"LARGE_8X",
"MEDIUM",
"R4_2XLARGE",
"R4_4XLARGE",
"R4_8XLARGE",
"R4_LARGE",
"R4_XLARGE",
"SMALL",
"T2_MEDIUM",
"T2_SMALL",
"XLARGE",
]
}
}
impl AsRef<str> for ApiCacheType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// When writing a match expression against `ApiCachingBehavior`, it is important to ensure
/// your code is forward-compatible. That is, if a match arm handles a case for a
/// feature that is supported by the service but has not been represented as an enum
/// variant in a current version of SDK, your code should continue to work when you
/// upgrade SDK to a future version in which the enum does include a variant for that
/// feature.
///
/// Here is an example of how you can make a match expression forward-compatible:
///
/// ```text
/// # let apicachingbehavior = unimplemented!();
/// match apicachingbehavior {
/// ApiCachingBehavior::FullRequestCaching => { /* ... */ },
/// ApiCachingBehavior::PerResolverCaching => { /* ... */ },
/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
/// _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `apicachingbehavior` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `ApiCachingBehavior::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `ApiCachingBehavior::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
/// and calling `as_str` on it yields `"NewFeature"`.
/// This match expression is forward-compatible when executed with a newer
/// version of SDK where the variant `ApiCachingBehavior::NewFeature` is defined.
/// Specifically, when `apicachingbehavior` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `ApiCachingBehavior::NewFeature` also yielding `"NewFeature"`.
///
/// Explicitly matching on the `Unknown` variant should
/// be avoided for two reasons:
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
/// - It might inadvertently shadow other intended match arms.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum ApiCachingBehavior {
#[allow(missing_docs)] // documentation missing in model
FullRequestCaching,
#[allow(missing_docs)] // documentation missing in model
PerResolverCaching,
/// `Unknown` contains new variants that have been added since this code was generated.
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for ApiCachingBehavior {
fn from(s: &str) -> Self {
match s {
"FULL_REQUEST_CACHING" => ApiCachingBehavior::FullRequestCaching,
"PER_RESOLVER_CACHING" => ApiCachingBehavior::PerResolverCaching,
other => {
ApiCachingBehavior::Unknown(crate::types::UnknownVariantValue(other.to_owned()))
}
}
}
}
impl std::str::FromStr for ApiCachingBehavior {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(ApiCachingBehavior::from(s))
}
}
impl ApiCachingBehavior {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
ApiCachingBehavior::FullRequestCaching => "FULL_REQUEST_CACHING",
ApiCachingBehavior::PerResolverCaching => "PER_RESOLVER_CACHING",
ApiCachingBehavior::Unknown(value) => value.as_str(),
}
}
/// Returns all the `&str` values of the enum members.
pub const fn values() -> &'static [&'static str] {
&["FULL_REQUEST_CACHING", "PER_RESOLVER_CACHING"]
}
}
impl AsRef<str> for ApiCachingBehavior {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// When writing a match expression against `SchemaStatus`, it is important to ensure
/// your code is forward-compatible. That is, if a match arm handles a case for a
/// feature that is supported by the service but has not been represented as an enum
/// variant in a current version of SDK, your code should continue to work when you
/// upgrade SDK to a future version in which the enum does include a variant for that
/// feature.
///
/// Here is an example of how you can make a match expression forward-compatible:
///
/// ```text
/// # let schemastatus = unimplemented!();
/// match schemastatus {
/// SchemaStatus::Active => { /* ... */ },
/// SchemaStatus::Deleting => { /* ... */ },
/// SchemaStatus::Failed => { /* ... */ },
/// SchemaStatus::NotApplicable => { /* ... */ },
/// SchemaStatus::Processing => { /* ... */ },
/// SchemaStatus::Success => { /* ... */ },
/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
/// _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `schemastatus` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `SchemaStatus::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `SchemaStatus::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
/// and calling `as_str` on it yields `"NewFeature"`.
/// This match expression is forward-compatible when executed with a newer
/// version of SDK where the variant `SchemaStatus::NewFeature` is defined.
/// Specifically, when `schemastatus` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `SchemaStatus::NewFeature` also yielding `"NewFeature"`.
///
/// Explicitly matching on the `Unknown` variant should
/// be avoided for two reasons:
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
/// - It might inadvertently shadow other intended match arms.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum SchemaStatus {
#[allow(missing_docs)] // documentation missing in model
Active,
#[allow(missing_docs)] // documentation missing in model
Deleting,
#[allow(missing_docs)] // documentation missing in model
Failed,
#[allow(missing_docs)] // documentation missing in model
NotApplicable,
#[allow(missing_docs)] // documentation missing in model
Processing,
#[allow(missing_docs)] // documentation missing in model
Success,
/// `Unknown` contains new variants that have been added since this code was generated.
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for SchemaStatus {
fn from(s: &str) -> Self {
match s {
"ACTIVE" => SchemaStatus::Active,
"DELETING" => SchemaStatus::Deleting,
"FAILED" => SchemaStatus::Failed,
"NOT_APPLICABLE" => SchemaStatus::NotApplicable,
"PROCESSING" => SchemaStatus::Processing,
"SUCCESS" => SchemaStatus::Success,
other => SchemaStatus::Unknown(crate::types::UnknownVariantValue(other.to_owned())),
}
}
}
impl std::str::FromStr for SchemaStatus {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(SchemaStatus::from(s))
}
}
impl SchemaStatus {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
SchemaStatus::Active => "ACTIVE",
SchemaStatus::Deleting => "DELETING",
SchemaStatus::Failed => "FAILED",
SchemaStatus::NotApplicable => "NOT_APPLICABLE",
SchemaStatus::Processing => "PROCESSING",
SchemaStatus::Success => "SUCCESS",
SchemaStatus::Unknown(value) => value.as_str(),
}
}
/// Returns all the `&str` values of the enum members.
pub const fn values() -> &'static [&'static str] {
&[
"ACTIVE",
"DELETING",
"FAILED",
"NOT_APPLICABLE",
"PROCESSING",
"SUCCESS",
]
}
}
impl AsRef<str> for SchemaStatus {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// When writing a match expression against `OutputType`, it is important to ensure
/// your code is forward-compatible. That is, if a match arm handles a case for a
/// feature that is supported by the service but has not been represented as an enum
/// variant in a current version of SDK, your code should continue to work when you
/// upgrade SDK to a future version in which the enum does include a variant for that
/// feature.
///
/// Here is an example of how you can make a match expression forward-compatible:
///
/// ```text
/// # let outputtype = unimplemented!();
/// match outputtype {
/// OutputType::Json => { /* ... */ },
/// OutputType::Sdl => { /* ... */ },
/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
/// _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `outputtype` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `OutputType::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `OutputType::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
/// and calling `as_str` on it yields `"NewFeature"`.
/// This match expression is forward-compatible when executed with a newer
/// version of SDK where the variant `OutputType::NewFeature` is defined.
/// Specifically, when `outputtype` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `OutputType::NewFeature` also yielding `"NewFeature"`.
///
/// Explicitly matching on the `Unknown` variant should
/// be avoided for two reasons:
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
/// - It might inadvertently shadow other intended match arms.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum OutputType {
#[allow(missing_docs)] // documentation missing in model
Json,
#[allow(missing_docs)] // documentation missing in model
Sdl,
/// `Unknown` contains new variants that have been added since this code was generated.
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for OutputType {
fn from(s: &str) -> Self {
match s {
"JSON" => OutputType::Json,
"SDL" => OutputType::Sdl,
other => OutputType::Unknown(crate::types::UnknownVariantValue(other.to_owned())),
}
}
}
impl std::str::FromStr for OutputType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(OutputType::from(s))
}
}
impl OutputType {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
OutputType::Json => "JSON",
OutputType::Sdl => "SDL",
OutputType::Unknown(value) => value.as_str(),
}
}
/// Returns all the `&str` values of the enum members.
pub const fn values() -> &'static [&'static str] {
&["JSON", "SDL"]
}
}
impl AsRef<str> for OutputType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>Describes an <code>ApiAssociation</code> object.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ApiAssociation {
/// <p>The domain name.</p>
#[doc(hidden)]
pub domain_name: std::option::Option<std::string::String>,
/// <p>The API ID.</p>
#[doc(hidden)]
pub api_id: std::option::Option<std::string::String>,
/// <p>Identifies the status of an association.</p>
/// <ul>
/// <li> <p> <b>PROCESSING</b>: The API association is being created. You cannot modify association requests during processing.</p> </li>
/// <li> <p> <b>SUCCESS</b>: The API association was successful. You can modify associations after success.</p> </li>
/// <li> <p> <b>FAILED</b>: The API association has failed. You can modify associations after failure.</p> </li>
/// </ul>
#[doc(hidden)]
pub association_status: std::option::Option<crate::model::AssociationStatus>,
/// <p>Details about the last deployment status.</p>
#[doc(hidden)]
pub deployment_detail: std::option::Option<std::string::String>,
}
impl ApiAssociation {
/// <p>The domain name.</p>
pub fn domain_name(&self) -> std::option::Option<&str> {
self.domain_name.as_deref()
}
/// <p>The API ID.</p>
pub fn api_id(&self) -> std::option::Option<&str> {
self.api_id.as_deref()
}
/// <p>Identifies the status of an association.</p>
/// <ul>
/// <li> <p> <b>PROCESSING</b>: The API association is being created. You cannot modify association requests during processing.</p> </li>
/// <li> <p> <b>SUCCESS</b>: The API association was successful. You can modify associations after success.</p> </li>
/// <li> <p> <b>FAILED</b>: The API association has failed. You can modify associations after failure.</p> </li>
/// </ul>
pub fn association_status(&self) -> std::option::Option<&crate::model::AssociationStatus> {
self.association_status.as_ref()
}
/// <p>Details about the last deployment status.</p>
pub fn deployment_detail(&self) -> std::option::Option<&str> {
self.deployment_detail.as_deref()
}
}
/// See [`ApiAssociation`](crate::model::ApiAssociation).
pub mod api_association {
/// A builder for [`ApiAssociation`](crate::model::ApiAssociation).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) domain_name: std::option::Option<std::string::String>,
pub(crate) api_id: std::option::Option<std::string::String>,
pub(crate) association_status: std::option::Option<crate::model::AssociationStatus>,
pub(crate) deployment_detail: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The domain name.</p>
pub fn domain_name(mut self, input: impl Into<std::string::String>) -> Self {
self.domain_name = Some(input.into());
self
}
/// <p>The domain name.</p>
pub fn set_domain_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.domain_name = input;
self
}
/// <p>The API ID.</p>
pub fn api_id(mut self, input: impl Into<std::string::String>) -> Self {
self.api_id = Some(input.into());
self
}
/// <p>The API ID.</p>
pub fn set_api_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.api_id = input;
self
}
/// <p>Identifies the status of an association.</p>
/// <ul>
/// <li> <p> <b>PROCESSING</b>: The API association is being created. You cannot modify association requests during processing.</p> </li>
/// <li> <p> <b>SUCCESS</b>: The API association was successful. You can modify associations after success.</p> </li>
/// <li> <p> <b>FAILED</b>: The API association has failed. You can modify associations after failure.</p> </li>
/// </ul>
pub fn association_status(mut self, input: crate::model::AssociationStatus) -> Self {
self.association_status = Some(input);
self
}
/// <p>Identifies the status of an association.</p>
/// <ul>
/// <li> <p> <b>PROCESSING</b>: The API association is being created. You cannot modify association requests during processing.</p> </li>
/// <li> <p> <b>SUCCESS</b>: The API association was successful. You can modify associations after success.</p> </li>
/// <li> <p> <b>FAILED</b>: The API association has failed. You can modify associations after failure.</p> </li>
/// </ul>
pub fn set_association_status(
mut self,
input: std::option::Option<crate::model::AssociationStatus>,
) -> Self {
self.association_status = input;
self
}
/// <p>Details about the last deployment status.</p>
pub fn deployment_detail(mut self, input: impl Into<std::string::String>) -> Self {
self.deployment_detail = Some(input.into());
self
}
/// <p>Details about the last deployment status.</p>
pub fn set_deployment_detail(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.deployment_detail = input;
self
}
/// Consumes the builder and constructs a [`ApiAssociation`](crate::model::ApiAssociation).
pub fn build(self) -> crate::model::ApiAssociation {
crate::model::ApiAssociation {
domain_name: self.domain_name,
api_id: self.api_id,
association_status: self.association_status,
deployment_detail: self.deployment_detail,
}
}
}
}
impl ApiAssociation {
/// Creates a new builder-style object to manufacture [`ApiAssociation`](crate::model::ApiAssociation).
pub fn builder() -> crate::model::api_association::Builder {
crate::model::api_association::Builder::default()
}
}
/// When writing a match expression against `AssociationStatus`, it is important to ensure
/// your code is forward-compatible. That is, if a match arm handles a case for a
/// feature that is supported by the service but has not been represented as an enum
/// variant in a current version of SDK, your code should continue to work when you
/// upgrade SDK to a future version in which the enum does include a variant for that
/// feature.
///
/// Here is an example of how you can make a match expression forward-compatible:
///
/// ```text
/// # let associationstatus = unimplemented!();
/// match associationstatus {
/// AssociationStatus::Failed => { /* ... */ },
/// AssociationStatus::Processing => { /* ... */ },
/// AssociationStatus::Success => { /* ... */ },
/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
/// _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `associationstatus` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `AssociationStatus::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `AssociationStatus::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
/// and calling `as_str` on it yields `"NewFeature"`.
/// This match expression is forward-compatible when executed with a newer
/// version of SDK where the variant `AssociationStatus::NewFeature` is defined.
/// Specifically, when `associationstatus` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `AssociationStatus::NewFeature` also yielding `"NewFeature"`.
///
/// Explicitly matching on the `Unknown` variant should
/// be avoided for two reasons:
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
/// - It might inadvertently shadow other intended match arms.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum AssociationStatus {
#[allow(missing_docs)] // documentation missing in model
Failed,
#[allow(missing_docs)] // documentation missing in model
Processing,
#[allow(missing_docs)] // documentation missing in model
Success,
/// `Unknown` contains new variants that have been added since this code was generated.
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for AssociationStatus {
fn from(s: &str) -> Self {
match s {
"FAILED" => AssociationStatus::Failed,
"PROCESSING" => AssociationStatus::Processing,
"SUCCESS" => AssociationStatus::Success,
other => {
AssociationStatus::Unknown(crate::types::UnknownVariantValue(other.to_owned()))
}
}
}
}
impl std::str::FromStr for AssociationStatus {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(AssociationStatus::from(s))
}
}
impl AssociationStatus {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
AssociationStatus::Failed => "FAILED",
AssociationStatus::Processing => "PROCESSING",
AssociationStatus::Success => "SUCCESS",
AssociationStatus::Unknown(value) => value.as_str(),
}
}
/// Returns all the `&str` values of the enum members.
pub const fn values() -> &'static [&'static str] {
&["FAILED", "PROCESSING", "SUCCESS"]
}
}
impl AsRef<str> for AssociationStatus {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>Contains the list of errors generated. When using JavaScript, this will apply to the request or response function evaluation.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ErrorDetail {
/// <p>The error payload.</p>
#[doc(hidden)]
pub message: std::option::Option<std::string::String>,
}
impl ErrorDetail {
/// <p>The error payload.</p>
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
/// See [`ErrorDetail`](crate::model::ErrorDetail).
pub mod error_detail {
/// A builder for [`ErrorDetail`](crate::model::ErrorDetail).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The error payload.</p>
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
/// <p>The error payload.</p>
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// Consumes the builder and constructs a [`ErrorDetail`](crate::model::ErrorDetail).
pub fn build(self) -> crate::model::ErrorDetail {
crate::model::ErrorDetail {
message: self.message,
}
}
}
}
impl ErrorDetail {
/// Creates a new builder-style object to manufacture [`ErrorDetail`](crate::model::ErrorDetail).
pub fn builder() -> crate::model::error_detail::Builder {
crate::model::error_detail::Builder::default()
}
}
/// <p>Contains the list of errors from a code evaluation response.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct EvaluateCodeErrorDetail {
/// <p>The error payload.</p>
#[doc(hidden)]
pub message: std::option::Option<std::string::String>,
/// <p>Contains the list of <code>CodeError</code> objects.</p>
#[doc(hidden)]
pub code_errors: std::option::Option<std::vec::Vec<crate::model::CodeError>>,
}
impl EvaluateCodeErrorDetail {
/// <p>The error payload.</p>
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
/// <p>Contains the list of <code>CodeError</code> objects.</p>
pub fn code_errors(&self) -> std::option::Option<&[crate::model::CodeError]> {
self.code_errors.as_deref()
}
}
/// See [`EvaluateCodeErrorDetail`](crate::model::EvaluateCodeErrorDetail).
pub mod evaluate_code_error_detail {
/// A builder for [`EvaluateCodeErrorDetail`](crate::model::EvaluateCodeErrorDetail).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
pub(crate) code_errors: std::option::Option<std::vec::Vec<crate::model::CodeError>>,
}
impl Builder {
/// <p>The error payload.</p>
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
/// <p>The error payload.</p>
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// Appends an item to `code_errors`.
///
/// To override the contents of this collection use [`set_code_errors`](Self::set_code_errors).
///
/// <p>Contains the list of <code>CodeError</code> objects.</p>
pub fn code_errors(mut self, input: crate::model::CodeError) -> Self {
let mut v = self.code_errors.unwrap_or_default();
v.push(input);
self.code_errors = Some(v);
self
}
/// <p>Contains the list of <code>CodeError</code> objects.</p>
pub fn set_code_errors(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::CodeError>>,
) -> Self {
self.code_errors = input;
self
}
/// Consumes the builder and constructs a [`EvaluateCodeErrorDetail`](crate::model::EvaluateCodeErrorDetail).
pub fn build(self) -> crate::model::EvaluateCodeErrorDetail {
crate::model::EvaluateCodeErrorDetail {
message: self.message,
code_errors: self.code_errors,
}
}
}
}
impl EvaluateCodeErrorDetail {
/// Creates a new builder-style object to manufacture [`EvaluateCodeErrorDetail`](crate::model::EvaluateCodeErrorDetail).
pub fn builder() -> crate::model::evaluate_code_error_detail::Builder {
crate::model::evaluate_code_error_detail::Builder::default()
}
}