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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>An object that defines the log patterns that belongs to a <code>LogPatternSet</code>.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct LogPattern {
/// <p>The name of the log pattern. A log pattern name can contain as many as 30 characters, and it cannot be empty. The characters can be Unicode letters, digits, or one of the following symbols: period, dash, underscore.</p>
#[doc(hidden)]
pub pattern_set_name: std::option::Option<std::string::String>,
/// <p>The name of the log pattern. A log pattern name can contain as many as 50 characters, and it cannot be empty. The characters can be Unicode letters, digits, or one of the following symbols: period, dash, underscore.</p>
#[doc(hidden)]
pub pattern_name: std::option::Option<std::string::String>,
/// <p>A regular expression that defines the log pattern. A log pattern can contain as many as 50 characters, and it cannot be empty. The pattern must be DFA compatible. Patterns that utilize forward lookahead or backreference constructions are not supported.</p>
#[doc(hidden)]
pub pattern: std::option::Option<std::string::String>,
/// <p>Rank of the log pattern. Must be a value between <code>1</code> and <code>1,000,000</code>. The patterns are sorted by rank, so we recommend that you set your highest priority patterns with the lowest rank. A pattern of rank <code>1</code> will be the first to get matched to a log line. A pattern of rank <code>1,000,000</code> will be last to get matched. When you configure custom log patterns from the console, a <code>Low</code> severity pattern translates to a <code>750,000</code> rank. A <code>Medium</code> severity pattern translates to a <code>500,000</code> rank. And a <code>High</code> severity pattern translates to a <code>250,000</code> rank. Rank values less than <code>1</code> or greater than <code>1,000,000</code> are reserved for AWS-provided patterns. </p>
#[doc(hidden)]
pub rank: i32,
}
impl LogPattern {
/// <p>The name of the log pattern. A log pattern name can contain as many as 30 characters, and it cannot be empty. The characters can be Unicode letters, digits, or one of the following symbols: period, dash, underscore.</p>
pub fn pattern_set_name(&self) -> std::option::Option<&str> {
self.pattern_set_name.as_deref()
}
/// <p>The name of the log pattern. A log pattern name can contain as many as 50 characters, and it cannot be empty. The characters can be Unicode letters, digits, or one of the following symbols: period, dash, underscore.</p>
pub fn pattern_name(&self) -> std::option::Option<&str> {
self.pattern_name.as_deref()
}
/// <p>A regular expression that defines the log pattern. A log pattern can contain as many as 50 characters, and it cannot be empty. The pattern must be DFA compatible. Patterns that utilize forward lookahead or backreference constructions are not supported.</p>
pub fn pattern(&self) -> std::option::Option<&str> {
self.pattern.as_deref()
}
/// <p>Rank of the log pattern. Must be a value between <code>1</code> and <code>1,000,000</code>. The patterns are sorted by rank, so we recommend that you set your highest priority patterns with the lowest rank. A pattern of rank <code>1</code> will be the first to get matched to a log line. A pattern of rank <code>1,000,000</code> will be last to get matched. When you configure custom log patterns from the console, a <code>Low</code> severity pattern translates to a <code>750,000</code> rank. A <code>Medium</code> severity pattern translates to a <code>500,000</code> rank. And a <code>High</code> severity pattern translates to a <code>250,000</code> rank. Rank values less than <code>1</code> or greater than <code>1,000,000</code> are reserved for AWS-provided patterns. </p>
pub fn rank(&self) -> i32 {
self.rank
}
}
/// See [`LogPattern`](crate::model::LogPattern).
pub mod log_pattern {
/// A builder for [`LogPattern`](crate::model::LogPattern).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) pattern_set_name: std::option::Option<std::string::String>,
pub(crate) pattern_name: std::option::Option<std::string::String>,
pub(crate) pattern: std::option::Option<std::string::String>,
pub(crate) rank: std::option::Option<i32>,
}
impl Builder {
/// <p>The name of the log pattern. A log pattern name can contain as many as 30 characters, and it cannot be empty. The characters can be Unicode letters, digits, or one of the following symbols: period, dash, underscore.</p>
pub fn pattern_set_name(mut self, input: impl Into<std::string::String>) -> Self {
self.pattern_set_name = Some(input.into());
self
}
/// <p>The name of the log pattern. A log pattern name can contain as many as 30 characters, and it cannot be empty. The characters can be Unicode letters, digits, or one of the following symbols: period, dash, underscore.</p>
pub fn set_pattern_set_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.pattern_set_name = input;
self
}
/// <p>The name of the log pattern. A log pattern name can contain as many as 50 characters, and it cannot be empty. The characters can be Unicode letters, digits, or one of the following symbols: period, dash, underscore.</p>
pub fn pattern_name(mut self, input: impl Into<std::string::String>) -> Self {
self.pattern_name = Some(input.into());
self
}
/// <p>The name of the log pattern. A log pattern name can contain as many as 50 characters, and it cannot be empty. The characters can be Unicode letters, digits, or one of the following symbols: period, dash, underscore.</p>
pub fn set_pattern_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.pattern_name = input;
self
}
/// <p>A regular expression that defines the log pattern. A log pattern can contain as many as 50 characters, and it cannot be empty. The pattern must be DFA compatible. Patterns that utilize forward lookahead or backreference constructions are not supported.</p>
pub fn pattern(mut self, input: impl Into<std::string::String>) -> Self {
self.pattern = Some(input.into());
self
}
/// <p>A regular expression that defines the log pattern. A log pattern can contain as many as 50 characters, and it cannot be empty. The pattern must be DFA compatible. Patterns that utilize forward lookahead or backreference constructions are not supported.</p>
pub fn set_pattern(mut self, input: std::option::Option<std::string::String>) -> Self {
self.pattern = input;
self
}
/// <p>Rank of the log pattern. Must be a value between <code>1</code> and <code>1,000,000</code>. The patterns are sorted by rank, so we recommend that you set your highest priority patterns with the lowest rank. A pattern of rank <code>1</code> will be the first to get matched to a log line. A pattern of rank <code>1,000,000</code> will be last to get matched. When you configure custom log patterns from the console, a <code>Low</code> severity pattern translates to a <code>750,000</code> rank. A <code>Medium</code> severity pattern translates to a <code>500,000</code> rank. And a <code>High</code> severity pattern translates to a <code>250,000</code> rank. Rank values less than <code>1</code> or greater than <code>1,000,000</code> are reserved for AWS-provided patterns. </p>
pub fn rank(mut self, input: i32) -> Self {
self.rank = Some(input);
self
}
/// <p>Rank of the log pattern. Must be a value between <code>1</code> and <code>1,000,000</code>. The patterns are sorted by rank, so we recommend that you set your highest priority patterns with the lowest rank. A pattern of rank <code>1</code> will be the first to get matched to a log line. A pattern of rank <code>1,000,000</code> will be last to get matched. When you configure custom log patterns from the console, a <code>Low</code> severity pattern translates to a <code>750,000</code> rank. A <code>Medium</code> severity pattern translates to a <code>500,000</code> rank. And a <code>High</code> severity pattern translates to a <code>250,000</code> rank. Rank values less than <code>1</code> or greater than <code>1,000,000</code> are reserved for AWS-provided patterns. </p>
pub fn set_rank(mut self, input: std::option::Option<i32>) -> Self {
self.rank = input;
self
}
/// Consumes the builder and constructs a [`LogPattern`](crate::model::LogPattern).
pub fn build(self) -> crate::model::LogPattern {
crate::model::LogPattern {
pattern_set_name: self.pattern_set_name,
pattern_name: self.pattern_name,
pattern: self.pattern,
rank: self.rank.unwrap_or_default(),
}
}
}
}
impl LogPattern {
/// Creates a new builder-style object to manufacture [`LogPattern`](crate::model::LogPattern).
pub fn builder() -> crate::model::log_pattern::Builder {
crate::model::log_pattern::Builder::default()
}
}
/// When writing a match expression against `Tier`, 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 tier = unimplemented!();
/// match tier {
/// Tier::ActiveDirectory => { /* ... */ },
/// Tier::Custom => { /* ... */ },
/// Tier::Default => { /* ... */ },
/// Tier::DotNetCore => { /* ... */ },
/// Tier::DotNetWeb => { /* ... */ },
/// Tier::DotNetWebTier => { /* ... */ },
/// Tier::DotNetWorker => { /* ... */ },
/// Tier::JavaJmx => { /* ... */ },
/// Tier::Mysql => { /* ... */ },
/// Tier::Oracle => { /* ... */ },
/// Tier::Postgresql => { /* ... */ },
/// Tier::SapHanaHighAvailability => { /* ... */ },
/// Tier::SapHanaMultiNode => { /* ... */ },
/// Tier::SapHanaSingleNode => { /* ... */ },
/// Tier::Sharepoint => { /* ... */ },
/// Tier::SqlServer => { /* ... */ },
/// Tier::SqlServerAlwaysonAvailabilityGroup => { /* ... */ },
/// Tier::SqlServerFailoverClusterInstance => { /* ... */ },
/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
/// _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `tier` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `Tier::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `Tier::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 `Tier::NewFeature` is defined.
/// Specifically, when `tier` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `Tier::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 Tier {
#[allow(missing_docs)] // documentation missing in model
ActiveDirectory,
#[allow(missing_docs)] // documentation missing in model
Custom,
#[allow(missing_docs)] // documentation missing in model
Default,
#[allow(missing_docs)] // documentation missing in model
DotNetCore,
#[allow(missing_docs)] // documentation missing in model
DotNetWeb,
#[allow(missing_docs)] // documentation missing in model
DotNetWebTier,
#[allow(missing_docs)] // documentation missing in model
DotNetWorker,
#[allow(missing_docs)] // documentation missing in model
JavaJmx,
#[allow(missing_docs)] // documentation missing in model
Mysql,
#[allow(missing_docs)] // documentation missing in model
Oracle,
#[allow(missing_docs)] // documentation missing in model
Postgresql,
#[allow(missing_docs)] // documentation missing in model
SapHanaHighAvailability,
#[allow(missing_docs)] // documentation missing in model
SapHanaMultiNode,
#[allow(missing_docs)] // documentation missing in model
SapHanaSingleNode,
#[allow(missing_docs)] // documentation missing in model
Sharepoint,
#[allow(missing_docs)] // documentation missing in model
SqlServer,
#[allow(missing_docs)] // documentation missing in model
SqlServerAlwaysonAvailabilityGroup,
#[allow(missing_docs)] // documentation missing in model
SqlServerFailoverClusterInstance,
/// `Unknown` contains new variants that have been added since this code was generated.
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for Tier {
fn from(s: &str) -> Self {
match s {
"ACTIVE_DIRECTORY" => Tier::ActiveDirectory,
"CUSTOM" => Tier::Custom,
"DEFAULT" => Tier::Default,
"DOT_NET_CORE" => Tier::DotNetCore,
"DOT_NET_WEB" => Tier::DotNetWeb,
"DOT_NET_WEB_TIER" => Tier::DotNetWebTier,
"DOT_NET_WORKER" => Tier::DotNetWorker,
"JAVA_JMX" => Tier::JavaJmx,
"MYSQL" => Tier::Mysql,
"ORACLE" => Tier::Oracle,
"POSTGRESQL" => Tier::Postgresql,
"SAP_HANA_HIGH_AVAILABILITY" => Tier::SapHanaHighAvailability,
"SAP_HANA_MULTI_NODE" => Tier::SapHanaMultiNode,
"SAP_HANA_SINGLE_NODE" => Tier::SapHanaSingleNode,
"SHAREPOINT" => Tier::Sharepoint,
"SQL_SERVER" => Tier::SqlServer,
"SQL_SERVER_ALWAYSON_AVAILABILITY_GROUP" => Tier::SqlServerAlwaysonAvailabilityGroup,
"SQL_SERVER_FAILOVER_CLUSTER_INSTANCE" => Tier::SqlServerFailoverClusterInstance,
other => Tier::Unknown(crate::types::UnknownVariantValue(other.to_owned())),
}
}
}
impl std::str::FromStr for Tier {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(Tier::from(s))
}
}
impl Tier {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
Tier::ActiveDirectory => "ACTIVE_DIRECTORY",
Tier::Custom => "CUSTOM",
Tier::Default => "DEFAULT",
Tier::DotNetCore => "DOT_NET_CORE",
Tier::DotNetWeb => "DOT_NET_WEB",
Tier::DotNetWebTier => "DOT_NET_WEB_TIER",
Tier::DotNetWorker => "DOT_NET_WORKER",
Tier::JavaJmx => "JAVA_JMX",
Tier::Mysql => "MYSQL",
Tier::Oracle => "ORACLE",
Tier::Postgresql => "POSTGRESQL",
Tier::SapHanaHighAvailability => "SAP_HANA_HIGH_AVAILABILITY",
Tier::SapHanaMultiNode => "SAP_HANA_MULTI_NODE",
Tier::SapHanaSingleNode => "SAP_HANA_SINGLE_NODE",
Tier::Sharepoint => "SHAREPOINT",
Tier::SqlServer => "SQL_SERVER",
Tier::SqlServerAlwaysonAvailabilityGroup => "SQL_SERVER_ALWAYSON_AVAILABILITY_GROUP",
Tier::SqlServerFailoverClusterInstance => "SQL_SERVER_FAILOVER_CLUSTER_INSTANCE",
Tier::Unknown(value) => value.as_str(),
}
}
/// Returns all the `&str` values of the enum members.
pub const fn values() -> &'static [&'static str] {
&[
"ACTIVE_DIRECTORY",
"CUSTOM",
"DEFAULT",
"DOT_NET_CORE",
"DOT_NET_WEB",
"DOT_NET_WEB_TIER",
"DOT_NET_WORKER",
"JAVA_JMX",
"MYSQL",
"ORACLE",
"POSTGRESQL",
"SAP_HANA_HIGH_AVAILABILITY",
"SAP_HANA_MULTI_NODE",
"SAP_HANA_SINGLE_NODE",
"SHAREPOINT",
"SQL_SERVER",
"SQL_SERVER_ALWAYSON_AVAILABILITY_GROUP",
"SQL_SERVER_FAILOVER_CLUSTER_INSTANCE",
]
}
}
impl AsRef<str> for Tier {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>Describes the status of the application.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ApplicationInfo {
/// <p>The name of the resource group used for the application.</p>
#[doc(hidden)]
pub resource_group_name: std::option::Option<std::string::String>,
/// <p>The lifecycle of the application. </p>
#[doc(hidden)]
pub life_cycle: std::option::Option<std::string::String>,
/// <p> The SNS topic provided to Application Insights that is associated to the created opsItems to receive SNS notifications for opsItem updates. </p>
#[doc(hidden)]
pub ops_item_sns_topic_arn: std::option::Option<std::string::String>,
/// <p> Indicates whether Application Insights will create opsItems for any problem detected by Application Insights for an application. </p>
#[doc(hidden)]
pub ops_center_enabled: std::option::Option<bool>,
/// <p> Indicates whether Application Insights can listen to CloudWatch events for the application resources, such as <code>instance terminated</code>, <code>failed deployment</code>, and others. </p>
#[doc(hidden)]
pub cwe_monitor_enabled: std::option::Option<bool>,
/// <p>The issues on the user side that block Application Insights from successfully monitoring an application. Example remarks include:</p>
/// <ul>
/// <li> <p>“Configuring application, detected 1 Errors, 3 Warnings”</p> </li>
/// <li> <p>“Configuring application, detected 1 Unconfigured Components”</p> </li>
/// </ul>
#[doc(hidden)]
pub remarks: std::option::Option<std::string::String>,
/// <p> Indicates whether auto-configuration is turned on for this application. </p>
#[doc(hidden)]
pub auto_config_enabled: std::option::Option<bool>,
/// <p> The method used by Application Insights to onboard your resources. </p>
#[doc(hidden)]
pub discovery_type: std::option::Option<crate::model::DiscoveryType>,
}
impl ApplicationInfo {
/// <p>The name of the resource group used for the application.</p>
pub fn resource_group_name(&self) -> std::option::Option<&str> {
self.resource_group_name.as_deref()
}
/// <p>The lifecycle of the application. </p>
pub fn life_cycle(&self) -> std::option::Option<&str> {
self.life_cycle.as_deref()
}
/// <p> The SNS topic provided to Application Insights that is associated to the created opsItems to receive SNS notifications for opsItem updates. </p>
pub fn ops_item_sns_topic_arn(&self) -> std::option::Option<&str> {
self.ops_item_sns_topic_arn.as_deref()
}
/// <p> Indicates whether Application Insights will create opsItems for any problem detected by Application Insights for an application. </p>
pub fn ops_center_enabled(&self) -> std::option::Option<bool> {
self.ops_center_enabled
}
/// <p> Indicates whether Application Insights can listen to CloudWatch events for the application resources, such as <code>instance terminated</code>, <code>failed deployment</code>, and others. </p>
pub fn cwe_monitor_enabled(&self) -> std::option::Option<bool> {
self.cwe_monitor_enabled
}
/// <p>The issues on the user side that block Application Insights from successfully monitoring an application. Example remarks include:</p>
/// <ul>
/// <li> <p>“Configuring application, detected 1 Errors, 3 Warnings”</p> </li>
/// <li> <p>“Configuring application, detected 1 Unconfigured Components”</p> </li>
/// </ul>
pub fn remarks(&self) -> std::option::Option<&str> {
self.remarks.as_deref()
}
/// <p> Indicates whether auto-configuration is turned on for this application. </p>
pub fn auto_config_enabled(&self) -> std::option::Option<bool> {
self.auto_config_enabled
}
/// <p> The method used by Application Insights to onboard your resources. </p>
pub fn discovery_type(&self) -> std::option::Option<&crate::model::DiscoveryType> {
self.discovery_type.as_ref()
}
}
/// See [`ApplicationInfo`](crate::model::ApplicationInfo).
pub mod application_info {
/// A builder for [`ApplicationInfo`](crate::model::ApplicationInfo).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) resource_group_name: std::option::Option<std::string::String>,
pub(crate) life_cycle: std::option::Option<std::string::String>,
pub(crate) ops_item_sns_topic_arn: std::option::Option<std::string::String>,
pub(crate) ops_center_enabled: std::option::Option<bool>,
pub(crate) cwe_monitor_enabled: std::option::Option<bool>,
pub(crate) remarks: std::option::Option<std::string::String>,
pub(crate) auto_config_enabled: std::option::Option<bool>,
pub(crate) discovery_type: std::option::Option<crate::model::DiscoveryType>,
}
impl Builder {
/// <p>The name of the resource group used for the application.</p>
pub fn resource_group_name(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_group_name = Some(input.into());
self
}
/// <p>The name of the resource group used for the application.</p>
pub fn set_resource_group_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.resource_group_name = input;
self
}
/// <p>The lifecycle of the application. </p>
pub fn life_cycle(mut self, input: impl Into<std::string::String>) -> Self {
self.life_cycle = Some(input.into());
self
}
/// <p>The lifecycle of the application. </p>
pub fn set_life_cycle(mut self, input: std::option::Option<std::string::String>) -> Self {
self.life_cycle = input;
self
}
/// <p> The SNS topic provided to Application Insights that is associated to the created opsItems to receive SNS notifications for opsItem updates. </p>
pub fn ops_item_sns_topic_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.ops_item_sns_topic_arn = Some(input.into());
self
}
/// <p> The SNS topic provided to Application Insights that is associated to the created opsItems to receive SNS notifications for opsItem updates. </p>
pub fn set_ops_item_sns_topic_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.ops_item_sns_topic_arn = input;
self
}
/// <p> Indicates whether Application Insights will create opsItems for any problem detected by Application Insights for an application. </p>
pub fn ops_center_enabled(mut self, input: bool) -> Self {
self.ops_center_enabled = Some(input);
self
}
/// <p> Indicates whether Application Insights will create opsItems for any problem detected by Application Insights for an application. </p>
pub fn set_ops_center_enabled(mut self, input: std::option::Option<bool>) -> Self {
self.ops_center_enabled = input;
self
}
/// <p> Indicates whether Application Insights can listen to CloudWatch events for the application resources, such as <code>instance terminated</code>, <code>failed deployment</code>, and others. </p>
pub fn cwe_monitor_enabled(mut self, input: bool) -> Self {
self.cwe_monitor_enabled = Some(input);
self
}
/// <p> Indicates whether Application Insights can listen to CloudWatch events for the application resources, such as <code>instance terminated</code>, <code>failed deployment</code>, and others. </p>
pub fn set_cwe_monitor_enabled(mut self, input: std::option::Option<bool>) -> Self {
self.cwe_monitor_enabled = input;
self
}
/// <p>The issues on the user side that block Application Insights from successfully monitoring an application. Example remarks include:</p>
/// <ul>
/// <li> <p>“Configuring application, detected 1 Errors, 3 Warnings”</p> </li>
/// <li> <p>“Configuring application, detected 1 Unconfigured Components”</p> </li>
/// </ul>
pub fn remarks(mut self, input: impl Into<std::string::String>) -> Self {
self.remarks = Some(input.into());
self
}
/// <p>The issues on the user side that block Application Insights from successfully monitoring an application. Example remarks include:</p>
/// <ul>
/// <li> <p>“Configuring application, detected 1 Errors, 3 Warnings”</p> </li>
/// <li> <p>“Configuring application, detected 1 Unconfigured Components”</p> </li>
/// </ul>
pub fn set_remarks(mut self, input: std::option::Option<std::string::String>) -> Self {
self.remarks = input;
self
}
/// <p> Indicates whether auto-configuration is turned on for this application. </p>
pub fn auto_config_enabled(mut self, input: bool) -> Self {
self.auto_config_enabled = Some(input);
self
}
/// <p> Indicates whether auto-configuration is turned on for this application. </p>
pub fn set_auto_config_enabled(mut self, input: std::option::Option<bool>) -> Self {
self.auto_config_enabled = input;
self
}
/// <p> The method used by Application Insights to onboard your resources. </p>
pub fn discovery_type(mut self, input: crate::model::DiscoveryType) -> Self {
self.discovery_type = Some(input);
self
}
/// <p> The method used by Application Insights to onboard your resources. </p>
pub fn set_discovery_type(
mut self,
input: std::option::Option<crate::model::DiscoveryType>,
) -> Self {
self.discovery_type = input;
self
}
/// Consumes the builder and constructs a [`ApplicationInfo`](crate::model::ApplicationInfo).
pub fn build(self) -> crate::model::ApplicationInfo {
crate::model::ApplicationInfo {
resource_group_name: self.resource_group_name,
life_cycle: self.life_cycle,
ops_item_sns_topic_arn: self.ops_item_sns_topic_arn,
ops_center_enabled: self.ops_center_enabled,
cwe_monitor_enabled: self.cwe_monitor_enabled,
remarks: self.remarks,
auto_config_enabled: self.auto_config_enabled,
discovery_type: self.discovery_type,
}
}
}
}
impl ApplicationInfo {
/// Creates a new builder-style object to manufacture [`ApplicationInfo`](crate::model::ApplicationInfo).
pub fn builder() -> crate::model::application_info::Builder {
crate::model::application_info::Builder::default()
}
}
/// When writing a match expression against `DiscoveryType`, 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 discoverytype = unimplemented!();
/// match discoverytype {
/// DiscoveryType::AccountBased => { /* ... */ },
/// DiscoveryType::ResourceGroupBased => { /* ... */ },
/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
/// _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `discoverytype` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `DiscoveryType::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `DiscoveryType::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 `DiscoveryType::NewFeature` is defined.
/// Specifically, when `discoverytype` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `DiscoveryType::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 DiscoveryType {
#[allow(missing_docs)] // documentation missing in model
AccountBased,
#[allow(missing_docs)] // documentation missing in model
ResourceGroupBased,
/// `Unknown` contains new variants that have been added since this code was generated.
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for DiscoveryType {
fn from(s: &str) -> Self {
match s {
"ACCOUNT_BASED" => DiscoveryType::AccountBased,
"RESOURCE_GROUP_BASED" => DiscoveryType::ResourceGroupBased,
other => DiscoveryType::Unknown(crate::types::UnknownVariantValue(other.to_owned())),
}
}
}
impl std::str::FromStr for DiscoveryType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(DiscoveryType::from(s))
}
}
impl DiscoveryType {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
DiscoveryType::AccountBased => "ACCOUNT_BASED",
DiscoveryType::ResourceGroupBased => "RESOURCE_GROUP_BASED",
DiscoveryType::Unknown(value) => value.as_str(),
}
}
/// Returns all the `&str` values of the enum members.
pub const fn values() -> &'static [&'static str] {
&["ACCOUNT_BASED", "RESOURCE_GROUP_BASED"]
}
}
impl AsRef<str> for DiscoveryType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>An object that defines the tags associated with an application. A <i>tag</i> is a label that you optionally define and associate with an application. Tags can help you categorize and manage resources in different ways, such as by purpose, owner, environment, or other criteria.</p>
/// <p>Each tag consists of a required <i>tag key</i> and an associated <i>tag value</i>, both of which you define. A tag key is a general label that acts as a category for a more specific tag value. A tag value acts as a descriptor within a tag key. A tag key can contain as many as 128 characters. A tag value can contain as many as 256 characters. The characters can be Unicode letters, digits, white space, or one of the following symbols: _ . : / = + -. The following additional restrictions apply to tags:</p>
/// <ul>
/// <li> <p>Tag keys and values are case sensitive.</p> </li>
/// <li> <p>For each associated resource, each tag key must be unique and it can have only one value.</p> </li>
/// <li> <p>The <code>aws:</code> prefix is reserved for use by AWS; you can’t use it in any tag keys or values that you define. In addition, you can't edit or remove tag keys or values that use this prefix. </p> </li>
/// </ul>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Tag {
/// <p>One part of a key-value pair that defines a tag. The maximum length of a tag key is 128 characters. The minimum length is 1 character.</p>
#[doc(hidden)]
pub key: std::option::Option<std::string::String>,
/// <p>The optional part of a key-value pair that defines a tag. The maximum length of a tag value is 256 characters. The minimum length is 0 characters. If you don't want an application to have a specific tag value, don't specify a value for this parameter.</p>
#[doc(hidden)]
pub value: std::option::Option<std::string::String>,
}
impl Tag {
/// <p>One part of a key-value pair that defines a tag. The maximum length of a tag key is 128 characters. The minimum length is 1 character.</p>
pub fn key(&self) -> std::option::Option<&str> {
self.key.as_deref()
}
/// <p>The optional part of a key-value pair that defines a tag. The maximum length of a tag value is 256 characters. The minimum length is 0 characters. If you don't want an application to have a specific tag value, don't specify a value for this parameter.</p>
pub fn value(&self) -> std::option::Option<&str> {
self.value.as_deref()
}
}
/// See [`Tag`](crate::model::Tag).
pub mod tag {
/// A builder for [`Tag`](crate::model::Tag).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) key: std::option::Option<std::string::String>,
pub(crate) value: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>One part of a key-value pair that defines a tag. The maximum length of a tag key is 128 characters. The minimum length is 1 character.</p>
pub fn key(mut self, input: impl Into<std::string::String>) -> Self {
self.key = Some(input.into());
self
}
/// <p>One part of a key-value pair that defines a tag. The maximum length of a tag key is 128 characters. The minimum length is 1 character.</p>
pub fn set_key(mut self, input: std::option::Option<std::string::String>) -> Self {
self.key = input;
self
}
/// <p>The optional part of a key-value pair that defines a tag. The maximum length of a tag value is 256 characters. The minimum length is 0 characters. If you don't want an application to have a specific tag value, don't specify a value for this parameter.</p>
pub fn value(mut self, input: impl Into<std::string::String>) -> Self {
self.value = Some(input.into());
self
}
/// <p>The optional part of a key-value pair that defines a tag. The maximum length of a tag value is 256 characters. The minimum length is 0 characters. If you don't want an application to have a specific tag value, don't specify a value for this parameter.</p>
pub fn set_value(mut self, input: std::option::Option<std::string::String>) -> Self {
self.value = input;
self
}
/// Consumes the builder and constructs a [`Tag`](crate::model::Tag).
pub fn build(self) -> crate::model::Tag {
crate::model::Tag {
key: self.key,
value: self.value,
}
}
}
}
impl Tag {
/// Creates a new builder-style object to manufacture [`Tag`](crate::model::Tag).
pub fn builder() -> crate::model::tag::Builder {
crate::model::tag::Builder::default()
}
}
/// <p>Describes a problem that is detected by correlating observations.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Problem {
/// <p>The ID of the problem.</p>
#[doc(hidden)]
pub id: std::option::Option<std::string::String>,
/// <p>The name of the problem.</p>
#[doc(hidden)]
pub title: std::option::Option<std::string::String>,
/// <p>A detailed analysis of the problem using machine learning.</p>
#[doc(hidden)]
pub insights: std::option::Option<std::string::String>,
/// <p>The status of the problem.</p>
#[doc(hidden)]
pub status: std::option::Option<crate::model::Status>,
/// <p>The resource affected by the problem.</p>
#[doc(hidden)]
pub affected_resource: std::option::Option<std::string::String>,
/// <p>The time when the problem started, in epoch seconds.</p>
#[doc(hidden)]
pub start_time: std::option::Option<aws_smithy_types::DateTime>,
/// <p>The time when the problem ended, in epoch seconds.</p>
#[doc(hidden)]
pub end_time: std::option::Option<aws_smithy_types::DateTime>,
/// <p>A measure of the level of impact of the problem.</p>
#[doc(hidden)]
pub severity_level: std::option::Option<crate::model::SeverityLevel>,
/// <p>The name of the resource group affected by the problem.</p>
#[doc(hidden)]
pub resource_group_name: std::option::Option<std::string::String>,
/// <p>Feedback provided by the user about the problem.</p>
#[doc(hidden)]
pub feedback: std::option::Option<
std::collections::HashMap<crate::model::FeedbackKey, crate::model::FeedbackValue>,
>,
/// <p> The number of times that the same problem reoccurred after the first time it was resolved. </p>
#[doc(hidden)]
pub recurring_count: std::option::Option<i64>,
/// <p> The last time that the problem reoccurred after its last resolution. </p>
#[doc(hidden)]
pub last_recurrence_time: std::option::Option<aws_smithy_types::DateTime>,
}
impl Problem {
/// <p>The ID of the problem.</p>
pub fn id(&self) -> std::option::Option<&str> {
self.id.as_deref()
}
/// <p>The name of the problem.</p>
pub fn title(&self) -> std::option::Option<&str> {
self.title.as_deref()
}
/// <p>A detailed analysis of the problem using machine learning.</p>
pub fn insights(&self) -> std::option::Option<&str> {
self.insights.as_deref()
}
/// <p>The status of the problem.</p>
pub fn status(&self) -> std::option::Option<&crate::model::Status> {
self.status.as_ref()
}
/// <p>The resource affected by the problem.</p>
pub fn affected_resource(&self) -> std::option::Option<&str> {
self.affected_resource.as_deref()
}
/// <p>The time when the problem started, in epoch seconds.</p>
pub fn start_time(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.start_time.as_ref()
}
/// <p>The time when the problem ended, in epoch seconds.</p>
pub fn end_time(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.end_time.as_ref()
}
/// <p>A measure of the level of impact of the problem.</p>
pub fn severity_level(&self) -> std::option::Option<&crate::model::SeverityLevel> {
self.severity_level.as_ref()
}
/// <p>The name of the resource group affected by the problem.</p>
pub fn resource_group_name(&self) -> std::option::Option<&str> {
self.resource_group_name.as_deref()
}
/// <p>Feedback provided by the user about the problem.</p>
pub fn feedback(
&self,
) -> std::option::Option<
&std::collections::HashMap<crate::model::FeedbackKey, crate::model::FeedbackValue>,
> {
self.feedback.as_ref()
}
/// <p> The number of times that the same problem reoccurred after the first time it was resolved. </p>
pub fn recurring_count(&self) -> std::option::Option<i64> {
self.recurring_count
}
/// <p> The last time that the problem reoccurred after its last resolution. </p>
pub fn last_recurrence_time(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.last_recurrence_time.as_ref()
}
}
/// See [`Problem`](crate::model::Problem).
pub mod problem {
/// A builder for [`Problem`](crate::model::Problem).
#[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) title: std::option::Option<std::string::String>,
pub(crate) insights: std::option::Option<std::string::String>,
pub(crate) status: std::option::Option<crate::model::Status>,
pub(crate) affected_resource: std::option::Option<std::string::String>,
pub(crate) start_time: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) end_time: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) severity_level: std::option::Option<crate::model::SeverityLevel>,
pub(crate) resource_group_name: std::option::Option<std::string::String>,
pub(crate) feedback: std::option::Option<
std::collections::HashMap<crate::model::FeedbackKey, crate::model::FeedbackValue>,
>,
pub(crate) recurring_count: std::option::Option<i64>,
pub(crate) last_recurrence_time: std::option::Option<aws_smithy_types::DateTime>,
}
impl Builder {
/// <p>The ID of the problem.</p>
pub fn id(mut self, input: impl Into<std::string::String>) -> Self {
self.id = Some(input.into());
self
}
/// <p>The ID of the problem.</p>
pub fn set_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.id = input;
self
}
/// <p>The name of the problem.</p>
pub fn title(mut self, input: impl Into<std::string::String>) -> Self {
self.title = Some(input.into());
self
}
/// <p>The name of the problem.</p>
pub fn set_title(mut self, input: std::option::Option<std::string::String>) -> Self {
self.title = input;
self
}
/// <p>A detailed analysis of the problem using machine learning.</p>
pub fn insights(mut self, input: impl Into<std::string::String>) -> Self {
self.insights = Some(input.into());
self
}
/// <p>A detailed analysis of the problem using machine learning.</p>
pub fn set_insights(mut self, input: std::option::Option<std::string::String>) -> Self {
self.insights = input;
self
}
/// <p>The status of the problem.</p>
pub fn status(mut self, input: crate::model::Status) -> Self {
self.status = Some(input);
self
}
/// <p>The status of the problem.</p>
pub fn set_status(mut self, input: std::option::Option<crate::model::Status>) -> Self {
self.status = input;
self
}
/// <p>The resource affected by the problem.</p>
pub fn affected_resource(mut self, input: impl Into<std::string::String>) -> Self {
self.affected_resource = Some(input.into());
self
}
/// <p>The resource affected by the problem.</p>
pub fn set_affected_resource(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.affected_resource = input;
self
}
/// <p>The time when the problem started, in epoch seconds.</p>
pub fn start_time(mut self, input: aws_smithy_types::DateTime) -> Self {
self.start_time = Some(input);
self
}
/// <p>The time when the problem started, in epoch seconds.</p>
pub fn set_start_time(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.start_time = input;
self
}
/// <p>The time when the problem ended, in epoch seconds.</p>
pub fn end_time(mut self, input: aws_smithy_types::DateTime) -> Self {
self.end_time = Some(input);
self
}
/// <p>The time when the problem ended, in epoch seconds.</p>
pub fn set_end_time(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.end_time = input;
self
}
/// <p>A measure of the level of impact of the problem.</p>
pub fn severity_level(mut self, input: crate::model::SeverityLevel) -> Self {
self.severity_level = Some(input);
self
}
/// <p>A measure of the level of impact of the problem.</p>
pub fn set_severity_level(
mut self,
input: std::option::Option<crate::model::SeverityLevel>,
) -> Self {
self.severity_level = input;
self
}
/// <p>The name of the resource group affected by the problem.</p>
pub fn resource_group_name(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_group_name = Some(input.into());
self
}
/// <p>The name of the resource group affected by the problem.</p>
pub fn set_resource_group_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.resource_group_name = input;
self
}
/// Adds a key-value pair to `feedback`.
///
/// To override the contents of this collection use [`set_feedback`](Self::set_feedback).
///
/// <p>Feedback provided by the user about the problem.</p>
pub fn feedback(
mut self,
k: crate::model::FeedbackKey,
v: crate::model::FeedbackValue,
) -> Self {
let mut hash_map = self.feedback.unwrap_or_default();
hash_map.insert(k, v);
self.feedback = Some(hash_map);
self
}
/// <p>Feedback provided by the user about the problem.</p>
pub fn set_feedback(
mut self,
input: std::option::Option<
std::collections::HashMap<crate::model::FeedbackKey, crate::model::FeedbackValue>,
>,
) -> Self {
self.feedback = input;
self
}
/// <p> The number of times that the same problem reoccurred after the first time it was resolved. </p>
pub fn recurring_count(mut self, input: i64) -> Self {
self.recurring_count = Some(input);
self
}
/// <p> The number of times that the same problem reoccurred after the first time it was resolved. </p>
pub fn set_recurring_count(mut self, input: std::option::Option<i64>) -> Self {
self.recurring_count = input;
self
}
/// <p> The last time that the problem reoccurred after its last resolution. </p>
pub fn last_recurrence_time(mut self, input: aws_smithy_types::DateTime) -> Self {
self.last_recurrence_time = Some(input);
self
}
/// <p> The last time that the problem reoccurred after its last resolution. </p>
pub fn set_last_recurrence_time(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.last_recurrence_time = input;
self
}
/// Consumes the builder and constructs a [`Problem`](crate::model::Problem).
pub fn build(self) -> crate::model::Problem {
crate::model::Problem {
id: self.id,
title: self.title,
insights: self.insights,
status: self.status,
affected_resource: self.affected_resource,
start_time: self.start_time,
end_time: self.end_time,
severity_level: self.severity_level,
resource_group_name: self.resource_group_name,
feedback: self.feedback,
recurring_count: self.recurring_count,
last_recurrence_time: self.last_recurrence_time,
}
}
}
}
impl Problem {
/// Creates a new builder-style object to manufacture [`Problem`](crate::model::Problem).
pub fn builder() -> crate::model::problem::Builder {
crate::model::problem::Builder::default()
}
}
/// When writing a match expression against `FeedbackValue`, 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 feedbackvalue = unimplemented!();
/// match feedbackvalue {
/// FeedbackValue::NotSpecified => { /* ... */ },
/// FeedbackValue::NotUseful => { /* ... */ },
/// FeedbackValue::Useful => { /* ... */ },
/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
/// _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `feedbackvalue` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `FeedbackValue::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `FeedbackValue::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 `FeedbackValue::NewFeature` is defined.
/// Specifically, when `feedbackvalue` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `FeedbackValue::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 FeedbackValue {
#[allow(missing_docs)] // documentation missing in model
NotSpecified,
#[allow(missing_docs)] // documentation missing in model
NotUseful,
#[allow(missing_docs)] // documentation missing in model
Useful,
/// `Unknown` contains new variants that have been added since this code was generated.
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for FeedbackValue {
fn from(s: &str) -> Self {
match s {
"NOT_SPECIFIED" => FeedbackValue::NotSpecified,
"NOT_USEFUL" => FeedbackValue::NotUseful,
"USEFUL" => FeedbackValue::Useful,
other => FeedbackValue::Unknown(crate::types::UnknownVariantValue(other.to_owned())),
}
}
}
impl std::str::FromStr for FeedbackValue {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(FeedbackValue::from(s))
}
}
impl FeedbackValue {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
FeedbackValue::NotSpecified => "NOT_SPECIFIED",
FeedbackValue::NotUseful => "NOT_USEFUL",
FeedbackValue::Useful => "USEFUL",
FeedbackValue::Unknown(value) => value.as_str(),
}
}
/// Returns all the `&str` values of the enum members.
pub const fn values() -> &'static [&'static str] {
&["NOT_SPECIFIED", "NOT_USEFUL", "USEFUL"]
}
}
impl AsRef<str> for FeedbackValue {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// When writing a match expression against `FeedbackKey`, 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 feedbackkey = unimplemented!();
/// match feedbackkey {
/// FeedbackKey::InsightsFeedback => { /* ... */ },
/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
/// _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `feedbackkey` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `FeedbackKey::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `FeedbackKey::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 `FeedbackKey::NewFeature` is defined.
/// Specifically, when `feedbackkey` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `FeedbackKey::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 FeedbackKey {
#[allow(missing_docs)] // documentation missing in model
InsightsFeedback,
/// `Unknown` contains new variants that have been added since this code was generated.
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for FeedbackKey {
fn from(s: &str) -> Self {
match s {
"INSIGHTS_FEEDBACK" => FeedbackKey::InsightsFeedback,
other => FeedbackKey::Unknown(crate::types::UnknownVariantValue(other.to_owned())),
}
}
}
impl std::str::FromStr for FeedbackKey {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(FeedbackKey::from(s))
}
}
impl FeedbackKey {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
FeedbackKey::InsightsFeedback => "INSIGHTS_FEEDBACK",
FeedbackKey::Unknown(value) => value.as_str(),
}
}
/// Returns all the `&str` values of the enum members.
pub const fn values() -> &'static [&'static str] {
&["INSIGHTS_FEEDBACK"]
}
}
impl AsRef<str> for FeedbackKey {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// When writing a match expression against `SeverityLevel`, 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 severitylevel = unimplemented!();
/// match severitylevel {
/// SeverityLevel::High => { /* ... */ },
/// SeverityLevel::Informative => { /* ... */ },
/// SeverityLevel::Low => { /* ... */ },
/// SeverityLevel::Medium => { /* ... */ },
/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
/// _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `severitylevel` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `SeverityLevel::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `SeverityLevel::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 `SeverityLevel::NewFeature` is defined.
/// Specifically, when `severitylevel` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `SeverityLevel::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 SeverityLevel {
#[allow(missing_docs)] // documentation missing in model
High,
#[allow(missing_docs)] // documentation missing in model
Informative,
#[allow(missing_docs)] // documentation missing in model
Low,
#[allow(missing_docs)] // documentation missing in model
Medium,
/// `Unknown` contains new variants that have been added since this code was generated.
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for SeverityLevel {
fn from(s: &str) -> Self {
match s {
"High" => SeverityLevel::High,
"Informative" => SeverityLevel::Informative,
"Low" => SeverityLevel::Low,
"Medium" => SeverityLevel::Medium,
other => SeverityLevel::Unknown(crate::types::UnknownVariantValue(other.to_owned())),
}
}
}
impl std::str::FromStr for SeverityLevel {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(SeverityLevel::from(s))
}
}
impl SeverityLevel {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
SeverityLevel::High => "High",
SeverityLevel::Informative => "Informative",
SeverityLevel::Low => "Low",
SeverityLevel::Medium => "Medium",
SeverityLevel::Unknown(value) => value.as_str(),
}
}
/// Returns all the `&str` values of the enum members.
pub const fn values() -> &'static [&'static str] {
&["High", "Informative", "Low", "Medium"]
}
}
impl AsRef<str> for SeverityLevel {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// When writing a match expression against `Status`, 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 status = unimplemented!();
/// match status {
/// Status::Ignore => { /* ... */ },
/// Status::Pending => { /* ... */ },
/// Status::Recurring => { /* ... */ },
/// Status::Resolved => { /* ... */ },
/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
/// _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `status` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `Status::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `Status::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 `Status::NewFeature` is defined.
/// Specifically, when `status` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `Status::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 Status {
#[allow(missing_docs)] // documentation missing in model
Ignore,
#[allow(missing_docs)] // documentation missing in model
Pending,
#[allow(missing_docs)] // documentation missing in model
Recurring,
#[allow(missing_docs)] // documentation missing in model
Resolved,
/// `Unknown` contains new variants that have been added since this code was generated.
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for Status {
fn from(s: &str) -> Self {
match s {
"IGNORE" => Status::Ignore,
"PENDING" => Status::Pending,
"RECURRING" => Status::Recurring,
"RESOLVED" => Status::Resolved,
other => Status::Unknown(crate::types::UnknownVariantValue(other.to_owned())),
}
}
}
impl std::str::FromStr for Status {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(Status::from(s))
}
}
impl Status {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
Status::Ignore => "IGNORE",
Status::Pending => "PENDING",
Status::Recurring => "RECURRING",
Status::Resolved => "RESOLVED",
Status::Unknown(value) => value.as_str(),
}
}
/// Returns all the `&str` values of the enum members.
pub const fn values() -> &'static [&'static str] {
&["IGNORE", "PENDING", "RECURRING", "RESOLVED"]
}
}
impl AsRef<str> for Status {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p> The event information. </p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ConfigurationEvent {
/// <p> The resource monitored by Application Insights. </p>
#[doc(hidden)]
pub monitored_resource_arn: std::option::Option<std::string::String>,
/// <p> The status of the configuration update event. Possible values include INFO, WARN, and ERROR. </p>
#[doc(hidden)]
pub event_status: std::option::Option<crate::model::ConfigurationEventStatus>,
/// <p> The resource type that Application Insights attempted to configure, for example, CLOUDWATCH_ALARM. </p>
#[doc(hidden)]
pub event_resource_type: std::option::Option<crate::model::ConfigurationEventResourceType>,
/// <p> The timestamp of the event. </p>
#[doc(hidden)]
pub event_time: std::option::Option<aws_smithy_types::DateTime>,
/// <p> The details of the event in plain text. </p>
#[doc(hidden)]
pub event_detail: std::option::Option<std::string::String>,
/// <p> The name of the resource Application Insights attempted to configure. </p>
#[doc(hidden)]
pub event_resource_name: std::option::Option<std::string::String>,
}
impl ConfigurationEvent {
/// <p> The resource monitored by Application Insights. </p>
pub fn monitored_resource_arn(&self) -> std::option::Option<&str> {
self.monitored_resource_arn.as_deref()
}
/// <p> The status of the configuration update event. Possible values include INFO, WARN, and ERROR. </p>
pub fn event_status(&self) -> std::option::Option<&crate::model::ConfigurationEventStatus> {
self.event_status.as_ref()
}
/// <p> The resource type that Application Insights attempted to configure, for example, CLOUDWATCH_ALARM. </p>
pub fn event_resource_type(
&self,
) -> std::option::Option<&crate::model::ConfigurationEventResourceType> {
self.event_resource_type.as_ref()
}
/// <p> The timestamp of the event. </p>
pub fn event_time(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.event_time.as_ref()
}
/// <p> The details of the event in plain text. </p>
pub fn event_detail(&self) -> std::option::Option<&str> {
self.event_detail.as_deref()
}
/// <p> The name of the resource Application Insights attempted to configure. </p>
pub fn event_resource_name(&self) -> std::option::Option<&str> {
self.event_resource_name.as_deref()
}
}
/// See [`ConfigurationEvent`](crate::model::ConfigurationEvent).
pub mod configuration_event {
/// A builder for [`ConfigurationEvent`](crate::model::ConfigurationEvent).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) monitored_resource_arn: std::option::Option<std::string::String>,
pub(crate) event_status: std::option::Option<crate::model::ConfigurationEventStatus>,
pub(crate) event_resource_type:
std::option::Option<crate::model::ConfigurationEventResourceType>,
pub(crate) event_time: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) event_detail: std::option::Option<std::string::String>,
pub(crate) event_resource_name: std::option::Option<std::string::String>,
}
impl Builder {
/// <p> The resource monitored by Application Insights. </p>
pub fn monitored_resource_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.monitored_resource_arn = Some(input.into());
self
}
/// <p> The resource monitored by Application Insights. </p>
pub fn set_monitored_resource_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.monitored_resource_arn = input;
self
}
/// <p> The status of the configuration update event. Possible values include INFO, WARN, and ERROR. </p>
pub fn event_status(mut self, input: crate::model::ConfigurationEventStatus) -> Self {
self.event_status = Some(input);
self
}
/// <p> The status of the configuration update event. Possible values include INFO, WARN, and ERROR. </p>
pub fn set_event_status(
mut self,
input: std::option::Option<crate::model::ConfigurationEventStatus>,
) -> Self {
self.event_status = input;
self
}
/// <p> The resource type that Application Insights attempted to configure, for example, CLOUDWATCH_ALARM. </p>
pub fn event_resource_type(
mut self,
input: crate::model::ConfigurationEventResourceType,
) -> Self {
self.event_resource_type = Some(input);
self
}
/// <p> The resource type that Application Insights attempted to configure, for example, CLOUDWATCH_ALARM. </p>
pub fn set_event_resource_type(
mut self,
input: std::option::Option<crate::model::ConfigurationEventResourceType>,
) -> Self {
self.event_resource_type = input;
self
}
/// <p> The timestamp of the event. </p>
pub fn event_time(mut self, input: aws_smithy_types::DateTime) -> Self {
self.event_time = Some(input);
self
}
/// <p> The timestamp of the event. </p>
pub fn set_event_time(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.event_time = input;
self
}
/// <p> The details of the event in plain text. </p>
pub fn event_detail(mut self, input: impl Into<std::string::String>) -> Self {
self.event_detail = Some(input.into());
self
}
/// <p> The details of the event in plain text. </p>
pub fn set_event_detail(mut self, input: std::option::Option<std::string::String>) -> Self {
self.event_detail = input;
self
}
/// <p> The name of the resource Application Insights attempted to configure. </p>
pub fn event_resource_name(mut self, input: impl Into<std::string::String>) -> Self {
self.event_resource_name = Some(input.into());
self
}
/// <p> The name of the resource Application Insights attempted to configure. </p>
pub fn set_event_resource_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.event_resource_name = input;
self
}
/// Consumes the builder and constructs a [`ConfigurationEvent`](crate::model::ConfigurationEvent).
pub fn build(self) -> crate::model::ConfigurationEvent {
crate::model::ConfigurationEvent {
monitored_resource_arn: self.monitored_resource_arn,
event_status: self.event_status,
event_resource_type: self.event_resource_type,
event_time: self.event_time,
event_detail: self.event_detail,
event_resource_name: self.event_resource_name,
}
}
}
}
impl ConfigurationEvent {
/// Creates a new builder-style object to manufacture [`ConfigurationEvent`](crate::model::ConfigurationEvent).
pub fn builder() -> crate::model::configuration_event::Builder {
crate::model::configuration_event::Builder::default()
}
}
/// When writing a match expression against `ConfigurationEventResourceType`, 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 configurationeventresourcetype = unimplemented!();
/// match configurationeventresourcetype {
/// ConfigurationEventResourceType::Cloudformation => { /* ... */ },
/// ConfigurationEventResourceType::CloudwatchAlarm => { /* ... */ },
/// ConfigurationEventResourceType::CloudwatchLog => { /* ... */ },
/// ConfigurationEventResourceType::SsmAssociation => { /* ... */ },
/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
/// _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `configurationeventresourcetype` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `ConfigurationEventResourceType::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `ConfigurationEventResourceType::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 `ConfigurationEventResourceType::NewFeature` is defined.
/// Specifically, when `configurationeventresourcetype` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `ConfigurationEventResourceType::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 ConfigurationEventResourceType {
#[allow(missing_docs)] // documentation missing in model
Cloudformation,
#[allow(missing_docs)] // documentation missing in model
CloudwatchAlarm,
#[allow(missing_docs)] // documentation missing in model
CloudwatchLog,
#[allow(missing_docs)] // documentation missing in model
SsmAssociation,
/// `Unknown` contains new variants that have been added since this code was generated.
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for ConfigurationEventResourceType {
fn from(s: &str) -> Self {
match s {
"CLOUDFORMATION" => ConfigurationEventResourceType::Cloudformation,
"CLOUDWATCH_ALARM" => ConfigurationEventResourceType::CloudwatchAlarm,
"CLOUDWATCH_LOG" => ConfigurationEventResourceType::CloudwatchLog,
"SSM_ASSOCIATION" => ConfigurationEventResourceType::SsmAssociation,
other => ConfigurationEventResourceType::Unknown(crate::types::UnknownVariantValue(
other.to_owned(),
)),
}
}
}
impl std::str::FromStr for ConfigurationEventResourceType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(ConfigurationEventResourceType::from(s))
}
}
impl ConfigurationEventResourceType {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
ConfigurationEventResourceType::Cloudformation => "CLOUDFORMATION",
ConfigurationEventResourceType::CloudwatchAlarm => "CLOUDWATCH_ALARM",
ConfigurationEventResourceType::CloudwatchLog => "CLOUDWATCH_LOG",
ConfigurationEventResourceType::SsmAssociation => "SSM_ASSOCIATION",
ConfigurationEventResourceType::Unknown(value) => value.as_str(),
}
}
/// Returns all the `&str` values of the enum members.
pub const fn values() -> &'static [&'static str] {
&[
"CLOUDFORMATION",
"CLOUDWATCH_ALARM",
"CLOUDWATCH_LOG",
"SSM_ASSOCIATION",
]
}
}
impl AsRef<str> for ConfigurationEventResourceType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// When writing a match expression against `ConfigurationEventStatus`, 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 configurationeventstatus = unimplemented!();
/// match configurationeventstatus {
/// ConfigurationEventStatus::Error => { /* ... */ },
/// ConfigurationEventStatus::Info => { /* ... */ },
/// ConfigurationEventStatus::Warn => { /* ... */ },
/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
/// _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `configurationeventstatus` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `ConfigurationEventStatus::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `ConfigurationEventStatus::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 `ConfigurationEventStatus::NewFeature` is defined.
/// Specifically, when `configurationeventstatus` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `ConfigurationEventStatus::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 ConfigurationEventStatus {
#[allow(missing_docs)] // documentation missing in model
Error,
#[allow(missing_docs)] // documentation missing in model
Info,
#[allow(missing_docs)] // documentation missing in model
Warn,
/// `Unknown` contains new variants that have been added since this code was generated.
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for ConfigurationEventStatus {
fn from(s: &str) -> Self {
match s {
"ERROR" => ConfigurationEventStatus::Error,
"INFO" => ConfigurationEventStatus::Info,
"WARN" => ConfigurationEventStatus::Warn,
other => ConfigurationEventStatus::Unknown(crate::types::UnknownVariantValue(
other.to_owned(),
)),
}
}
}
impl std::str::FromStr for ConfigurationEventStatus {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(ConfigurationEventStatus::from(s))
}
}
impl ConfigurationEventStatus {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
ConfigurationEventStatus::Error => "ERROR",
ConfigurationEventStatus::Info => "INFO",
ConfigurationEventStatus::Warn => "WARN",
ConfigurationEventStatus::Unknown(value) => value.as_str(),
}
}
/// Returns all the `&str` values of the enum members.
pub const fn values() -> &'static [&'static str] {
&["ERROR", "INFO", "WARN"]
}
}
impl AsRef<str> for ConfigurationEventStatus {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>Describes a standalone resource or similarly grouped resources that the application is made up of.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ApplicationComponent {
/// <p>The name of the component.</p>
#[doc(hidden)]
pub component_name: std::option::Option<std::string::String>,
/// <p> If logging is supported for the resource type, indicates whether the component has configured logs to be monitored. </p>
#[doc(hidden)]
pub component_remarks: std::option::Option<std::string::String>,
/// <p>The resource type. Supported resource types include EC2 instances, Auto Scaling group, Classic ELB, Application ELB, and SQS Queue.</p>
#[doc(hidden)]
pub resource_type: std::option::Option<std::string::String>,
/// <p> The operating system of the component. </p>
#[doc(hidden)]
pub os_type: std::option::Option<crate::model::OsType>,
/// <p>The stack tier of the application component.</p>
#[doc(hidden)]
pub tier: std::option::Option<crate::model::Tier>,
/// <p>Indicates whether the application component is monitored. </p>
#[doc(hidden)]
pub monitor: std::option::Option<bool>,
/// <p> Workloads detected in the application component. </p>
#[doc(hidden)]
pub detected_workload: std::option::Option<
std::collections::HashMap<
crate::model::Tier,
std::collections::HashMap<std::string::String, std::string::String>,
>,
>,
}
impl ApplicationComponent {
/// <p>The name of the component.</p>
pub fn component_name(&self) -> std::option::Option<&str> {
self.component_name.as_deref()
}
/// <p> If logging is supported for the resource type, indicates whether the component has configured logs to be monitored. </p>
pub fn component_remarks(&self) -> std::option::Option<&str> {
self.component_remarks.as_deref()
}
/// <p>The resource type. Supported resource types include EC2 instances, Auto Scaling group, Classic ELB, Application ELB, and SQS Queue.</p>
pub fn resource_type(&self) -> std::option::Option<&str> {
self.resource_type.as_deref()
}
/// <p> The operating system of the component. </p>
pub fn os_type(&self) -> std::option::Option<&crate::model::OsType> {
self.os_type.as_ref()
}
/// <p>The stack tier of the application component.</p>
pub fn tier(&self) -> std::option::Option<&crate::model::Tier> {
self.tier.as_ref()
}
/// <p>Indicates whether the application component is monitored. </p>
pub fn monitor(&self) -> std::option::Option<bool> {
self.monitor
}
/// <p> Workloads detected in the application component. </p>
pub fn detected_workload(
&self,
) -> std::option::Option<
&std::collections::HashMap<
crate::model::Tier,
std::collections::HashMap<std::string::String, std::string::String>,
>,
> {
self.detected_workload.as_ref()
}
}
/// See [`ApplicationComponent`](crate::model::ApplicationComponent).
pub mod application_component {
/// A builder for [`ApplicationComponent`](crate::model::ApplicationComponent).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) component_name: std::option::Option<std::string::String>,
pub(crate) component_remarks: std::option::Option<std::string::String>,
pub(crate) resource_type: std::option::Option<std::string::String>,
pub(crate) os_type: std::option::Option<crate::model::OsType>,
pub(crate) tier: std::option::Option<crate::model::Tier>,
pub(crate) monitor: std::option::Option<bool>,
pub(crate) detected_workload: std::option::Option<
std::collections::HashMap<
crate::model::Tier,
std::collections::HashMap<std::string::String, std::string::String>,
>,
>,
}
impl Builder {
/// <p>The name of the component.</p>
pub fn component_name(mut self, input: impl Into<std::string::String>) -> Self {
self.component_name = Some(input.into());
self
}
/// <p>The name of the component.</p>
pub fn set_component_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.component_name = input;
self
}
/// <p> If logging is supported for the resource type, indicates whether the component has configured logs to be monitored. </p>
pub fn component_remarks(mut self, input: impl Into<std::string::String>) -> Self {
self.component_remarks = Some(input.into());
self
}
/// <p> If logging is supported for the resource type, indicates whether the component has configured logs to be monitored. </p>
pub fn set_component_remarks(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.component_remarks = input;
self
}
/// <p>The resource type. Supported resource types include EC2 instances, Auto Scaling group, Classic ELB, Application ELB, and SQS Queue.</p>
pub fn resource_type(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_type = Some(input.into());
self
}
/// <p>The resource type. Supported resource types include EC2 instances, Auto Scaling group, Classic ELB, Application ELB, and SQS Queue.</p>
pub fn set_resource_type(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.resource_type = input;
self
}
/// <p> The operating system of the component. </p>
pub fn os_type(mut self, input: crate::model::OsType) -> Self {
self.os_type = Some(input);
self
}
/// <p> The operating system of the component. </p>
pub fn set_os_type(mut self, input: std::option::Option<crate::model::OsType>) -> Self {
self.os_type = input;
self
}
/// <p>The stack tier of the application component.</p>
pub fn tier(mut self, input: crate::model::Tier) -> Self {
self.tier = Some(input);
self
}
/// <p>The stack tier of the application component.</p>
pub fn set_tier(mut self, input: std::option::Option<crate::model::Tier>) -> Self {
self.tier = input;
self
}
/// <p>Indicates whether the application component is monitored. </p>
pub fn monitor(mut self, input: bool) -> Self {
self.monitor = Some(input);
self
}
/// <p>Indicates whether the application component is monitored. </p>
pub fn set_monitor(mut self, input: std::option::Option<bool>) -> Self {
self.monitor = input;
self
}
/// Adds a key-value pair to `detected_workload`.
///
/// To override the contents of this collection use [`set_detected_workload`](Self::set_detected_workload).
///
/// <p> Workloads detected in the application component. </p>
pub fn detected_workload(
mut self,
k: crate::model::Tier,
v: std::collections::HashMap<std::string::String, std::string::String>,
) -> Self {
let mut hash_map = self.detected_workload.unwrap_or_default();
hash_map.insert(k, v);
self.detected_workload = Some(hash_map);
self
}
/// <p> Workloads detected in the application component. </p>
pub fn set_detected_workload(
mut self,
input: std::option::Option<
std::collections::HashMap<
crate::model::Tier,
std::collections::HashMap<std::string::String, std::string::String>,
>,
>,
) -> Self {
self.detected_workload = input;
self
}
/// Consumes the builder and constructs a [`ApplicationComponent`](crate::model::ApplicationComponent).
pub fn build(self) -> crate::model::ApplicationComponent {
crate::model::ApplicationComponent {
component_name: self.component_name,
component_remarks: self.component_remarks,
resource_type: self.resource_type,
os_type: self.os_type,
tier: self.tier,
monitor: self.monitor,
detected_workload: self.detected_workload,
}
}
}
}
impl ApplicationComponent {
/// Creates a new builder-style object to manufacture [`ApplicationComponent`](crate::model::ApplicationComponent).
pub fn builder() -> crate::model::application_component::Builder {
crate::model::application_component::Builder::default()
}
}
/// When writing a match expression against `OsType`, 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 ostype = unimplemented!();
/// match ostype {
/// OsType::Linux => { /* ... */ },
/// OsType::Windows => { /* ... */ },
/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
/// _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `ostype` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `OsType::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `OsType::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 `OsType::NewFeature` is defined.
/// Specifically, when `ostype` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `OsType::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 OsType {
#[allow(missing_docs)] // documentation missing in model
Linux,
#[allow(missing_docs)] // documentation missing in model
Windows,
/// `Unknown` contains new variants that have been added since this code was generated.
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for OsType {
fn from(s: &str) -> Self {
match s {
"LINUX" => OsType::Linux,
"WINDOWS" => OsType::Windows,
other => OsType::Unknown(crate::types::UnknownVariantValue(other.to_owned())),
}
}
}
impl std::str::FromStr for OsType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(OsType::from(s))
}
}
impl OsType {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
OsType::Linux => "LINUX",
OsType::Windows => "WINDOWS",
OsType::Unknown(value) => value.as_str(),
}
}
/// Returns all the `&str` values of the enum members.
pub const fn values() -> &'static [&'static str] {
&["LINUX", "WINDOWS"]
}
}
impl AsRef<str> for OsType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>Describes observations related to the problem.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct RelatedObservations {
/// <p>The list of observations related to the problem.</p>
#[doc(hidden)]
pub observation_list: std::option::Option<std::vec::Vec<crate::model::Observation>>,
}
impl RelatedObservations {
/// <p>The list of observations related to the problem.</p>
pub fn observation_list(&self) -> std::option::Option<&[crate::model::Observation]> {
self.observation_list.as_deref()
}
}
/// See [`RelatedObservations`](crate::model::RelatedObservations).
pub mod related_observations {
/// A builder for [`RelatedObservations`](crate::model::RelatedObservations).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) observation_list: std::option::Option<std::vec::Vec<crate::model::Observation>>,
}
impl Builder {
/// Appends an item to `observation_list`.
///
/// To override the contents of this collection use [`set_observation_list`](Self::set_observation_list).
///
/// <p>The list of observations related to the problem.</p>
pub fn observation_list(mut self, input: crate::model::Observation) -> Self {
let mut v = self.observation_list.unwrap_or_default();
v.push(input);
self.observation_list = Some(v);
self
}
/// <p>The list of observations related to the problem.</p>
pub fn set_observation_list(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Observation>>,
) -> Self {
self.observation_list = input;
self
}
/// Consumes the builder and constructs a [`RelatedObservations`](crate::model::RelatedObservations).
pub fn build(self) -> crate::model::RelatedObservations {
crate::model::RelatedObservations {
observation_list: self.observation_list,
}
}
}
}
impl RelatedObservations {
/// Creates a new builder-style object to manufacture [`RelatedObservations`](crate::model::RelatedObservations).
pub fn builder() -> crate::model::related_observations::Builder {
crate::model::related_observations::Builder::default()
}
}
/// <p>Describes an anomaly or error with the application.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Observation {
/// <p>The ID of the observation type.</p>
#[doc(hidden)]
pub id: std::option::Option<std::string::String>,
/// <p>The time when the observation was first detected, in epoch seconds.</p>
#[doc(hidden)]
pub start_time: std::option::Option<aws_smithy_types::DateTime>,
/// <p>The time when the observation ended, in epoch seconds.</p>
#[doc(hidden)]
pub end_time: std::option::Option<aws_smithy_types::DateTime>,
/// <p>The source type of the observation.</p>
#[doc(hidden)]
pub source_type: std::option::Option<std::string::String>,
/// <p>The source resource ARN of the observation.</p>
#[doc(hidden)]
pub source_arn: std::option::Option<std::string::String>,
/// <p>The log group name.</p>
#[doc(hidden)]
pub log_group: std::option::Option<std::string::String>,
/// <p>The timestamp in the CloudWatch Logs that specifies when the matched line occurred.</p>
#[doc(hidden)]
pub line_time: std::option::Option<aws_smithy_types::DateTime>,
/// <p>The log text of the observation.</p>
#[doc(hidden)]
pub log_text: std::option::Option<std::string::String>,
/// <p>The log filter of the observation.</p>
#[doc(hidden)]
pub log_filter: std::option::Option<crate::model::LogFilter>,
/// <p>The namespace of the observation metric.</p>
#[doc(hidden)]
pub metric_namespace: std::option::Option<std::string::String>,
/// <p>The name of the observation metric.</p>
#[doc(hidden)]
pub metric_name: std::option::Option<std::string::String>,
/// <p>The unit of the source observation metric.</p>
#[doc(hidden)]
pub unit: std::option::Option<std::string::String>,
/// <p>The value of the source observation metric.</p>
#[doc(hidden)]
pub value: std::option::Option<f64>,
/// <p> The ID of the CloudWatch Event-based observation related to the detected problem. </p>
#[doc(hidden)]
pub cloud_watch_event_id: std::option::Option<std::string::String>,
/// <p> The source of the CloudWatch Event. </p>
#[doc(hidden)]
pub cloud_watch_event_source: std::option::Option<crate::model::CloudWatchEventSource>,
/// <p> The detail type of the CloudWatch Event-based observation, for example, <code>EC2 Instance State-change Notification</code>. </p>
#[doc(hidden)]
pub cloud_watch_event_detail_type: std::option::Option<std::string::String>,
/// <p> The Amazon Resource Name (ARN) of the AWS Health Event-based observation.</p>
#[doc(hidden)]
pub health_event_arn: std::option::Option<std::string::String>,
/// <p> The service to which the AWS Health Event belongs, such as EC2. </p>
#[doc(hidden)]
pub health_service: std::option::Option<std::string::String>,
/// <p> The type of the AWS Health event, for example, <code>AWS_EC2_POWER_CONNECTIVITY_ISSUE</code>. </p>
#[doc(hidden)]
pub health_event_type_code: std::option::Option<std::string::String>,
/// <p> The category of the AWS Health event, such as <code>issue</code>. </p>
#[doc(hidden)]
pub health_event_type_category: std::option::Option<std::string::String>,
/// <p> The description of the AWS Health event provided by the service, such as Amazon EC2. </p>
#[doc(hidden)]
pub health_event_description: std::option::Option<std::string::String>,
/// <p> The deployment ID of the CodeDeploy-based observation related to the detected problem. </p>
#[doc(hidden)]
pub code_deploy_deployment_id: std::option::Option<std::string::String>,
/// <p> The deployment group to which the CodeDeploy deployment belongs. </p>
#[doc(hidden)]
pub code_deploy_deployment_group: std::option::Option<std::string::String>,
/// <p> The status of the CodeDeploy deployment, for example <code>SUCCESS</code> or <code> FAILURE</code>. </p>
#[doc(hidden)]
pub code_deploy_state: std::option::Option<std::string::String>,
/// <p> The CodeDeploy application to which the deployment belongs. </p>
#[doc(hidden)]
pub code_deploy_application: std::option::Option<std::string::String>,
/// <p> The instance group to which the CodeDeploy instance belongs. </p>
#[doc(hidden)]
pub code_deploy_instance_group_id: std::option::Option<std::string::String>,
/// <p> The state of the instance, such as <code>STOPPING</code> or <code>TERMINATING</code>. </p>
#[doc(hidden)]
pub ec2_state: std::option::Option<std::string::String>,
/// <p> The category of an RDS event. </p>
#[doc(hidden)]
pub rds_event_categories: std::option::Option<std::string::String>,
/// <p> The message of an RDS event. </p>
#[doc(hidden)]
pub rds_event_message: std::option::Option<std::string::String>,
/// <p> The name of the S3 CloudWatch Event-based observation. </p>
#[doc(hidden)]
pub s3_event_name: std::option::Option<std::string::String>,
/// <p> The Amazon Resource Name (ARN) of the step function execution-based observation. </p>
#[doc(hidden)]
pub states_execution_arn: std::option::Option<std::string::String>,
/// <p> The Amazon Resource Name (ARN) of the step function-based observation. </p>
#[doc(hidden)]
pub states_arn: std::option::Option<std::string::String>,
/// <p> The status of the step function-related observation. </p>
#[doc(hidden)]
pub states_status: std::option::Option<std::string::String>,
/// <p> The input to the step function-based observation. </p>
#[doc(hidden)]
pub states_input: std::option::Option<std::string::String>,
/// <p> The type of EBS CloudWatch event, such as <code>createVolume</code>, <code>deleteVolume</code> or <code>attachVolume</code>. </p>
#[doc(hidden)]
pub ebs_event: std::option::Option<std::string::String>,
/// <p> The result of an EBS CloudWatch event, such as <code>failed</code> or <code>succeeded</code>. </p>
#[doc(hidden)]
pub ebs_result: std::option::Option<std::string::String>,
/// <p> The cause of an EBS CloudWatch event. </p>
#[doc(hidden)]
pub ebs_cause: std::option::Option<std::string::String>,
/// <p> The request ID of an EBS CloudWatch event. </p>
#[doc(hidden)]
pub ebs_request_id: std::option::Option<std::string::String>,
/// <p> The X-Ray request fault percentage for this node. </p>
#[doc(hidden)]
pub x_ray_fault_percent: std::option::Option<i32>,
/// <p> The X-Ray request throttle percentage for this node. </p>
#[doc(hidden)]
pub x_ray_throttle_percent: std::option::Option<i32>,
/// <p> The X-Ray request error percentage for this node. </p>
#[doc(hidden)]
pub x_ray_error_percent: std::option::Option<i32>,
/// <p> The X-Ray request count for this node. </p>
#[doc(hidden)]
pub x_ray_request_count: std::option::Option<i32>,
/// <p> The X-Ray node request average latency for this node. </p>
#[doc(hidden)]
pub x_ray_request_average_latency: std::option::Option<i64>,
/// <p> The name of the X-Ray node. </p>
#[doc(hidden)]
pub x_ray_node_name: std::option::Option<std::string::String>,
/// <p> The type of the X-Ray node. </p>
#[doc(hidden)]
pub x_ray_node_type: std::option::Option<std::string::String>,
}
impl Observation {
/// <p>The ID of the observation type.</p>
pub fn id(&self) -> std::option::Option<&str> {
self.id.as_deref()
}
/// <p>The time when the observation was first detected, in epoch seconds.</p>
pub fn start_time(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.start_time.as_ref()
}
/// <p>The time when the observation ended, in epoch seconds.</p>
pub fn end_time(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.end_time.as_ref()
}
/// <p>The source type of the observation.</p>
pub fn source_type(&self) -> std::option::Option<&str> {
self.source_type.as_deref()
}
/// <p>The source resource ARN of the observation.</p>
pub fn source_arn(&self) -> std::option::Option<&str> {
self.source_arn.as_deref()
}
/// <p>The log group name.</p>
pub fn log_group(&self) -> std::option::Option<&str> {
self.log_group.as_deref()
}
/// <p>The timestamp in the CloudWatch Logs that specifies when the matched line occurred.</p>
pub fn line_time(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.line_time.as_ref()
}
/// <p>The log text of the observation.</p>
pub fn log_text(&self) -> std::option::Option<&str> {
self.log_text.as_deref()
}
/// <p>The log filter of the observation.</p>
pub fn log_filter(&self) -> std::option::Option<&crate::model::LogFilter> {
self.log_filter.as_ref()
}
/// <p>The namespace of the observation metric.</p>
pub fn metric_namespace(&self) -> std::option::Option<&str> {
self.metric_namespace.as_deref()
}
/// <p>The name of the observation metric.</p>
pub fn metric_name(&self) -> std::option::Option<&str> {
self.metric_name.as_deref()
}
/// <p>The unit of the source observation metric.</p>
pub fn unit(&self) -> std::option::Option<&str> {
self.unit.as_deref()
}
/// <p>The value of the source observation metric.</p>
pub fn value(&self) -> std::option::Option<f64> {
self.value
}
/// <p> The ID of the CloudWatch Event-based observation related to the detected problem. </p>
pub fn cloud_watch_event_id(&self) -> std::option::Option<&str> {
self.cloud_watch_event_id.as_deref()
}
/// <p> The source of the CloudWatch Event. </p>
pub fn cloud_watch_event_source(
&self,
) -> std::option::Option<&crate::model::CloudWatchEventSource> {
self.cloud_watch_event_source.as_ref()
}
/// <p> The detail type of the CloudWatch Event-based observation, for example, <code>EC2 Instance State-change Notification</code>. </p>
pub fn cloud_watch_event_detail_type(&self) -> std::option::Option<&str> {
self.cloud_watch_event_detail_type.as_deref()
}
/// <p> The Amazon Resource Name (ARN) of the AWS Health Event-based observation.</p>
pub fn health_event_arn(&self) -> std::option::Option<&str> {
self.health_event_arn.as_deref()
}
/// <p> The service to which the AWS Health Event belongs, such as EC2. </p>
pub fn health_service(&self) -> std::option::Option<&str> {
self.health_service.as_deref()
}
/// <p> The type of the AWS Health event, for example, <code>AWS_EC2_POWER_CONNECTIVITY_ISSUE</code>. </p>
pub fn health_event_type_code(&self) -> std::option::Option<&str> {
self.health_event_type_code.as_deref()
}
/// <p> The category of the AWS Health event, such as <code>issue</code>. </p>
pub fn health_event_type_category(&self) -> std::option::Option<&str> {
self.health_event_type_category.as_deref()
}
/// <p> The description of the AWS Health event provided by the service, such as Amazon EC2. </p>
pub fn health_event_description(&self) -> std::option::Option<&str> {
self.health_event_description.as_deref()
}
/// <p> The deployment ID of the CodeDeploy-based observation related to the detected problem. </p>
pub fn code_deploy_deployment_id(&self) -> std::option::Option<&str> {
self.code_deploy_deployment_id.as_deref()
}
/// <p> The deployment group to which the CodeDeploy deployment belongs. </p>
pub fn code_deploy_deployment_group(&self) -> std::option::Option<&str> {
self.code_deploy_deployment_group.as_deref()
}
/// <p> The status of the CodeDeploy deployment, for example <code>SUCCESS</code> or <code> FAILURE</code>. </p>
pub fn code_deploy_state(&self) -> std::option::Option<&str> {
self.code_deploy_state.as_deref()
}
/// <p> The CodeDeploy application to which the deployment belongs. </p>
pub fn code_deploy_application(&self) -> std::option::Option<&str> {
self.code_deploy_application.as_deref()
}
/// <p> The instance group to which the CodeDeploy instance belongs. </p>
pub fn code_deploy_instance_group_id(&self) -> std::option::Option<&str> {
self.code_deploy_instance_group_id.as_deref()
}
/// <p> The state of the instance, such as <code>STOPPING</code> or <code>TERMINATING</code>. </p>
pub fn ec2_state(&self) -> std::option::Option<&str> {
self.ec2_state.as_deref()
}
/// <p> The category of an RDS event. </p>
pub fn rds_event_categories(&self) -> std::option::Option<&str> {
self.rds_event_categories.as_deref()
}
/// <p> The message of an RDS event. </p>
pub fn rds_event_message(&self) -> std::option::Option<&str> {
self.rds_event_message.as_deref()
}
/// <p> The name of the S3 CloudWatch Event-based observation. </p>
pub fn s3_event_name(&self) -> std::option::Option<&str> {
self.s3_event_name.as_deref()
}
/// <p> The Amazon Resource Name (ARN) of the step function execution-based observation. </p>
pub fn states_execution_arn(&self) -> std::option::Option<&str> {
self.states_execution_arn.as_deref()
}
/// <p> The Amazon Resource Name (ARN) of the step function-based observation. </p>
pub fn states_arn(&self) -> std::option::Option<&str> {
self.states_arn.as_deref()
}
/// <p> The status of the step function-related observation. </p>
pub fn states_status(&self) -> std::option::Option<&str> {
self.states_status.as_deref()
}
/// <p> The input to the step function-based observation. </p>
pub fn states_input(&self) -> std::option::Option<&str> {
self.states_input.as_deref()
}
/// <p> The type of EBS CloudWatch event, such as <code>createVolume</code>, <code>deleteVolume</code> or <code>attachVolume</code>. </p>
pub fn ebs_event(&self) -> std::option::Option<&str> {
self.ebs_event.as_deref()
}
/// <p> The result of an EBS CloudWatch event, such as <code>failed</code> or <code>succeeded</code>. </p>
pub fn ebs_result(&self) -> std::option::Option<&str> {
self.ebs_result.as_deref()
}
/// <p> The cause of an EBS CloudWatch event. </p>
pub fn ebs_cause(&self) -> std::option::Option<&str> {
self.ebs_cause.as_deref()
}
/// <p> The request ID of an EBS CloudWatch event. </p>
pub fn ebs_request_id(&self) -> std::option::Option<&str> {
self.ebs_request_id.as_deref()
}
/// <p> The X-Ray request fault percentage for this node. </p>
pub fn x_ray_fault_percent(&self) -> std::option::Option<i32> {
self.x_ray_fault_percent
}
/// <p> The X-Ray request throttle percentage for this node. </p>
pub fn x_ray_throttle_percent(&self) -> std::option::Option<i32> {
self.x_ray_throttle_percent
}
/// <p> The X-Ray request error percentage for this node. </p>
pub fn x_ray_error_percent(&self) -> std::option::Option<i32> {
self.x_ray_error_percent
}
/// <p> The X-Ray request count for this node. </p>
pub fn x_ray_request_count(&self) -> std::option::Option<i32> {
self.x_ray_request_count
}
/// <p> The X-Ray node request average latency for this node. </p>
pub fn x_ray_request_average_latency(&self) -> std::option::Option<i64> {
self.x_ray_request_average_latency
}
/// <p> The name of the X-Ray node. </p>
pub fn x_ray_node_name(&self) -> std::option::Option<&str> {
self.x_ray_node_name.as_deref()
}
/// <p> The type of the X-Ray node. </p>
pub fn x_ray_node_type(&self) -> std::option::Option<&str> {
self.x_ray_node_type.as_deref()
}
}
/// See [`Observation`](crate::model::Observation).
pub mod observation {
/// A builder for [`Observation`](crate::model::Observation).
#[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) start_time: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) end_time: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) source_type: std::option::Option<std::string::String>,
pub(crate) source_arn: std::option::Option<std::string::String>,
pub(crate) log_group: std::option::Option<std::string::String>,
pub(crate) line_time: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) log_text: std::option::Option<std::string::String>,
pub(crate) log_filter: std::option::Option<crate::model::LogFilter>,
pub(crate) metric_namespace: std::option::Option<std::string::String>,
pub(crate) metric_name: std::option::Option<std::string::String>,
pub(crate) unit: std::option::Option<std::string::String>,
pub(crate) value: std::option::Option<f64>,
pub(crate) cloud_watch_event_id: std::option::Option<std::string::String>,
pub(crate) cloud_watch_event_source:
std::option::Option<crate::model::CloudWatchEventSource>,
pub(crate) cloud_watch_event_detail_type: std::option::Option<std::string::String>,
pub(crate) health_event_arn: std::option::Option<std::string::String>,
pub(crate) health_service: std::option::Option<std::string::String>,
pub(crate) health_event_type_code: std::option::Option<std::string::String>,
pub(crate) health_event_type_category: std::option::Option<std::string::String>,
pub(crate) health_event_description: std::option::Option<std::string::String>,
pub(crate) code_deploy_deployment_id: std::option::Option<std::string::String>,
pub(crate) code_deploy_deployment_group: std::option::Option<std::string::String>,
pub(crate) code_deploy_state: std::option::Option<std::string::String>,
pub(crate) code_deploy_application: std::option::Option<std::string::String>,
pub(crate) code_deploy_instance_group_id: std::option::Option<std::string::String>,
pub(crate) ec2_state: std::option::Option<std::string::String>,
pub(crate) rds_event_categories: std::option::Option<std::string::String>,
pub(crate) rds_event_message: std::option::Option<std::string::String>,
pub(crate) s3_event_name: std::option::Option<std::string::String>,
pub(crate) states_execution_arn: std::option::Option<std::string::String>,
pub(crate) states_arn: std::option::Option<std::string::String>,
pub(crate) states_status: std::option::Option<std::string::String>,
pub(crate) states_input: std::option::Option<std::string::String>,
pub(crate) ebs_event: std::option::Option<std::string::String>,
pub(crate) ebs_result: std::option::Option<std::string::String>,
pub(crate) ebs_cause: std::option::Option<std::string::String>,
pub(crate) ebs_request_id: std::option::Option<std::string::String>,
pub(crate) x_ray_fault_percent: std::option::Option<i32>,
pub(crate) x_ray_throttle_percent: std::option::Option<i32>,
pub(crate) x_ray_error_percent: std::option::Option<i32>,
pub(crate) x_ray_request_count: std::option::Option<i32>,
pub(crate) x_ray_request_average_latency: std::option::Option<i64>,
pub(crate) x_ray_node_name: std::option::Option<std::string::String>,
pub(crate) x_ray_node_type: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The ID of the observation type.</p>
pub fn id(mut self, input: impl Into<std::string::String>) -> Self {
self.id = Some(input.into());
self
}
/// <p>The ID of the observation type.</p>
pub fn set_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.id = input;
self
}
/// <p>The time when the observation was first detected, in epoch seconds.</p>
pub fn start_time(mut self, input: aws_smithy_types::DateTime) -> Self {
self.start_time = Some(input);
self
}
/// <p>The time when the observation was first detected, in epoch seconds.</p>
pub fn set_start_time(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.start_time = input;
self
}
/// <p>The time when the observation ended, in epoch seconds.</p>
pub fn end_time(mut self, input: aws_smithy_types::DateTime) -> Self {
self.end_time = Some(input);
self
}
/// <p>The time when the observation ended, in epoch seconds.</p>
pub fn set_end_time(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.end_time = input;
self
}
/// <p>The source type of the observation.</p>
pub fn source_type(mut self, input: impl Into<std::string::String>) -> Self {
self.source_type = Some(input.into());
self
}
/// <p>The source type of the observation.</p>
pub fn set_source_type(mut self, input: std::option::Option<std::string::String>) -> Self {
self.source_type = input;
self
}
/// <p>The source resource ARN of the observation.</p>
pub fn source_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.source_arn = Some(input.into());
self
}
/// <p>The source resource ARN of the observation.</p>
pub fn set_source_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.source_arn = input;
self
}
/// <p>The log group name.</p>
pub fn log_group(mut self, input: impl Into<std::string::String>) -> Self {
self.log_group = Some(input.into());
self
}
/// <p>The log group name.</p>
pub fn set_log_group(mut self, input: std::option::Option<std::string::String>) -> Self {
self.log_group = input;
self
}
/// <p>The timestamp in the CloudWatch Logs that specifies when the matched line occurred.</p>
pub fn line_time(mut self, input: aws_smithy_types::DateTime) -> Self {
self.line_time = Some(input);
self
}
/// <p>The timestamp in the CloudWatch Logs that specifies when the matched line occurred.</p>
pub fn set_line_time(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.line_time = input;
self
}
/// <p>The log text of the observation.</p>
pub fn log_text(mut self, input: impl Into<std::string::String>) -> Self {
self.log_text = Some(input.into());
self
}
/// <p>The log text of the observation.</p>
pub fn set_log_text(mut self, input: std::option::Option<std::string::String>) -> Self {
self.log_text = input;
self
}
/// <p>The log filter of the observation.</p>
pub fn log_filter(mut self, input: crate::model::LogFilter) -> Self {
self.log_filter = Some(input);
self
}
/// <p>The log filter of the observation.</p>
pub fn set_log_filter(
mut self,
input: std::option::Option<crate::model::LogFilter>,
) -> Self {
self.log_filter = input;
self
}
/// <p>The namespace of the observation metric.</p>
pub fn metric_namespace(mut self, input: impl Into<std::string::String>) -> Self {
self.metric_namespace = Some(input.into());
self
}
/// <p>The namespace of the observation metric.</p>
pub fn set_metric_namespace(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.metric_namespace = input;
self
}
/// <p>The name of the observation metric.</p>
pub fn metric_name(mut self, input: impl Into<std::string::String>) -> Self {
self.metric_name = Some(input.into());
self
}
/// <p>The name of the observation metric.</p>
pub fn set_metric_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.metric_name = input;
self
}
/// <p>The unit of the source observation metric.</p>
pub fn unit(mut self, input: impl Into<std::string::String>) -> Self {
self.unit = Some(input.into());
self
}
/// <p>The unit of the source observation metric.</p>
pub fn set_unit(mut self, input: std::option::Option<std::string::String>) -> Self {
self.unit = input;
self
}
/// <p>The value of the source observation metric.</p>
pub fn value(mut self, input: f64) -> Self {
self.value = Some(input);
self
}
/// <p>The value of the source observation metric.</p>
pub fn set_value(mut self, input: std::option::Option<f64>) -> Self {
self.value = input;
self
}
/// <p> The ID of the CloudWatch Event-based observation related to the detected problem. </p>
pub fn cloud_watch_event_id(mut self, input: impl Into<std::string::String>) -> Self {
self.cloud_watch_event_id = Some(input.into());
self
}
/// <p> The ID of the CloudWatch Event-based observation related to the detected problem. </p>
pub fn set_cloud_watch_event_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.cloud_watch_event_id = input;
self
}
/// <p> The source of the CloudWatch Event. </p>
pub fn cloud_watch_event_source(
mut self,
input: crate::model::CloudWatchEventSource,
) -> Self {
self.cloud_watch_event_source = Some(input);
self
}
/// <p> The source of the CloudWatch Event. </p>
pub fn set_cloud_watch_event_source(
mut self,
input: std::option::Option<crate::model::CloudWatchEventSource>,
) -> Self {
self.cloud_watch_event_source = input;
self
}
/// <p> The detail type of the CloudWatch Event-based observation, for example, <code>EC2 Instance State-change Notification</code>. </p>
pub fn cloud_watch_event_detail_type(
mut self,
input: impl Into<std::string::String>,
) -> Self {
self.cloud_watch_event_detail_type = Some(input.into());
self
}
/// <p> The detail type of the CloudWatch Event-based observation, for example, <code>EC2 Instance State-change Notification</code>. </p>
pub fn set_cloud_watch_event_detail_type(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.cloud_watch_event_detail_type = input;
self
}
/// <p> The Amazon Resource Name (ARN) of the AWS Health Event-based observation.</p>
pub fn health_event_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.health_event_arn = Some(input.into());
self
}
/// <p> The Amazon Resource Name (ARN) of the AWS Health Event-based observation.</p>
pub fn set_health_event_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.health_event_arn = input;
self
}
/// <p> The service to which the AWS Health Event belongs, such as EC2. </p>
pub fn health_service(mut self, input: impl Into<std::string::String>) -> Self {
self.health_service = Some(input.into());
self
}
/// <p> The service to which the AWS Health Event belongs, such as EC2. </p>
pub fn set_health_service(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.health_service = input;
self
}
/// <p> The type of the AWS Health event, for example, <code>AWS_EC2_POWER_CONNECTIVITY_ISSUE</code>. </p>
pub fn health_event_type_code(mut self, input: impl Into<std::string::String>) -> Self {
self.health_event_type_code = Some(input.into());
self
}
/// <p> The type of the AWS Health event, for example, <code>AWS_EC2_POWER_CONNECTIVITY_ISSUE</code>. </p>
pub fn set_health_event_type_code(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.health_event_type_code = input;
self
}
/// <p> The category of the AWS Health event, such as <code>issue</code>. </p>
pub fn health_event_type_category(mut self, input: impl Into<std::string::String>) -> Self {
self.health_event_type_category = Some(input.into());
self
}
/// <p> The category of the AWS Health event, such as <code>issue</code>. </p>
pub fn set_health_event_type_category(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.health_event_type_category = input;
self
}
/// <p> The description of the AWS Health event provided by the service, such as Amazon EC2. </p>
pub fn health_event_description(mut self, input: impl Into<std::string::String>) -> Self {
self.health_event_description = Some(input.into());
self
}
/// <p> The description of the AWS Health event provided by the service, such as Amazon EC2. </p>
pub fn set_health_event_description(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.health_event_description = input;
self
}
/// <p> The deployment ID of the CodeDeploy-based observation related to the detected problem. </p>
pub fn code_deploy_deployment_id(mut self, input: impl Into<std::string::String>) -> Self {
self.code_deploy_deployment_id = Some(input.into());
self
}
/// <p> The deployment ID of the CodeDeploy-based observation related to the detected problem. </p>
pub fn set_code_deploy_deployment_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.code_deploy_deployment_id = input;
self
}
/// <p> The deployment group to which the CodeDeploy deployment belongs. </p>
pub fn code_deploy_deployment_group(
mut self,
input: impl Into<std::string::String>,
) -> Self {
self.code_deploy_deployment_group = Some(input.into());
self
}
/// <p> The deployment group to which the CodeDeploy deployment belongs. </p>
pub fn set_code_deploy_deployment_group(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.code_deploy_deployment_group = input;
self
}
/// <p> The status of the CodeDeploy deployment, for example <code>SUCCESS</code> or <code> FAILURE</code>. </p>
pub fn code_deploy_state(mut self, input: impl Into<std::string::String>) -> Self {
self.code_deploy_state = Some(input.into());
self
}
/// <p> The status of the CodeDeploy deployment, for example <code>SUCCESS</code> or <code> FAILURE</code>. </p>
pub fn set_code_deploy_state(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.code_deploy_state = input;
self
}
/// <p> The CodeDeploy application to which the deployment belongs. </p>
pub fn code_deploy_application(mut self, input: impl Into<std::string::String>) -> Self {
self.code_deploy_application = Some(input.into());
self
}
/// <p> The CodeDeploy application to which the deployment belongs. </p>
pub fn set_code_deploy_application(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.code_deploy_application = input;
self
}
/// <p> The instance group to which the CodeDeploy instance belongs. </p>
pub fn code_deploy_instance_group_id(
mut self,
input: impl Into<std::string::String>,
) -> Self {
self.code_deploy_instance_group_id = Some(input.into());
self
}
/// <p> The instance group to which the CodeDeploy instance belongs. </p>
pub fn set_code_deploy_instance_group_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.code_deploy_instance_group_id = input;
self
}
/// <p> The state of the instance, such as <code>STOPPING</code> or <code>TERMINATING</code>. </p>
pub fn ec2_state(mut self, input: impl Into<std::string::String>) -> Self {
self.ec2_state = Some(input.into());
self
}
/// <p> The state of the instance, such as <code>STOPPING</code> or <code>TERMINATING</code>. </p>
pub fn set_ec2_state(mut self, input: std::option::Option<std::string::String>) -> Self {
self.ec2_state = input;
self
}
/// <p> The category of an RDS event. </p>
pub fn rds_event_categories(mut self, input: impl Into<std::string::String>) -> Self {
self.rds_event_categories = Some(input.into());
self
}
/// <p> The category of an RDS event. </p>
pub fn set_rds_event_categories(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.rds_event_categories = input;
self
}
/// <p> The message of an RDS event. </p>
pub fn rds_event_message(mut self, input: impl Into<std::string::String>) -> Self {
self.rds_event_message = Some(input.into());
self
}
/// <p> The message of an RDS event. </p>
pub fn set_rds_event_message(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.rds_event_message = input;
self
}
/// <p> The name of the S3 CloudWatch Event-based observation. </p>
pub fn s3_event_name(mut self, input: impl Into<std::string::String>) -> Self {
self.s3_event_name = Some(input.into());
self
}
/// <p> The name of the S3 CloudWatch Event-based observation. </p>
pub fn set_s3_event_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.s3_event_name = input;
self
}
/// <p> The Amazon Resource Name (ARN) of the step function execution-based observation. </p>
pub fn states_execution_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.states_execution_arn = Some(input.into());
self
}
/// <p> The Amazon Resource Name (ARN) of the step function execution-based observation. </p>
pub fn set_states_execution_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.states_execution_arn = input;
self
}
/// <p> The Amazon Resource Name (ARN) of the step function-based observation. </p>
pub fn states_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.states_arn = Some(input.into());
self
}
/// <p> The Amazon Resource Name (ARN) of the step function-based observation. </p>
pub fn set_states_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.states_arn = input;
self
}
/// <p> The status of the step function-related observation. </p>
pub fn states_status(mut self, input: impl Into<std::string::String>) -> Self {
self.states_status = Some(input.into());
self
}
/// <p> The status of the step function-related observation. </p>
pub fn set_states_status(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.states_status = input;
self
}
/// <p> The input to the step function-based observation. </p>
pub fn states_input(mut self, input: impl Into<std::string::String>) -> Self {
self.states_input = Some(input.into());
self
}
/// <p> The input to the step function-based observation. </p>
pub fn set_states_input(mut self, input: std::option::Option<std::string::String>) -> Self {
self.states_input = input;
self
}
/// <p> The type of EBS CloudWatch event, such as <code>createVolume</code>, <code>deleteVolume</code> or <code>attachVolume</code>. </p>
pub fn ebs_event(mut self, input: impl Into<std::string::String>) -> Self {
self.ebs_event = Some(input.into());
self
}
/// <p> The type of EBS CloudWatch event, such as <code>createVolume</code>, <code>deleteVolume</code> or <code>attachVolume</code>. </p>
pub fn set_ebs_event(mut self, input: std::option::Option<std::string::String>) -> Self {
self.ebs_event = input;
self
}
/// <p> The result of an EBS CloudWatch event, such as <code>failed</code> or <code>succeeded</code>. </p>
pub fn ebs_result(mut self, input: impl Into<std::string::String>) -> Self {
self.ebs_result = Some(input.into());
self
}
/// <p> The result of an EBS CloudWatch event, such as <code>failed</code> or <code>succeeded</code>. </p>
pub fn set_ebs_result(mut self, input: std::option::Option<std::string::String>) -> Self {
self.ebs_result = input;
self
}
/// <p> The cause of an EBS CloudWatch event. </p>
pub fn ebs_cause(mut self, input: impl Into<std::string::String>) -> Self {
self.ebs_cause = Some(input.into());
self
}
/// <p> The cause of an EBS CloudWatch event. </p>
pub fn set_ebs_cause(mut self, input: std::option::Option<std::string::String>) -> Self {
self.ebs_cause = input;
self
}
/// <p> The request ID of an EBS CloudWatch event. </p>
pub fn ebs_request_id(mut self, input: impl Into<std::string::String>) -> Self {
self.ebs_request_id = Some(input.into());
self
}
/// <p> The request ID of an EBS CloudWatch event. </p>
pub fn set_ebs_request_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.ebs_request_id = input;
self
}
/// <p> The X-Ray request fault percentage for this node. </p>
pub fn x_ray_fault_percent(mut self, input: i32) -> Self {
self.x_ray_fault_percent = Some(input);
self
}
/// <p> The X-Ray request fault percentage for this node. </p>
pub fn set_x_ray_fault_percent(mut self, input: std::option::Option<i32>) -> Self {
self.x_ray_fault_percent = input;
self
}
/// <p> The X-Ray request throttle percentage for this node. </p>
pub fn x_ray_throttle_percent(mut self, input: i32) -> Self {
self.x_ray_throttle_percent = Some(input);
self
}
/// <p> The X-Ray request throttle percentage for this node. </p>
pub fn set_x_ray_throttle_percent(mut self, input: std::option::Option<i32>) -> Self {
self.x_ray_throttle_percent = input;
self
}
/// <p> The X-Ray request error percentage for this node. </p>
pub fn x_ray_error_percent(mut self, input: i32) -> Self {
self.x_ray_error_percent = Some(input);
self
}
/// <p> The X-Ray request error percentage for this node. </p>
pub fn set_x_ray_error_percent(mut self, input: std::option::Option<i32>) -> Self {
self.x_ray_error_percent = input;
self
}
/// <p> The X-Ray request count for this node. </p>
pub fn x_ray_request_count(mut self, input: i32) -> Self {
self.x_ray_request_count = Some(input);
self
}
/// <p> The X-Ray request count for this node. </p>
pub fn set_x_ray_request_count(mut self, input: std::option::Option<i32>) -> Self {
self.x_ray_request_count = input;
self
}
/// <p> The X-Ray node request average latency for this node. </p>
pub fn x_ray_request_average_latency(mut self, input: i64) -> Self {
self.x_ray_request_average_latency = Some(input);
self
}
/// <p> The X-Ray node request average latency for this node. </p>
pub fn set_x_ray_request_average_latency(
mut self,
input: std::option::Option<i64>,
) -> Self {
self.x_ray_request_average_latency = input;
self
}
/// <p> The name of the X-Ray node. </p>
pub fn x_ray_node_name(mut self, input: impl Into<std::string::String>) -> Self {
self.x_ray_node_name = Some(input.into());
self
}
/// <p> The name of the X-Ray node. </p>
pub fn set_x_ray_node_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.x_ray_node_name = input;
self
}
/// <p> The type of the X-Ray node. </p>
pub fn x_ray_node_type(mut self, input: impl Into<std::string::String>) -> Self {
self.x_ray_node_type = Some(input.into());
self
}
/// <p> The type of the X-Ray node. </p>
pub fn set_x_ray_node_type(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.x_ray_node_type = input;
self
}
/// Consumes the builder and constructs a [`Observation`](crate::model::Observation).
pub fn build(self) -> crate::model::Observation {
crate::model::Observation {
id: self.id,
start_time: self.start_time,
end_time: self.end_time,
source_type: self.source_type,
source_arn: self.source_arn,
log_group: self.log_group,
line_time: self.line_time,
log_text: self.log_text,
log_filter: self.log_filter,
metric_namespace: self.metric_namespace,
metric_name: self.metric_name,
unit: self.unit,
value: self.value,
cloud_watch_event_id: self.cloud_watch_event_id,
cloud_watch_event_source: self.cloud_watch_event_source,
cloud_watch_event_detail_type: self.cloud_watch_event_detail_type,
health_event_arn: self.health_event_arn,
health_service: self.health_service,
health_event_type_code: self.health_event_type_code,
health_event_type_category: self.health_event_type_category,
health_event_description: self.health_event_description,
code_deploy_deployment_id: self.code_deploy_deployment_id,
code_deploy_deployment_group: self.code_deploy_deployment_group,
code_deploy_state: self.code_deploy_state,
code_deploy_application: self.code_deploy_application,
code_deploy_instance_group_id: self.code_deploy_instance_group_id,
ec2_state: self.ec2_state,
rds_event_categories: self.rds_event_categories,
rds_event_message: self.rds_event_message,
s3_event_name: self.s3_event_name,
states_execution_arn: self.states_execution_arn,
states_arn: self.states_arn,
states_status: self.states_status,
states_input: self.states_input,
ebs_event: self.ebs_event,
ebs_result: self.ebs_result,
ebs_cause: self.ebs_cause,
ebs_request_id: self.ebs_request_id,
x_ray_fault_percent: self.x_ray_fault_percent,
x_ray_throttle_percent: self.x_ray_throttle_percent,
x_ray_error_percent: self.x_ray_error_percent,
x_ray_request_count: self.x_ray_request_count,
x_ray_request_average_latency: self.x_ray_request_average_latency,
x_ray_node_name: self.x_ray_node_name,
x_ray_node_type: self.x_ray_node_type,
}
}
}
}
impl Observation {
/// Creates a new builder-style object to manufacture [`Observation`](crate::model::Observation).
pub fn builder() -> crate::model::observation::Builder {
crate::model::observation::Builder::default()
}
}
/// When writing a match expression against `CloudWatchEventSource`, 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 cloudwatcheventsource = unimplemented!();
/// match cloudwatcheventsource {
/// CloudWatchEventSource::CodeDeploy => { /* ... */ },
/// CloudWatchEventSource::Ec2 => { /* ... */ },
/// CloudWatchEventSource::Health => { /* ... */ },
/// CloudWatchEventSource::Rds => { /* ... */ },
/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
/// _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `cloudwatcheventsource` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `CloudWatchEventSource::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `CloudWatchEventSource::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 `CloudWatchEventSource::NewFeature` is defined.
/// Specifically, when `cloudwatcheventsource` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `CloudWatchEventSource::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 CloudWatchEventSource {
#[allow(missing_docs)] // documentation missing in model
CodeDeploy,
#[allow(missing_docs)] // documentation missing in model
Ec2,
#[allow(missing_docs)] // documentation missing in model
Health,
#[allow(missing_docs)] // documentation missing in model
Rds,
/// `Unknown` contains new variants that have been added since this code was generated.
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for CloudWatchEventSource {
fn from(s: &str) -> Self {
match s {
"CODE_DEPLOY" => CloudWatchEventSource::CodeDeploy,
"EC2" => CloudWatchEventSource::Ec2,
"HEALTH" => CloudWatchEventSource::Health,
"RDS" => CloudWatchEventSource::Rds,
other => {
CloudWatchEventSource::Unknown(crate::types::UnknownVariantValue(other.to_owned()))
}
}
}
}
impl std::str::FromStr for CloudWatchEventSource {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(CloudWatchEventSource::from(s))
}
}
impl CloudWatchEventSource {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
CloudWatchEventSource::CodeDeploy => "CODE_DEPLOY",
CloudWatchEventSource::Ec2 => "EC2",
CloudWatchEventSource::Health => "HEALTH",
CloudWatchEventSource::Rds => "RDS",
CloudWatchEventSource::Unknown(value) => value.as_str(),
}
}
/// Returns all the `&str` values of the enum members.
pub const fn values() -> &'static [&'static str] {
&["CODE_DEPLOY", "EC2", "HEALTH", "RDS"]
}
}
impl AsRef<str> for CloudWatchEventSource {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// When writing a match expression against `LogFilter`, 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 logfilter = unimplemented!();
/// match logfilter {
/// LogFilter::Error => { /* ... */ },
/// LogFilter::Info => { /* ... */ },
/// LogFilter::Warn => { /* ... */ },
/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
/// _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `logfilter` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `LogFilter::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `LogFilter::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 `LogFilter::NewFeature` is defined.
/// Specifically, when `logfilter` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `LogFilter::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 LogFilter {
#[allow(missing_docs)] // documentation missing in model
Error,
#[allow(missing_docs)] // documentation missing in model
Info,
#[allow(missing_docs)] // documentation missing in model
Warn,
/// `Unknown` contains new variants that have been added since this code was generated.
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for LogFilter {
fn from(s: &str) -> Self {
match s {
"ERROR" => LogFilter::Error,
"INFO" => LogFilter::Info,
"WARN" => LogFilter::Warn,
other => LogFilter::Unknown(crate::types::UnknownVariantValue(other.to_owned())),
}
}
}
impl std::str::FromStr for LogFilter {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(LogFilter::from(s))
}
}
impl LogFilter {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
LogFilter::Error => "ERROR",
LogFilter::Info => "INFO",
LogFilter::Warn => "WARN",
LogFilter::Unknown(value) => value.as_str(),
}
}
/// Returns all the `&str` values of the enum members.
pub const fn values() -> &'static [&'static str] {
&["ERROR", "INFO", "WARN"]
}
}
impl AsRef<str> for LogFilter {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// When writing a match expression against `GroupingType`, 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 groupingtype = unimplemented!();
/// match groupingtype {
/// GroupingType::AccountBased => { /* ... */ },
/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
/// _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `groupingtype` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `GroupingType::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `GroupingType::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 `GroupingType::NewFeature` is defined.
/// Specifically, when `groupingtype` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `GroupingType::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 GroupingType {
#[allow(missing_docs)] // documentation missing in model
AccountBased,
/// `Unknown` contains new variants that have been added since this code was generated.
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for GroupingType {
fn from(s: &str) -> Self {
match s {
"ACCOUNT_BASED" => GroupingType::AccountBased,
other => GroupingType::Unknown(crate::types::UnknownVariantValue(other.to_owned())),
}
}
}
impl std::str::FromStr for GroupingType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(GroupingType::from(s))
}
}
impl GroupingType {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
GroupingType::AccountBased => "ACCOUNT_BASED",
GroupingType::Unknown(value) => value.as_str(),
}
}
/// Returns all the `&str` values of the enum members.
pub const fn values() -> &'static [&'static str] {
&["ACCOUNT_BASED"]
}
}
impl AsRef<str> for GroupingType {
fn as_ref(&self) -> &str {
self.as_str()
}
}