1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>A key-value pair associated with a CloudWatch resource.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct Tag {
/// <p>A string that you can use to assign a value. The combination of tag keys and values can help you organize and categorize your resources.</p>
pub key: std::option::Option<std::string::String>,
/// <p>The value for the specified tag key.</p>
pub value: std::option::Option<std::string::String>,
}
impl Tag {
/// <p>A string that you can use to assign a value. The combination of tag keys and values can help you organize and categorize your resources.</p>
pub fn key(&self) -> std::option::Option<&str> {
self.key.as_deref()
}
/// <p>The value for the specified tag key.</p>
pub fn value(&self) -> std::option::Option<&str> {
self.value.as_deref()
}
}
impl std::fmt::Debug for Tag {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Tag");
formatter.field("key", &self.key);
formatter.field("value", &self.value);
formatter.finish()
}
}
/// See [`Tag`](crate::model::Tag)
pub mod tag {
/// A builder for [`Tag`](crate::model::Tag)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, 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>A string that you can use to assign a value. The combination of tag keys and values can help you organize and categorize your resources.</p>
pub fn key(mut self, input: impl Into<std::string::String>) -> Self {
self.key = Some(input.into());
self
}
/// <p>A string that you can use to assign a value. The combination of tag keys and values can help you organize and categorize your resources.</p>
pub fn set_key(mut self, input: std::option::Option<std::string::String>) -> Self {
self.key = input;
self
}
/// <p>The value for the specified tag key.</p>
pub fn value(mut self, input: impl Into<std::string::String>) -> Self {
self.value = Some(input.into());
self
}
/// <p>The value for the specified tag key.</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()
}
}
#[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 StateValue {
#[allow(missing_docs)] // documentation missing in model
Alarm,
#[allow(missing_docs)] // documentation missing in model
InsufficientData,
#[allow(missing_docs)] // documentation missing in model
Ok,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for StateValue {
fn from(s: &str) -> Self {
match s {
"ALARM" => StateValue::Alarm,
"INSUFFICIENT_DATA" => StateValue::InsufficientData,
"OK" => StateValue::Ok,
other => StateValue::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for StateValue {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(StateValue::from(s))
}
}
impl StateValue {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
StateValue::Alarm => "ALARM",
StateValue::InsufficientData => "INSUFFICIENT_DATA",
StateValue::Ok => "OK",
StateValue::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&["ALARM", "INSUFFICIENT_DATA", "OK"]
}
}
impl AsRef<str> for StateValue {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>By default, a metric stream always sends the <code>MAX</code>, <code>MIN</code>, <code>SUM</code>, and <code>SAMPLECOUNT</code> statistics for each metric that is streamed. This structure contains information for one metric that includes additional statistics in the stream. For more information about statistics, see CloudWatch, listed in <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Statistics-definitions.html.html"> CloudWatch statistics definitions</a>.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct MetricStreamStatisticsConfiguration {
/// <p>An array of metric name and namespace pairs that stream the additional statistics listed in the value of the <code>AdditionalStatistics</code> parameter. There can be as many as 100 pairs in the array.</p>
/// <p>All metrics that match the combination of metric name and namespace will be streamed with the additional statistics, no matter their dimensions.</p>
pub include_metrics:
std::option::Option<std::vec::Vec<crate::model::MetricStreamStatisticsMetric>>,
/// <p>The list of additional statistics that are to be streamed for the metrics listed in the <code>IncludeMetrics</code> array in this structure. This list can include as many as 20 statistics.</p>
/// <p>If the <code>OutputFormat</code> for the stream is <code>opentelemetry0.7</code>, the only valid values are <code>p<i>??</i> </code> percentile statistics such as <code>p90</code>, <code>p99</code> and so on.</p>
/// <p>If the <code>OutputFormat</code> for the stream is <code>json</code>, the valid values include the abbreviations for all of the statistics listed in <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Statistics-definitions.html.html"> CloudWatch statistics definitions</a>. For example, this includes <code>tm98, </code> <code>wm90</code>, <code>PR(:300)</code>, and so on.</p>
pub additional_statistics: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl MetricStreamStatisticsConfiguration {
/// <p>An array of metric name and namespace pairs that stream the additional statistics listed in the value of the <code>AdditionalStatistics</code> parameter. There can be as many as 100 pairs in the array.</p>
/// <p>All metrics that match the combination of metric name and namespace will be streamed with the additional statistics, no matter their dimensions.</p>
pub fn include_metrics(
&self,
) -> std::option::Option<&[crate::model::MetricStreamStatisticsMetric]> {
self.include_metrics.as_deref()
}
/// <p>The list of additional statistics that are to be streamed for the metrics listed in the <code>IncludeMetrics</code> array in this structure. This list can include as many as 20 statistics.</p>
/// <p>If the <code>OutputFormat</code> for the stream is <code>opentelemetry0.7</code>, the only valid values are <code>p<i>??</i> </code> percentile statistics such as <code>p90</code>, <code>p99</code> and so on.</p>
/// <p>If the <code>OutputFormat</code> for the stream is <code>json</code>, the valid values include the abbreviations for all of the statistics listed in <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Statistics-definitions.html.html"> CloudWatch statistics definitions</a>. For example, this includes <code>tm98, </code> <code>wm90</code>, <code>PR(:300)</code>, and so on.</p>
pub fn additional_statistics(&self) -> std::option::Option<&[std::string::String]> {
self.additional_statistics.as_deref()
}
}
impl std::fmt::Debug for MetricStreamStatisticsConfiguration {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("MetricStreamStatisticsConfiguration");
formatter.field("include_metrics", &self.include_metrics);
formatter.field("additional_statistics", &self.additional_statistics);
formatter.finish()
}
}
/// See [`MetricStreamStatisticsConfiguration`](crate::model::MetricStreamStatisticsConfiguration)
pub mod metric_stream_statistics_configuration {
/// A builder for [`MetricStreamStatisticsConfiguration`](crate::model::MetricStreamStatisticsConfiguration)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) include_metrics:
std::option::Option<std::vec::Vec<crate::model::MetricStreamStatisticsMetric>>,
pub(crate) additional_statistics: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl Builder {
/// Appends an item to `include_metrics`.
///
/// To override the contents of this collection use [`set_include_metrics`](Self::set_include_metrics).
///
/// <p>An array of metric name and namespace pairs that stream the additional statistics listed in the value of the <code>AdditionalStatistics</code> parameter. There can be as many as 100 pairs in the array.</p>
/// <p>All metrics that match the combination of metric name and namespace will be streamed with the additional statistics, no matter their dimensions.</p>
pub fn include_metrics(
mut self,
input: crate::model::MetricStreamStatisticsMetric,
) -> Self {
let mut v = self.include_metrics.unwrap_or_default();
v.push(input);
self.include_metrics = Some(v);
self
}
/// <p>An array of metric name and namespace pairs that stream the additional statistics listed in the value of the <code>AdditionalStatistics</code> parameter. There can be as many as 100 pairs in the array.</p>
/// <p>All metrics that match the combination of metric name and namespace will be streamed with the additional statistics, no matter their dimensions.</p>
pub fn set_include_metrics(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::MetricStreamStatisticsMetric>>,
) -> Self {
self.include_metrics = input;
self
}
/// Appends an item to `additional_statistics`.
///
/// To override the contents of this collection use [`set_additional_statistics`](Self::set_additional_statistics).
///
/// <p>The list of additional statistics that are to be streamed for the metrics listed in the <code>IncludeMetrics</code> array in this structure. This list can include as many as 20 statistics.</p>
/// <p>If the <code>OutputFormat</code> for the stream is <code>opentelemetry0.7</code>, the only valid values are <code>p<i>??</i> </code> percentile statistics such as <code>p90</code>, <code>p99</code> and so on.</p>
/// <p>If the <code>OutputFormat</code> for the stream is <code>json</code>, the valid values include the abbreviations for all of the statistics listed in <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Statistics-definitions.html.html"> CloudWatch statistics definitions</a>. For example, this includes <code>tm98, </code> <code>wm90</code>, <code>PR(:300)</code>, and so on.</p>
pub fn additional_statistics(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.additional_statistics.unwrap_or_default();
v.push(input.into());
self.additional_statistics = Some(v);
self
}
/// <p>The list of additional statistics that are to be streamed for the metrics listed in the <code>IncludeMetrics</code> array in this structure. This list can include as many as 20 statistics.</p>
/// <p>If the <code>OutputFormat</code> for the stream is <code>opentelemetry0.7</code>, the only valid values are <code>p<i>??</i> </code> percentile statistics such as <code>p90</code>, <code>p99</code> and so on.</p>
/// <p>If the <code>OutputFormat</code> for the stream is <code>json</code>, the valid values include the abbreviations for all of the statistics listed in <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Statistics-definitions.html.html"> CloudWatch statistics definitions</a>. For example, this includes <code>tm98, </code> <code>wm90</code>, <code>PR(:300)</code>, and so on.</p>
pub fn set_additional_statistics(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.additional_statistics = input;
self
}
/// Consumes the builder and constructs a [`MetricStreamStatisticsConfiguration`](crate::model::MetricStreamStatisticsConfiguration)
pub fn build(self) -> crate::model::MetricStreamStatisticsConfiguration {
crate::model::MetricStreamStatisticsConfiguration {
include_metrics: self.include_metrics,
additional_statistics: self.additional_statistics,
}
}
}
}
impl MetricStreamStatisticsConfiguration {
/// Creates a new builder-style object to manufacture [`MetricStreamStatisticsConfiguration`](crate::model::MetricStreamStatisticsConfiguration)
pub fn builder() -> crate::model::metric_stream_statistics_configuration::Builder {
crate::model::metric_stream_statistics_configuration::Builder::default()
}
}
/// <p>This object contains the information for one metric that is to be streamed with additional statistics.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct MetricStreamStatisticsMetric {
/// <p>The namespace of the metric.</p>
pub namespace: std::option::Option<std::string::String>,
/// <p>The name of the metric.</p>
pub metric_name: std::option::Option<std::string::String>,
}
impl MetricStreamStatisticsMetric {
/// <p>The namespace of the metric.</p>
pub fn namespace(&self) -> std::option::Option<&str> {
self.namespace.as_deref()
}
/// <p>The name of the metric.</p>
pub fn metric_name(&self) -> std::option::Option<&str> {
self.metric_name.as_deref()
}
}
impl std::fmt::Debug for MetricStreamStatisticsMetric {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("MetricStreamStatisticsMetric");
formatter.field("namespace", &self.namespace);
formatter.field("metric_name", &self.metric_name);
formatter.finish()
}
}
/// See [`MetricStreamStatisticsMetric`](crate::model::MetricStreamStatisticsMetric)
pub mod metric_stream_statistics_metric {
/// A builder for [`MetricStreamStatisticsMetric`](crate::model::MetricStreamStatisticsMetric)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) namespace: std::option::Option<std::string::String>,
pub(crate) metric_name: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The namespace of the metric.</p>
pub fn namespace(mut self, input: impl Into<std::string::String>) -> Self {
self.namespace = Some(input.into());
self
}
/// <p>The namespace of the metric.</p>
pub fn set_namespace(mut self, input: std::option::Option<std::string::String>) -> Self {
self.namespace = input;
self
}
/// <p>The name of the 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 metric.</p>
pub fn set_metric_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.metric_name = input;
self
}
/// Consumes the builder and constructs a [`MetricStreamStatisticsMetric`](crate::model::MetricStreamStatisticsMetric)
pub fn build(self) -> crate::model::MetricStreamStatisticsMetric {
crate::model::MetricStreamStatisticsMetric {
namespace: self.namespace,
metric_name: self.metric_name,
}
}
}
}
impl MetricStreamStatisticsMetric {
/// Creates a new builder-style object to manufacture [`MetricStreamStatisticsMetric`](crate::model::MetricStreamStatisticsMetric)
pub fn builder() -> crate::model::metric_stream_statistics_metric::Builder {
crate::model::metric_stream_statistics_metric::Builder::default()
}
}
#[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 MetricStreamOutputFormat {
#[allow(missing_docs)] // documentation missing in model
Json,
#[allow(missing_docs)] // documentation missing in model
OpenTelemetry07,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for MetricStreamOutputFormat {
fn from(s: &str) -> Self {
match s {
"json" => MetricStreamOutputFormat::Json,
"opentelemetry0.7" => MetricStreamOutputFormat::OpenTelemetry07,
other => MetricStreamOutputFormat::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for MetricStreamOutputFormat {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(MetricStreamOutputFormat::from(s))
}
}
impl MetricStreamOutputFormat {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
MetricStreamOutputFormat::Json => "json",
MetricStreamOutputFormat::OpenTelemetry07 => "opentelemetry0.7",
MetricStreamOutputFormat::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&["json", "opentelemetry0.7"]
}
}
impl AsRef<str> for MetricStreamOutputFormat {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>This structure contains the name of one of the metric namespaces that is listed in a filter of a metric stream.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct MetricStreamFilter {
/// <p>The name of the metric namespace in the filter.</p>
pub namespace: std::option::Option<std::string::String>,
}
impl MetricStreamFilter {
/// <p>The name of the metric namespace in the filter.</p>
pub fn namespace(&self) -> std::option::Option<&str> {
self.namespace.as_deref()
}
}
impl std::fmt::Debug for MetricStreamFilter {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("MetricStreamFilter");
formatter.field("namespace", &self.namespace);
formatter.finish()
}
}
/// See [`MetricStreamFilter`](crate::model::MetricStreamFilter)
pub mod metric_stream_filter {
/// A builder for [`MetricStreamFilter`](crate::model::MetricStreamFilter)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) namespace: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The name of the metric namespace in the filter.</p>
pub fn namespace(mut self, input: impl Into<std::string::String>) -> Self {
self.namespace = Some(input.into());
self
}
/// <p>The name of the metric namespace in the filter.</p>
pub fn set_namespace(mut self, input: std::option::Option<std::string::String>) -> Self {
self.namespace = input;
self
}
/// Consumes the builder and constructs a [`MetricStreamFilter`](crate::model::MetricStreamFilter)
pub fn build(self) -> crate::model::MetricStreamFilter {
crate::model::MetricStreamFilter {
namespace: self.namespace,
}
}
}
}
impl MetricStreamFilter {
/// Creates a new builder-style object to manufacture [`MetricStreamFilter`](crate::model::MetricStreamFilter)
pub fn builder() -> crate::model::metric_stream_filter::Builder {
crate::model::metric_stream_filter::Builder::default()
}
}
/// <p>Encapsulates the information sent to either create a metric or add new values to be aggregated into an existing metric.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct MetricDatum {
/// <p>The name of the metric.</p>
pub metric_name: std::option::Option<std::string::String>,
/// <p>The dimensions associated with the metric.</p>
pub dimensions: std::option::Option<std::vec::Vec<crate::model::Dimension>>,
/// <p>The time the metric data was received, expressed as the number of milliseconds since Jan 1, 1970 00:00:00 UTC.</p>
pub timestamp: std::option::Option<aws_smithy_types::DateTime>,
/// <p>The value for the metric.</p>
/// <p>Although the parameter accepts numbers of type Double, CloudWatch rejects values that are either too small or too large. Values must be in the range of -2^360 to 2^360. In addition, special values (for example, NaN, +Infinity, -Infinity) are not supported.</p>
pub value: std::option::Option<f64>,
/// <p>The statistical values for the metric.</p>
pub statistic_values: std::option::Option<crate::model::StatisticSet>,
/// <p>Array of numbers representing the values for the metric during the period. Each unique value is listed just once in this array, and the corresponding number in the <code>Counts</code> array specifies the number of times that value occurred during the period. You can include up to 150 unique values in each <code>PutMetricData</code> action that specifies a <code>Values</code> array.</p>
/// <p>Although the <code>Values</code> array accepts numbers of type <code>Double</code>, CloudWatch rejects values that are either too small or too large. Values must be in the range of -2^360 to 2^360. In addition, special values (for example, NaN, +Infinity, -Infinity) are not supported.</p>
pub values: std::option::Option<std::vec::Vec<f64>>,
/// <p>Array of numbers that is used along with the <code>Values</code> array. Each number in the <code>Count</code> array is the number of times the corresponding value in the <code>Values</code> array occurred during the period. </p>
/// <p>If you omit the <code>Counts</code> array, the default of 1 is used as the value for each count. If you include a <code>Counts</code> array, it must include the same amount of values as the <code>Values</code> array.</p>
pub counts: std::option::Option<std::vec::Vec<f64>>,
/// <p>When you are using a <code>Put</code> operation, this defines what unit you want to use when storing the metric.</p>
/// <p>In a <code>Get</code> operation, this displays the unit that is used for the metric.</p>
pub unit: std::option::Option<crate::model::StandardUnit>,
/// <p>Valid values are 1 and 60. Setting this to 1 specifies this metric as a high-resolution metric, so that CloudWatch stores the metric with sub-minute resolution down to one second. Setting this to 60 specifies this metric as a regular-resolution metric, which CloudWatch stores at 1-minute resolution. Currently, high resolution is available only for custom metrics. For more information about high-resolution metrics, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/publishingMetrics.html#high-resolution-metrics">High-Resolution Metrics</a> in the <i>Amazon CloudWatch User Guide</i>. </p>
/// <p>This field is optional, if you do not specify it the default of 60 is used.</p>
pub storage_resolution: std::option::Option<i32>,
}
impl MetricDatum {
/// <p>The name of the metric.</p>
pub fn metric_name(&self) -> std::option::Option<&str> {
self.metric_name.as_deref()
}
/// <p>The dimensions associated with the metric.</p>
pub fn dimensions(&self) -> std::option::Option<&[crate::model::Dimension]> {
self.dimensions.as_deref()
}
/// <p>The time the metric data was received, expressed as the number of milliseconds since Jan 1, 1970 00:00:00 UTC.</p>
pub fn timestamp(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.timestamp.as_ref()
}
/// <p>The value for the metric.</p>
/// <p>Although the parameter accepts numbers of type Double, CloudWatch rejects values that are either too small or too large. Values must be in the range of -2^360 to 2^360. In addition, special values (for example, NaN, +Infinity, -Infinity) are not supported.</p>
pub fn value(&self) -> std::option::Option<f64> {
self.value
}
/// <p>The statistical values for the metric.</p>
pub fn statistic_values(&self) -> std::option::Option<&crate::model::StatisticSet> {
self.statistic_values.as_ref()
}
/// <p>Array of numbers representing the values for the metric during the period. Each unique value is listed just once in this array, and the corresponding number in the <code>Counts</code> array specifies the number of times that value occurred during the period. You can include up to 150 unique values in each <code>PutMetricData</code> action that specifies a <code>Values</code> array.</p>
/// <p>Although the <code>Values</code> array accepts numbers of type <code>Double</code>, CloudWatch rejects values that are either too small or too large. Values must be in the range of -2^360 to 2^360. In addition, special values (for example, NaN, +Infinity, -Infinity) are not supported.</p>
pub fn values(&self) -> std::option::Option<&[f64]> {
self.values.as_deref()
}
/// <p>Array of numbers that is used along with the <code>Values</code> array. Each number in the <code>Count</code> array is the number of times the corresponding value in the <code>Values</code> array occurred during the period. </p>
/// <p>If you omit the <code>Counts</code> array, the default of 1 is used as the value for each count. If you include a <code>Counts</code> array, it must include the same amount of values as the <code>Values</code> array.</p>
pub fn counts(&self) -> std::option::Option<&[f64]> {
self.counts.as_deref()
}
/// <p>When you are using a <code>Put</code> operation, this defines what unit you want to use when storing the metric.</p>
/// <p>In a <code>Get</code> operation, this displays the unit that is used for the metric.</p>
pub fn unit(&self) -> std::option::Option<&crate::model::StandardUnit> {
self.unit.as_ref()
}
/// <p>Valid values are 1 and 60. Setting this to 1 specifies this metric as a high-resolution metric, so that CloudWatch stores the metric with sub-minute resolution down to one second. Setting this to 60 specifies this metric as a regular-resolution metric, which CloudWatch stores at 1-minute resolution. Currently, high resolution is available only for custom metrics. For more information about high-resolution metrics, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/publishingMetrics.html#high-resolution-metrics">High-Resolution Metrics</a> in the <i>Amazon CloudWatch User Guide</i>. </p>
/// <p>This field is optional, if you do not specify it the default of 60 is used.</p>
pub fn storage_resolution(&self) -> std::option::Option<i32> {
self.storage_resolution
}
}
impl std::fmt::Debug for MetricDatum {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("MetricDatum");
formatter.field("metric_name", &self.metric_name);
formatter.field("dimensions", &self.dimensions);
formatter.field("timestamp", &self.timestamp);
formatter.field("value", &self.value);
formatter.field("statistic_values", &self.statistic_values);
formatter.field("values", &self.values);
formatter.field("counts", &self.counts);
formatter.field("unit", &self.unit);
formatter.field("storage_resolution", &self.storage_resolution);
formatter.finish()
}
}
/// See [`MetricDatum`](crate::model::MetricDatum)
pub mod metric_datum {
/// A builder for [`MetricDatum`](crate::model::MetricDatum)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) metric_name: std::option::Option<std::string::String>,
pub(crate) dimensions: std::option::Option<std::vec::Vec<crate::model::Dimension>>,
pub(crate) timestamp: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) value: std::option::Option<f64>,
pub(crate) statistic_values: std::option::Option<crate::model::StatisticSet>,
pub(crate) values: std::option::Option<std::vec::Vec<f64>>,
pub(crate) counts: std::option::Option<std::vec::Vec<f64>>,
pub(crate) unit: std::option::Option<crate::model::StandardUnit>,
pub(crate) storage_resolution: std::option::Option<i32>,
}
impl Builder {
/// <p>The name of the 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 metric.</p>
pub fn set_metric_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.metric_name = input;
self
}
/// Appends an item to `dimensions`.
///
/// To override the contents of this collection use [`set_dimensions`](Self::set_dimensions).
///
/// <p>The dimensions associated with the metric.</p>
pub fn dimensions(mut self, input: crate::model::Dimension) -> Self {
let mut v = self.dimensions.unwrap_or_default();
v.push(input);
self.dimensions = Some(v);
self
}
/// <p>The dimensions associated with the metric.</p>
pub fn set_dimensions(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Dimension>>,
) -> Self {
self.dimensions = input;
self
}
/// <p>The time the metric data was received, expressed as the number of milliseconds since Jan 1, 1970 00:00:00 UTC.</p>
pub fn timestamp(mut self, input: aws_smithy_types::DateTime) -> Self {
self.timestamp = Some(input);
self
}
/// <p>The time the metric data was received, expressed as the number of milliseconds since Jan 1, 1970 00:00:00 UTC.</p>
pub fn set_timestamp(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.timestamp = input;
self
}
/// <p>The value for the metric.</p>
/// <p>Although the parameter accepts numbers of type Double, CloudWatch rejects values that are either too small or too large. Values must be in the range of -2^360 to 2^360. In addition, special values (for example, NaN, +Infinity, -Infinity) are not supported.</p>
pub fn value(mut self, input: f64) -> Self {
self.value = Some(input);
self
}
/// <p>The value for the metric.</p>
/// <p>Although the parameter accepts numbers of type Double, CloudWatch rejects values that are either too small or too large. Values must be in the range of -2^360 to 2^360. In addition, special values (for example, NaN, +Infinity, -Infinity) are not supported.</p>
pub fn set_value(mut self, input: std::option::Option<f64>) -> Self {
self.value = input;
self
}
/// <p>The statistical values for the metric.</p>
pub fn statistic_values(mut self, input: crate::model::StatisticSet) -> Self {
self.statistic_values = Some(input);
self
}
/// <p>The statistical values for the metric.</p>
pub fn set_statistic_values(
mut self,
input: std::option::Option<crate::model::StatisticSet>,
) -> Self {
self.statistic_values = input;
self
}
/// Appends an item to `values`.
///
/// To override the contents of this collection use [`set_values`](Self::set_values).
///
/// <p>Array of numbers representing the values for the metric during the period. Each unique value is listed just once in this array, and the corresponding number in the <code>Counts</code> array specifies the number of times that value occurred during the period. You can include up to 150 unique values in each <code>PutMetricData</code> action that specifies a <code>Values</code> array.</p>
/// <p>Although the <code>Values</code> array accepts numbers of type <code>Double</code>, CloudWatch rejects values that are either too small or too large. Values must be in the range of -2^360 to 2^360. In addition, special values (for example, NaN, +Infinity, -Infinity) are not supported.</p>
pub fn values(mut self, input: f64) -> Self {
let mut v = self.values.unwrap_or_default();
v.push(input);
self.values = Some(v);
self
}
/// <p>Array of numbers representing the values for the metric during the period. Each unique value is listed just once in this array, and the corresponding number in the <code>Counts</code> array specifies the number of times that value occurred during the period. You can include up to 150 unique values in each <code>PutMetricData</code> action that specifies a <code>Values</code> array.</p>
/// <p>Although the <code>Values</code> array accepts numbers of type <code>Double</code>, CloudWatch rejects values that are either too small or too large. Values must be in the range of -2^360 to 2^360. In addition, special values (for example, NaN, +Infinity, -Infinity) are not supported.</p>
pub fn set_values(mut self, input: std::option::Option<std::vec::Vec<f64>>) -> Self {
self.values = input;
self
}
/// Appends an item to `counts`.
///
/// To override the contents of this collection use [`set_counts`](Self::set_counts).
///
/// <p>Array of numbers that is used along with the <code>Values</code> array. Each number in the <code>Count</code> array is the number of times the corresponding value in the <code>Values</code> array occurred during the period. </p>
/// <p>If you omit the <code>Counts</code> array, the default of 1 is used as the value for each count. If you include a <code>Counts</code> array, it must include the same amount of values as the <code>Values</code> array.</p>
pub fn counts(mut self, input: f64) -> Self {
let mut v = self.counts.unwrap_or_default();
v.push(input);
self.counts = Some(v);
self
}
/// <p>Array of numbers that is used along with the <code>Values</code> array. Each number in the <code>Count</code> array is the number of times the corresponding value in the <code>Values</code> array occurred during the period. </p>
/// <p>If you omit the <code>Counts</code> array, the default of 1 is used as the value for each count. If you include a <code>Counts</code> array, it must include the same amount of values as the <code>Values</code> array.</p>
pub fn set_counts(mut self, input: std::option::Option<std::vec::Vec<f64>>) -> Self {
self.counts = input;
self
}
/// <p>When you are using a <code>Put</code> operation, this defines what unit you want to use when storing the metric.</p>
/// <p>In a <code>Get</code> operation, this displays the unit that is used for the metric.</p>
pub fn unit(mut self, input: crate::model::StandardUnit) -> Self {
self.unit = Some(input);
self
}
/// <p>When you are using a <code>Put</code> operation, this defines what unit you want to use when storing the metric.</p>
/// <p>In a <code>Get</code> operation, this displays the unit that is used for the metric.</p>
pub fn set_unit(mut self, input: std::option::Option<crate::model::StandardUnit>) -> Self {
self.unit = input;
self
}
/// <p>Valid values are 1 and 60. Setting this to 1 specifies this metric as a high-resolution metric, so that CloudWatch stores the metric with sub-minute resolution down to one second. Setting this to 60 specifies this metric as a regular-resolution metric, which CloudWatch stores at 1-minute resolution. Currently, high resolution is available only for custom metrics. For more information about high-resolution metrics, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/publishingMetrics.html#high-resolution-metrics">High-Resolution Metrics</a> in the <i>Amazon CloudWatch User Guide</i>. </p>
/// <p>This field is optional, if you do not specify it the default of 60 is used.</p>
pub fn storage_resolution(mut self, input: i32) -> Self {
self.storage_resolution = Some(input);
self
}
/// <p>Valid values are 1 and 60. Setting this to 1 specifies this metric as a high-resolution metric, so that CloudWatch stores the metric with sub-minute resolution down to one second. Setting this to 60 specifies this metric as a regular-resolution metric, which CloudWatch stores at 1-minute resolution. Currently, high resolution is available only for custom metrics. For more information about high-resolution metrics, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/publishingMetrics.html#high-resolution-metrics">High-Resolution Metrics</a> in the <i>Amazon CloudWatch User Guide</i>. </p>
/// <p>This field is optional, if you do not specify it the default of 60 is used.</p>
pub fn set_storage_resolution(mut self, input: std::option::Option<i32>) -> Self {
self.storage_resolution = input;
self
}
/// Consumes the builder and constructs a [`MetricDatum`](crate::model::MetricDatum)
pub fn build(self) -> crate::model::MetricDatum {
crate::model::MetricDatum {
metric_name: self.metric_name,
dimensions: self.dimensions,
timestamp: self.timestamp,
value: self.value,
statistic_values: self.statistic_values,
values: self.values,
counts: self.counts,
unit: self.unit,
storage_resolution: self.storage_resolution,
}
}
}
}
impl MetricDatum {
/// Creates a new builder-style object to manufacture [`MetricDatum`](crate::model::MetricDatum)
pub fn builder() -> crate::model::metric_datum::Builder {
crate::model::metric_datum::Builder::default()
}
}
#[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 StandardUnit {
#[allow(missing_docs)] // documentation missing in model
Bits,
#[allow(missing_docs)] // documentation missing in model
BitsSecond,
#[allow(missing_docs)] // documentation missing in model
Bytes,
#[allow(missing_docs)] // documentation missing in model
BytesSecond,
#[allow(missing_docs)] // documentation missing in model
Count,
#[allow(missing_docs)] // documentation missing in model
CountSecond,
#[allow(missing_docs)] // documentation missing in model
Gigabits,
#[allow(missing_docs)] // documentation missing in model
GigabitsSecond,
#[allow(missing_docs)] // documentation missing in model
Gigabytes,
#[allow(missing_docs)] // documentation missing in model
GigabytesSecond,
#[allow(missing_docs)] // documentation missing in model
Kilobits,
#[allow(missing_docs)] // documentation missing in model
KilobitsSecond,
#[allow(missing_docs)] // documentation missing in model
Kilobytes,
#[allow(missing_docs)] // documentation missing in model
KilobytesSecond,
#[allow(missing_docs)] // documentation missing in model
Megabits,
#[allow(missing_docs)] // documentation missing in model
MegabitsSecond,
#[allow(missing_docs)] // documentation missing in model
Megabytes,
#[allow(missing_docs)] // documentation missing in model
MegabytesSecond,
#[allow(missing_docs)] // documentation missing in model
Microseconds,
#[allow(missing_docs)] // documentation missing in model
Milliseconds,
#[allow(missing_docs)] // documentation missing in model
None,
#[allow(missing_docs)] // documentation missing in model
Percent,
#[allow(missing_docs)] // documentation missing in model
Seconds,
#[allow(missing_docs)] // documentation missing in model
Terabits,
#[allow(missing_docs)] // documentation missing in model
TerabitsSecond,
#[allow(missing_docs)] // documentation missing in model
Terabytes,
#[allow(missing_docs)] // documentation missing in model
TerabytesSecond,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for StandardUnit {
fn from(s: &str) -> Self {
match s {
"Bits" => StandardUnit::Bits,
"Bits/Second" => StandardUnit::BitsSecond,
"Bytes" => StandardUnit::Bytes,
"Bytes/Second" => StandardUnit::BytesSecond,
"Count" => StandardUnit::Count,
"Count/Second" => StandardUnit::CountSecond,
"Gigabits" => StandardUnit::Gigabits,
"Gigabits/Second" => StandardUnit::GigabitsSecond,
"Gigabytes" => StandardUnit::Gigabytes,
"Gigabytes/Second" => StandardUnit::GigabytesSecond,
"Kilobits" => StandardUnit::Kilobits,
"Kilobits/Second" => StandardUnit::KilobitsSecond,
"Kilobytes" => StandardUnit::Kilobytes,
"Kilobytes/Second" => StandardUnit::KilobytesSecond,
"Megabits" => StandardUnit::Megabits,
"Megabits/Second" => StandardUnit::MegabitsSecond,
"Megabytes" => StandardUnit::Megabytes,
"Megabytes/Second" => StandardUnit::MegabytesSecond,
"Microseconds" => StandardUnit::Microseconds,
"Milliseconds" => StandardUnit::Milliseconds,
"None" => StandardUnit::None,
"Percent" => StandardUnit::Percent,
"Seconds" => StandardUnit::Seconds,
"Terabits" => StandardUnit::Terabits,
"Terabits/Second" => StandardUnit::TerabitsSecond,
"Terabytes" => StandardUnit::Terabytes,
"Terabytes/Second" => StandardUnit::TerabytesSecond,
other => StandardUnit::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for StandardUnit {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(StandardUnit::from(s))
}
}
impl StandardUnit {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
StandardUnit::Bits => "Bits",
StandardUnit::BitsSecond => "Bits/Second",
StandardUnit::Bytes => "Bytes",
StandardUnit::BytesSecond => "Bytes/Second",
StandardUnit::Count => "Count",
StandardUnit::CountSecond => "Count/Second",
StandardUnit::Gigabits => "Gigabits",
StandardUnit::GigabitsSecond => "Gigabits/Second",
StandardUnit::Gigabytes => "Gigabytes",
StandardUnit::GigabytesSecond => "Gigabytes/Second",
StandardUnit::Kilobits => "Kilobits",
StandardUnit::KilobitsSecond => "Kilobits/Second",
StandardUnit::Kilobytes => "Kilobytes",
StandardUnit::KilobytesSecond => "Kilobytes/Second",
StandardUnit::Megabits => "Megabits",
StandardUnit::MegabitsSecond => "Megabits/Second",
StandardUnit::Megabytes => "Megabytes",
StandardUnit::MegabytesSecond => "Megabytes/Second",
StandardUnit::Microseconds => "Microseconds",
StandardUnit::Milliseconds => "Milliseconds",
StandardUnit::None => "None",
StandardUnit::Percent => "Percent",
StandardUnit::Seconds => "Seconds",
StandardUnit::Terabits => "Terabits",
StandardUnit::TerabitsSecond => "Terabits/Second",
StandardUnit::Terabytes => "Terabytes",
StandardUnit::TerabytesSecond => "Terabytes/Second",
StandardUnit::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&[
"Bits",
"Bits/Second",
"Bytes",
"Bytes/Second",
"Count",
"Count/Second",
"Gigabits",
"Gigabits/Second",
"Gigabytes",
"Gigabytes/Second",
"Kilobits",
"Kilobits/Second",
"Kilobytes",
"Kilobytes/Second",
"Megabits",
"Megabits/Second",
"Megabytes",
"Megabytes/Second",
"Microseconds",
"Milliseconds",
"None",
"Percent",
"Seconds",
"Terabits",
"Terabits/Second",
"Terabytes",
"Terabytes/Second",
]
}
}
impl AsRef<str> for StandardUnit {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>Represents a set of statistics that describes a specific metric. </p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct StatisticSet {
/// <p>The number of samples used for the statistic set.</p>
pub sample_count: std::option::Option<f64>,
/// <p>The sum of values for the sample set.</p>
pub sum: std::option::Option<f64>,
/// <p>The minimum value of the sample set.</p>
pub minimum: std::option::Option<f64>,
/// <p>The maximum value of the sample set.</p>
pub maximum: std::option::Option<f64>,
}
impl StatisticSet {
/// <p>The number of samples used for the statistic set.</p>
pub fn sample_count(&self) -> std::option::Option<f64> {
self.sample_count
}
/// <p>The sum of values for the sample set.</p>
pub fn sum(&self) -> std::option::Option<f64> {
self.sum
}
/// <p>The minimum value of the sample set.</p>
pub fn minimum(&self) -> std::option::Option<f64> {
self.minimum
}
/// <p>The maximum value of the sample set.</p>
pub fn maximum(&self) -> std::option::Option<f64> {
self.maximum
}
}
impl std::fmt::Debug for StatisticSet {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("StatisticSet");
formatter.field("sample_count", &self.sample_count);
formatter.field("sum", &self.sum);
formatter.field("minimum", &self.minimum);
formatter.field("maximum", &self.maximum);
formatter.finish()
}
}
/// See [`StatisticSet`](crate::model::StatisticSet)
pub mod statistic_set {
/// A builder for [`StatisticSet`](crate::model::StatisticSet)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) sample_count: std::option::Option<f64>,
pub(crate) sum: std::option::Option<f64>,
pub(crate) minimum: std::option::Option<f64>,
pub(crate) maximum: std::option::Option<f64>,
}
impl Builder {
/// <p>The number of samples used for the statistic set.</p>
pub fn sample_count(mut self, input: f64) -> Self {
self.sample_count = Some(input);
self
}
/// <p>The number of samples used for the statistic set.</p>
pub fn set_sample_count(mut self, input: std::option::Option<f64>) -> Self {
self.sample_count = input;
self
}
/// <p>The sum of values for the sample set.</p>
pub fn sum(mut self, input: f64) -> Self {
self.sum = Some(input);
self
}
/// <p>The sum of values for the sample set.</p>
pub fn set_sum(mut self, input: std::option::Option<f64>) -> Self {
self.sum = input;
self
}
/// <p>The minimum value of the sample set.</p>
pub fn minimum(mut self, input: f64) -> Self {
self.minimum = Some(input);
self
}
/// <p>The minimum value of the sample set.</p>
pub fn set_minimum(mut self, input: std::option::Option<f64>) -> Self {
self.minimum = input;
self
}
/// <p>The maximum value of the sample set.</p>
pub fn maximum(mut self, input: f64) -> Self {
self.maximum = Some(input);
self
}
/// <p>The maximum value of the sample set.</p>
pub fn set_maximum(mut self, input: std::option::Option<f64>) -> Self {
self.maximum = input;
self
}
/// Consumes the builder and constructs a [`StatisticSet`](crate::model::StatisticSet)
pub fn build(self) -> crate::model::StatisticSet {
crate::model::StatisticSet {
sample_count: self.sample_count,
sum: self.sum,
minimum: self.minimum,
maximum: self.maximum,
}
}
}
}
impl StatisticSet {
/// Creates a new builder-style object to manufacture [`StatisticSet`](crate::model::StatisticSet)
pub fn builder() -> crate::model::statistic_set::Builder {
crate::model::statistic_set::Builder::default()
}
}
/// <p>A dimension is a name/value pair that is part of the identity of a metric. Because dimensions are part of the unique identifier for a metric, whenever you add a unique name/value pair to one of your metrics, you are creating a new variation of that metric. For example, many Amazon EC2 metrics publish <code>InstanceId</code> as a dimension name, and the actual instance ID as the value for that dimension.</p>
/// <p>You can assign up to 10 dimensions to a metric.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct Dimension {
/// <p>The name of the dimension. Dimension names must contain only ASCII characters, must include at least one non-whitespace character, and cannot start with a colon (<code>:</code>).</p>
pub name: std::option::Option<std::string::String>,
/// <p>The value of the dimension. Dimension values must contain only ASCII characters and must include at least one non-whitespace character.</p>
pub value: std::option::Option<std::string::String>,
}
impl Dimension {
/// <p>The name of the dimension. Dimension names must contain only ASCII characters, must include at least one non-whitespace character, and cannot start with a colon (<code>:</code>).</p>
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
/// <p>The value of the dimension. Dimension values must contain only ASCII characters and must include at least one non-whitespace character.</p>
pub fn value(&self) -> std::option::Option<&str> {
self.value.as_deref()
}
}
impl std::fmt::Debug for Dimension {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Dimension");
formatter.field("name", &self.name);
formatter.field("value", &self.value);
formatter.finish()
}
}
/// See [`Dimension`](crate::model::Dimension)
pub mod dimension {
/// A builder for [`Dimension`](crate::model::Dimension)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) value: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The name of the dimension. Dimension names must contain only ASCII characters, must include at least one non-whitespace character, and cannot start with a colon (<code>:</code>).</p>
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
/// <p>The name of the dimension. Dimension names must contain only ASCII characters, must include at least one non-whitespace character, and cannot start with a colon (<code>:</code>).</p>
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
/// <p>The value of the dimension. Dimension values must contain only ASCII characters and must include at least one non-whitespace character.</p>
pub fn value(mut self, input: impl Into<std::string::String>) -> Self {
self.value = Some(input.into());
self
}
/// <p>The value of the dimension. Dimension values must contain only ASCII characters and must include at least one non-whitespace character.</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 [`Dimension`](crate::model::Dimension)
pub fn build(self) -> crate::model::Dimension {
crate::model::Dimension {
name: self.name,
value: self.value,
}
}
}
}
impl Dimension {
/// Creates a new builder-style object to manufacture [`Dimension`](crate::model::Dimension)
pub fn builder() -> crate::model::dimension::Builder {
crate::model::dimension::Builder::default()
}
}
/// <p>This structure is used in both <code>GetMetricData</code> and <code>PutMetricAlarm</code>. The supported use of this structure is different for those two operations.</p>
/// <p>When used in <code>GetMetricData</code>, it indicates the metric data to return, and whether this call is just retrieving a batch set of data for one metric, or is performing a Metrics Insights query or a math expression. A single <code>GetMetricData</code> call can include up to 500 <code>MetricDataQuery</code> structures.</p>
/// <p>When used in <code>PutMetricAlarm</code>, it enables you to create an alarm based on a metric math expression. Each <code>MetricDataQuery</code> in the array specifies either a metric to retrieve, or a math expression to be performed on retrieved metrics. A single <code>PutMetricAlarm</code> call can include up to 20 <code>MetricDataQuery</code> structures in the array. The 20 structures can include as many as 10 structures that contain a <code>MetricStat</code> parameter to retrieve a metric, and as many as 10 structures that contain the <code>Expression</code> parameter to perform a math expression. Of those <code>Expression</code> structures, one must have <code>True</code> as the value for <code>ReturnData</code>. The result of this expression is the value the alarm watches.</p>
/// <p>Any expression used in a <code>PutMetricAlarm</code> operation must return a single time series. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-metric-math.html#metric-math-syntax">Metric Math Syntax and Functions</a> in the <i>Amazon CloudWatch User Guide</i>.</p>
/// <p>Some of the parameters of this structure also have different uses whether you are using this structure in a <code>GetMetricData</code> operation or a <code>PutMetricAlarm</code> operation. These differences are explained in the following parameter list.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct MetricDataQuery {
/// <p>A short name used to tie this object to the results in the response. This name must be unique within a single call to <code>GetMetricData</code>. If you are performing math expressions on this set of data, this name represents that data and can serve as a variable in the mathematical expression. The valid characters are letters, numbers, and underscore. The first character must be a lowercase letter.</p>
pub id: std::option::Option<std::string::String>,
/// <p>The metric to be returned, along with statistics, period, and units. Use this parameter only if this object is retrieving a metric and not performing a math expression on returned data.</p>
/// <p>Within one MetricDataQuery object, you must specify either <code>Expression</code> or <code>MetricStat</code> but not both.</p>
pub metric_stat: std::option::Option<crate::model::MetricStat>,
/// <p>This field can contain either a Metrics Insights query, or a metric math expression to be performed on the returned data. For more information about Metrics Insights queries, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch-metrics-insights-querylanguage">Metrics Insights query components and syntax</a> in the <i>Amazon CloudWatch User Guide</i>.</p>
/// <p>A math expression can use the <code>Id</code> of the other metrics or queries to refer to those metrics, and can also use the <code>Id</code> of other expressions to use the result of those expressions. For more information about metric math expressions, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-metric-math.html#metric-math-syntax">Metric Math Syntax and Functions</a> in the <i>Amazon CloudWatch User Guide</i>.</p>
/// <p>Within each MetricDataQuery object, you must specify either <code>Expression</code> or <code>MetricStat</code> but not both.</p>
pub expression: std::option::Option<std::string::String>,
/// <p>A human-readable label for this metric or expression. This is especially useful if this is an expression, so that you know what the value represents. If the metric or expression is shown in a CloudWatch dashboard widget, the label is shown. If Label is omitted, CloudWatch generates a default.</p>
/// <p>You can put dynamic expressions into a label, so that it is more descriptive. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph-dynamic-labels.html">Using Dynamic Labels</a>.</p>
pub label: std::option::Option<std::string::String>,
/// <p>When used in <code>GetMetricData</code>, this option indicates whether to return the timestamps and raw data values of this metric. If you are performing this call just to do math expressions and do not also need the raw data returned, you can specify <code>False</code>. If you omit this, the default of <code>True</code> is used.</p>
/// <p>When used in <code>PutMetricAlarm</code>, specify <code>True</code> for the one expression result to use as the alarm. For all other metrics and expressions in the same <code>PutMetricAlarm</code> operation, specify <code>ReturnData</code> as False.</p>
pub return_data: std::option::Option<bool>,
/// <p>The granularity, in seconds, of the returned data points. For metrics with regular resolution, a period can be as short as one minute (60 seconds) and must be a multiple of 60. For high-resolution metrics that are collected at intervals of less than one minute, the period can be 1, 5, 10, 30, 60, or any multiple of 60. High-resolution metrics are those metrics stored by a <code>PutMetricData</code> operation that includes a <code>StorageResolution of 1 second</code>.</p>
pub period: std::option::Option<i32>,
/// <p>The ID of the account where the metrics are located, if this is a cross-account alarm.</p>
/// <p>Use this field only for <code>PutMetricAlarm</code> operations. It is not used in <code>GetMetricData</code> operations.</p>
pub account_id: std::option::Option<std::string::String>,
}
impl MetricDataQuery {
/// <p>A short name used to tie this object to the results in the response. This name must be unique within a single call to <code>GetMetricData</code>. If you are performing math expressions on this set of data, this name represents that data and can serve as a variable in the mathematical expression. The valid characters are letters, numbers, and underscore. The first character must be a lowercase letter.</p>
pub fn id(&self) -> std::option::Option<&str> {
self.id.as_deref()
}
/// <p>The metric to be returned, along with statistics, period, and units. Use this parameter only if this object is retrieving a metric and not performing a math expression on returned data.</p>
/// <p>Within one MetricDataQuery object, you must specify either <code>Expression</code> or <code>MetricStat</code> but not both.</p>
pub fn metric_stat(&self) -> std::option::Option<&crate::model::MetricStat> {
self.metric_stat.as_ref()
}
/// <p>This field can contain either a Metrics Insights query, or a metric math expression to be performed on the returned data. For more information about Metrics Insights queries, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch-metrics-insights-querylanguage">Metrics Insights query components and syntax</a> in the <i>Amazon CloudWatch User Guide</i>.</p>
/// <p>A math expression can use the <code>Id</code> of the other metrics or queries to refer to those metrics, and can also use the <code>Id</code> of other expressions to use the result of those expressions. For more information about metric math expressions, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-metric-math.html#metric-math-syntax">Metric Math Syntax and Functions</a> in the <i>Amazon CloudWatch User Guide</i>.</p>
/// <p>Within each MetricDataQuery object, you must specify either <code>Expression</code> or <code>MetricStat</code> but not both.</p>
pub fn expression(&self) -> std::option::Option<&str> {
self.expression.as_deref()
}
/// <p>A human-readable label for this metric or expression. This is especially useful if this is an expression, so that you know what the value represents. If the metric or expression is shown in a CloudWatch dashboard widget, the label is shown. If Label is omitted, CloudWatch generates a default.</p>
/// <p>You can put dynamic expressions into a label, so that it is more descriptive. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph-dynamic-labels.html">Using Dynamic Labels</a>.</p>
pub fn label(&self) -> std::option::Option<&str> {
self.label.as_deref()
}
/// <p>When used in <code>GetMetricData</code>, this option indicates whether to return the timestamps and raw data values of this metric. If you are performing this call just to do math expressions and do not also need the raw data returned, you can specify <code>False</code>. If you omit this, the default of <code>True</code> is used.</p>
/// <p>When used in <code>PutMetricAlarm</code>, specify <code>True</code> for the one expression result to use as the alarm. For all other metrics and expressions in the same <code>PutMetricAlarm</code> operation, specify <code>ReturnData</code> as False.</p>
pub fn return_data(&self) -> std::option::Option<bool> {
self.return_data
}
/// <p>The granularity, in seconds, of the returned data points. For metrics with regular resolution, a period can be as short as one minute (60 seconds) and must be a multiple of 60. For high-resolution metrics that are collected at intervals of less than one minute, the period can be 1, 5, 10, 30, 60, or any multiple of 60. High-resolution metrics are those metrics stored by a <code>PutMetricData</code> operation that includes a <code>StorageResolution of 1 second</code>.</p>
pub fn period(&self) -> std::option::Option<i32> {
self.period
}
/// <p>The ID of the account where the metrics are located, if this is a cross-account alarm.</p>
/// <p>Use this field only for <code>PutMetricAlarm</code> operations. It is not used in <code>GetMetricData</code> operations.</p>
pub fn account_id(&self) -> std::option::Option<&str> {
self.account_id.as_deref()
}
}
impl std::fmt::Debug for MetricDataQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("MetricDataQuery");
formatter.field("id", &self.id);
formatter.field("metric_stat", &self.metric_stat);
formatter.field("expression", &self.expression);
formatter.field("label", &self.label);
formatter.field("return_data", &self.return_data);
formatter.field("period", &self.period);
formatter.field("account_id", &self.account_id);
formatter.finish()
}
}
/// See [`MetricDataQuery`](crate::model::MetricDataQuery)
pub mod metric_data_query {
/// A builder for [`MetricDataQuery`](crate::model::MetricDataQuery)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) id: std::option::Option<std::string::String>,
pub(crate) metric_stat: std::option::Option<crate::model::MetricStat>,
pub(crate) expression: std::option::Option<std::string::String>,
pub(crate) label: std::option::Option<std::string::String>,
pub(crate) return_data: std::option::Option<bool>,
pub(crate) period: std::option::Option<i32>,
pub(crate) account_id: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>A short name used to tie this object to the results in the response. This name must be unique within a single call to <code>GetMetricData</code>. If you are performing math expressions on this set of data, this name represents that data and can serve as a variable in the mathematical expression. The valid characters are letters, numbers, and underscore. The first character must be a lowercase letter.</p>
pub fn id(mut self, input: impl Into<std::string::String>) -> Self {
self.id = Some(input.into());
self
}
/// <p>A short name used to tie this object to the results in the response. This name must be unique within a single call to <code>GetMetricData</code>. If you are performing math expressions on this set of data, this name represents that data and can serve as a variable in the mathematical expression. The valid characters are letters, numbers, and underscore. The first character must be a lowercase letter.</p>
pub fn set_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.id = input;
self
}
/// <p>The metric to be returned, along with statistics, period, and units. Use this parameter only if this object is retrieving a metric and not performing a math expression on returned data.</p>
/// <p>Within one MetricDataQuery object, you must specify either <code>Expression</code> or <code>MetricStat</code> but not both.</p>
pub fn metric_stat(mut self, input: crate::model::MetricStat) -> Self {
self.metric_stat = Some(input);
self
}
/// <p>The metric to be returned, along with statistics, period, and units. Use this parameter only if this object is retrieving a metric and not performing a math expression on returned data.</p>
/// <p>Within one MetricDataQuery object, you must specify either <code>Expression</code> or <code>MetricStat</code> but not both.</p>
pub fn set_metric_stat(
mut self,
input: std::option::Option<crate::model::MetricStat>,
) -> Self {
self.metric_stat = input;
self
}
/// <p>This field can contain either a Metrics Insights query, or a metric math expression to be performed on the returned data. For more information about Metrics Insights queries, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch-metrics-insights-querylanguage">Metrics Insights query components and syntax</a> in the <i>Amazon CloudWatch User Guide</i>.</p>
/// <p>A math expression can use the <code>Id</code> of the other metrics or queries to refer to those metrics, and can also use the <code>Id</code> of other expressions to use the result of those expressions. For more information about metric math expressions, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-metric-math.html#metric-math-syntax">Metric Math Syntax and Functions</a> in the <i>Amazon CloudWatch User Guide</i>.</p>
/// <p>Within each MetricDataQuery object, you must specify either <code>Expression</code> or <code>MetricStat</code> but not both.</p>
pub fn expression(mut self, input: impl Into<std::string::String>) -> Self {
self.expression = Some(input.into());
self
}
/// <p>This field can contain either a Metrics Insights query, or a metric math expression to be performed on the returned data. For more information about Metrics Insights queries, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch-metrics-insights-querylanguage">Metrics Insights query components and syntax</a> in the <i>Amazon CloudWatch User Guide</i>.</p>
/// <p>A math expression can use the <code>Id</code> of the other metrics or queries to refer to those metrics, and can also use the <code>Id</code> of other expressions to use the result of those expressions. For more information about metric math expressions, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-metric-math.html#metric-math-syntax">Metric Math Syntax and Functions</a> in the <i>Amazon CloudWatch User Guide</i>.</p>
/// <p>Within each MetricDataQuery object, you must specify either <code>Expression</code> or <code>MetricStat</code> but not both.</p>
pub fn set_expression(mut self, input: std::option::Option<std::string::String>) -> Self {
self.expression = input;
self
}
/// <p>A human-readable label for this metric or expression. This is especially useful if this is an expression, so that you know what the value represents. If the metric or expression is shown in a CloudWatch dashboard widget, the label is shown. If Label is omitted, CloudWatch generates a default.</p>
/// <p>You can put dynamic expressions into a label, so that it is more descriptive. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph-dynamic-labels.html">Using Dynamic Labels</a>.</p>
pub fn label(mut self, input: impl Into<std::string::String>) -> Self {
self.label = Some(input.into());
self
}
/// <p>A human-readable label for this metric or expression. This is especially useful if this is an expression, so that you know what the value represents. If the metric or expression is shown in a CloudWatch dashboard widget, the label is shown. If Label is omitted, CloudWatch generates a default.</p>
/// <p>You can put dynamic expressions into a label, so that it is more descriptive. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph-dynamic-labels.html">Using Dynamic Labels</a>.</p>
pub fn set_label(mut self, input: std::option::Option<std::string::String>) -> Self {
self.label = input;
self
}
/// <p>When used in <code>GetMetricData</code>, this option indicates whether to return the timestamps and raw data values of this metric. If you are performing this call just to do math expressions and do not also need the raw data returned, you can specify <code>False</code>. If you omit this, the default of <code>True</code> is used.</p>
/// <p>When used in <code>PutMetricAlarm</code>, specify <code>True</code> for the one expression result to use as the alarm. For all other metrics and expressions in the same <code>PutMetricAlarm</code> operation, specify <code>ReturnData</code> as False.</p>
pub fn return_data(mut self, input: bool) -> Self {
self.return_data = Some(input);
self
}
/// <p>When used in <code>GetMetricData</code>, this option indicates whether to return the timestamps and raw data values of this metric. If you are performing this call just to do math expressions and do not also need the raw data returned, you can specify <code>False</code>. If you omit this, the default of <code>True</code> is used.</p>
/// <p>When used in <code>PutMetricAlarm</code>, specify <code>True</code> for the one expression result to use as the alarm. For all other metrics and expressions in the same <code>PutMetricAlarm</code> operation, specify <code>ReturnData</code> as False.</p>
pub fn set_return_data(mut self, input: std::option::Option<bool>) -> Self {
self.return_data = input;
self
}
/// <p>The granularity, in seconds, of the returned data points. For metrics with regular resolution, a period can be as short as one minute (60 seconds) and must be a multiple of 60. For high-resolution metrics that are collected at intervals of less than one minute, the period can be 1, 5, 10, 30, 60, or any multiple of 60. High-resolution metrics are those metrics stored by a <code>PutMetricData</code> operation that includes a <code>StorageResolution of 1 second</code>.</p>
pub fn period(mut self, input: i32) -> Self {
self.period = Some(input);
self
}
/// <p>The granularity, in seconds, of the returned data points. For metrics with regular resolution, a period can be as short as one minute (60 seconds) and must be a multiple of 60. For high-resolution metrics that are collected at intervals of less than one minute, the period can be 1, 5, 10, 30, 60, or any multiple of 60. High-resolution metrics are those metrics stored by a <code>PutMetricData</code> operation that includes a <code>StorageResolution of 1 second</code>.</p>
pub fn set_period(mut self, input: std::option::Option<i32>) -> Self {
self.period = input;
self
}
/// <p>The ID of the account where the metrics are located, if this is a cross-account alarm.</p>
/// <p>Use this field only for <code>PutMetricAlarm</code> operations. It is not used in <code>GetMetricData</code> operations.</p>
pub fn account_id(mut self, input: impl Into<std::string::String>) -> Self {
self.account_id = Some(input.into());
self
}
/// <p>The ID of the account where the metrics are located, if this is a cross-account alarm.</p>
/// <p>Use this field only for <code>PutMetricAlarm</code> operations. It is not used in <code>GetMetricData</code> operations.</p>
pub fn set_account_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.account_id = input;
self
}
/// Consumes the builder and constructs a [`MetricDataQuery`](crate::model::MetricDataQuery)
pub fn build(self) -> crate::model::MetricDataQuery {
crate::model::MetricDataQuery {
id: self.id,
metric_stat: self.metric_stat,
expression: self.expression,
label: self.label,
return_data: self.return_data,
period: self.period,
account_id: self.account_id,
}
}
}
}
impl MetricDataQuery {
/// Creates a new builder-style object to manufacture [`MetricDataQuery`](crate::model::MetricDataQuery)
pub fn builder() -> crate::model::metric_data_query::Builder {
crate::model::metric_data_query::Builder::default()
}
}
/// <p>This structure defines the metric to be returned, along with the statistics, period, and units.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct MetricStat {
/// <p>The metric to return, including the metric name, namespace, and dimensions.</p>
pub metric: std::option::Option<crate::model::Metric>,
/// <p>The granularity, in seconds, of the returned data points. For metrics with regular resolution, a period can be as short as one minute (60 seconds) and must be a multiple of 60. For high-resolution metrics that are collected at intervals of less than one minute, the period can be 1, 5, 10, 30, 60, or any multiple of 60. High-resolution metrics are those metrics stored by a <code>PutMetricData</code> call that includes a <code>StorageResolution</code> of 1 second.</p>
/// <p>If the <code>StartTime</code> parameter specifies a time stamp that is greater than 3 hours ago, you must specify the period as follows or no data points in that time range is returned:</p>
/// <ul>
/// <li> <p>Start time between 3 hours and 15 days ago - Use a multiple of 60 seconds (1 minute).</p> </li>
/// <li> <p>Start time between 15 and 63 days ago - Use a multiple of 300 seconds (5 minutes).</p> </li>
/// <li> <p>Start time greater than 63 days ago - Use a multiple of 3600 seconds (1 hour).</p> </li>
/// </ul>
pub period: std::option::Option<i32>,
/// <p>The statistic to return. It can include any CloudWatch statistic or extended statistic.</p>
pub stat: std::option::Option<std::string::String>,
/// <p>When you are using a <code>Put</code> operation, this defines what unit you want to use when storing the metric.</p>
/// <p>In a <code>Get</code> operation, if you omit <code>Unit</code> then all data that was collected with any unit is returned, along with the corresponding units that were specified when the data was reported to CloudWatch. If you specify a unit, the operation returns only data that was collected with that unit specified. If you specify a unit that does not match the data collected, the results of the operation are null. CloudWatch does not perform unit conversions.</p>
pub unit: std::option::Option<crate::model::StandardUnit>,
}
impl MetricStat {
/// <p>The metric to return, including the metric name, namespace, and dimensions.</p>
pub fn metric(&self) -> std::option::Option<&crate::model::Metric> {
self.metric.as_ref()
}
/// <p>The granularity, in seconds, of the returned data points. For metrics with regular resolution, a period can be as short as one minute (60 seconds) and must be a multiple of 60. For high-resolution metrics that are collected at intervals of less than one minute, the period can be 1, 5, 10, 30, 60, or any multiple of 60. High-resolution metrics are those metrics stored by a <code>PutMetricData</code> call that includes a <code>StorageResolution</code> of 1 second.</p>
/// <p>If the <code>StartTime</code> parameter specifies a time stamp that is greater than 3 hours ago, you must specify the period as follows or no data points in that time range is returned:</p>
/// <ul>
/// <li> <p>Start time between 3 hours and 15 days ago - Use a multiple of 60 seconds (1 minute).</p> </li>
/// <li> <p>Start time between 15 and 63 days ago - Use a multiple of 300 seconds (5 minutes).</p> </li>
/// <li> <p>Start time greater than 63 days ago - Use a multiple of 3600 seconds (1 hour).</p> </li>
/// </ul>
pub fn period(&self) -> std::option::Option<i32> {
self.period
}
/// <p>The statistic to return. It can include any CloudWatch statistic or extended statistic.</p>
pub fn stat(&self) -> std::option::Option<&str> {
self.stat.as_deref()
}
/// <p>When you are using a <code>Put</code> operation, this defines what unit you want to use when storing the metric.</p>
/// <p>In a <code>Get</code> operation, if you omit <code>Unit</code> then all data that was collected with any unit is returned, along with the corresponding units that were specified when the data was reported to CloudWatch. If you specify a unit, the operation returns only data that was collected with that unit specified. If you specify a unit that does not match the data collected, the results of the operation are null. CloudWatch does not perform unit conversions.</p>
pub fn unit(&self) -> std::option::Option<&crate::model::StandardUnit> {
self.unit.as_ref()
}
}
impl std::fmt::Debug for MetricStat {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("MetricStat");
formatter.field("metric", &self.metric);
formatter.field("period", &self.period);
formatter.field("stat", &self.stat);
formatter.field("unit", &self.unit);
formatter.finish()
}
}
/// See [`MetricStat`](crate::model::MetricStat)
pub mod metric_stat {
/// A builder for [`MetricStat`](crate::model::MetricStat)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) metric: std::option::Option<crate::model::Metric>,
pub(crate) period: std::option::Option<i32>,
pub(crate) stat: std::option::Option<std::string::String>,
pub(crate) unit: std::option::Option<crate::model::StandardUnit>,
}
impl Builder {
/// <p>The metric to return, including the metric name, namespace, and dimensions.</p>
pub fn metric(mut self, input: crate::model::Metric) -> Self {
self.metric = Some(input);
self
}
/// <p>The metric to return, including the metric name, namespace, and dimensions.</p>
pub fn set_metric(mut self, input: std::option::Option<crate::model::Metric>) -> Self {
self.metric = input;
self
}
/// <p>The granularity, in seconds, of the returned data points. For metrics with regular resolution, a period can be as short as one minute (60 seconds) and must be a multiple of 60. For high-resolution metrics that are collected at intervals of less than one minute, the period can be 1, 5, 10, 30, 60, or any multiple of 60. High-resolution metrics are those metrics stored by a <code>PutMetricData</code> call that includes a <code>StorageResolution</code> of 1 second.</p>
/// <p>If the <code>StartTime</code> parameter specifies a time stamp that is greater than 3 hours ago, you must specify the period as follows or no data points in that time range is returned:</p>
/// <ul>
/// <li> <p>Start time between 3 hours and 15 days ago - Use a multiple of 60 seconds (1 minute).</p> </li>
/// <li> <p>Start time between 15 and 63 days ago - Use a multiple of 300 seconds (5 minutes).</p> </li>
/// <li> <p>Start time greater than 63 days ago - Use a multiple of 3600 seconds (1 hour).</p> </li>
/// </ul>
pub fn period(mut self, input: i32) -> Self {
self.period = Some(input);
self
}
/// <p>The granularity, in seconds, of the returned data points. For metrics with regular resolution, a period can be as short as one minute (60 seconds) and must be a multiple of 60. For high-resolution metrics that are collected at intervals of less than one minute, the period can be 1, 5, 10, 30, 60, or any multiple of 60. High-resolution metrics are those metrics stored by a <code>PutMetricData</code> call that includes a <code>StorageResolution</code> of 1 second.</p>
/// <p>If the <code>StartTime</code> parameter specifies a time stamp that is greater than 3 hours ago, you must specify the period as follows or no data points in that time range is returned:</p>
/// <ul>
/// <li> <p>Start time between 3 hours and 15 days ago - Use a multiple of 60 seconds (1 minute).</p> </li>
/// <li> <p>Start time between 15 and 63 days ago - Use a multiple of 300 seconds (5 minutes).</p> </li>
/// <li> <p>Start time greater than 63 days ago - Use a multiple of 3600 seconds (1 hour).</p> </li>
/// </ul>
pub fn set_period(mut self, input: std::option::Option<i32>) -> Self {
self.period = input;
self
}
/// <p>The statistic to return. It can include any CloudWatch statistic or extended statistic.</p>
pub fn stat(mut self, input: impl Into<std::string::String>) -> Self {
self.stat = Some(input.into());
self
}
/// <p>The statistic to return. It can include any CloudWatch statistic or extended statistic.</p>
pub fn set_stat(mut self, input: std::option::Option<std::string::String>) -> Self {
self.stat = input;
self
}
/// <p>When you are using a <code>Put</code> operation, this defines what unit you want to use when storing the metric.</p>
/// <p>In a <code>Get</code> operation, if you omit <code>Unit</code> then all data that was collected with any unit is returned, along with the corresponding units that were specified when the data was reported to CloudWatch. If you specify a unit, the operation returns only data that was collected with that unit specified. If you specify a unit that does not match the data collected, the results of the operation are null. CloudWatch does not perform unit conversions.</p>
pub fn unit(mut self, input: crate::model::StandardUnit) -> Self {
self.unit = Some(input);
self
}
/// <p>When you are using a <code>Put</code> operation, this defines what unit you want to use when storing the metric.</p>
/// <p>In a <code>Get</code> operation, if you omit <code>Unit</code> then all data that was collected with any unit is returned, along with the corresponding units that were specified when the data was reported to CloudWatch. If you specify a unit, the operation returns only data that was collected with that unit specified. If you specify a unit that does not match the data collected, the results of the operation are null. CloudWatch does not perform unit conversions.</p>
pub fn set_unit(mut self, input: std::option::Option<crate::model::StandardUnit>) -> Self {
self.unit = input;
self
}
/// Consumes the builder and constructs a [`MetricStat`](crate::model::MetricStat)
pub fn build(self) -> crate::model::MetricStat {
crate::model::MetricStat {
metric: self.metric,
period: self.period,
stat: self.stat,
unit: self.unit,
}
}
}
}
impl MetricStat {
/// Creates a new builder-style object to manufacture [`MetricStat`](crate::model::MetricStat)
pub fn builder() -> crate::model::metric_stat::Builder {
crate::model::metric_stat::Builder::default()
}
}
/// <p>Represents a specific metric.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct Metric {
/// <p>The namespace of the metric.</p>
pub namespace: std::option::Option<std::string::String>,
/// <p>The name of the metric. This is a required field.</p>
pub metric_name: std::option::Option<std::string::String>,
/// <p>The dimensions for the metric.</p>
pub dimensions: std::option::Option<std::vec::Vec<crate::model::Dimension>>,
}
impl Metric {
/// <p>The namespace of the metric.</p>
pub fn namespace(&self) -> std::option::Option<&str> {
self.namespace.as_deref()
}
/// <p>The name of the metric. This is a required field.</p>
pub fn metric_name(&self) -> std::option::Option<&str> {
self.metric_name.as_deref()
}
/// <p>The dimensions for the metric.</p>
pub fn dimensions(&self) -> std::option::Option<&[crate::model::Dimension]> {
self.dimensions.as_deref()
}
}
impl std::fmt::Debug for Metric {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Metric");
formatter.field("namespace", &self.namespace);
formatter.field("metric_name", &self.metric_name);
formatter.field("dimensions", &self.dimensions);
formatter.finish()
}
}
/// See [`Metric`](crate::model::Metric)
pub mod metric {
/// A builder for [`Metric`](crate::model::Metric)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) namespace: std::option::Option<std::string::String>,
pub(crate) metric_name: std::option::Option<std::string::String>,
pub(crate) dimensions: std::option::Option<std::vec::Vec<crate::model::Dimension>>,
}
impl Builder {
/// <p>The namespace of the metric.</p>
pub fn namespace(mut self, input: impl Into<std::string::String>) -> Self {
self.namespace = Some(input.into());
self
}
/// <p>The namespace of the metric.</p>
pub fn set_namespace(mut self, input: std::option::Option<std::string::String>) -> Self {
self.namespace = input;
self
}
/// <p>The name of the metric. This is a required field.</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 metric. This is a required field.</p>
pub fn set_metric_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.metric_name = input;
self
}
/// Appends an item to `dimensions`.
///
/// To override the contents of this collection use [`set_dimensions`](Self::set_dimensions).
///
/// <p>The dimensions for the metric.</p>
pub fn dimensions(mut self, input: crate::model::Dimension) -> Self {
let mut v = self.dimensions.unwrap_or_default();
v.push(input);
self.dimensions = Some(v);
self
}
/// <p>The dimensions for the metric.</p>
pub fn set_dimensions(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Dimension>>,
) -> Self {
self.dimensions = input;
self
}
/// Consumes the builder and constructs a [`Metric`](crate::model::Metric)
pub fn build(self) -> crate::model::Metric {
crate::model::Metric {
namespace: self.namespace,
metric_name: self.metric_name,
dimensions: self.dimensions,
}
}
}
}
impl Metric {
/// Creates a new builder-style object to manufacture [`Metric`](crate::model::Metric)
pub fn builder() -> crate::model::metric::Builder {
crate::model::metric::Builder::default()
}
}
#[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 ComparisonOperator {
#[allow(missing_docs)] // documentation missing in model
GreaterThanOrEqualToThreshold,
#[allow(missing_docs)] // documentation missing in model
GreaterThanThreshold,
#[allow(missing_docs)] // documentation missing in model
GreaterThanUpperThreshold,
#[allow(missing_docs)] // documentation missing in model
LessThanLowerOrGreaterThanUpperThreshold,
#[allow(missing_docs)] // documentation missing in model
LessThanLowerThreshold,
#[allow(missing_docs)] // documentation missing in model
LessThanOrEqualToThreshold,
#[allow(missing_docs)] // documentation missing in model
LessThanThreshold,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for ComparisonOperator {
fn from(s: &str) -> Self {
match s {
"GreaterThanOrEqualToThreshold" => ComparisonOperator::GreaterThanOrEqualToThreshold,
"GreaterThanThreshold" => ComparisonOperator::GreaterThanThreshold,
"GreaterThanUpperThreshold" => ComparisonOperator::GreaterThanUpperThreshold,
"LessThanLowerOrGreaterThanUpperThreshold" => {
ComparisonOperator::LessThanLowerOrGreaterThanUpperThreshold
}
"LessThanLowerThreshold" => ComparisonOperator::LessThanLowerThreshold,
"LessThanOrEqualToThreshold" => ComparisonOperator::LessThanOrEqualToThreshold,
"LessThanThreshold" => ComparisonOperator::LessThanThreshold,
other => ComparisonOperator::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for ComparisonOperator {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(ComparisonOperator::from(s))
}
}
impl ComparisonOperator {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
ComparisonOperator::GreaterThanOrEqualToThreshold => "GreaterThanOrEqualToThreshold",
ComparisonOperator::GreaterThanThreshold => "GreaterThanThreshold",
ComparisonOperator::GreaterThanUpperThreshold => "GreaterThanUpperThreshold",
ComparisonOperator::LessThanLowerOrGreaterThanUpperThreshold => {
"LessThanLowerOrGreaterThanUpperThreshold"
}
ComparisonOperator::LessThanLowerThreshold => "LessThanLowerThreshold",
ComparisonOperator::LessThanOrEqualToThreshold => "LessThanOrEqualToThreshold",
ComparisonOperator::LessThanThreshold => "LessThanThreshold",
ComparisonOperator::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&[
"GreaterThanOrEqualToThreshold",
"GreaterThanThreshold",
"GreaterThanUpperThreshold",
"LessThanLowerOrGreaterThanUpperThreshold",
"LessThanLowerThreshold",
"LessThanOrEqualToThreshold",
"LessThanThreshold",
]
}
}
impl AsRef<str> for ComparisonOperator {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[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 Statistic {
#[allow(missing_docs)] // documentation missing in model
Average,
#[allow(missing_docs)] // documentation missing in model
Maximum,
#[allow(missing_docs)] // documentation missing in model
Minimum,
#[allow(missing_docs)] // documentation missing in model
SampleCount,
#[allow(missing_docs)] // documentation missing in model
Sum,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for Statistic {
fn from(s: &str) -> Self {
match s {
"Average" => Statistic::Average,
"Maximum" => Statistic::Maximum,
"Minimum" => Statistic::Minimum,
"SampleCount" => Statistic::SampleCount,
"Sum" => Statistic::Sum,
other => Statistic::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for Statistic {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(Statistic::from(s))
}
}
impl Statistic {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
Statistic::Average => "Average",
Statistic::Maximum => "Maximum",
Statistic::Minimum => "Minimum",
Statistic::SampleCount => "SampleCount",
Statistic::Sum => "Sum",
Statistic::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&["Average", "Maximum", "Minimum", "SampleCount", "Sum"]
}
}
impl AsRef<str> for Statistic {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>An error or warning for the operation.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct DashboardValidationMessage {
/// <p>The data path related to the message.</p>
pub data_path: std::option::Option<std::string::String>,
/// <p>A message describing the error or warning.</p>
pub message: std::option::Option<std::string::String>,
}
impl DashboardValidationMessage {
/// <p>The data path related to the message.</p>
pub fn data_path(&self) -> std::option::Option<&str> {
self.data_path.as_deref()
}
/// <p>A message describing the error or warning.</p>
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Debug for DashboardValidationMessage {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("DashboardValidationMessage");
formatter.field("data_path", &self.data_path);
formatter.field("message", &self.message);
formatter.finish()
}
}
/// See [`DashboardValidationMessage`](crate::model::DashboardValidationMessage)
pub mod dashboard_validation_message {
/// A builder for [`DashboardValidationMessage`](crate::model::DashboardValidationMessage)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) data_path: std::option::Option<std::string::String>,
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The data path related to the message.</p>
pub fn data_path(mut self, input: impl Into<std::string::String>) -> Self {
self.data_path = Some(input.into());
self
}
/// <p>The data path related to the message.</p>
pub fn set_data_path(mut self, input: std::option::Option<std::string::String>) -> Self {
self.data_path = input;
self
}
/// <p>A message describing the error or warning.</p>
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
/// <p>A message describing the error or warning.</p>
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// Consumes the builder and constructs a [`DashboardValidationMessage`](crate::model::DashboardValidationMessage)
pub fn build(self) -> crate::model::DashboardValidationMessage {
crate::model::DashboardValidationMessage {
data_path: self.data_path,
message: self.message,
}
}
}
}
impl DashboardValidationMessage {
/// Creates a new builder-style object to manufacture [`DashboardValidationMessage`](crate::model::DashboardValidationMessage)
pub fn builder() -> crate::model::dashboard_validation_message::Builder {
crate::model::dashboard_validation_message::Builder::default()
}
}
/// <p>Indicates the CloudWatch math expression that provides the time series the anomaly detector uses as input. The designated math expression must return a single time series.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct MetricMathAnomalyDetector {
/// <p>An array of metric data query structures that enables you to create an anomaly detector based on the result of a metric math expression. Each item in <code>MetricDataQueries</code> gets a metric or performs a math expression. One item in <code>MetricDataQueries</code> is the expression that provides the time series that the anomaly detector uses as input. Designate the expression by setting <code>ReturnData</code> to <code>True</code> for this object in the array. For all other expressions and metrics, set <code>ReturnData</code> to <code>False</code>. The designated expression must return a single time series.</p>
pub metric_data_queries: std::option::Option<std::vec::Vec<crate::model::MetricDataQuery>>,
}
impl MetricMathAnomalyDetector {
/// <p>An array of metric data query structures that enables you to create an anomaly detector based on the result of a metric math expression. Each item in <code>MetricDataQueries</code> gets a metric or performs a math expression. One item in <code>MetricDataQueries</code> is the expression that provides the time series that the anomaly detector uses as input. Designate the expression by setting <code>ReturnData</code> to <code>True</code> for this object in the array. For all other expressions and metrics, set <code>ReturnData</code> to <code>False</code>. The designated expression must return a single time series.</p>
pub fn metric_data_queries(&self) -> std::option::Option<&[crate::model::MetricDataQuery]> {
self.metric_data_queries.as_deref()
}
}
impl std::fmt::Debug for MetricMathAnomalyDetector {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("MetricMathAnomalyDetector");
formatter.field("metric_data_queries", &self.metric_data_queries);
formatter.finish()
}
}
/// See [`MetricMathAnomalyDetector`](crate::model::MetricMathAnomalyDetector)
pub mod metric_math_anomaly_detector {
/// A builder for [`MetricMathAnomalyDetector`](crate::model::MetricMathAnomalyDetector)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) metric_data_queries:
std::option::Option<std::vec::Vec<crate::model::MetricDataQuery>>,
}
impl Builder {
/// Appends an item to `metric_data_queries`.
///
/// To override the contents of this collection use [`set_metric_data_queries`](Self::set_metric_data_queries).
///
/// <p>An array of metric data query structures that enables you to create an anomaly detector based on the result of a metric math expression. Each item in <code>MetricDataQueries</code> gets a metric or performs a math expression. One item in <code>MetricDataQueries</code> is the expression that provides the time series that the anomaly detector uses as input. Designate the expression by setting <code>ReturnData</code> to <code>True</code> for this object in the array. For all other expressions and metrics, set <code>ReturnData</code> to <code>False</code>. The designated expression must return a single time series.</p>
pub fn metric_data_queries(mut self, input: crate::model::MetricDataQuery) -> Self {
let mut v = self.metric_data_queries.unwrap_or_default();
v.push(input);
self.metric_data_queries = Some(v);
self
}
/// <p>An array of metric data query structures that enables you to create an anomaly detector based on the result of a metric math expression. Each item in <code>MetricDataQueries</code> gets a metric or performs a math expression. One item in <code>MetricDataQueries</code> is the expression that provides the time series that the anomaly detector uses as input. Designate the expression by setting <code>ReturnData</code> to <code>True</code> for this object in the array. For all other expressions and metrics, set <code>ReturnData</code> to <code>False</code>. The designated expression must return a single time series.</p>
pub fn set_metric_data_queries(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::MetricDataQuery>>,
) -> Self {
self.metric_data_queries = input;
self
}
/// Consumes the builder and constructs a [`MetricMathAnomalyDetector`](crate::model::MetricMathAnomalyDetector)
pub fn build(self) -> crate::model::MetricMathAnomalyDetector {
crate::model::MetricMathAnomalyDetector {
metric_data_queries: self.metric_data_queries,
}
}
}
}
impl MetricMathAnomalyDetector {
/// Creates a new builder-style object to manufacture [`MetricMathAnomalyDetector`](crate::model::MetricMathAnomalyDetector)
pub fn builder() -> crate::model::metric_math_anomaly_detector::Builder {
crate::model::metric_math_anomaly_detector::Builder::default()
}
}
/// <p>Designates the CloudWatch metric and statistic that provides the time series the anomaly detector uses as input.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct SingleMetricAnomalyDetector {
/// <p>The namespace of the metric to create the anomaly detection model for.</p>
pub namespace: std::option::Option<std::string::String>,
/// <p>The name of the metric to create the anomaly detection model for.</p>
pub metric_name: std::option::Option<std::string::String>,
/// <p>The metric dimensions to create the anomaly detection model for.</p>
pub dimensions: std::option::Option<std::vec::Vec<crate::model::Dimension>>,
/// <p>The statistic to use for the metric and anomaly detection model.</p>
pub stat: std::option::Option<std::string::String>,
}
impl SingleMetricAnomalyDetector {
/// <p>The namespace of the metric to create the anomaly detection model for.</p>
pub fn namespace(&self) -> std::option::Option<&str> {
self.namespace.as_deref()
}
/// <p>The name of the metric to create the anomaly detection model for.</p>
pub fn metric_name(&self) -> std::option::Option<&str> {
self.metric_name.as_deref()
}
/// <p>The metric dimensions to create the anomaly detection model for.</p>
pub fn dimensions(&self) -> std::option::Option<&[crate::model::Dimension]> {
self.dimensions.as_deref()
}
/// <p>The statistic to use for the metric and anomaly detection model.</p>
pub fn stat(&self) -> std::option::Option<&str> {
self.stat.as_deref()
}
}
impl std::fmt::Debug for SingleMetricAnomalyDetector {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("SingleMetricAnomalyDetector");
formatter.field("namespace", &self.namespace);
formatter.field("metric_name", &self.metric_name);
formatter.field("dimensions", &self.dimensions);
formatter.field("stat", &self.stat);
formatter.finish()
}
}
/// See [`SingleMetricAnomalyDetector`](crate::model::SingleMetricAnomalyDetector)
pub mod single_metric_anomaly_detector {
/// A builder for [`SingleMetricAnomalyDetector`](crate::model::SingleMetricAnomalyDetector)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) namespace: std::option::Option<std::string::String>,
pub(crate) metric_name: std::option::Option<std::string::String>,
pub(crate) dimensions: std::option::Option<std::vec::Vec<crate::model::Dimension>>,
pub(crate) stat: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The namespace of the metric to create the anomaly detection model for.</p>
pub fn namespace(mut self, input: impl Into<std::string::String>) -> Self {
self.namespace = Some(input.into());
self
}
/// <p>The namespace of the metric to create the anomaly detection model for.</p>
pub fn set_namespace(mut self, input: std::option::Option<std::string::String>) -> Self {
self.namespace = input;
self
}
/// <p>The name of the metric to create the anomaly detection model for.</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 metric to create the anomaly detection model for.</p>
pub fn set_metric_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.metric_name = input;
self
}
/// Appends an item to `dimensions`.
///
/// To override the contents of this collection use [`set_dimensions`](Self::set_dimensions).
///
/// <p>The metric dimensions to create the anomaly detection model for.</p>
pub fn dimensions(mut self, input: crate::model::Dimension) -> Self {
let mut v = self.dimensions.unwrap_or_default();
v.push(input);
self.dimensions = Some(v);
self
}
/// <p>The metric dimensions to create the anomaly detection model for.</p>
pub fn set_dimensions(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Dimension>>,
) -> Self {
self.dimensions = input;
self
}
/// <p>The statistic to use for the metric and anomaly detection model.</p>
pub fn stat(mut self, input: impl Into<std::string::String>) -> Self {
self.stat = Some(input.into());
self
}
/// <p>The statistic to use for the metric and anomaly detection model.</p>
pub fn set_stat(mut self, input: std::option::Option<std::string::String>) -> Self {
self.stat = input;
self
}
/// Consumes the builder and constructs a [`SingleMetricAnomalyDetector`](crate::model::SingleMetricAnomalyDetector)
pub fn build(self) -> crate::model::SingleMetricAnomalyDetector {
crate::model::SingleMetricAnomalyDetector {
namespace: self.namespace,
metric_name: self.metric_name,
dimensions: self.dimensions,
stat: self.stat,
}
}
}
}
impl SingleMetricAnomalyDetector {
/// Creates a new builder-style object to manufacture [`SingleMetricAnomalyDetector`](crate::model::SingleMetricAnomalyDetector)
pub fn builder() -> crate::model::single_metric_anomaly_detector::Builder {
crate::model::single_metric_anomaly_detector::Builder::default()
}
}
/// <p>The configuration specifies details about how the anomaly detection model is to be trained, including time ranges to exclude from use for training the model and the time zone to use for the metric.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct AnomalyDetectorConfiguration {
/// <p>An array of time ranges to exclude from use when the anomaly detection model is trained. Use this to make sure that events that could cause unusual values for the metric, such as deployments, aren't used when CloudWatch creates the model.</p>
pub excluded_time_ranges: std::option::Option<std::vec::Vec<crate::model::Range>>,
/// <p>The time zone to use for the metric. This is useful to enable the model to automatically account for daylight savings time changes if the metric is sensitive to such time changes.</p>
/// <p>To specify a time zone, use the name of the time zone as specified in the standard tz database. For more information, see <a href="https://en.wikipedia.org/wiki/Tz_database">tz database</a>.</p>
pub metric_timezone: std::option::Option<std::string::String>,
}
impl AnomalyDetectorConfiguration {
/// <p>An array of time ranges to exclude from use when the anomaly detection model is trained. Use this to make sure that events that could cause unusual values for the metric, such as deployments, aren't used when CloudWatch creates the model.</p>
pub fn excluded_time_ranges(&self) -> std::option::Option<&[crate::model::Range]> {
self.excluded_time_ranges.as_deref()
}
/// <p>The time zone to use for the metric. This is useful to enable the model to automatically account for daylight savings time changes if the metric is sensitive to such time changes.</p>
/// <p>To specify a time zone, use the name of the time zone as specified in the standard tz database. For more information, see <a href="https://en.wikipedia.org/wiki/Tz_database">tz database</a>.</p>
pub fn metric_timezone(&self) -> std::option::Option<&str> {
self.metric_timezone.as_deref()
}
}
impl std::fmt::Debug for AnomalyDetectorConfiguration {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("AnomalyDetectorConfiguration");
formatter.field("excluded_time_ranges", &self.excluded_time_ranges);
formatter.field("metric_timezone", &self.metric_timezone);
formatter.finish()
}
}
/// See [`AnomalyDetectorConfiguration`](crate::model::AnomalyDetectorConfiguration)
pub mod anomaly_detector_configuration {
/// A builder for [`AnomalyDetectorConfiguration`](crate::model::AnomalyDetectorConfiguration)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) excluded_time_ranges: std::option::Option<std::vec::Vec<crate::model::Range>>,
pub(crate) metric_timezone: std::option::Option<std::string::String>,
}
impl Builder {
/// Appends an item to `excluded_time_ranges`.
///
/// To override the contents of this collection use [`set_excluded_time_ranges`](Self::set_excluded_time_ranges).
///
/// <p>An array of time ranges to exclude from use when the anomaly detection model is trained. Use this to make sure that events that could cause unusual values for the metric, such as deployments, aren't used when CloudWatch creates the model.</p>
pub fn excluded_time_ranges(mut self, input: crate::model::Range) -> Self {
let mut v = self.excluded_time_ranges.unwrap_or_default();
v.push(input);
self.excluded_time_ranges = Some(v);
self
}
/// <p>An array of time ranges to exclude from use when the anomaly detection model is trained. Use this to make sure that events that could cause unusual values for the metric, such as deployments, aren't used when CloudWatch creates the model.</p>
pub fn set_excluded_time_ranges(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Range>>,
) -> Self {
self.excluded_time_ranges = input;
self
}
/// <p>The time zone to use for the metric. This is useful to enable the model to automatically account for daylight savings time changes if the metric is sensitive to such time changes.</p>
/// <p>To specify a time zone, use the name of the time zone as specified in the standard tz database. For more information, see <a href="https://en.wikipedia.org/wiki/Tz_database">tz database</a>.</p>
pub fn metric_timezone(mut self, input: impl Into<std::string::String>) -> Self {
self.metric_timezone = Some(input.into());
self
}
/// <p>The time zone to use for the metric. This is useful to enable the model to automatically account for daylight savings time changes if the metric is sensitive to such time changes.</p>
/// <p>To specify a time zone, use the name of the time zone as specified in the standard tz database. For more information, see <a href="https://en.wikipedia.org/wiki/Tz_database">tz database</a>.</p>
pub fn set_metric_timezone(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.metric_timezone = input;
self
}
/// Consumes the builder and constructs a [`AnomalyDetectorConfiguration`](crate::model::AnomalyDetectorConfiguration)
pub fn build(self) -> crate::model::AnomalyDetectorConfiguration {
crate::model::AnomalyDetectorConfiguration {
excluded_time_ranges: self.excluded_time_ranges,
metric_timezone: self.metric_timezone,
}
}
}
}
impl AnomalyDetectorConfiguration {
/// Creates a new builder-style object to manufacture [`AnomalyDetectorConfiguration`](crate::model::AnomalyDetectorConfiguration)
pub fn builder() -> crate::model::anomaly_detector_configuration::Builder {
crate::model::anomaly_detector_configuration::Builder::default()
}
}
/// <p>Specifies one range of days or times to exclude from use for training an anomaly detection model.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct Range {
/// <p>The start time of the range to exclude. The format is <code>yyyy-MM-dd'T'HH:mm:ss</code>. For example, <code>2019-07-01T23:59:59</code>.</p>
pub start_time: std::option::Option<aws_smithy_types::DateTime>,
/// <p>The end time of the range to exclude. The format is <code>yyyy-MM-dd'T'HH:mm:ss</code>. For example, <code>2019-07-01T23:59:59</code>.</p>
pub end_time: std::option::Option<aws_smithy_types::DateTime>,
}
impl Range {
/// <p>The start time of the range to exclude. The format is <code>yyyy-MM-dd'T'HH:mm:ss</code>. For example, <code>2019-07-01T23:59:59</code>.</p>
pub fn start_time(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.start_time.as_ref()
}
/// <p>The end time of the range to exclude. The format is <code>yyyy-MM-dd'T'HH:mm:ss</code>. For example, <code>2019-07-01T23:59:59</code>.</p>
pub fn end_time(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.end_time.as_ref()
}
}
impl std::fmt::Debug for Range {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Range");
formatter.field("start_time", &self.start_time);
formatter.field("end_time", &self.end_time);
formatter.finish()
}
}
/// See [`Range`](crate::model::Range)
pub mod range {
/// A builder for [`Range`](crate::model::Range)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) start_time: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) end_time: std::option::Option<aws_smithy_types::DateTime>,
}
impl Builder {
/// <p>The start time of the range to exclude. The format is <code>yyyy-MM-dd'T'HH:mm:ss</code>. For example, <code>2019-07-01T23:59:59</code>.</p>
pub fn start_time(mut self, input: aws_smithy_types::DateTime) -> Self {
self.start_time = Some(input);
self
}
/// <p>The start time of the range to exclude. The format is <code>yyyy-MM-dd'T'HH:mm:ss</code>. For example, <code>2019-07-01T23:59:59</code>.</p>
pub fn set_start_time(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.start_time = input;
self
}
/// <p>The end time of the range to exclude. The format is <code>yyyy-MM-dd'T'HH:mm:ss</code>. For example, <code>2019-07-01T23:59:59</code>.</p>
pub fn end_time(mut self, input: aws_smithy_types::DateTime) -> Self {
self.end_time = Some(input);
self
}
/// <p>The end time of the range to exclude. The format is <code>yyyy-MM-dd'T'HH:mm:ss</code>. For example, <code>2019-07-01T23:59:59</code>.</p>
pub fn set_end_time(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.end_time = input;
self
}
/// Consumes the builder and constructs a [`Range`](crate::model::Range)
pub fn build(self) -> crate::model::Range {
crate::model::Range {
start_time: self.start_time,
end_time: self.end_time,
}
}
}
}
impl Range {
/// Creates a new builder-style object to manufacture [`Range`](crate::model::Range)
pub fn builder() -> crate::model::range::Builder {
crate::model::range::Builder::default()
}
}
/// <p>This structure contains the configuration information about one metric stream.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct MetricStreamEntry {
/// <p>The ARN of the metric stream.</p>
pub arn: std::option::Option<std::string::String>,
/// <p>The date that the metric stream was originally created.</p>
pub creation_date: std::option::Option<aws_smithy_types::DateTime>,
/// <p>The date that the configuration of this metric stream was most recently updated.</p>
pub last_update_date: std::option::Option<aws_smithy_types::DateTime>,
/// <p>The name of the metric stream.</p>
pub name: std::option::Option<std::string::String>,
/// <p>The ARN of the Kinesis Firehose devlivery stream that is used for this metric stream.</p>
pub firehose_arn: std::option::Option<std::string::String>,
/// <p>The current state of this stream. Valid values are <code>running</code> and <code>stopped</code>.</p>
pub state: std::option::Option<std::string::String>,
/// <p>The output format of this metric stream. Valid values are <code>json</code> and <code>opentelemetry0.7</code>.</p>
pub output_format: std::option::Option<crate::model::MetricStreamOutputFormat>,
}
impl MetricStreamEntry {
/// <p>The ARN of the metric stream.</p>
pub fn arn(&self) -> std::option::Option<&str> {
self.arn.as_deref()
}
/// <p>The date that the metric stream was originally created.</p>
pub fn creation_date(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.creation_date.as_ref()
}
/// <p>The date that the configuration of this metric stream was most recently updated.</p>
pub fn last_update_date(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.last_update_date.as_ref()
}
/// <p>The name of the metric stream.</p>
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
/// <p>The ARN of the Kinesis Firehose devlivery stream that is used for this metric stream.</p>
pub fn firehose_arn(&self) -> std::option::Option<&str> {
self.firehose_arn.as_deref()
}
/// <p>The current state of this stream. Valid values are <code>running</code> and <code>stopped</code>.</p>
pub fn state(&self) -> std::option::Option<&str> {
self.state.as_deref()
}
/// <p>The output format of this metric stream. Valid values are <code>json</code> and <code>opentelemetry0.7</code>.</p>
pub fn output_format(&self) -> std::option::Option<&crate::model::MetricStreamOutputFormat> {
self.output_format.as_ref()
}
}
impl std::fmt::Debug for MetricStreamEntry {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("MetricStreamEntry");
formatter.field("arn", &self.arn);
formatter.field("creation_date", &self.creation_date);
formatter.field("last_update_date", &self.last_update_date);
formatter.field("name", &self.name);
formatter.field("firehose_arn", &self.firehose_arn);
formatter.field("state", &self.state);
formatter.field("output_format", &self.output_format);
formatter.finish()
}
}
/// See [`MetricStreamEntry`](crate::model::MetricStreamEntry)
pub mod metric_stream_entry {
/// A builder for [`MetricStreamEntry`](crate::model::MetricStreamEntry)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) arn: std::option::Option<std::string::String>,
pub(crate) creation_date: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) last_update_date: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) firehose_arn: std::option::Option<std::string::String>,
pub(crate) state: std::option::Option<std::string::String>,
pub(crate) output_format: std::option::Option<crate::model::MetricStreamOutputFormat>,
}
impl Builder {
/// <p>The ARN of the metric stream.</p>
pub fn arn(mut self, input: impl Into<std::string::String>) -> Self {
self.arn = Some(input.into());
self
}
/// <p>The ARN of the metric stream.</p>
pub fn set_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.arn = input;
self
}
/// <p>The date that the metric stream was originally created.</p>
pub fn creation_date(mut self, input: aws_smithy_types::DateTime) -> Self {
self.creation_date = Some(input);
self
}
/// <p>The date that the metric stream was originally created.</p>
pub fn set_creation_date(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.creation_date = input;
self
}
/// <p>The date that the configuration of this metric stream was most recently updated.</p>
pub fn last_update_date(mut self, input: aws_smithy_types::DateTime) -> Self {
self.last_update_date = Some(input);
self
}
/// <p>The date that the configuration of this metric stream was most recently updated.</p>
pub fn set_last_update_date(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.last_update_date = input;
self
}
/// <p>The name of the metric stream.</p>
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
/// <p>The name of the metric stream.</p>
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
/// <p>The ARN of the Kinesis Firehose devlivery stream that is used for this metric stream.</p>
pub fn firehose_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.firehose_arn = Some(input.into());
self
}
/// <p>The ARN of the Kinesis Firehose devlivery stream that is used for this metric stream.</p>
pub fn set_firehose_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.firehose_arn = input;
self
}
/// <p>The current state of this stream. Valid values are <code>running</code> and <code>stopped</code>.</p>
pub fn state(mut self, input: impl Into<std::string::String>) -> Self {
self.state = Some(input.into());
self
}
/// <p>The current state of this stream. Valid values are <code>running</code> and <code>stopped</code>.</p>
pub fn set_state(mut self, input: std::option::Option<std::string::String>) -> Self {
self.state = input;
self
}
/// <p>The output format of this metric stream. Valid values are <code>json</code> and <code>opentelemetry0.7</code>.</p>
pub fn output_format(mut self, input: crate::model::MetricStreamOutputFormat) -> Self {
self.output_format = Some(input);
self
}
/// <p>The output format of this metric stream. Valid values are <code>json</code> and <code>opentelemetry0.7</code>.</p>
pub fn set_output_format(
mut self,
input: std::option::Option<crate::model::MetricStreamOutputFormat>,
) -> Self {
self.output_format = input;
self
}
/// Consumes the builder and constructs a [`MetricStreamEntry`](crate::model::MetricStreamEntry)
pub fn build(self) -> crate::model::MetricStreamEntry {
crate::model::MetricStreamEntry {
arn: self.arn,
creation_date: self.creation_date,
last_update_date: self.last_update_date,
name: self.name,
firehose_arn: self.firehose_arn,
state: self.state,
output_format: self.output_format,
}
}
}
}
impl MetricStreamEntry {
/// Creates a new builder-style object to manufacture [`MetricStreamEntry`](crate::model::MetricStreamEntry)
pub fn builder() -> crate::model::metric_stream_entry::Builder {
crate::model::metric_stream_entry::Builder::default()
}
}
#[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 RecentlyActive {
#[allow(missing_docs)] // documentation missing in model
Pt3H,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for RecentlyActive {
fn from(s: &str) -> Self {
match s {
"PT3H" => RecentlyActive::Pt3H,
other => RecentlyActive::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for RecentlyActive {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(RecentlyActive::from(s))
}
}
impl RecentlyActive {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
RecentlyActive::Pt3H => "PT3H",
RecentlyActive::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&["PT3H"]
}
}
impl AsRef<str> for RecentlyActive {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>Represents filters for a dimension.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct DimensionFilter {
/// <p>The dimension name to be matched.</p>
pub name: std::option::Option<std::string::String>,
/// <p>The value of the dimension to be matched.</p>
pub value: std::option::Option<std::string::String>,
}
impl DimensionFilter {
/// <p>The dimension name to be matched.</p>
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
/// <p>The value of the dimension to be matched.</p>
pub fn value(&self) -> std::option::Option<&str> {
self.value.as_deref()
}
}
impl std::fmt::Debug for DimensionFilter {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("DimensionFilter");
formatter.field("name", &self.name);
formatter.field("value", &self.value);
formatter.finish()
}
}
/// See [`DimensionFilter`](crate::model::DimensionFilter)
pub mod dimension_filter {
/// A builder for [`DimensionFilter`](crate::model::DimensionFilter)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) value: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The dimension name to be matched.</p>
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
/// <p>The dimension name to be matched.</p>
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
/// <p>The value of the dimension to be matched.</p>
pub fn value(mut self, input: impl Into<std::string::String>) -> Self {
self.value = Some(input.into());
self
}
/// <p>The value of the dimension to be matched.</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 [`DimensionFilter`](crate::model::DimensionFilter)
pub fn build(self) -> crate::model::DimensionFilter {
crate::model::DimensionFilter {
name: self.name,
value: self.value,
}
}
}
}
impl DimensionFilter {
/// Creates a new builder-style object to manufacture [`DimensionFilter`](crate::model::DimensionFilter)
pub fn builder() -> crate::model::dimension_filter::Builder {
crate::model::dimension_filter::Builder::default()
}
}
/// <p>Represents a specific dashboard.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct DashboardEntry {
/// <p>The name of the dashboard.</p>
pub dashboard_name: std::option::Option<std::string::String>,
/// <p>The Amazon Resource Name (ARN) of the dashboard.</p>
pub dashboard_arn: std::option::Option<std::string::String>,
/// <p>The time stamp of when the dashboard was last modified, either by an API call or through the console. This number is expressed as the number of milliseconds since Jan 1, 1970 00:00:00 UTC.</p>
pub last_modified: std::option::Option<aws_smithy_types::DateTime>,
/// <p>The size of the dashboard, in bytes.</p>
pub size: i64,
}
impl DashboardEntry {
/// <p>The name of the dashboard.</p>
pub fn dashboard_name(&self) -> std::option::Option<&str> {
self.dashboard_name.as_deref()
}
/// <p>The Amazon Resource Name (ARN) of the dashboard.</p>
pub fn dashboard_arn(&self) -> std::option::Option<&str> {
self.dashboard_arn.as_deref()
}
/// <p>The time stamp of when the dashboard was last modified, either by an API call or through the console. This number is expressed as the number of milliseconds since Jan 1, 1970 00:00:00 UTC.</p>
pub fn last_modified(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.last_modified.as_ref()
}
/// <p>The size of the dashboard, in bytes.</p>
pub fn size(&self) -> i64 {
self.size
}
}
impl std::fmt::Debug for DashboardEntry {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("DashboardEntry");
formatter.field("dashboard_name", &self.dashboard_name);
formatter.field("dashboard_arn", &self.dashboard_arn);
formatter.field("last_modified", &self.last_modified);
formatter.field("size", &self.size);
formatter.finish()
}
}
/// See [`DashboardEntry`](crate::model::DashboardEntry)
pub mod dashboard_entry {
/// A builder for [`DashboardEntry`](crate::model::DashboardEntry)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) dashboard_name: std::option::Option<std::string::String>,
pub(crate) dashboard_arn: std::option::Option<std::string::String>,
pub(crate) last_modified: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) size: std::option::Option<i64>,
}
impl Builder {
/// <p>The name of the dashboard.</p>
pub fn dashboard_name(mut self, input: impl Into<std::string::String>) -> Self {
self.dashboard_name = Some(input.into());
self
}
/// <p>The name of the dashboard.</p>
pub fn set_dashboard_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.dashboard_name = input;
self
}
/// <p>The Amazon Resource Name (ARN) of the dashboard.</p>
pub fn dashboard_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.dashboard_arn = Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the dashboard.</p>
pub fn set_dashboard_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.dashboard_arn = input;
self
}
/// <p>The time stamp of when the dashboard was last modified, either by an API call or through the console. This number is expressed as the number of milliseconds since Jan 1, 1970 00:00:00 UTC.</p>
pub fn last_modified(mut self, input: aws_smithy_types::DateTime) -> Self {
self.last_modified = Some(input);
self
}
/// <p>The time stamp of when the dashboard was last modified, either by an API call or through the console. This number is expressed as the number of milliseconds since Jan 1, 1970 00:00:00 UTC.</p>
pub fn set_last_modified(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.last_modified = input;
self
}
/// <p>The size of the dashboard, in bytes.</p>
pub fn size(mut self, input: i64) -> Self {
self.size = Some(input);
self
}
/// <p>The size of the dashboard, in bytes.</p>
pub fn set_size(mut self, input: std::option::Option<i64>) -> Self {
self.size = input;
self
}
/// Consumes the builder and constructs a [`DashboardEntry`](crate::model::DashboardEntry)
pub fn build(self) -> crate::model::DashboardEntry {
crate::model::DashboardEntry {
dashboard_name: self.dashboard_name,
dashboard_arn: self.dashboard_arn,
last_modified: self.last_modified,
size: self.size.unwrap_or_default(),
}
}
}
}
impl DashboardEntry {
/// Creates a new builder-style object to manufacture [`DashboardEntry`](crate::model::DashboardEntry)
pub fn builder() -> crate::model::dashboard_entry::Builder {
crate::model::dashboard_entry::Builder::default()
}
}
/// <p>Encapsulates the statistical data that CloudWatch computes from metric data.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct Datapoint {
/// <p>The time stamp used for the data point.</p>
pub timestamp: std::option::Option<aws_smithy_types::DateTime>,
/// <p>The number of metric values that contributed to the aggregate value of this data point.</p>
pub sample_count: std::option::Option<f64>,
/// <p>The average of the metric values that correspond to the data point.</p>
pub average: std::option::Option<f64>,
/// <p>The sum of the metric values for the data point.</p>
pub sum: std::option::Option<f64>,
/// <p>The minimum metric value for the data point.</p>
pub minimum: std::option::Option<f64>,
/// <p>The maximum metric value for the data point.</p>
pub maximum: std::option::Option<f64>,
/// <p>The standard unit for the data point.</p>
pub unit: std::option::Option<crate::model::StandardUnit>,
/// <p>The percentile statistic for the data point.</p>
pub extended_statistics:
std::option::Option<std::collections::HashMap<std::string::String, f64>>,
}
impl Datapoint {
/// <p>The time stamp used for the data point.</p>
pub fn timestamp(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.timestamp.as_ref()
}
/// <p>The number of metric values that contributed to the aggregate value of this data point.</p>
pub fn sample_count(&self) -> std::option::Option<f64> {
self.sample_count
}
/// <p>The average of the metric values that correspond to the data point.</p>
pub fn average(&self) -> std::option::Option<f64> {
self.average
}
/// <p>The sum of the metric values for the data point.</p>
pub fn sum(&self) -> std::option::Option<f64> {
self.sum
}
/// <p>The minimum metric value for the data point.</p>
pub fn minimum(&self) -> std::option::Option<f64> {
self.minimum
}
/// <p>The maximum metric value for the data point.</p>
pub fn maximum(&self) -> std::option::Option<f64> {
self.maximum
}
/// <p>The standard unit for the data point.</p>
pub fn unit(&self) -> std::option::Option<&crate::model::StandardUnit> {
self.unit.as_ref()
}
/// <p>The percentile statistic for the data point.</p>
pub fn extended_statistics(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, f64>> {
self.extended_statistics.as_ref()
}
}
impl std::fmt::Debug for Datapoint {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Datapoint");
formatter.field("timestamp", &self.timestamp);
formatter.field("sample_count", &self.sample_count);
formatter.field("average", &self.average);
formatter.field("sum", &self.sum);
formatter.field("minimum", &self.minimum);
formatter.field("maximum", &self.maximum);
formatter.field("unit", &self.unit);
formatter.field("extended_statistics", &self.extended_statistics);
formatter.finish()
}
}
/// See [`Datapoint`](crate::model::Datapoint)
pub mod datapoint {
/// A builder for [`Datapoint`](crate::model::Datapoint)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) timestamp: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) sample_count: std::option::Option<f64>,
pub(crate) average: std::option::Option<f64>,
pub(crate) sum: std::option::Option<f64>,
pub(crate) minimum: std::option::Option<f64>,
pub(crate) maximum: std::option::Option<f64>,
pub(crate) unit: std::option::Option<crate::model::StandardUnit>,
pub(crate) extended_statistics:
std::option::Option<std::collections::HashMap<std::string::String, f64>>,
}
impl Builder {
/// <p>The time stamp used for the data point.</p>
pub fn timestamp(mut self, input: aws_smithy_types::DateTime) -> Self {
self.timestamp = Some(input);
self
}
/// <p>The time stamp used for the data point.</p>
pub fn set_timestamp(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.timestamp = input;
self
}
/// <p>The number of metric values that contributed to the aggregate value of this data point.</p>
pub fn sample_count(mut self, input: f64) -> Self {
self.sample_count = Some(input);
self
}
/// <p>The number of metric values that contributed to the aggregate value of this data point.</p>
pub fn set_sample_count(mut self, input: std::option::Option<f64>) -> Self {
self.sample_count = input;
self
}
/// <p>The average of the metric values that correspond to the data point.</p>
pub fn average(mut self, input: f64) -> Self {
self.average = Some(input);
self
}
/// <p>The average of the metric values that correspond to the data point.</p>
pub fn set_average(mut self, input: std::option::Option<f64>) -> Self {
self.average = input;
self
}
/// <p>The sum of the metric values for the data point.</p>
pub fn sum(mut self, input: f64) -> Self {
self.sum = Some(input);
self
}
/// <p>The sum of the metric values for the data point.</p>
pub fn set_sum(mut self, input: std::option::Option<f64>) -> Self {
self.sum = input;
self
}
/// <p>The minimum metric value for the data point.</p>
pub fn minimum(mut self, input: f64) -> Self {
self.minimum = Some(input);
self
}
/// <p>The minimum metric value for the data point.</p>
pub fn set_minimum(mut self, input: std::option::Option<f64>) -> Self {
self.minimum = input;
self
}
/// <p>The maximum metric value for the data point.</p>
pub fn maximum(mut self, input: f64) -> Self {
self.maximum = Some(input);
self
}
/// <p>The maximum metric value for the data point.</p>
pub fn set_maximum(mut self, input: std::option::Option<f64>) -> Self {
self.maximum = input;
self
}
/// <p>The standard unit for the data point.</p>
pub fn unit(mut self, input: crate::model::StandardUnit) -> Self {
self.unit = Some(input);
self
}
/// <p>The standard unit for the data point.</p>
pub fn set_unit(mut self, input: std::option::Option<crate::model::StandardUnit>) -> Self {
self.unit = input;
self
}
/// Adds a key-value pair to `extended_statistics`.
///
/// To override the contents of this collection use [`set_extended_statistics`](Self::set_extended_statistics).
///
/// <p>The percentile statistic for the data point.</p>
pub fn extended_statistics(mut self, k: impl Into<std::string::String>, v: f64) -> Self {
let mut hash_map = self.extended_statistics.unwrap_or_default();
hash_map.insert(k.into(), v);
self.extended_statistics = Some(hash_map);
self
}
/// <p>The percentile statistic for the data point.</p>
pub fn set_extended_statistics(
mut self,
input: std::option::Option<std::collections::HashMap<std::string::String, f64>>,
) -> Self {
self.extended_statistics = input;
self
}
/// Consumes the builder and constructs a [`Datapoint`](crate::model::Datapoint)
pub fn build(self) -> crate::model::Datapoint {
crate::model::Datapoint {
timestamp: self.timestamp,
sample_count: self.sample_count,
average: self.average,
sum: self.sum,
minimum: self.minimum,
maximum: self.maximum,
unit: self.unit,
extended_statistics: self.extended_statistics,
}
}
}
}
impl Datapoint {
/// Creates a new builder-style object to manufacture [`Datapoint`](crate::model::Datapoint)
pub fn builder() -> crate::model::datapoint::Builder {
crate::model::datapoint::Builder::default()
}
}
/// <p>A message returned by the <code>GetMetricData</code>API, including a code and a description.</p>
/// <p>If a cross-Region <code>GetMetricData</code> operation fails with a code of <code>Forbidden</code> and a value of <code>Authentication too complex to retrieve cross region data</code>, you can correct the problem by running the <code>GetMetricData</code> operation in the same Region where the metric data is.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct MessageData {
/// <p>The error code or status code associated with the message.</p>
pub code: std::option::Option<std::string::String>,
/// <p>The message text.</p>
pub value: std::option::Option<std::string::String>,
}
impl MessageData {
/// <p>The error code or status code associated with the message.</p>
pub fn code(&self) -> std::option::Option<&str> {
self.code.as_deref()
}
/// <p>The message text.</p>
pub fn value(&self) -> std::option::Option<&str> {
self.value.as_deref()
}
}
impl std::fmt::Debug for MessageData {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("MessageData");
formatter.field("code", &self.code);
formatter.field("value", &self.value);
formatter.finish()
}
}
/// See [`MessageData`](crate::model::MessageData)
pub mod message_data {
/// A builder for [`MessageData`](crate::model::MessageData)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) code: std::option::Option<std::string::String>,
pub(crate) value: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The error code or status code associated with the message.</p>
pub fn code(mut self, input: impl Into<std::string::String>) -> Self {
self.code = Some(input.into());
self
}
/// <p>The error code or status code associated with the message.</p>
pub fn set_code(mut self, input: std::option::Option<std::string::String>) -> Self {
self.code = input;
self
}
/// <p>The message text.</p>
pub fn value(mut self, input: impl Into<std::string::String>) -> Self {
self.value = Some(input.into());
self
}
/// <p>The message text.</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 [`MessageData`](crate::model::MessageData)
pub fn build(self) -> crate::model::MessageData {
crate::model::MessageData {
code: self.code,
value: self.value,
}
}
}
}
impl MessageData {
/// Creates a new builder-style object to manufacture [`MessageData`](crate::model::MessageData)
pub fn builder() -> crate::model::message_data::Builder {
crate::model::message_data::Builder::default()
}
}
/// <p>A <code>GetMetricData</code> call returns an array of <code>MetricDataResult</code> structures. Each of these structures includes the data points for that metric, along with the timestamps of those data points and other identifying information.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct MetricDataResult {
/// <p>The short name you specified to represent this metric.</p>
pub id: std::option::Option<std::string::String>,
/// <p>The human-readable label associated with the data.</p>
pub label: std::option::Option<std::string::String>,
/// <p>The timestamps for the data points, formatted in Unix timestamp format. The number of timestamps always matches the number of values and the value for Timestamps[x] is Values[x].</p>
pub timestamps: std::option::Option<std::vec::Vec<aws_smithy_types::DateTime>>,
/// <p>The data points for the metric corresponding to <code>Timestamps</code>. The number of values always matches the number of timestamps and the timestamp for Values[x] is Timestamps[x].</p>
pub values: std::option::Option<std::vec::Vec<f64>>,
/// <p>The status of the returned data. <code>Complete</code> indicates that all data points in the requested time range were returned. <code>PartialData</code> means that an incomplete set of data points were returned. You can use the <code>NextToken</code> value that was returned and repeat your request to get more data points. <code>NextToken</code> is not returned if you are performing a math expression. <code>InternalError</code> indicates that an error occurred. Retry your request using <code>NextToken</code>, if present.</p>
pub status_code: std::option::Option<crate::model::StatusCode>,
/// <p>A list of messages with additional information about the data returned.</p>
pub messages: std::option::Option<std::vec::Vec<crate::model::MessageData>>,
}
impl MetricDataResult {
/// <p>The short name you specified to represent this metric.</p>
pub fn id(&self) -> std::option::Option<&str> {
self.id.as_deref()
}
/// <p>The human-readable label associated with the data.</p>
pub fn label(&self) -> std::option::Option<&str> {
self.label.as_deref()
}
/// <p>The timestamps for the data points, formatted in Unix timestamp format. The number of timestamps always matches the number of values and the value for Timestamps[x] is Values[x].</p>
pub fn timestamps(&self) -> std::option::Option<&[aws_smithy_types::DateTime]> {
self.timestamps.as_deref()
}
/// <p>The data points for the metric corresponding to <code>Timestamps</code>. The number of values always matches the number of timestamps and the timestamp for Values[x] is Timestamps[x].</p>
pub fn values(&self) -> std::option::Option<&[f64]> {
self.values.as_deref()
}
/// <p>The status of the returned data. <code>Complete</code> indicates that all data points in the requested time range were returned. <code>PartialData</code> means that an incomplete set of data points were returned. You can use the <code>NextToken</code> value that was returned and repeat your request to get more data points. <code>NextToken</code> is not returned if you are performing a math expression. <code>InternalError</code> indicates that an error occurred. Retry your request using <code>NextToken</code>, if present.</p>
pub fn status_code(&self) -> std::option::Option<&crate::model::StatusCode> {
self.status_code.as_ref()
}
/// <p>A list of messages with additional information about the data returned.</p>
pub fn messages(&self) -> std::option::Option<&[crate::model::MessageData]> {
self.messages.as_deref()
}
}
impl std::fmt::Debug for MetricDataResult {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("MetricDataResult");
formatter.field("id", &self.id);
formatter.field("label", &self.label);
formatter.field("timestamps", &self.timestamps);
formatter.field("values", &self.values);
formatter.field("status_code", &self.status_code);
formatter.field("messages", &self.messages);
formatter.finish()
}
}
/// See [`MetricDataResult`](crate::model::MetricDataResult)
pub mod metric_data_result {
/// A builder for [`MetricDataResult`](crate::model::MetricDataResult)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) id: std::option::Option<std::string::String>,
pub(crate) label: std::option::Option<std::string::String>,
pub(crate) timestamps: std::option::Option<std::vec::Vec<aws_smithy_types::DateTime>>,
pub(crate) values: std::option::Option<std::vec::Vec<f64>>,
pub(crate) status_code: std::option::Option<crate::model::StatusCode>,
pub(crate) messages: std::option::Option<std::vec::Vec<crate::model::MessageData>>,
}
impl Builder {
/// <p>The short name you specified to represent this metric.</p>
pub fn id(mut self, input: impl Into<std::string::String>) -> Self {
self.id = Some(input.into());
self
}
/// <p>The short name you specified to represent this metric.</p>
pub fn set_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.id = input;
self
}
/// <p>The human-readable label associated with the data.</p>
pub fn label(mut self, input: impl Into<std::string::String>) -> Self {
self.label = Some(input.into());
self
}
/// <p>The human-readable label associated with the data.</p>
pub fn set_label(mut self, input: std::option::Option<std::string::String>) -> Self {
self.label = input;
self
}
/// Appends an item to `timestamps`.
///
/// To override the contents of this collection use [`set_timestamps`](Self::set_timestamps).
///
/// <p>The timestamps for the data points, formatted in Unix timestamp format. The number of timestamps always matches the number of values and the value for Timestamps[x] is Values[x].</p>
pub fn timestamps(mut self, input: aws_smithy_types::DateTime) -> Self {
let mut v = self.timestamps.unwrap_or_default();
v.push(input);
self.timestamps = Some(v);
self
}
/// <p>The timestamps for the data points, formatted in Unix timestamp format. The number of timestamps always matches the number of values and the value for Timestamps[x] is Values[x].</p>
pub fn set_timestamps(
mut self,
input: std::option::Option<std::vec::Vec<aws_smithy_types::DateTime>>,
) -> Self {
self.timestamps = input;
self
}
/// Appends an item to `values`.
///
/// To override the contents of this collection use [`set_values`](Self::set_values).
///
/// <p>The data points for the metric corresponding to <code>Timestamps</code>. The number of values always matches the number of timestamps and the timestamp for Values[x] is Timestamps[x].</p>
pub fn values(mut self, input: f64) -> Self {
let mut v = self.values.unwrap_or_default();
v.push(input);
self.values = Some(v);
self
}
/// <p>The data points for the metric corresponding to <code>Timestamps</code>. The number of values always matches the number of timestamps and the timestamp for Values[x] is Timestamps[x].</p>
pub fn set_values(mut self, input: std::option::Option<std::vec::Vec<f64>>) -> Self {
self.values = input;
self
}
/// <p>The status of the returned data. <code>Complete</code> indicates that all data points in the requested time range were returned. <code>PartialData</code> means that an incomplete set of data points were returned. You can use the <code>NextToken</code> value that was returned and repeat your request to get more data points. <code>NextToken</code> is not returned if you are performing a math expression. <code>InternalError</code> indicates that an error occurred. Retry your request using <code>NextToken</code>, if present.</p>
pub fn status_code(mut self, input: crate::model::StatusCode) -> Self {
self.status_code = Some(input);
self
}
/// <p>The status of the returned data. <code>Complete</code> indicates that all data points in the requested time range were returned. <code>PartialData</code> means that an incomplete set of data points were returned. You can use the <code>NextToken</code> value that was returned and repeat your request to get more data points. <code>NextToken</code> is not returned if you are performing a math expression. <code>InternalError</code> indicates that an error occurred. Retry your request using <code>NextToken</code>, if present.</p>
pub fn set_status_code(
mut self,
input: std::option::Option<crate::model::StatusCode>,
) -> Self {
self.status_code = input;
self
}
/// Appends an item to `messages`.
///
/// To override the contents of this collection use [`set_messages`](Self::set_messages).
///
/// <p>A list of messages with additional information about the data returned.</p>
pub fn messages(mut self, input: crate::model::MessageData) -> Self {
let mut v = self.messages.unwrap_or_default();
v.push(input);
self.messages = Some(v);
self
}
/// <p>A list of messages with additional information about the data returned.</p>
pub fn set_messages(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::MessageData>>,
) -> Self {
self.messages = input;
self
}
/// Consumes the builder and constructs a [`MetricDataResult`](crate::model::MetricDataResult)
pub fn build(self) -> crate::model::MetricDataResult {
crate::model::MetricDataResult {
id: self.id,
label: self.label,
timestamps: self.timestamps,
values: self.values,
status_code: self.status_code,
messages: self.messages,
}
}
}
}
impl MetricDataResult {
/// Creates a new builder-style object to manufacture [`MetricDataResult`](crate::model::MetricDataResult)
pub fn builder() -> crate::model::metric_data_result::Builder {
crate::model::metric_data_result::Builder::default()
}
}
#[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 StatusCode {
#[allow(missing_docs)] // documentation missing in model
Complete,
#[allow(missing_docs)] // documentation missing in model
InternalError,
#[allow(missing_docs)] // documentation missing in model
PartialData,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for StatusCode {
fn from(s: &str) -> Self {
match s {
"Complete" => StatusCode::Complete,
"InternalError" => StatusCode::InternalError,
"PartialData" => StatusCode::PartialData,
other => StatusCode::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for StatusCode {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(StatusCode::from(s))
}
}
impl StatusCode {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
StatusCode::Complete => "Complete",
StatusCode::InternalError => "InternalError",
StatusCode::PartialData => "PartialData",
StatusCode::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&["Complete", "InternalError", "PartialData"]
}
}
impl AsRef<str> for StatusCode {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>This structure includes the <code>Timezone</code> parameter, which you can use to specify your time zone so that the labels that are associated with returned metrics display the correct time for your time zone. </p>
/// <p>The <code>Timezone</code> value affects a label only if you have a time-based dynamic expression in the label. For more information about dynamic expressions in labels, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph-dynamic-labels.html">Using Dynamic Labels</a>.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct LabelOptions {
/// <p>The time zone to use for metric data return in this operation. The format is <code>+</code> or <code>-</code> followed by four digits. The first two digits indicate the number of hours ahead or behind of UTC, and the final two digits are the number of minutes. For example, +0130 indicates a time zone that is 1 hour and 30 minutes ahead of UTC. The default is +0000. </p>
pub timezone: std::option::Option<std::string::String>,
}
impl LabelOptions {
/// <p>The time zone to use for metric data return in this operation. The format is <code>+</code> or <code>-</code> followed by four digits. The first two digits indicate the number of hours ahead or behind of UTC, and the final two digits are the number of minutes. For example, +0130 indicates a time zone that is 1 hour and 30 minutes ahead of UTC. The default is +0000. </p>
pub fn timezone(&self) -> std::option::Option<&str> {
self.timezone.as_deref()
}
}
impl std::fmt::Debug for LabelOptions {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("LabelOptions");
formatter.field("timezone", &self.timezone);
formatter.finish()
}
}
/// See [`LabelOptions`](crate::model::LabelOptions)
pub mod label_options {
/// A builder for [`LabelOptions`](crate::model::LabelOptions)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) timezone: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The time zone to use for metric data return in this operation. The format is <code>+</code> or <code>-</code> followed by four digits. The first two digits indicate the number of hours ahead or behind of UTC, and the final two digits are the number of minutes. For example, +0130 indicates a time zone that is 1 hour and 30 minutes ahead of UTC. The default is +0000. </p>
pub fn timezone(mut self, input: impl Into<std::string::String>) -> Self {
self.timezone = Some(input.into());
self
}
/// <p>The time zone to use for metric data return in this operation. The format is <code>+</code> or <code>-</code> followed by four digits. The first two digits indicate the number of hours ahead or behind of UTC, and the final two digits are the number of minutes. For example, +0130 indicates a time zone that is 1 hour and 30 minutes ahead of UTC. The default is +0000. </p>
pub fn set_timezone(mut self, input: std::option::Option<std::string::String>) -> Self {
self.timezone = input;
self
}
/// Consumes the builder and constructs a [`LabelOptions`](crate::model::LabelOptions)
pub fn build(self) -> crate::model::LabelOptions {
crate::model::LabelOptions {
timezone: self.timezone,
}
}
}
}
impl LabelOptions {
/// Creates a new builder-style object to manufacture [`LabelOptions`](crate::model::LabelOptions)
pub fn builder() -> crate::model::label_options::Builder {
crate::model::label_options::Builder::default()
}
}
#[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 ScanBy {
#[allow(missing_docs)] // documentation missing in model
TimestampAscending,
#[allow(missing_docs)] // documentation missing in model
TimestampDescending,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for ScanBy {
fn from(s: &str) -> Self {
match s {
"TimestampAscending" => ScanBy::TimestampAscending,
"TimestampDescending" => ScanBy::TimestampDescending,
other => ScanBy::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for ScanBy {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(ScanBy::from(s))
}
}
impl ScanBy {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
ScanBy::TimestampAscending => "TimestampAscending",
ScanBy::TimestampDescending => "TimestampDescending",
ScanBy::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&["TimestampAscending", "TimestampDescending"]
}
}
impl AsRef<str> for ScanBy {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>One data point from the metric time series returned in a Contributor Insights rule report.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_GetInsightRuleReport.html">GetInsightRuleReport</a>.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct InsightRuleMetricDatapoint {
/// <p>The timestamp of the data point.</p>
pub timestamp: std::option::Option<aws_smithy_types::DateTime>,
/// <p>The number of unique contributors who published data during this timestamp.</p>
/// <p>This statistic is returned only if you included it in the <code>Metrics</code> array in your request.</p>
pub unique_contributors: std::option::Option<f64>,
/// <p>The maximum value provided by one contributor during this timestamp. Each timestamp is evaluated separately, so the identity of the max contributor could be different for each timestamp.</p>
/// <p>This statistic is returned only if you included it in the <code>Metrics</code> array in your request.</p>
pub max_contributor_value: std::option::Option<f64>,
/// <p>The number of occurrences that matched the rule during this data point.</p>
/// <p>This statistic is returned only if you included it in the <code>Metrics</code> array in your request.</p>
pub sample_count: std::option::Option<f64>,
/// <p>The average value from all contributors during the time period represented by that data point.</p>
/// <p>This statistic is returned only if you included it in the <code>Metrics</code> array in your request.</p>
pub average: std::option::Option<f64>,
/// <p>The sum of the values from all contributors during the time period represented by that data point.</p>
/// <p>This statistic is returned only if you included it in the <code>Metrics</code> array in your request.</p>
pub sum: std::option::Option<f64>,
/// <p>The minimum value from a single contributor during the time period represented by that data point.</p>
/// <p>This statistic is returned only if you included it in the <code>Metrics</code> array in your request.</p>
pub minimum: std::option::Option<f64>,
/// <p>The maximum value from a single occurence from a single contributor during the time period represented by that data point.</p>
/// <p>This statistic is returned only if you included it in the <code>Metrics</code> array in your request.</p>
pub maximum: std::option::Option<f64>,
}
impl InsightRuleMetricDatapoint {
/// <p>The timestamp of the data point.</p>
pub fn timestamp(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.timestamp.as_ref()
}
/// <p>The number of unique contributors who published data during this timestamp.</p>
/// <p>This statistic is returned only if you included it in the <code>Metrics</code> array in your request.</p>
pub fn unique_contributors(&self) -> std::option::Option<f64> {
self.unique_contributors
}
/// <p>The maximum value provided by one contributor during this timestamp. Each timestamp is evaluated separately, so the identity of the max contributor could be different for each timestamp.</p>
/// <p>This statistic is returned only if you included it in the <code>Metrics</code> array in your request.</p>
pub fn max_contributor_value(&self) -> std::option::Option<f64> {
self.max_contributor_value
}
/// <p>The number of occurrences that matched the rule during this data point.</p>
/// <p>This statistic is returned only if you included it in the <code>Metrics</code> array in your request.</p>
pub fn sample_count(&self) -> std::option::Option<f64> {
self.sample_count
}
/// <p>The average value from all contributors during the time period represented by that data point.</p>
/// <p>This statistic is returned only if you included it in the <code>Metrics</code> array in your request.</p>
pub fn average(&self) -> std::option::Option<f64> {
self.average
}
/// <p>The sum of the values from all contributors during the time period represented by that data point.</p>
/// <p>This statistic is returned only if you included it in the <code>Metrics</code> array in your request.</p>
pub fn sum(&self) -> std::option::Option<f64> {
self.sum
}
/// <p>The minimum value from a single contributor during the time period represented by that data point.</p>
/// <p>This statistic is returned only if you included it in the <code>Metrics</code> array in your request.</p>
pub fn minimum(&self) -> std::option::Option<f64> {
self.minimum
}
/// <p>The maximum value from a single occurence from a single contributor during the time period represented by that data point.</p>
/// <p>This statistic is returned only if you included it in the <code>Metrics</code> array in your request.</p>
pub fn maximum(&self) -> std::option::Option<f64> {
self.maximum
}
}
impl std::fmt::Debug for InsightRuleMetricDatapoint {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("InsightRuleMetricDatapoint");
formatter.field("timestamp", &self.timestamp);
formatter.field("unique_contributors", &self.unique_contributors);
formatter.field("max_contributor_value", &self.max_contributor_value);
formatter.field("sample_count", &self.sample_count);
formatter.field("average", &self.average);
formatter.field("sum", &self.sum);
formatter.field("minimum", &self.minimum);
formatter.field("maximum", &self.maximum);
formatter.finish()
}
}
/// See [`InsightRuleMetricDatapoint`](crate::model::InsightRuleMetricDatapoint)
pub mod insight_rule_metric_datapoint {
/// A builder for [`InsightRuleMetricDatapoint`](crate::model::InsightRuleMetricDatapoint)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) timestamp: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) unique_contributors: std::option::Option<f64>,
pub(crate) max_contributor_value: std::option::Option<f64>,
pub(crate) sample_count: std::option::Option<f64>,
pub(crate) average: std::option::Option<f64>,
pub(crate) sum: std::option::Option<f64>,
pub(crate) minimum: std::option::Option<f64>,
pub(crate) maximum: std::option::Option<f64>,
}
impl Builder {
/// <p>The timestamp of the data point.</p>
pub fn timestamp(mut self, input: aws_smithy_types::DateTime) -> Self {
self.timestamp = Some(input);
self
}
/// <p>The timestamp of the data point.</p>
pub fn set_timestamp(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.timestamp = input;
self
}
/// <p>The number of unique contributors who published data during this timestamp.</p>
/// <p>This statistic is returned only if you included it in the <code>Metrics</code> array in your request.</p>
pub fn unique_contributors(mut self, input: f64) -> Self {
self.unique_contributors = Some(input);
self
}
/// <p>The number of unique contributors who published data during this timestamp.</p>
/// <p>This statistic is returned only if you included it in the <code>Metrics</code> array in your request.</p>
pub fn set_unique_contributors(mut self, input: std::option::Option<f64>) -> Self {
self.unique_contributors = input;
self
}
/// <p>The maximum value provided by one contributor during this timestamp. Each timestamp is evaluated separately, so the identity of the max contributor could be different for each timestamp.</p>
/// <p>This statistic is returned only if you included it in the <code>Metrics</code> array in your request.</p>
pub fn max_contributor_value(mut self, input: f64) -> Self {
self.max_contributor_value = Some(input);
self
}
/// <p>The maximum value provided by one contributor during this timestamp. Each timestamp is evaluated separately, so the identity of the max contributor could be different for each timestamp.</p>
/// <p>This statistic is returned only if you included it in the <code>Metrics</code> array in your request.</p>
pub fn set_max_contributor_value(mut self, input: std::option::Option<f64>) -> Self {
self.max_contributor_value = input;
self
}
/// <p>The number of occurrences that matched the rule during this data point.</p>
/// <p>This statistic is returned only if you included it in the <code>Metrics</code> array in your request.</p>
pub fn sample_count(mut self, input: f64) -> Self {
self.sample_count = Some(input);
self
}
/// <p>The number of occurrences that matched the rule during this data point.</p>
/// <p>This statistic is returned only if you included it in the <code>Metrics</code> array in your request.</p>
pub fn set_sample_count(mut self, input: std::option::Option<f64>) -> Self {
self.sample_count = input;
self
}
/// <p>The average value from all contributors during the time period represented by that data point.</p>
/// <p>This statistic is returned only if you included it in the <code>Metrics</code> array in your request.</p>
pub fn average(mut self, input: f64) -> Self {
self.average = Some(input);
self
}
/// <p>The average value from all contributors during the time period represented by that data point.</p>
/// <p>This statistic is returned only if you included it in the <code>Metrics</code> array in your request.</p>
pub fn set_average(mut self, input: std::option::Option<f64>) -> Self {
self.average = input;
self
}
/// <p>The sum of the values from all contributors during the time period represented by that data point.</p>
/// <p>This statistic is returned only if you included it in the <code>Metrics</code> array in your request.</p>
pub fn sum(mut self, input: f64) -> Self {
self.sum = Some(input);
self
}
/// <p>The sum of the values from all contributors during the time period represented by that data point.</p>
/// <p>This statistic is returned only if you included it in the <code>Metrics</code> array in your request.</p>
pub fn set_sum(mut self, input: std::option::Option<f64>) -> Self {
self.sum = input;
self
}
/// <p>The minimum value from a single contributor during the time period represented by that data point.</p>
/// <p>This statistic is returned only if you included it in the <code>Metrics</code> array in your request.</p>
pub fn minimum(mut self, input: f64) -> Self {
self.minimum = Some(input);
self
}
/// <p>The minimum value from a single contributor during the time period represented by that data point.</p>
/// <p>This statistic is returned only if you included it in the <code>Metrics</code> array in your request.</p>
pub fn set_minimum(mut self, input: std::option::Option<f64>) -> Self {
self.minimum = input;
self
}
/// <p>The maximum value from a single occurence from a single contributor during the time period represented by that data point.</p>
/// <p>This statistic is returned only if you included it in the <code>Metrics</code> array in your request.</p>
pub fn maximum(mut self, input: f64) -> Self {
self.maximum = Some(input);
self
}
/// <p>The maximum value from a single occurence from a single contributor during the time period represented by that data point.</p>
/// <p>This statistic is returned only if you included it in the <code>Metrics</code> array in your request.</p>
pub fn set_maximum(mut self, input: std::option::Option<f64>) -> Self {
self.maximum = input;
self
}
/// Consumes the builder and constructs a [`InsightRuleMetricDatapoint`](crate::model::InsightRuleMetricDatapoint)
pub fn build(self) -> crate::model::InsightRuleMetricDatapoint {
crate::model::InsightRuleMetricDatapoint {
timestamp: self.timestamp,
unique_contributors: self.unique_contributors,
max_contributor_value: self.max_contributor_value,
sample_count: self.sample_count,
average: self.average,
sum: self.sum,
minimum: self.minimum,
maximum: self.maximum,
}
}
}
}
impl InsightRuleMetricDatapoint {
/// Creates a new builder-style object to manufacture [`InsightRuleMetricDatapoint`](crate::model::InsightRuleMetricDatapoint)
pub fn builder() -> crate::model::insight_rule_metric_datapoint::Builder {
crate::model::insight_rule_metric_datapoint::Builder::default()
}
}
/// <p>One of the unique contributors found by a Contributor Insights rule. If the rule contains multiple keys, then a unique contributor is a unique combination of values from all the keys in the rule.</p>
/// <p>If the rule contains a single key, then each unique contributor is each unique value for this key.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_GetInsightRuleReport.html">GetInsightRuleReport</a>.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct InsightRuleContributor {
/// <p>One of the log entry field keywords that is used to define contributors for this rule.</p>
pub keys: std::option::Option<std::vec::Vec<std::string::String>>,
/// <p>An approximation of the aggregate value that comes from this contributor.</p>
pub approximate_aggregate_value: std::option::Option<f64>,
/// <p>An array of the data points where this contributor is present. Only the data points when this contributor appeared are included in the array.</p>
pub datapoints:
std::option::Option<std::vec::Vec<crate::model::InsightRuleContributorDatapoint>>,
}
impl InsightRuleContributor {
/// <p>One of the log entry field keywords that is used to define contributors for this rule.</p>
pub fn keys(&self) -> std::option::Option<&[std::string::String]> {
self.keys.as_deref()
}
/// <p>An approximation of the aggregate value that comes from this contributor.</p>
pub fn approximate_aggregate_value(&self) -> std::option::Option<f64> {
self.approximate_aggregate_value
}
/// <p>An array of the data points where this contributor is present. Only the data points when this contributor appeared are included in the array.</p>
pub fn datapoints(
&self,
) -> std::option::Option<&[crate::model::InsightRuleContributorDatapoint]> {
self.datapoints.as_deref()
}
}
impl std::fmt::Debug for InsightRuleContributor {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("InsightRuleContributor");
formatter.field("keys", &self.keys);
formatter.field(
"approximate_aggregate_value",
&self.approximate_aggregate_value,
);
formatter.field("datapoints", &self.datapoints);
formatter.finish()
}
}
/// See [`InsightRuleContributor`](crate::model::InsightRuleContributor)
pub mod insight_rule_contributor {
/// A builder for [`InsightRuleContributor`](crate::model::InsightRuleContributor)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) keys: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) approximate_aggregate_value: std::option::Option<f64>,
pub(crate) datapoints:
std::option::Option<std::vec::Vec<crate::model::InsightRuleContributorDatapoint>>,
}
impl Builder {
/// Appends an item to `keys`.
///
/// To override the contents of this collection use [`set_keys`](Self::set_keys).
///
/// <p>One of the log entry field keywords that is used to define contributors for this rule.</p>
pub fn keys(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.keys.unwrap_or_default();
v.push(input.into());
self.keys = Some(v);
self
}
/// <p>One of the log entry field keywords that is used to define contributors for this rule.</p>
pub fn set_keys(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.keys = input;
self
}
/// <p>An approximation of the aggregate value that comes from this contributor.</p>
pub fn approximate_aggregate_value(mut self, input: f64) -> Self {
self.approximate_aggregate_value = Some(input);
self
}
/// <p>An approximation of the aggregate value that comes from this contributor.</p>
pub fn set_approximate_aggregate_value(mut self, input: std::option::Option<f64>) -> Self {
self.approximate_aggregate_value = input;
self
}
/// Appends an item to `datapoints`.
///
/// To override the contents of this collection use [`set_datapoints`](Self::set_datapoints).
///
/// <p>An array of the data points where this contributor is present. Only the data points when this contributor appeared are included in the array.</p>
pub fn datapoints(mut self, input: crate::model::InsightRuleContributorDatapoint) -> Self {
let mut v = self.datapoints.unwrap_or_default();
v.push(input);
self.datapoints = Some(v);
self
}
/// <p>An array of the data points where this contributor is present. Only the data points when this contributor appeared are included in the array.</p>
pub fn set_datapoints(
mut self,
input: std::option::Option<
std::vec::Vec<crate::model::InsightRuleContributorDatapoint>,
>,
) -> Self {
self.datapoints = input;
self
}
/// Consumes the builder and constructs a [`InsightRuleContributor`](crate::model::InsightRuleContributor)
pub fn build(self) -> crate::model::InsightRuleContributor {
crate::model::InsightRuleContributor {
keys: self.keys,
approximate_aggregate_value: self.approximate_aggregate_value,
datapoints: self.datapoints,
}
}
}
}
impl InsightRuleContributor {
/// Creates a new builder-style object to manufacture [`InsightRuleContributor`](crate::model::InsightRuleContributor)
pub fn builder() -> crate::model::insight_rule_contributor::Builder {
crate::model::insight_rule_contributor::Builder::default()
}
}
/// <p>One data point related to one contributor.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_GetInsightRuleReport.html">GetInsightRuleReport</a> and <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_InsightRuleContributor.html">InsightRuleContributor</a>.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct InsightRuleContributorDatapoint {
/// <p>The timestamp of the data point.</p>
pub timestamp: std::option::Option<aws_smithy_types::DateTime>,
/// <p>The approximate value that this contributor added during this timestamp.</p>
pub approximate_value: std::option::Option<f64>,
}
impl InsightRuleContributorDatapoint {
/// <p>The timestamp of the data point.</p>
pub fn timestamp(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.timestamp.as_ref()
}
/// <p>The approximate value that this contributor added during this timestamp.</p>
pub fn approximate_value(&self) -> std::option::Option<f64> {
self.approximate_value
}
}
impl std::fmt::Debug for InsightRuleContributorDatapoint {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("InsightRuleContributorDatapoint");
formatter.field("timestamp", &self.timestamp);
formatter.field("approximate_value", &self.approximate_value);
formatter.finish()
}
}
/// See [`InsightRuleContributorDatapoint`](crate::model::InsightRuleContributorDatapoint)
pub mod insight_rule_contributor_datapoint {
/// A builder for [`InsightRuleContributorDatapoint`](crate::model::InsightRuleContributorDatapoint)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) timestamp: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) approximate_value: std::option::Option<f64>,
}
impl Builder {
/// <p>The timestamp of the data point.</p>
pub fn timestamp(mut self, input: aws_smithy_types::DateTime) -> Self {
self.timestamp = Some(input);
self
}
/// <p>The timestamp of the data point.</p>
pub fn set_timestamp(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.timestamp = input;
self
}
/// <p>The approximate value that this contributor added during this timestamp.</p>
pub fn approximate_value(mut self, input: f64) -> Self {
self.approximate_value = Some(input);
self
}
/// <p>The approximate value that this contributor added during this timestamp.</p>
pub fn set_approximate_value(mut self, input: std::option::Option<f64>) -> Self {
self.approximate_value = input;
self
}
/// Consumes the builder and constructs a [`InsightRuleContributorDatapoint`](crate::model::InsightRuleContributorDatapoint)
pub fn build(self) -> crate::model::InsightRuleContributorDatapoint {
crate::model::InsightRuleContributorDatapoint {
timestamp: self.timestamp,
approximate_value: self.approximate_value,
}
}
}
}
impl InsightRuleContributorDatapoint {
/// Creates a new builder-style object to manufacture [`InsightRuleContributorDatapoint`](crate::model::InsightRuleContributorDatapoint)
pub fn builder() -> crate::model::insight_rule_contributor_datapoint::Builder {
crate::model::insight_rule_contributor_datapoint::Builder::default()
}
}
/// <p>This array is empty if the API operation was successful for all the rules specified in the request. If the operation could not process one of the rules, the following data is returned for each of those rules.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct PartialFailure {
/// <p>The specified rule that could not be deleted.</p>
pub failure_resource: std::option::Option<std::string::String>,
/// <p>The type of error.</p>
pub exception_type: std::option::Option<std::string::String>,
/// <p>The code of the error.</p>
pub failure_code: std::option::Option<std::string::String>,
/// <p>A description of the error.</p>
pub failure_description: std::option::Option<std::string::String>,
}
impl PartialFailure {
/// <p>The specified rule that could not be deleted.</p>
pub fn failure_resource(&self) -> std::option::Option<&str> {
self.failure_resource.as_deref()
}
/// <p>The type of error.</p>
pub fn exception_type(&self) -> std::option::Option<&str> {
self.exception_type.as_deref()
}
/// <p>The code of the error.</p>
pub fn failure_code(&self) -> std::option::Option<&str> {
self.failure_code.as_deref()
}
/// <p>A description of the error.</p>
pub fn failure_description(&self) -> std::option::Option<&str> {
self.failure_description.as_deref()
}
}
impl std::fmt::Debug for PartialFailure {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("PartialFailure");
formatter.field("failure_resource", &self.failure_resource);
formatter.field("exception_type", &self.exception_type);
formatter.field("failure_code", &self.failure_code);
formatter.field("failure_description", &self.failure_description);
formatter.finish()
}
}
/// See [`PartialFailure`](crate::model::PartialFailure)
pub mod partial_failure {
/// A builder for [`PartialFailure`](crate::model::PartialFailure)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) failure_resource: std::option::Option<std::string::String>,
pub(crate) exception_type: std::option::Option<std::string::String>,
pub(crate) failure_code: std::option::Option<std::string::String>,
pub(crate) failure_description: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The specified rule that could not be deleted.</p>
pub fn failure_resource(mut self, input: impl Into<std::string::String>) -> Self {
self.failure_resource = Some(input.into());
self
}
/// <p>The specified rule that could not be deleted.</p>
pub fn set_failure_resource(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.failure_resource = input;
self
}
/// <p>The type of error.</p>
pub fn exception_type(mut self, input: impl Into<std::string::String>) -> Self {
self.exception_type = Some(input.into());
self
}
/// <p>The type of error.</p>
pub fn set_exception_type(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.exception_type = input;
self
}
/// <p>The code of the error.</p>
pub fn failure_code(mut self, input: impl Into<std::string::String>) -> Self {
self.failure_code = Some(input.into());
self
}
/// <p>The code of the error.</p>
pub fn set_failure_code(mut self, input: std::option::Option<std::string::String>) -> Self {
self.failure_code = input;
self
}
/// <p>A description of the error.</p>
pub fn failure_description(mut self, input: impl Into<std::string::String>) -> Self {
self.failure_description = Some(input.into());
self
}
/// <p>A description of the error.</p>
pub fn set_failure_description(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.failure_description = input;
self
}
/// Consumes the builder and constructs a [`PartialFailure`](crate::model::PartialFailure)
pub fn build(self) -> crate::model::PartialFailure {
crate::model::PartialFailure {
failure_resource: self.failure_resource,
exception_type: self.exception_type,
failure_code: self.failure_code,
failure_description: self.failure_description,
}
}
}
}
impl PartialFailure {
/// Creates a new builder-style object to manufacture [`PartialFailure`](crate::model::PartialFailure)
pub fn builder() -> crate::model::partial_failure::Builder {
crate::model::partial_failure::Builder::default()
}
}
/// <p>This structure contains the definition for a Contributor Insights rule. For more information about this rule, see<a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ContributorInsights.html"> Using Constributor Insights to analyze high-cardinality data</a> in the <i>Amazon CloudWatch User Guide</i>.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct InsightRule {
/// <p>The name of the rule.</p>
pub name: std::option::Option<std::string::String>,
/// <p>Indicates whether the rule is enabled or disabled.</p>
pub state: std::option::Option<std::string::String>,
/// <p>For rules that you create, this is always <code>{"Name": "CloudWatchLogRule", "Version": 1}</code>. For managed rules, this is <code>{"Name": "ServiceLogRule", "Version": 1}</code> </p>
pub schema: std::option::Option<std::string::String>,
/// <p>The definition of the rule, as a JSON object. The definition contains the keywords used to define contributors, the value to aggregate on if this rule returns a sum instead of a count, and the filters. For details on the valid syntax, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ContributorInsights-RuleSyntax.html">Contributor Insights Rule Syntax</a>.</p>
pub definition: std::option::Option<std::string::String>,
}
impl InsightRule {
/// <p>The name of the rule.</p>
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
/// <p>Indicates whether the rule is enabled or disabled.</p>
pub fn state(&self) -> std::option::Option<&str> {
self.state.as_deref()
}
/// <p>For rules that you create, this is always <code>{"Name": "CloudWatchLogRule", "Version": 1}</code>. For managed rules, this is <code>{"Name": "ServiceLogRule", "Version": 1}</code> </p>
pub fn schema(&self) -> std::option::Option<&str> {
self.schema.as_deref()
}
/// <p>The definition of the rule, as a JSON object. The definition contains the keywords used to define contributors, the value to aggregate on if this rule returns a sum instead of a count, and the filters. For details on the valid syntax, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ContributorInsights-RuleSyntax.html">Contributor Insights Rule Syntax</a>.</p>
pub fn definition(&self) -> std::option::Option<&str> {
self.definition.as_deref()
}
}
impl std::fmt::Debug for InsightRule {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("InsightRule");
formatter.field("name", &self.name);
formatter.field("state", &self.state);
formatter.field("schema", &self.schema);
formatter.field("definition", &self.definition);
formatter.finish()
}
}
/// See [`InsightRule`](crate::model::InsightRule)
pub mod insight_rule {
/// A builder for [`InsightRule`](crate::model::InsightRule)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) state: std::option::Option<std::string::String>,
pub(crate) schema: std::option::Option<std::string::String>,
pub(crate) definition: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The name of the rule.</p>
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
/// <p>The name of the rule.</p>
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
/// <p>Indicates whether the rule is enabled or disabled.</p>
pub fn state(mut self, input: impl Into<std::string::String>) -> Self {
self.state = Some(input.into());
self
}
/// <p>Indicates whether the rule is enabled or disabled.</p>
pub fn set_state(mut self, input: std::option::Option<std::string::String>) -> Self {
self.state = input;
self
}
/// <p>For rules that you create, this is always <code>{"Name": "CloudWatchLogRule", "Version": 1}</code>. For managed rules, this is <code>{"Name": "ServiceLogRule", "Version": 1}</code> </p>
pub fn schema(mut self, input: impl Into<std::string::String>) -> Self {
self.schema = Some(input.into());
self
}
/// <p>For rules that you create, this is always <code>{"Name": "CloudWatchLogRule", "Version": 1}</code>. For managed rules, this is <code>{"Name": "ServiceLogRule", "Version": 1}</code> </p>
pub fn set_schema(mut self, input: std::option::Option<std::string::String>) -> Self {
self.schema = input;
self
}
/// <p>The definition of the rule, as a JSON object. The definition contains the keywords used to define contributors, the value to aggregate on if this rule returns a sum instead of a count, and the filters. For details on the valid syntax, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ContributorInsights-RuleSyntax.html">Contributor Insights Rule Syntax</a>.</p>
pub fn definition(mut self, input: impl Into<std::string::String>) -> Self {
self.definition = Some(input.into());
self
}
/// <p>The definition of the rule, as a JSON object. The definition contains the keywords used to define contributors, the value to aggregate on if this rule returns a sum instead of a count, and the filters. For details on the valid syntax, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ContributorInsights-RuleSyntax.html">Contributor Insights Rule Syntax</a>.</p>
pub fn set_definition(mut self, input: std::option::Option<std::string::String>) -> Self {
self.definition = input;
self
}
/// Consumes the builder and constructs a [`InsightRule`](crate::model::InsightRule)
pub fn build(self) -> crate::model::InsightRule {
crate::model::InsightRule {
name: self.name,
state: self.state,
schema: self.schema,
definition: self.definition,
}
}
}
}
impl InsightRule {
/// Creates a new builder-style object to manufacture [`InsightRule`](crate::model::InsightRule)
pub fn builder() -> crate::model::insight_rule::Builder {
crate::model::insight_rule::Builder::default()
}
}
/// <p>An anomaly detection model associated with a particular CloudWatch metric, statistic, or metric math expression. You can use the model to display a band of expected, normal values when the metric is graphed.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct AnomalyDetector {
/// <p>The namespace of the metric associated with the anomaly detection model.</p>
pub namespace: std::option::Option<std::string::String>,
/// <p>The name of the metric associated with the anomaly detection model.</p>
pub metric_name: std::option::Option<std::string::String>,
/// <p>The metric dimensions associated with the anomaly detection model.</p>
pub dimensions: std::option::Option<std::vec::Vec<crate::model::Dimension>>,
/// <p>The statistic associated with the anomaly detection model.</p>
pub stat: std::option::Option<std::string::String>,
/// <p>The configuration specifies details about how the anomaly detection model is to be trained, including time ranges to exclude from use for training the model, and the time zone to use for the metric.</p>
pub configuration: std::option::Option<crate::model::AnomalyDetectorConfiguration>,
/// <p>The current status of the anomaly detector's training. The possible values are <code>TRAINED | PENDING_TRAINING | TRAINED_INSUFFICIENT_DATA</code> </p>
pub state_value: std::option::Option<crate::model::AnomalyDetectorStateValue>,
/// <p>The CloudWatch metric and statistic for this anomaly detector.</p>
pub single_metric_anomaly_detector:
std::option::Option<crate::model::SingleMetricAnomalyDetector>,
/// <p>The CloudWatch metric math expression for this anomaly detector.</p>
pub metric_math_anomaly_detector: std::option::Option<crate::model::MetricMathAnomalyDetector>,
}
impl AnomalyDetector {
/// <p>The namespace of the metric associated with the anomaly detection model.</p>
pub fn namespace(&self) -> std::option::Option<&str> {
self.namespace.as_deref()
}
/// <p>The name of the metric associated with the anomaly detection model.</p>
pub fn metric_name(&self) -> std::option::Option<&str> {
self.metric_name.as_deref()
}
/// <p>The metric dimensions associated with the anomaly detection model.</p>
pub fn dimensions(&self) -> std::option::Option<&[crate::model::Dimension]> {
self.dimensions.as_deref()
}
/// <p>The statistic associated with the anomaly detection model.</p>
pub fn stat(&self) -> std::option::Option<&str> {
self.stat.as_deref()
}
/// <p>The configuration specifies details about how the anomaly detection model is to be trained, including time ranges to exclude from use for training the model, and the time zone to use for the metric.</p>
pub fn configuration(
&self,
) -> std::option::Option<&crate::model::AnomalyDetectorConfiguration> {
self.configuration.as_ref()
}
/// <p>The current status of the anomaly detector's training. The possible values are <code>TRAINED | PENDING_TRAINING | TRAINED_INSUFFICIENT_DATA</code> </p>
pub fn state_value(&self) -> std::option::Option<&crate::model::AnomalyDetectorStateValue> {
self.state_value.as_ref()
}
/// <p>The CloudWatch metric and statistic for this anomaly detector.</p>
pub fn single_metric_anomaly_detector(
&self,
) -> std::option::Option<&crate::model::SingleMetricAnomalyDetector> {
self.single_metric_anomaly_detector.as_ref()
}
/// <p>The CloudWatch metric math expression for this anomaly detector.</p>
pub fn metric_math_anomaly_detector(
&self,
) -> std::option::Option<&crate::model::MetricMathAnomalyDetector> {
self.metric_math_anomaly_detector.as_ref()
}
}
impl std::fmt::Debug for AnomalyDetector {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("AnomalyDetector");
formatter.field("namespace", &self.namespace);
formatter.field("metric_name", &self.metric_name);
formatter.field("dimensions", &self.dimensions);
formatter.field("stat", &self.stat);
formatter.field("configuration", &self.configuration);
formatter.field("state_value", &self.state_value);
formatter.field(
"single_metric_anomaly_detector",
&self.single_metric_anomaly_detector,
);
formatter.field(
"metric_math_anomaly_detector",
&self.metric_math_anomaly_detector,
);
formatter.finish()
}
}
/// See [`AnomalyDetector`](crate::model::AnomalyDetector)
pub mod anomaly_detector {
/// A builder for [`AnomalyDetector`](crate::model::AnomalyDetector)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) namespace: std::option::Option<std::string::String>,
pub(crate) metric_name: std::option::Option<std::string::String>,
pub(crate) dimensions: std::option::Option<std::vec::Vec<crate::model::Dimension>>,
pub(crate) stat: std::option::Option<std::string::String>,
pub(crate) configuration: std::option::Option<crate::model::AnomalyDetectorConfiguration>,
pub(crate) state_value: std::option::Option<crate::model::AnomalyDetectorStateValue>,
pub(crate) single_metric_anomaly_detector:
std::option::Option<crate::model::SingleMetricAnomalyDetector>,
pub(crate) metric_math_anomaly_detector:
std::option::Option<crate::model::MetricMathAnomalyDetector>,
}
impl Builder {
/// <p>The namespace of the metric associated with the anomaly detection model.</p>
pub fn namespace(mut self, input: impl Into<std::string::String>) -> Self {
self.namespace = Some(input.into());
self
}
/// <p>The namespace of the metric associated with the anomaly detection model.</p>
pub fn set_namespace(mut self, input: std::option::Option<std::string::String>) -> Self {
self.namespace = input;
self
}
/// <p>The name of the metric associated with the anomaly detection model.</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 metric associated with the anomaly detection model.</p>
pub fn set_metric_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.metric_name = input;
self
}
/// Appends an item to `dimensions`.
///
/// To override the contents of this collection use [`set_dimensions`](Self::set_dimensions).
///
/// <p>The metric dimensions associated with the anomaly detection model.</p>
pub fn dimensions(mut self, input: crate::model::Dimension) -> Self {
let mut v = self.dimensions.unwrap_or_default();
v.push(input);
self.dimensions = Some(v);
self
}
/// <p>The metric dimensions associated with the anomaly detection model.</p>
pub fn set_dimensions(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Dimension>>,
) -> Self {
self.dimensions = input;
self
}
/// <p>The statistic associated with the anomaly detection model.</p>
pub fn stat(mut self, input: impl Into<std::string::String>) -> Self {
self.stat = Some(input.into());
self
}
/// <p>The statistic associated with the anomaly detection model.</p>
pub fn set_stat(mut self, input: std::option::Option<std::string::String>) -> Self {
self.stat = input;
self
}
/// <p>The configuration specifies details about how the anomaly detection model is to be trained, including time ranges to exclude from use for training the model, and the time zone to use for the metric.</p>
pub fn configuration(mut self, input: crate::model::AnomalyDetectorConfiguration) -> Self {
self.configuration = Some(input);
self
}
/// <p>The configuration specifies details about how the anomaly detection model is to be trained, including time ranges to exclude from use for training the model, and the time zone to use for the metric.</p>
pub fn set_configuration(
mut self,
input: std::option::Option<crate::model::AnomalyDetectorConfiguration>,
) -> Self {
self.configuration = input;
self
}
/// <p>The current status of the anomaly detector's training. The possible values are <code>TRAINED | PENDING_TRAINING | TRAINED_INSUFFICIENT_DATA</code> </p>
pub fn state_value(mut self, input: crate::model::AnomalyDetectorStateValue) -> Self {
self.state_value = Some(input);
self
}
/// <p>The current status of the anomaly detector's training. The possible values are <code>TRAINED | PENDING_TRAINING | TRAINED_INSUFFICIENT_DATA</code> </p>
pub fn set_state_value(
mut self,
input: std::option::Option<crate::model::AnomalyDetectorStateValue>,
) -> Self {
self.state_value = input;
self
}
/// <p>The CloudWatch metric and statistic for this anomaly detector.</p>
pub fn single_metric_anomaly_detector(
mut self,
input: crate::model::SingleMetricAnomalyDetector,
) -> Self {
self.single_metric_anomaly_detector = Some(input);
self
}
/// <p>The CloudWatch metric and statistic for this anomaly detector.</p>
pub fn set_single_metric_anomaly_detector(
mut self,
input: std::option::Option<crate::model::SingleMetricAnomalyDetector>,
) -> Self {
self.single_metric_anomaly_detector = input;
self
}
/// <p>The CloudWatch metric math expression for this anomaly detector.</p>
pub fn metric_math_anomaly_detector(
mut self,
input: crate::model::MetricMathAnomalyDetector,
) -> Self {
self.metric_math_anomaly_detector = Some(input);
self
}
/// <p>The CloudWatch metric math expression for this anomaly detector.</p>
pub fn set_metric_math_anomaly_detector(
mut self,
input: std::option::Option<crate::model::MetricMathAnomalyDetector>,
) -> Self {
self.metric_math_anomaly_detector = input;
self
}
/// Consumes the builder and constructs a [`AnomalyDetector`](crate::model::AnomalyDetector)
pub fn build(self) -> crate::model::AnomalyDetector {
crate::model::AnomalyDetector {
namespace: self.namespace,
metric_name: self.metric_name,
dimensions: self.dimensions,
stat: self.stat,
configuration: self.configuration,
state_value: self.state_value,
single_metric_anomaly_detector: self.single_metric_anomaly_detector,
metric_math_anomaly_detector: self.metric_math_anomaly_detector,
}
}
}
}
impl AnomalyDetector {
/// Creates a new builder-style object to manufacture [`AnomalyDetector`](crate::model::AnomalyDetector)
pub fn builder() -> crate::model::anomaly_detector::Builder {
crate::model::anomaly_detector::Builder::default()
}
}
#[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 AnomalyDetectorStateValue {
#[allow(missing_docs)] // documentation missing in model
PendingTraining,
#[allow(missing_docs)] // documentation missing in model
Trained,
#[allow(missing_docs)] // documentation missing in model
TrainedInsufficientData,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for AnomalyDetectorStateValue {
fn from(s: &str) -> Self {
match s {
"PENDING_TRAINING" => AnomalyDetectorStateValue::PendingTraining,
"TRAINED" => AnomalyDetectorStateValue::Trained,
"TRAINED_INSUFFICIENT_DATA" => AnomalyDetectorStateValue::TrainedInsufficientData,
other => AnomalyDetectorStateValue::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for AnomalyDetectorStateValue {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(AnomalyDetectorStateValue::from(s))
}
}
impl AnomalyDetectorStateValue {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
AnomalyDetectorStateValue::PendingTraining => "PENDING_TRAINING",
AnomalyDetectorStateValue::Trained => "TRAINED",
AnomalyDetectorStateValue::TrainedInsufficientData => "TRAINED_INSUFFICIENT_DATA",
AnomalyDetectorStateValue::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&["PENDING_TRAINING", "TRAINED", "TRAINED_INSUFFICIENT_DATA"]
}
}
impl AsRef<str> for AnomalyDetectorStateValue {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[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 AnomalyDetectorType {
#[allow(missing_docs)] // documentation missing in model
MetricMath,
#[allow(missing_docs)] // documentation missing in model
SingleMetric,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for AnomalyDetectorType {
fn from(s: &str) -> Self {
match s {
"METRIC_MATH" => AnomalyDetectorType::MetricMath,
"SINGLE_METRIC" => AnomalyDetectorType::SingleMetric,
other => AnomalyDetectorType::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for AnomalyDetectorType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(AnomalyDetectorType::from(s))
}
}
impl AnomalyDetectorType {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
AnomalyDetectorType::MetricMath => "METRIC_MATH",
AnomalyDetectorType::SingleMetric => "SINGLE_METRIC",
AnomalyDetectorType::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&["METRIC_MATH", "SINGLE_METRIC"]
}
}
impl AsRef<str> for AnomalyDetectorType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>The details about a metric alarm.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct MetricAlarm {
/// <p>The name of the alarm.</p>
pub alarm_name: std::option::Option<std::string::String>,
/// <p>The Amazon Resource Name (ARN) of the alarm.</p>
pub alarm_arn: std::option::Option<std::string::String>,
/// <p>The description of the alarm.</p>
pub alarm_description: std::option::Option<std::string::String>,
/// <p>The time stamp of the last update to the alarm configuration.</p>
pub alarm_configuration_updated_timestamp: std::option::Option<aws_smithy_types::DateTime>,
/// <p>Indicates whether actions should be executed during any changes to the alarm state.</p>
pub actions_enabled: std::option::Option<bool>,
/// <p>The actions to execute when this alarm transitions to the <code>OK</code> state from any other state. Each action is specified as an Amazon Resource Name (ARN).</p>
pub ok_actions: std::option::Option<std::vec::Vec<std::string::String>>,
/// <p>The actions to execute when this alarm transitions to the <code>ALARM</code> state from any other state. Each action is specified as an Amazon Resource Name (ARN).</p>
pub alarm_actions: std::option::Option<std::vec::Vec<std::string::String>>,
/// <p>The actions to execute when this alarm transitions to the <code>INSUFFICIENT_DATA</code> state from any other state. Each action is specified as an Amazon Resource Name (ARN).</p>
pub insufficient_data_actions: std::option::Option<std::vec::Vec<std::string::String>>,
/// <p>The state value for the alarm.</p>
pub state_value: std::option::Option<crate::model::StateValue>,
/// <p>An explanation for the alarm state, in text format.</p>
pub state_reason: std::option::Option<std::string::String>,
/// <p>An explanation for the alarm state, in JSON format.</p>
pub state_reason_data: std::option::Option<std::string::String>,
/// <p>The time stamp of the last update to the alarm state.</p>
pub state_updated_timestamp: std::option::Option<aws_smithy_types::DateTime>,
/// <p>The name of the metric associated with the alarm, if this is an alarm based on a single metric.</p>
pub metric_name: std::option::Option<std::string::String>,
/// <p>The namespace of the metric associated with the alarm.</p>
pub namespace: std::option::Option<std::string::String>,
/// <p>The statistic for the metric associated with the alarm, other than percentile. For percentile statistics, use <code>ExtendedStatistic</code>.</p>
pub statistic: std::option::Option<crate::model::Statistic>,
/// <p>The percentile statistic for the metric associated with the alarm. Specify a value between p0.0 and p100.</p>
pub extended_statistic: std::option::Option<std::string::String>,
/// <p>The dimensions for the metric associated with the alarm.</p>
pub dimensions: std::option::Option<std::vec::Vec<crate::model::Dimension>>,
/// <p>The period, in seconds, over which the statistic is applied.</p>
pub period: std::option::Option<i32>,
/// <p>The unit of the metric associated with the alarm.</p>
pub unit: std::option::Option<crate::model::StandardUnit>,
/// <p>The number of periods over which data is compared to the specified threshold.</p>
pub evaluation_periods: std::option::Option<i32>,
/// <p>The number of data points that must be breaching to trigger the alarm.</p>
pub datapoints_to_alarm: std::option::Option<i32>,
/// <p>The value to compare with the specified statistic.</p>
pub threshold: std::option::Option<f64>,
/// <p>The arithmetic operation to use when comparing the specified statistic and threshold. The specified statistic value is used as the first operand.</p>
pub comparison_operator: std::option::Option<crate::model::ComparisonOperator>,
/// <p>Sets how this alarm is to handle missing data points. The valid values are <code>breaching</code>, <code>notBreaching</code>, <code>ignore</code>, and <code>missing</code>. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarms-and-missing-data">Configuring how CloudWatch alarms treat missing data</a>.</p>
/// <p>If this parameter is omitted, the default behavior of <code>missing</code> is used.</p>
pub treat_missing_data: std::option::Option<std::string::String>,
/// <p>Used only for alarms based on percentiles. If <code>ignore</code>, the alarm state does not change during periods with too few data points to be statistically significant. If <code>evaluate</code> or this parameter is not used, the alarm is always evaluated and possibly changes state no matter how many data points are available.</p>
pub evaluate_low_sample_count_percentile: std::option::Option<std::string::String>,
/// <p>An array of MetricDataQuery structures, used in an alarm based on a metric math expression. Each structure either retrieves a metric or performs a math expression. One item in the Metrics array is the math expression that the alarm watches. This expression by designated by having <code>ReturnData</code> set to true.</p>
pub metrics: std::option::Option<std::vec::Vec<crate::model::MetricDataQuery>>,
/// <p>In an alarm based on an anomaly detection model, this is the ID of the <code>ANOMALY_DETECTION_BAND</code> function used as the threshold for the alarm.</p>
pub threshold_metric_id: std::option::Option<std::string::String>,
}
impl MetricAlarm {
/// <p>The name of the alarm.</p>
pub fn alarm_name(&self) -> std::option::Option<&str> {
self.alarm_name.as_deref()
}
/// <p>The Amazon Resource Name (ARN) of the alarm.</p>
pub fn alarm_arn(&self) -> std::option::Option<&str> {
self.alarm_arn.as_deref()
}
/// <p>The description of the alarm.</p>
pub fn alarm_description(&self) -> std::option::Option<&str> {
self.alarm_description.as_deref()
}
/// <p>The time stamp of the last update to the alarm configuration.</p>
pub fn alarm_configuration_updated_timestamp(
&self,
) -> std::option::Option<&aws_smithy_types::DateTime> {
self.alarm_configuration_updated_timestamp.as_ref()
}
/// <p>Indicates whether actions should be executed during any changes to the alarm state.</p>
pub fn actions_enabled(&self) -> std::option::Option<bool> {
self.actions_enabled
}
/// <p>The actions to execute when this alarm transitions to the <code>OK</code> state from any other state. Each action is specified as an Amazon Resource Name (ARN).</p>
pub fn ok_actions(&self) -> std::option::Option<&[std::string::String]> {
self.ok_actions.as_deref()
}
/// <p>The actions to execute when this alarm transitions to the <code>ALARM</code> state from any other state. Each action is specified as an Amazon Resource Name (ARN).</p>
pub fn alarm_actions(&self) -> std::option::Option<&[std::string::String]> {
self.alarm_actions.as_deref()
}
/// <p>The actions to execute when this alarm transitions to the <code>INSUFFICIENT_DATA</code> state from any other state. Each action is specified as an Amazon Resource Name (ARN).</p>
pub fn insufficient_data_actions(&self) -> std::option::Option<&[std::string::String]> {
self.insufficient_data_actions.as_deref()
}
/// <p>The state value for the alarm.</p>
pub fn state_value(&self) -> std::option::Option<&crate::model::StateValue> {
self.state_value.as_ref()
}
/// <p>An explanation for the alarm state, in text format.</p>
pub fn state_reason(&self) -> std::option::Option<&str> {
self.state_reason.as_deref()
}
/// <p>An explanation for the alarm state, in JSON format.</p>
pub fn state_reason_data(&self) -> std::option::Option<&str> {
self.state_reason_data.as_deref()
}
/// <p>The time stamp of the last update to the alarm state.</p>
pub fn state_updated_timestamp(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.state_updated_timestamp.as_ref()
}
/// <p>The name of the metric associated with the alarm, if this is an alarm based on a single metric.</p>
pub fn metric_name(&self) -> std::option::Option<&str> {
self.metric_name.as_deref()
}
/// <p>The namespace of the metric associated with the alarm.</p>
pub fn namespace(&self) -> std::option::Option<&str> {
self.namespace.as_deref()
}
/// <p>The statistic for the metric associated with the alarm, other than percentile. For percentile statistics, use <code>ExtendedStatistic</code>.</p>
pub fn statistic(&self) -> std::option::Option<&crate::model::Statistic> {
self.statistic.as_ref()
}
/// <p>The percentile statistic for the metric associated with the alarm. Specify a value between p0.0 and p100.</p>
pub fn extended_statistic(&self) -> std::option::Option<&str> {
self.extended_statistic.as_deref()
}
/// <p>The dimensions for the metric associated with the alarm.</p>
pub fn dimensions(&self) -> std::option::Option<&[crate::model::Dimension]> {
self.dimensions.as_deref()
}
/// <p>The period, in seconds, over which the statistic is applied.</p>
pub fn period(&self) -> std::option::Option<i32> {
self.period
}
/// <p>The unit of the metric associated with the alarm.</p>
pub fn unit(&self) -> std::option::Option<&crate::model::StandardUnit> {
self.unit.as_ref()
}
/// <p>The number of periods over which data is compared to the specified threshold.</p>
pub fn evaluation_periods(&self) -> std::option::Option<i32> {
self.evaluation_periods
}
/// <p>The number of data points that must be breaching to trigger the alarm.</p>
pub fn datapoints_to_alarm(&self) -> std::option::Option<i32> {
self.datapoints_to_alarm
}
/// <p>The value to compare with the specified statistic.</p>
pub fn threshold(&self) -> std::option::Option<f64> {
self.threshold
}
/// <p>The arithmetic operation to use when comparing the specified statistic and threshold. The specified statistic value is used as the first operand.</p>
pub fn comparison_operator(&self) -> std::option::Option<&crate::model::ComparisonOperator> {
self.comparison_operator.as_ref()
}
/// <p>Sets how this alarm is to handle missing data points. The valid values are <code>breaching</code>, <code>notBreaching</code>, <code>ignore</code>, and <code>missing</code>. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarms-and-missing-data">Configuring how CloudWatch alarms treat missing data</a>.</p>
/// <p>If this parameter is omitted, the default behavior of <code>missing</code> is used.</p>
pub fn treat_missing_data(&self) -> std::option::Option<&str> {
self.treat_missing_data.as_deref()
}
/// <p>Used only for alarms based on percentiles. If <code>ignore</code>, the alarm state does not change during periods with too few data points to be statistically significant. If <code>evaluate</code> or this parameter is not used, the alarm is always evaluated and possibly changes state no matter how many data points are available.</p>
pub fn evaluate_low_sample_count_percentile(&self) -> std::option::Option<&str> {
self.evaluate_low_sample_count_percentile.as_deref()
}
/// <p>An array of MetricDataQuery structures, used in an alarm based on a metric math expression. Each structure either retrieves a metric or performs a math expression. One item in the Metrics array is the math expression that the alarm watches. This expression by designated by having <code>ReturnData</code> set to true.</p>
pub fn metrics(&self) -> std::option::Option<&[crate::model::MetricDataQuery]> {
self.metrics.as_deref()
}
/// <p>In an alarm based on an anomaly detection model, this is the ID of the <code>ANOMALY_DETECTION_BAND</code> function used as the threshold for the alarm.</p>
pub fn threshold_metric_id(&self) -> std::option::Option<&str> {
self.threshold_metric_id.as_deref()
}
}
impl std::fmt::Debug for MetricAlarm {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("MetricAlarm");
formatter.field("alarm_name", &self.alarm_name);
formatter.field("alarm_arn", &self.alarm_arn);
formatter.field("alarm_description", &self.alarm_description);
formatter.field(
"alarm_configuration_updated_timestamp",
&self.alarm_configuration_updated_timestamp,
);
formatter.field("actions_enabled", &self.actions_enabled);
formatter.field("ok_actions", &self.ok_actions);
formatter.field("alarm_actions", &self.alarm_actions);
formatter.field("insufficient_data_actions", &self.insufficient_data_actions);
formatter.field("state_value", &self.state_value);
formatter.field("state_reason", &self.state_reason);
formatter.field("state_reason_data", &self.state_reason_data);
formatter.field("state_updated_timestamp", &self.state_updated_timestamp);
formatter.field("metric_name", &self.metric_name);
formatter.field("namespace", &self.namespace);
formatter.field("statistic", &self.statistic);
formatter.field("extended_statistic", &self.extended_statistic);
formatter.field("dimensions", &self.dimensions);
formatter.field("period", &self.period);
formatter.field("unit", &self.unit);
formatter.field("evaluation_periods", &self.evaluation_periods);
formatter.field("datapoints_to_alarm", &self.datapoints_to_alarm);
formatter.field("threshold", &self.threshold);
formatter.field("comparison_operator", &self.comparison_operator);
formatter.field("treat_missing_data", &self.treat_missing_data);
formatter.field(
"evaluate_low_sample_count_percentile",
&self.evaluate_low_sample_count_percentile,
);
formatter.field("metrics", &self.metrics);
formatter.field("threshold_metric_id", &self.threshold_metric_id);
formatter.finish()
}
}
/// See [`MetricAlarm`](crate::model::MetricAlarm)
pub mod metric_alarm {
/// A builder for [`MetricAlarm`](crate::model::MetricAlarm)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) alarm_name: std::option::Option<std::string::String>,
pub(crate) alarm_arn: std::option::Option<std::string::String>,
pub(crate) alarm_description: std::option::Option<std::string::String>,
pub(crate) alarm_configuration_updated_timestamp:
std::option::Option<aws_smithy_types::DateTime>,
pub(crate) actions_enabled: std::option::Option<bool>,
pub(crate) ok_actions: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) alarm_actions: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) insufficient_data_actions:
std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) state_value: std::option::Option<crate::model::StateValue>,
pub(crate) state_reason: std::option::Option<std::string::String>,
pub(crate) state_reason_data: std::option::Option<std::string::String>,
pub(crate) state_updated_timestamp: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) metric_name: std::option::Option<std::string::String>,
pub(crate) namespace: std::option::Option<std::string::String>,
pub(crate) statistic: std::option::Option<crate::model::Statistic>,
pub(crate) extended_statistic: std::option::Option<std::string::String>,
pub(crate) dimensions: std::option::Option<std::vec::Vec<crate::model::Dimension>>,
pub(crate) period: std::option::Option<i32>,
pub(crate) unit: std::option::Option<crate::model::StandardUnit>,
pub(crate) evaluation_periods: std::option::Option<i32>,
pub(crate) datapoints_to_alarm: std::option::Option<i32>,
pub(crate) threshold: std::option::Option<f64>,
pub(crate) comparison_operator: std::option::Option<crate::model::ComparisonOperator>,
pub(crate) treat_missing_data: std::option::Option<std::string::String>,
pub(crate) evaluate_low_sample_count_percentile: std::option::Option<std::string::String>,
pub(crate) metrics: std::option::Option<std::vec::Vec<crate::model::MetricDataQuery>>,
pub(crate) threshold_metric_id: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The name of the alarm.</p>
pub fn alarm_name(mut self, input: impl Into<std::string::String>) -> Self {
self.alarm_name = Some(input.into());
self
}
/// <p>The name of the alarm.</p>
pub fn set_alarm_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.alarm_name = input;
self
}
/// <p>The Amazon Resource Name (ARN) of the alarm.</p>
pub fn alarm_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.alarm_arn = Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the alarm.</p>
pub fn set_alarm_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.alarm_arn = input;
self
}
/// <p>The description of the alarm.</p>
pub fn alarm_description(mut self, input: impl Into<std::string::String>) -> Self {
self.alarm_description = Some(input.into());
self
}
/// <p>The description of the alarm.</p>
pub fn set_alarm_description(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.alarm_description = input;
self
}
/// <p>The time stamp of the last update to the alarm configuration.</p>
pub fn alarm_configuration_updated_timestamp(
mut self,
input: aws_smithy_types::DateTime,
) -> Self {
self.alarm_configuration_updated_timestamp = Some(input);
self
}
/// <p>The time stamp of the last update to the alarm configuration.</p>
pub fn set_alarm_configuration_updated_timestamp(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.alarm_configuration_updated_timestamp = input;
self
}
/// <p>Indicates whether actions should be executed during any changes to the alarm state.</p>
pub fn actions_enabled(mut self, input: bool) -> Self {
self.actions_enabled = Some(input);
self
}
/// <p>Indicates whether actions should be executed during any changes to the alarm state.</p>
pub fn set_actions_enabled(mut self, input: std::option::Option<bool>) -> Self {
self.actions_enabled = input;
self
}
/// Appends an item to `ok_actions`.
///
/// To override the contents of this collection use [`set_ok_actions`](Self::set_ok_actions).
///
/// <p>The actions to execute when this alarm transitions to the <code>OK</code> state from any other state. Each action is specified as an Amazon Resource Name (ARN).</p>
pub fn ok_actions(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.ok_actions.unwrap_or_default();
v.push(input.into());
self.ok_actions = Some(v);
self
}
/// <p>The actions to execute when this alarm transitions to the <code>OK</code> state from any other state. Each action is specified as an Amazon Resource Name (ARN).</p>
pub fn set_ok_actions(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.ok_actions = input;
self
}
/// Appends an item to `alarm_actions`.
///
/// To override the contents of this collection use [`set_alarm_actions`](Self::set_alarm_actions).
///
/// <p>The actions to execute when this alarm transitions to the <code>ALARM</code> state from any other state. Each action is specified as an Amazon Resource Name (ARN).</p>
pub fn alarm_actions(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.alarm_actions.unwrap_or_default();
v.push(input.into());
self.alarm_actions = Some(v);
self
}
/// <p>The actions to execute when this alarm transitions to the <code>ALARM</code> state from any other state. Each action is specified as an Amazon Resource Name (ARN).</p>
pub fn set_alarm_actions(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.alarm_actions = input;
self
}
/// Appends an item to `insufficient_data_actions`.
///
/// To override the contents of this collection use [`set_insufficient_data_actions`](Self::set_insufficient_data_actions).
///
/// <p>The actions to execute when this alarm transitions to the <code>INSUFFICIENT_DATA</code> state from any other state. Each action is specified as an Amazon Resource Name (ARN).</p>
pub fn insufficient_data_actions(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.insufficient_data_actions.unwrap_or_default();
v.push(input.into());
self.insufficient_data_actions = Some(v);
self
}
/// <p>The actions to execute when this alarm transitions to the <code>INSUFFICIENT_DATA</code> state from any other state. Each action is specified as an Amazon Resource Name (ARN).</p>
pub fn set_insufficient_data_actions(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.insufficient_data_actions = input;
self
}
/// <p>The state value for the alarm.</p>
pub fn state_value(mut self, input: crate::model::StateValue) -> Self {
self.state_value = Some(input);
self
}
/// <p>The state value for the alarm.</p>
pub fn set_state_value(
mut self,
input: std::option::Option<crate::model::StateValue>,
) -> Self {
self.state_value = input;
self
}
/// <p>An explanation for the alarm state, in text format.</p>
pub fn state_reason(mut self, input: impl Into<std::string::String>) -> Self {
self.state_reason = Some(input.into());
self
}
/// <p>An explanation for the alarm state, in text format.</p>
pub fn set_state_reason(mut self, input: std::option::Option<std::string::String>) -> Self {
self.state_reason = input;
self
}
/// <p>An explanation for the alarm state, in JSON format.</p>
pub fn state_reason_data(mut self, input: impl Into<std::string::String>) -> Self {
self.state_reason_data = Some(input.into());
self
}
/// <p>An explanation for the alarm state, in JSON format.</p>
pub fn set_state_reason_data(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.state_reason_data = input;
self
}
/// <p>The time stamp of the last update to the alarm state.</p>
pub fn state_updated_timestamp(mut self, input: aws_smithy_types::DateTime) -> Self {
self.state_updated_timestamp = Some(input);
self
}
/// <p>The time stamp of the last update to the alarm state.</p>
pub fn set_state_updated_timestamp(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.state_updated_timestamp = input;
self
}
/// <p>The name of the metric associated with the alarm, if this is an alarm based on a single 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 metric associated with the alarm, if this is an alarm based on a single metric.</p>
pub fn set_metric_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.metric_name = input;
self
}
/// <p>The namespace of the metric associated with the alarm.</p>
pub fn namespace(mut self, input: impl Into<std::string::String>) -> Self {
self.namespace = Some(input.into());
self
}
/// <p>The namespace of the metric associated with the alarm.</p>
pub fn set_namespace(mut self, input: std::option::Option<std::string::String>) -> Self {
self.namespace = input;
self
}
/// <p>The statistic for the metric associated with the alarm, other than percentile. For percentile statistics, use <code>ExtendedStatistic</code>.</p>
pub fn statistic(mut self, input: crate::model::Statistic) -> Self {
self.statistic = Some(input);
self
}
/// <p>The statistic for the metric associated with the alarm, other than percentile. For percentile statistics, use <code>ExtendedStatistic</code>.</p>
pub fn set_statistic(
mut self,
input: std::option::Option<crate::model::Statistic>,
) -> Self {
self.statistic = input;
self
}
/// <p>The percentile statistic for the metric associated with the alarm. Specify a value between p0.0 and p100.</p>
pub fn extended_statistic(mut self, input: impl Into<std::string::String>) -> Self {
self.extended_statistic = Some(input.into());
self
}
/// <p>The percentile statistic for the metric associated with the alarm. Specify a value between p0.0 and p100.</p>
pub fn set_extended_statistic(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.extended_statistic = input;
self
}
/// Appends an item to `dimensions`.
///
/// To override the contents of this collection use [`set_dimensions`](Self::set_dimensions).
///
/// <p>The dimensions for the metric associated with the alarm.</p>
pub fn dimensions(mut self, input: crate::model::Dimension) -> Self {
let mut v = self.dimensions.unwrap_or_default();
v.push(input);
self.dimensions = Some(v);
self
}
/// <p>The dimensions for the metric associated with the alarm.</p>
pub fn set_dimensions(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Dimension>>,
) -> Self {
self.dimensions = input;
self
}
/// <p>The period, in seconds, over which the statistic is applied.</p>
pub fn period(mut self, input: i32) -> Self {
self.period = Some(input);
self
}
/// <p>The period, in seconds, over which the statistic is applied.</p>
pub fn set_period(mut self, input: std::option::Option<i32>) -> Self {
self.period = input;
self
}
/// <p>The unit of the metric associated with the alarm.</p>
pub fn unit(mut self, input: crate::model::StandardUnit) -> Self {
self.unit = Some(input);
self
}
/// <p>The unit of the metric associated with the alarm.</p>
pub fn set_unit(mut self, input: std::option::Option<crate::model::StandardUnit>) -> Self {
self.unit = input;
self
}
/// <p>The number of periods over which data is compared to the specified threshold.</p>
pub fn evaluation_periods(mut self, input: i32) -> Self {
self.evaluation_periods = Some(input);
self
}
/// <p>The number of periods over which data is compared to the specified threshold.</p>
pub fn set_evaluation_periods(mut self, input: std::option::Option<i32>) -> Self {
self.evaluation_periods = input;
self
}
/// <p>The number of data points that must be breaching to trigger the alarm.</p>
pub fn datapoints_to_alarm(mut self, input: i32) -> Self {
self.datapoints_to_alarm = Some(input);
self
}
/// <p>The number of data points that must be breaching to trigger the alarm.</p>
pub fn set_datapoints_to_alarm(mut self, input: std::option::Option<i32>) -> Self {
self.datapoints_to_alarm = input;
self
}
/// <p>The value to compare with the specified statistic.</p>
pub fn threshold(mut self, input: f64) -> Self {
self.threshold = Some(input);
self
}
/// <p>The value to compare with the specified statistic.</p>
pub fn set_threshold(mut self, input: std::option::Option<f64>) -> Self {
self.threshold = input;
self
}
/// <p>The arithmetic operation to use when comparing the specified statistic and threshold. The specified statistic value is used as the first operand.</p>
pub fn comparison_operator(mut self, input: crate::model::ComparisonOperator) -> Self {
self.comparison_operator = Some(input);
self
}
/// <p>The arithmetic operation to use when comparing the specified statistic and threshold. The specified statistic value is used as the first operand.</p>
pub fn set_comparison_operator(
mut self,
input: std::option::Option<crate::model::ComparisonOperator>,
) -> Self {
self.comparison_operator = input;
self
}
/// <p>Sets how this alarm is to handle missing data points. The valid values are <code>breaching</code>, <code>notBreaching</code>, <code>ignore</code>, and <code>missing</code>. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarms-and-missing-data">Configuring how CloudWatch alarms treat missing data</a>.</p>
/// <p>If this parameter is omitted, the default behavior of <code>missing</code> is used.</p>
pub fn treat_missing_data(mut self, input: impl Into<std::string::String>) -> Self {
self.treat_missing_data = Some(input.into());
self
}
/// <p>Sets how this alarm is to handle missing data points. The valid values are <code>breaching</code>, <code>notBreaching</code>, <code>ignore</code>, and <code>missing</code>. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarms-and-missing-data">Configuring how CloudWatch alarms treat missing data</a>.</p>
/// <p>If this parameter is omitted, the default behavior of <code>missing</code> is used.</p>
pub fn set_treat_missing_data(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.treat_missing_data = input;
self
}
/// <p>Used only for alarms based on percentiles. If <code>ignore</code>, the alarm state does not change during periods with too few data points to be statistically significant. If <code>evaluate</code> or this parameter is not used, the alarm is always evaluated and possibly changes state no matter how many data points are available.</p>
pub fn evaluate_low_sample_count_percentile(
mut self,
input: impl Into<std::string::String>,
) -> Self {
self.evaluate_low_sample_count_percentile = Some(input.into());
self
}
/// <p>Used only for alarms based on percentiles. If <code>ignore</code>, the alarm state does not change during periods with too few data points to be statistically significant. If <code>evaluate</code> or this parameter is not used, the alarm is always evaluated and possibly changes state no matter how many data points are available.</p>
pub fn set_evaluate_low_sample_count_percentile(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.evaluate_low_sample_count_percentile = input;
self
}
/// Appends an item to `metrics`.
///
/// To override the contents of this collection use [`set_metrics`](Self::set_metrics).
///
/// <p>An array of MetricDataQuery structures, used in an alarm based on a metric math expression. Each structure either retrieves a metric or performs a math expression. One item in the Metrics array is the math expression that the alarm watches. This expression by designated by having <code>ReturnData</code> set to true.</p>
pub fn metrics(mut self, input: crate::model::MetricDataQuery) -> Self {
let mut v = self.metrics.unwrap_or_default();
v.push(input);
self.metrics = Some(v);
self
}
/// <p>An array of MetricDataQuery structures, used in an alarm based on a metric math expression. Each structure either retrieves a metric or performs a math expression. One item in the Metrics array is the math expression that the alarm watches. This expression by designated by having <code>ReturnData</code> set to true.</p>
pub fn set_metrics(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::MetricDataQuery>>,
) -> Self {
self.metrics = input;
self
}
/// <p>In an alarm based on an anomaly detection model, this is the ID of the <code>ANOMALY_DETECTION_BAND</code> function used as the threshold for the alarm.</p>
pub fn threshold_metric_id(mut self, input: impl Into<std::string::String>) -> Self {
self.threshold_metric_id = Some(input.into());
self
}
/// <p>In an alarm based on an anomaly detection model, this is the ID of the <code>ANOMALY_DETECTION_BAND</code> function used as the threshold for the alarm.</p>
pub fn set_threshold_metric_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.threshold_metric_id = input;
self
}
/// Consumes the builder and constructs a [`MetricAlarm`](crate::model::MetricAlarm)
pub fn build(self) -> crate::model::MetricAlarm {
crate::model::MetricAlarm {
alarm_name: self.alarm_name,
alarm_arn: self.alarm_arn,
alarm_description: self.alarm_description,
alarm_configuration_updated_timestamp: self.alarm_configuration_updated_timestamp,
actions_enabled: self.actions_enabled,
ok_actions: self.ok_actions,
alarm_actions: self.alarm_actions,
insufficient_data_actions: self.insufficient_data_actions,
state_value: self.state_value,
state_reason: self.state_reason,
state_reason_data: self.state_reason_data,
state_updated_timestamp: self.state_updated_timestamp,
metric_name: self.metric_name,
namespace: self.namespace,
statistic: self.statistic,
extended_statistic: self.extended_statistic,
dimensions: self.dimensions,
period: self.period,
unit: self.unit,
evaluation_periods: self.evaluation_periods,
datapoints_to_alarm: self.datapoints_to_alarm,
threshold: self.threshold,
comparison_operator: self.comparison_operator,
treat_missing_data: self.treat_missing_data,
evaluate_low_sample_count_percentile: self.evaluate_low_sample_count_percentile,
metrics: self.metrics,
threshold_metric_id: self.threshold_metric_id,
}
}
}
}
impl MetricAlarm {
/// Creates a new builder-style object to manufacture [`MetricAlarm`](crate::model::MetricAlarm)
pub fn builder() -> crate::model::metric_alarm::Builder {
crate::model::metric_alarm::Builder::default()
}
}
/// <p>The details about a composite alarm.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct CompositeAlarm {
/// <p>Indicates whether actions should be executed during any changes to the alarm state.</p>
pub actions_enabled: std::option::Option<bool>,
/// <p>The actions to execute when this alarm transitions to the ALARM state from any other state. Each action is specified as an Amazon Resource Name (ARN).</p>
pub alarm_actions: std::option::Option<std::vec::Vec<std::string::String>>,
/// <p>The Amazon Resource Name (ARN) of the alarm.</p>
pub alarm_arn: std::option::Option<std::string::String>,
/// <p>The time stamp of the last update to the alarm configuration.</p>
pub alarm_configuration_updated_timestamp: std::option::Option<aws_smithy_types::DateTime>,
/// <p>The description of the alarm.</p>
pub alarm_description: std::option::Option<std::string::String>,
/// <p>The name of the alarm.</p>
pub alarm_name: std::option::Option<std::string::String>,
/// <p>The rule that this alarm uses to evaluate its alarm state.</p>
pub alarm_rule: std::option::Option<std::string::String>,
/// <p>The actions to execute when this alarm transitions to the INSUFFICIENT_DATA state from any other state. Each action is specified as an Amazon Resource Name (ARN).</p>
pub insufficient_data_actions: std::option::Option<std::vec::Vec<std::string::String>>,
/// <p>The actions to execute when this alarm transitions to the OK state from any other state. Each action is specified as an Amazon Resource Name (ARN).</p>
pub ok_actions: std::option::Option<std::vec::Vec<std::string::String>>,
/// <p>An explanation for the alarm state, in text format.</p>
pub state_reason: std::option::Option<std::string::String>,
/// <p>An explanation for the alarm state, in JSON format.</p>
pub state_reason_data: std::option::Option<std::string::String>,
/// <p>The time stamp of the last update to the alarm state.</p>
pub state_updated_timestamp: std::option::Option<aws_smithy_types::DateTime>,
/// <p>The state value for the alarm.</p>
pub state_value: std::option::Option<crate::model::StateValue>,
}
impl CompositeAlarm {
/// <p>Indicates whether actions should be executed during any changes to the alarm state.</p>
pub fn actions_enabled(&self) -> std::option::Option<bool> {
self.actions_enabled
}
/// <p>The actions to execute when this alarm transitions to the ALARM state from any other state. Each action is specified as an Amazon Resource Name (ARN).</p>
pub fn alarm_actions(&self) -> std::option::Option<&[std::string::String]> {
self.alarm_actions.as_deref()
}
/// <p>The Amazon Resource Name (ARN) of the alarm.</p>
pub fn alarm_arn(&self) -> std::option::Option<&str> {
self.alarm_arn.as_deref()
}
/// <p>The time stamp of the last update to the alarm configuration.</p>
pub fn alarm_configuration_updated_timestamp(
&self,
) -> std::option::Option<&aws_smithy_types::DateTime> {
self.alarm_configuration_updated_timestamp.as_ref()
}
/// <p>The description of the alarm.</p>
pub fn alarm_description(&self) -> std::option::Option<&str> {
self.alarm_description.as_deref()
}
/// <p>The name of the alarm.</p>
pub fn alarm_name(&self) -> std::option::Option<&str> {
self.alarm_name.as_deref()
}
/// <p>The rule that this alarm uses to evaluate its alarm state.</p>
pub fn alarm_rule(&self) -> std::option::Option<&str> {
self.alarm_rule.as_deref()
}
/// <p>The actions to execute when this alarm transitions to the INSUFFICIENT_DATA state from any other state. Each action is specified as an Amazon Resource Name (ARN).</p>
pub fn insufficient_data_actions(&self) -> std::option::Option<&[std::string::String]> {
self.insufficient_data_actions.as_deref()
}
/// <p>The actions to execute when this alarm transitions to the OK state from any other state. Each action is specified as an Amazon Resource Name (ARN).</p>
pub fn ok_actions(&self) -> std::option::Option<&[std::string::String]> {
self.ok_actions.as_deref()
}
/// <p>An explanation for the alarm state, in text format.</p>
pub fn state_reason(&self) -> std::option::Option<&str> {
self.state_reason.as_deref()
}
/// <p>An explanation for the alarm state, in JSON format.</p>
pub fn state_reason_data(&self) -> std::option::Option<&str> {
self.state_reason_data.as_deref()
}
/// <p>The time stamp of the last update to the alarm state.</p>
pub fn state_updated_timestamp(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.state_updated_timestamp.as_ref()
}
/// <p>The state value for the alarm.</p>
pub fn state_value(&self) -> std::option::Option<&crate::model::StateValue> {
self.state_value.as_ref()
}
}
impl std::fmt::Debug for CompositeAlarm {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("CompositeAlarm");
formatter.field("actions_enabled", &self.actions_enabled);
formatter.field("alarm_actions", &self.alarm_actions);
formatter.field("alarm_arn", &self.alarm_arn);
formatter.field(
"alarm_configuration_updated_timestamp",
&self.alarm_configuration_updated_timestamp,
);
formatter.field("alarm_description", &self.alarm_description);
formatter.field("alarm_name", &self.alarm_name);
formatter.field("alarm_rule", &self.alarm_rule);
formatter.field("insufficient_data_actions", &self.insufficient_data_actions);
formatter.field("ok_actions", &self.ok_actions);
formatter.field("state_reason", &self.state_reason);
formatter.field("state_reason_data", &self.state_reason_data);
formatter.field("state_updated_timestamp", &self.state_updated_timestamp);
formatter.field("state_value", &self.state_value);
formatter.finish()
}
}
/// See [`CompositeAlarm`](crate::model::CompositeAlarm)
pub mod composite_alarm {
/// A builder for [`CompositeAlarm`](crate::model::CompositeAlarm)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) actions_enabled: std::option::Option<bool>,
pub(crate) alarm_actions: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) alarm_arn: std::option::Option<std::string::String>,
pub(crate) alarm_configuration_updated_timestamp:
std::option::Option<aws_smithy_types::DateTime>,
pub(crate) alarm_description: std::option::Option<std::string::String>,
pub(crate) alarm_name: std::option::Option<std::string::String>,
pub(crate) alarm_rule: std::option::Option<std::string::String>,
pub(crate) insufficient_data_actions:
std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) ok_actions: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) state_reason: std::option::Option<std::string::String>,
pub(crate) state_reason_data: std::option::Option<std::string::String>,
pub(crate) state_updated_timestamp: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) state_value: std::option::Option<crate::model::StateValue>,
}
impl Builder {
/// <p>Indicates whether actions should be executed during any changes to the alarm state.</p>
pub fn actions_enabled(mut self, input: bool) -> Self {
self.actions_enabled = Some(input);
self
}
/// <p>Indicates whether actions should be executed during any changes to the alarm state.</p>
pub fn set_actions_enabled(mut self, input: std::option::Option<bool>) -> Self {
self.actions_enabled = input;
self
}
/// Appends an item to `alarm_actions`.
///
/// To override the contents of this collection use [`set_alarm_actions`](Self::set_alarm_actions).
///
/// <p>The actions to execute when this alarm transitions to the ALARM state from any other state. Each action is specified as an Amazon Resource Name (ARN).</p>
pub fn alarm_actions(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.alarm_actions.unwrap_or_default();
v.push(input.into());
self.alarm_actions = Some(v);
self
}
/// <p>The actions to execute when this alarm transitions to the ALARM state from any other state. Each action is specified as an Amazon Resource Name (ARN).</p>
pub fn set_alarm_actions(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.alarm_actions = input;
self
}
/// <p>The Amazon Resource Name (ARN) of the alarm.</p>
pub fn alarm_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.alarm_arn = Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the alarm.</p>
pub fn set_alarm_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.alarm_arn = input;
self
}
/// <p>The time stamp of the last update to the alarm configuration.</p>
pub fn alarm_configuration_updated_timestamp(
mut self,
input: aws_smithy_types::DateTime,
) -> Self {
self.alarm_configuration_updated_timestamp = Some(input);
self
}
/// <p>The time stamp of the last update to the alarm configuration.</p>
pub fn set_alarm_configuration_updated_timestamp(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.alarm_configuration_updated_timestamp = input;
self
}
/// <p>The description of the alarm.</p>
pub fn alarm_description(mut self, input: impl Into<std::string::String>) -> Self {
self.alarm_description = Some(input.into());
self
}
/// <p>The description of the alarm.</p>
pub fn set_alarm_description(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.alarm_description = input;
self
}
/// <p>The name of the alarm.</p>
pub fn alarm_name(mut self, input: impl Into<std::string::String>) -> Self {
self.alarm_name = Some(input.into());
self
}
/// <p>The name of the alarm.</p>
pub fn set_alarm_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.alarm_name = input;
self
}
/// <p>The rule that this alarm uses to evaluate its alarm state.</p>
pub fn alarm_rule(mut self, input: impl Into<std::string::String>) -> Self {
self.alarm_rule = Some(input.into());
self
}
/// <p>The rule that this alarm uses to evaluate its alarm state.</p>
pub fn set_alarm_rule(mut self, input: std::option::Option<std::string::String>) -> Self {
self.alarm_rule = input;
self
}
/// Appends an item to `insufficient_data_actions`.
///
/// To override the contents of this collection use [`set_insufficient_data_actions`](Self::set_insufficient_data_actions).
///
/// <p>The actions to execute when this alarm transitions to the INSUFFICIENT_DATA state from any other state. Each action is specified as an Amazon Resource Name (ARN).</p>
pub fn insufficient_data_actions(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.insufficient_data_actions.unwrap_or_default();
v.push(input.into());
self.insufficient_data_actions = Some(v);
self
}
/// <p>The actions to execute when this alarm transitions to the INSUFFICIENT_DATA state from any other state. Each action is specified as an Amazon Resource Name (ARN).</p>
pub fn set_insufficient_data_actions(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.insufficient_data_actions = input;
self
}
/// Appends an item to `ok_actions`.
///
/// To override the contents of this collection use [`set_ok_actions`](Self::set_ok_actions).
///
/// <p>The actions to execute when this alarm transitions to the OK state from any other state. Each action is specified as an Amazon Resource Name (ARN).</p>
pub fn ok_actions(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.ok_actions.unwrap_or_default();
v.push(input.into());
self.ok_actions = Some(v);
self
}
/// <p>The actions to execute when this alarm transitions to the OK state from any other state. Each action is specified as an Amazon Resource Name (ARN).</p>
pub fn set_ok_actions(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.ok_actions = input;
self
}
/// <p>An explanation for the alarm state, in text format.</p>
pub fn state_reason(mut self, input: impl Into<std::string::String>) -> Self {
self.state_reason = Some(input.into());
self
}
/// <p>An explanation for the alarm state, in text format.</p>
pub fn set_state_reason(mut self, input: std::option::Option<std::string::String>) -> Self {
self.state_reason = input;
self
}
/// <p>An explanation for the alarm state, in JSON format.</p>
pub fn state_reason_data(mut self, input: impl Into<std::string::String>) -> Self {
self.state_reason_data = Some(input.into());
self
}
/// <p>An explanation for the alarm state, in JSON format.</p>
pub fn set_state_reason_data(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.state_reason_data = input;
self
}
/// <p>The time stamp of the last update to the alarm state.</p>
pub fn state_updated_timestamp(mut self, input: aws_smithy_types::DateTime) -> Self {
self.state_updated_timestamp = Some(input);
self
}
/// <p>The time stamp of the last update to the alarm state.</p>
pub fn set_state_updated_timestamp(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.state_updated_timestamp = input;
self
}
/// <p>The state value for the alarm.</p>
pub fn state_value(mut self, input: crate::model::StateValue) -> Self {
self.state_value = Some(input);
self
}
/// <p>The state value for the alarm.</p>
pub fn set_state_value(
mut self,
input: std::option::Option<crate::model::StateValue>,
) -> Self {
self.state_value = input;
self
}
/// Consumes the builder and constructs a [`CompositeAlarm`](crate::model::CompositeAlarm)
pub fn build(self) -> crate::model::CompositeAlarm {
crate::model::CompositeAlarm {
actions_enabled: self.actions_enabled,
alarm_actions: self.alarm_actions,
alarm_arn: self.alarm_arn,
alarm_configuration_updated_timestamp: self.alarm_configuration_updated_timestamp,
alarm_description: self.alarm_description,
alarm_name: self.alarm_name,
alarm_rule: self.alarm_rule,
insufficient_data_actions: self.insufficient_data_actions,
ok_actions: self.ok_actions,
state_reason: self.state_reason,
state_reason_data: self.state_reason_data,
state_updated_timestamp: self.state_updated_timestamp,
state_value: self.state_value,
}
}
}
}
impl CompositeAlarm {
/// Creates a new builder-style object to manufacture [`CompositeAlarm`](crate::model::CompositeAlarm)
pub fn builder() -> crate::model::composite_alarm::Builder {
crate::model::composite_alarm::Builder::default()
}
}
#[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 AlarmType {
#[allow(missing_docs)] // documentation missing in model
CompositeAlarm,
#[allow(missing_docs)] // documentation missing in model
MetricAlarm,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for AlarmType {
fn from(s: &str) -> Self {
match s {
"CompositeAlarm" => AlarmType::CompositeAlarm,
"MetricAlarm" => AlarmType::MetricAlarm,
other => AlarmType::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for AlarmType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(AlarmType::from(s))
}
}
impl AlarmType {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
AlarmType::CompositeAlarm => "CompositeAlarm",
AlarmType::MetricAlarm => "MetricAlarm",
AlarmType::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&["CompositeAlarm", "MetricAlarm"]
}
}
impl AsRef<str> for AlarmType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>Represents the history of a specific alarm.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct AlarmHistoryItem {
/// <p>The descriptive name for the alarm.</p>
pub alarm_name: std::option::Option<std::string::String>,
/// <p>The type of alarm, either metric alarm or composite alarm.</p>
pub alarm_type: std::option::Option<crate::model::AlarmType>,
/// <p>The time stamp for the alarm history item.</p>
pub timestamp: std::option::Option<aws_smithy_types::DateTime>,
/// <p>The type of alarm history item.</p>
pub history_item_type: std::option::Option<crate::model::HistoryItemType>,
/// <p>A summary of the alarm history, in text format.</p>
pub history_summary: std::option::Option<std::string::String>,
/// <p>Data about the alarm, in JSON format.</p>
pub history_data: std::option::Option<std::string::String>,
}
impl AlarmHistoryItem {
/// <p>The descriptive name for the alarm.</p>
pub fn alarm_name(&self) -> std::option::Option<&str> {
self.alarm_name.as_deref()
}
/// <p>The type of alarm, either metric alarm or composite alarm.</p>
pub fn alarm_type(&self) -> std::option::Option<&crate::model::AlarmType> {
self.alarm_type.as_ref()
}
/// <p>The time stamp for the alarm history item.</p>
pub fn timestamp(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.timestamp.as_ref()
}
/// <p>The type of alarm history item.</p>
pub fn history_item_type(&self) -> std::option::Option<&crate::model::HistoryItemType> {
self.history_item_type.as_ref()
}
/// <p>A summary of the alarm history, in text format.</p>
pub fn history_summary(&self) -> std::option::Option<&str> {
self.history_summary.as_deref()
}
/// <p>Data about the alarm, in JSON format.</p>
pub fn history_data(&self) -> std::option::Option<&str> {
self.history_data.as_deref()
}
}
impl std::fmt::Debug for AlarmHistoryItem {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("AlarmHistoryItem");
formatter.field("alarm_name", &self.alarm_name);
formatter.field("alarm_type", &self.alarm_type);
formatter.field("timestamp", &self.timestamp);
formatter.field("history_item_type", &self.history_item_type);
formatter.field("history_summary", &self.history_summary);
formatter.field("history_data", &self.history_data);
formatter.finish()
}
}
/// See [`AlarmHistoryItem`](crate::model::AlarmHistoryItem)
pub mod alarm_history_item {
/// A builder for [`AlarmHistoryItem`](crate::model::AlarmHistoryItem)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) alarm_name: std::option::Option<std::string::String>,
pub(crate) alarm_type: std::option::Option<crate::model::AlarmType>,
pub(crate) timestamp: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) history_item_type: std::option::Option<crate::model::HistoryItemType>,
pub(crate) history_summary: std::option::Option<std::string::String>,
pub(crate) history_data: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The descriptive name for the alarm.</p>
pub fn alarm_name(mut self, input: impl Into<std::string::String>) -> Self {
self.alarm_name = Some(input.into());
self
}
/// <p>The descriptive name for the alarm.</p>
pub fn set_alarm_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.alarm_name = input;
self
}
/// <p>The type of alarm, either metric alarm or composite alarm.</p>
pub fn alarm_type(mut self, input: crate::model::AlarmType) -> Self {
self.alarm_type = Some(input);
self
}
/// <p>The type of alarm, either metric alarm or composite alarm.</p>
pub fn set_alarm_type(
mut self,
input: std::option::Option<crate::model::AlarmType>,
) -> Self {
self.alarm_type = input;
self
}
/// <p>The time stamp for the alarm history item.</p>
pub fn timestamp(mut self, input: aws_smithy_types::DateTime) -> Self {
self.timestamp = Some(input);
self
}
/// <p>The time stamp for the alarm history item.</p>
pub fn set_timestamp(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.timestamp = input;
self
}
/// <p>The type of alarm history item.</p>
pub fn history_item_type(mut self, input: crate::model::HistoryItemType) -> Self {
self.history_item_type = Some(input);
self
}
/// <p>The type of alarm history item.</p>
pub fn set_history_item_type(
mut self,
input: std::option::Option<crate::model::HistoryItemType>,
) -> Self {
self.history_item_type = input;
self
}
/// <p>A summary of the alarm history, in text format.</p>
pub fn history_summary(mut self, input: impl Into<std::string::String>) -> Self {
self.history_summary = Some(input.into());
self
}
/// <p>A summary of the alarm history, in text format.</p>
pub fn set_history_summary(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.history_summary = input;
self
}
/// <p>Data about the alarm, in JSON format.</p>
pub fn history_data(mut self, input: impl Into<std::string::String>) -> Self {
self.history_data = Some(input.into());
self
}
/// <p>Data about the alarm, in JSON format.</p>
pub fn set_history_data(mut self, input: std::option::Option<std::string::String>) -> Self {
self.history_data = input;
self
}
/// Consumes the builder and constructs a [`AlarmHistoryItem`](crate::model::AlarmHistoryItem)
pub fn build(self) -> crate::model::AlarmHistoryItem {
crate::model::AlarmHistoryItem {
alarm_name: self.alarm_name,
alarm_type: self.alarm_type,
timestamp: self.timestamp,
history_item_type: self.history_item_type,
history_summary: self.history_summary,
history_data: self.history_data,
}
}
}
}
impl AlarmHistoryItem {
/// Creates a new builder-style object to manufacture [`AlarmHistoryItem`](crate::model::AlarmHistoryItem)
pub fn builder() -> crate::model::alarm_history_item::Builder {
crate::model::alarm_history_item::Builder::default()
}
}
#[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 HistoryItemType {
#[allow(missing_docs)] // documentation missing in model
Action,
#[allow(missing_docs)] // documentation missing in model
ConfigurationUpdate,
#[allow(missing_docs)] // documentation missing in model
StateUpdate,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for HistoryItemType {
fn from(s: &str) -> Self {
match s {
"Action" => HistoryItemType::Action,
"ConfigurationUpdate" => HistoryItemType::ConfigurationUpdate,
"StateUpdate" => HistoryItemType::StateUpdate,
other => HistoryItemType::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for HistoryItemType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(HistoryItemType::from(s))
}
}
impl HistoryItemType {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
HistoryItemType::Action => "Action",
HistoryItemType::ConfigurationUpdate => "ConfigurationUpdate",
HistoryItemType::StateUpdate => "StateUpdate",
HistoryItemType::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&["Action", "ConfigurationUpdate", "StateUpdate"]
}
}
impl AsRef<str> for HistoryItemType {
fn as_ref(&self) -> &str {
self.as_str()
}
}