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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>The details of a schedule group.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ScheduleGroupSummary {
/// <p>The Amazon Resource Name (ARN) of the schedule group.</p>
#[doc(hidden)]
pub arn: std::option::Option<std::string::String>,
/// <p>The name of the schedule group.</p>
#[doc(hidden)]
pub name: std::option::Option<std::string::String>,
/// <p>Specifies the state of the schedule group.</p>
#[doc(hidden)]
pub state: std::option::Option<crate::model::ScheduleGroupState>,
/// <p>The time at which the schedule group was created.</p>
#[doc(hidden)]
pub creation_date: std::option::Option<aws_smithy_types::DateTime>,
/// <p>The time at which the schedule group was last modified.</p>
#[doc(hidden)]
pub last_modification_date: std::option::Option<aws_smithy_types::DateTime>,
}
impl ScheduleGroupSummary {
/// <p>The Amazon Resource Name (ARN) of the schedule group.</p>
pub fn arn(&self) -> std::option::Option<&str> {
self.arn.as_deref()
}
/// <p>The name of the schedule group.</p>
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
/// <p>Specifies the state of the schedule group.</p>
pub fn state(&self) -> std::option::Option<&crate::model::ScheduleGroupState> {
self.state.as_ref()
}
/// <p>The time at which the schedule group was created.</p>
pub fn creation_date(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.creation_date.as_ref()
}
/// <p>The time at which the schedule group was last modified.</p>
pub fn last_modification_date(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.last_modification_date.as_ref()
}
}
/// See [`ScheduleGroupSummary`](crate::model::ScheduleGroupSummary).
pub mod schedule_group_summary {
/// A builder for [`ScheduleGroupSummary`](crate::model::ScheduleGroupSummary).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) arn: std::option::Option<std::string::String>,
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) state: std::option::Option<crate::model::ScheduleGroupState>,
pub(crate) creation_date: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) last_modification_date: std::option::Option<aws_smithy_types::DateTime>,
}
impl Builder {
/// <p>The Amazon Resource Name (ARN) of the schedule group.</p>
pub fn arn(mut self, input: impl Into<std::string::String>) -> Self {
self.arn = Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the schedule group.</p>
pub fn set_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.arn = input;
self
}
/// <p>The name of the schedule group.</p>
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
/// <p>The name of the schedule group.</p>
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
/// <p>Specifies the state of the schedule group.</p>
pub fn state(mut self, input: crate::model::ScheduleGroupState) -> Self {
self.state = Some(input);
self
}
/// <p>Specifies the state of the schedule group.</p>
pub fn set_state(
mut self,
input: std::option::Option<crate::model::ScheduleGroupState>,
) -> Self {
self.state = input;
self
}
/// <p>The time at which the schedule group was created.</p>
pub fn creation_date(mut self, input: aws_smithy_types::DateTime) -> Self {
self.creation_date = Some(input);
self
}
/// <p>The time at which the schedule group was 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 time at which the schedule group was last modified.</p>
pub fn last_modification_date(mut self, input: aws_smithy_types::DateTime) -> Self {
self.last_modification_date = Some(input);
self
}
/// <p>The time at which the schedule group was last modified.</p>
pub fn set_last_modification_date(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.last_modification_date = input;
self
}
/// Consumes the builder and constructs a [`ScheduleGroupSummary`](crate::model::ScheduleGroupSummary).
pub fn build(self) -> crate::model::ScheduleGroupSummary {
crate::model::ScheduleGroupSummary {
arn: self.arn,
name: self.name,
state: self.state,
creation_date: self.creation_date,
last_modification_date: self.last_modification_date,
}
}
}
}
impl ScheduleGroupSummary {
/// Creates a new builder-style object to manufacture [`ScheduleGroupSummary`](crate::model::ScheduleGroupSummary).
pub fn builder() -> crate::model::schedule_group_summary::Builder {
crate::model::schedule_group_summary::Builder::default()
}
}
/// When writing a match expression against `ScheduleGroupState`, it is important to ensure
/// your code is forward-compatible. That is, if a match arm handles a case for a
/// feature that is supported by the service but has not been represented as an enum
/// variant in a current version of SDK, your code should continue to work when you
/// upgrade SDK to a future version in which the enum does include a variant for that
/// feature.
///
/// Here is an example of how you can make a match expression forward-compatible:
///
/// ```text
/// # let schedulegroupstate = unimplemented!();
/// match schedulegroupstate {
/// ScheduleGroupState::Active => { /* ... */ },
/// ScheduleGroupState::Deleting => { /* ... */ },
/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
/// _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `schedulegroupstate` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `ScheduleGroupState::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `ScheduleGroupState::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
/// and calling `as_str` on it yields `"NewFeature"`.
/// This match expression is forward-compatible when executed with a newer
/// version of SDK where the variant `ScheduleGroupState::NewFeature` is defined.
/// Specifically, when `schedulegroupstate` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `ScheduleGroupState::NewFeature` also yielding `"NewFeature"`.
///
/// Explicitly matching on the `Unknown` variant should
/// be avoided for two reasons:
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
/// - It might inadvertently shadow other intended match arms.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum ScheduleGroupState {
#[allow(missing_docs)] // documentation missing in model
Active,
#[allow(missing_docs)] // documentation missing in model
Deleting,
/// `Unknown` contains new variants that have been added since this code was generated.
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for ScheduleGroupState {
fn from(s: &str) -> Self {
match s {
"ACTIVE" => ScheduleGroupState::Active,
"DELETING" => ScheduleGroupState::Deleting,
other => {
ScheduleGroupState::Unknown(crate::types::UnknownVariantValue(other.to_owned()))
}
}
}
}
impl std::str::FromStr for ScheduleGroupState {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(ScheduleGroupState::from(s))
}
}
impl ScheduleGroupState {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
ScheduleGroupState::Active => "ACTIVE",
ScheduleGroupState::Deleting => "DELETING",
ScheduleGroupState::Unknown(value) => value.as_str(),
}
}
/// Returns all the `&str` values of the enum members.
pub const fn values() -> &'static [&'static str] {
&["ACTIVE", "DELETING"]
}
}
impl AsRef<str> for ScheduleGroupState {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>Tag to associate with a schedule group.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Tag {
/// <p>The key for the tag.</p>
#[doc(hidden)]
pub key: std::option::Option<std::string::String>,
/// <p>The value for the tag.</p>
#[doc(hidden)]
pub value: std::option::Option<std::string::String>,
}
impl Tag {
/// <p>The key for the tag.</p>
pub fn key(&self) -> std::option::Option<&str> {
self.key.as_deref()
}
/// <p>The value for the tag.</p>
pub fn value(&self) -> std::option::Option<&str> {
self.value.as_deref()
}
}
/// See [`Tag`](crate::model::Tag).
pub mod tag {
/// A builder for [`Tag`](crate::model::Tag).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) key: std::option::Option<std::string::String>,
pub(crate) value: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The key for the tag.</p>
pub fn key(mut self, input: impl Into<std::string::String>) -> Self {
self.key = Some(input.into());
self
}
/// <p>The key for the tag.</p>
pub fn set_key(mut self, input: std::option::Option<std::string::String>) -> Self {
self.key = input;
self
}
/// <p>The value for the tag.</p>
pub fn value(mut self, input: impl Into<std::string::String>) -> Self {
self.value = Some(input.into());
self
}
/// <p>The value for the tag.</p>
pub fn set_value(mut self, input: std::option::Option<std::string::String>) -> Self {
self.value = input;
self
}
/// Consumes the builder and constructs a [`Tag`](crate::model::Tag).
pub fn build(self) -> crate::model::Tag {
crate::model::Tag {
key: self.key,
value: self.value,
}
}
}
}
impl Tag {
/// Creates a new builder-style object to manufacture [`Tag`](crate::model::Tag).
pub fn builder() -> crate::model::tag::Builder {
crate::model::tag::Builder::default()
}
}
/// <p>The details of a schedule.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ScheduleSummary {
/// <p>The Amazon Resource Name (ARN) of the schedule.</p>
#[doc(hidden)]
pub arn: std::option::Option<std::string::String>,
/// <p>The name of the schedule.</p>
#[doc(hidden)]
pub name: std::option::Option<std::string::String>,
/// <p>The name of the schedule group associated with this schedule.</p>
#[doc(hidden)]
pub group_name: std::option::Option<std::string::String>,
/// <p>Specifies whether the schedule is enabled or disabled.</p>
#[doc(hidden)]
pub state: std::option::Option<crate::model::ScheduleState>,
/// <p>The time at which the schedule was created.</p>
#[doc(hidden)]
pub creation_date: std::option::Option<aws_smithy_types::DateTime>,
/// <p>The time at which the schedule was last modified.</p>
#[doc(hidden)]
pub last_modification_date: std::option::Option<aws_smithy_types::DateTime>,
/// <p>The schedule's target details.</p>
#[doc(hidden)]
pub target: std::option::Option<crate::model::TargetSummary>,
}
impl ScheduleSummary {
/// <p>The Amazon Resource Name (ARN) of the schedule.</p>
pub fn arn(&self) -> std::option::Option<&str> {
self.arn.as_deref()
}
/// <p>The name of the schedule.</p>
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
/// <p>The name of the schedule group associated with this schedule.</p>
pub fn group_name(&self) -> std::option::Option<&str> {
self.group_name.as_deref()
}
/// <p>Specifies whether the schedule is enabled or disabled.</p>
pub fn state(&self) -> std::option::Option<&crate::model::ScheduleState> {
self.state.as_ref()
}
/// <p>The time at which the schedule was created.</p>
pub fn creation_date(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.creation_date.as_ref()
}
/// <p>The time at which the schedule was last modified.</p>
pub fn last_modification_date(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.last_modification_date.as_ref()
}
/// <p>The schedule's target details.</p>
pub fn target(&self) -> std::option::Option<&crate::model::TargetSummary> {
self.target.as_ref()
}
}
/// See [`ScheduleSummary`](crate::model::ScheduleSummary).
pub mod schedule_summary {
/// A builder for [`ScheduleSummary`](crate::model::ScheduleSummary).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) arn: std::option::Option<std::string::String>,
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) group_name: std::option::Option<std::string::String>,
pub(crate) state: std::option::Option<crate::model::ScheduleState>,
pub(crate) creation_date: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) last_modification_date: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) target: std::option::Option<crate::model::TargetSummary>,
}
impl Builder {
/// <p>The Amazon Resource Name (ARN) of the schedule.</p>
pub fn arn(mut self, input: impl Into<std::string::String>) -> Self {
self.arn = Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the schedule.</p>
pub fn set_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.arn = input;
self
}
/// <p>The name of the schedule.</p>
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
/// <p>The name of the schedule.</p>
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
/// <p>The name of the schedule group associated with this schedule.</p>
pub fn group_name(mut self, input: impl Into<std::string::String>) -> Self {
self.group_name = Some(input.into());
self
}
/// <p>The name of the schedule group associated with this schedule.</p>
pub fn set_group_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.group_name = input;
self
}
/// <p>Specifies whether the schedule is enabled or disabled.</p>
pub fn state(mut self, input: crate::model::ScheduleState) -> Self {
self.state = Some(input);
self
}
/// <p>Specifies whether the schedule is enabled or disabled.</p>
pub fn set_state(
mut self,
input: std::option::Option<crate::model::ScheduleState>,
) -> Self {
self.state = input;
self
}
/// <p>The time at which the schedule was created.</p>
pub fn creation_date(mut self, input: aws_smithy_types::DateTime) -> Self {
self.creation_date = Some(input);
self
}
/// <p>The time at which the schedule was 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 time at which the schedule was last modified.</p>
pub fn last_modification_date(mut self, input: aws_smithy_types::DateTime) -> Self {
self.last_modification_date = Some(input);
self
}
/// <p>The time at which the schedule was last modified.</p>
pub fn set_last_modification_date(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.last_modification_date = input;
self
}
/// <p>The schedule's target details.</p>
pub fn target(mut self, input: crate::model::TargetSummary) -> Self {
self.target = Some(input);
self
}
/// <p>The schedule's target details.</p>
pub fn set_target(
mut self,
input: std::option::Option<crate::model::TargetSummary>,
) -> Self {
self.target = input;
self
}
/// Consumes the builder and constructs a [`ScheduleSummary`](crate::model::ScheduleSummary).
pub fn build(self) -> crate::model::ScheduleSummary {
crate::model::ScheduleSummary {
arn: self.arn,
name: self.name,
group_name: self.group_name,
state: self.state,
creation_date: self.creation_date,
last_modification_date: self.last_modification_date,
target: self.target,
}
}
}
}
impl ScheduleSummary {
/// Creates a new builder-style object to manufacture [`ScheduleSummary`](crate::model::ScheduleSummary).
pub fn builder() -> crate::model::schedule_summary::Builder {
crate::model::schedule_summary::Builder::default()
}
}
/// <p>The details of a target.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct TargetSummary {
/// <p>The Amazon Resource Name (ARN) of the target.</p>
#[doc(hidden)]
pub arn: std::option::Option<std::string::String>,
}
impl TargetSummary {
/// <p>The Amazon Resource Name (ARN) of the target.</p>
pub fn arn(&self) -> std::option::Option<&str> {
self.arn.as_deref()
}
}
/// See [`TargetSummary`](crate::model::TargetSummary).
pub mod target_summary {
/// A builder for [`TargetSummary`](crate::model::TargetSummary).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) arn: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The Amazon Resource Name (ARN) of the target.</p>
pub fn arn(mut self, input: impl Into<std::string::String>) -> Self {
self.arn = Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the target.</p>
pub fn set_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.arn = input;
self
}
/// Consumes the builder and constructs a [`TargetSummary`](crate::model::TargetSummary).
pub fn build(self) -> crate::model::TargetSummary {
crate::model::TargetSummary { arn: self.arn }
}
}
}
impl TargetSummary {
/// Creates a new builder-style object to manufacture [`TargetSummary`](crate::model::TargetSummary).
pub fn builder() -> crate::model::target_summary::Builder {
crate::model::target_summary::Builder::default()
}
}
/// When writing a match expression against `ScheduleState`, it is important to ensure
/// your code is forward-compatible. That is, if a match arm handles a case for a
/// feature that is supported by the service but has not been represented as an enum
/// variant in a current version of SDK, your code should continue to work when you
/// upgrade SDK to a future version in which the enum does include a variant for that
/// feature.
///
/// Here is an example of how you can make a match expression forward-compatible:
///
/// ```text
/// # let schedulestate = unimplemented!();
/// match schedulestate {
/// ScheduleState::Disabled => { /* ... */ },
/// ScheduleState::Enabled => { /* ... */ },
/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
/// _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `schedulestate` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `ScheduleState::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `ScheduleState::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
/// and calling `as_str` on it yields `"NewFeature"`.
/// This match expression is forward-compatible when executed with a newer
/// version of SDK where the variant `ScheduleState::NewFeature` is defined.
/// Specifically, when `schedulestate` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `ScheduleState::NewFeature` also yielding `"NewFeature"`.
///
/// Explicitly matching on the `Unknown` variant should
/// be avoided for two reasons:
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
/// - It might inadvertently shadow other intended match arms.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum ScheduleState {
#[allow(missing_docs)] // documentation missing in model
Disabled,
#[allow(missing_docs)] // documentation missing in model
Enabled,
/// `Unknown` contains new variants that have been added since this code was generated.
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for ScheduleState {
fn from(s: &str) -> Self {
match s {
"DISABLED" => ScheduleState::Disabled,
"ENABLED" => ScheduleState::Enabled,
other => ScheduleState::Unknown(crate::types::UnknownVariantValue(other.to_owned())),
}
}
}
impl std::str::FromStr for ScheduleState {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(ScheduleState::from(s))
}
}
impl ScheduleState {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
ScheduleState::Disabled => "DISABLED",
ScheduleState::Enabled => "ENABLED",
ScheduleState::Unknown(value) => value.as_str(),
}
}
/// Returns all the `&str` values of the enum members.
pub const fn values() -> &'static [&'static str] {
&["DISABLED", "ENABLED"]
}
}
impl AsRef<str> for ScheduleState {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>Allows you to configure a time window during which EventBridge Scheduler invokes the schedule.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct FlexibleTimeWindow {
/// <p>Determines whether the schedule is invoked within a flexible time window.</p>
#[doc(hidden)]
pub mode: std::option::Option<crate::model::FlexibleTimeWindowMode>,
/// <p>The maximum time window during which a schedule can be invoked.</p>
#[doc(hidden)]
pub maximum_window_in_minutes: std::option::Option<i32>,
}
impl FlexibleTimeWindow {
/// <p>Determines whether the schedule is invoked within a flexible time window.</p>
pub fn mode(&self) -> std::option::Option<&crate::model::FlexibleTimeWindowMode> {
self.mode.as_ref()
}
/// <p>The maximum time window during which a schedule can be invoked.</p>
pub fn maximum_window_in_minutes(&self) -> std::option::Option<i32> {
self.maximum_window_in_minutes
}
}
/// See [`FlexibleTimeWindow`](crate::model::FlexibleTimeWindow).
pub mod flexible_time_window {
/// A builder for [`FlexibleTimeWindow`](crate::model::FlexibleTimeWindow).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) mode: std::option::Option<crate::model::FlexibleTimeWindowMode>,
pub(crate) maximum_window_in_minutes: std::option::Option<i32>,
}
impl Builder {
/// <p>Determines whether the schedule is invoked within a flexible time window.</p>
pub fn mode(mut self, input: crate::model::FlexibleTimeWindowMode) -> Self {
self.mode = Some(input);
self
}
/// <p>Determines whether the schedule is invoked within a flexible time window.</p>
pub fn set_mode(
mut self,
input: std::option::Option<crate::model::FlexibleTimeWindowMode>,
) -> Self {
self.mode = input;
self
}
/// <p>The maximum time window during which a schedule can be invoked.</p>
pub fn maximum_window_in_minutes(mut self, input: i32) -> Self {
self.maximum_window_in_minutes = Some(input);
self
}
/// <p>The maximum time window during which a schedule can be invoked.</p>
pub fn set_maximum_window_in_minutes(mut self, input: std::option::Option<i32>) -> Self {
self.maximum_window_in_minutes = input;
self
}
/// Consumes the builder and constructs a [`FlexibleTimeWindow`](crate::model::FlexibleTimeWindow).
pub fn build(self) -> crate::model::FlexibleTimeWindow {
crate::model::FlexibleTimeWindow {
mode: self.mode,
maximum_window_in_minutes: self.maximum_window_in_minutes,
}
}
}
}
impl FlexibleTimeWindow {
/// Creates a new builder-style object to manufacture [`FlexibleTimeWindow`](crate::model::FlexibleTimeWindow).
pub fn builder() -> crate::model::flexible_time_window::Builder {
crate::model::flexible_time_window::Builder::default()
}
}
/// When writing a match expression against `FlexibleTimeWindowMode`, it is important to ensure
/// your code is forward-compatible. That is, if a match arm handles a case for a
/// feature that is supported by the service but has not been represented as an enum
/// variant in a current version of SDK, your code should continue to work when you
/// upgrade SDK to a future version in which the enum does include a variant for that
/// feature.
///
/// Here is an example of how you can make a match expression forward-compatible:
///
/// ```text
/// # let flexibletimewindowmode = unimplemented!();
/// match flexibletimewindowmode {
/// FlexibleTimeWindowMode::Flexible => { /* ... */ },
/// FlexibleTimeWindowMode::Off => { /* ... */ },
/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
/// _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `flexibletimewindowmode` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `FlexibleTimeWindowMode::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `FlexibleTimeWindowMode::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
/// and calling `as_str` on it yields `"NewFeature"`.
/// This match expression is forward-compatible when executed with a newer
/// version of SDK where the variant `FlexibleTimeWindowMode::NewFeature` is defined.
/// Specifically, when `flexibletimewindowmode` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `FlexibleTimeWindowMode::NewFeature` also yielding `"NewFeature"`.
///
/// Explicitly matching on the `Unknown` variant should
/// be avoided for two reasons:
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
/// - It might inadvertently shadow other intended match arms.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum FlexibleTimeWindowMode {
#[allow(missing_docs)] // documentation missing in model
Flexible,
#[allow(missing_docs)] // documentation missing in model
Off,
/// `Unknown` contains new variants that have been added since this code was generated.
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for FlexibleTimeWindowMode {
fn from(s: &str) -> Self {
match s {
"FLEXIBLE" => FlexibleTimeWindowMode::Flexible,
"OFF" => FlexibleTimeWindowMode::Off,
other => {
FlexibleTimeWindowMode::Unknown(crate::types::UnknownVariantValue(other.to_owned()))
}
}
}
}
impl std::str::FromStr for FlexibleTimeWindowMode {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(FlexibleTimeWindowMode::from(s))
}
}
impl FlexibleTimeWindowMode {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
FlexibleTimeWindowMode::Flexible => "FLEXIBLE",
FlexibleTimeWindowMode::Off => "OFF",
FlexibleTimeWindowMode::Unknown(value) => value.as_str(),
}
}
/// Returns all the `&str` values of the enum members.
pub const fn values() -> &'static [&'static str] {
&["FLEXIBLE", "OFF"]
}
}
impl AsRef<str> for FlexibleTimeWindowMode {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>The schedule's target. EventBridge Scheduler supports templated target that invoke common API operations, as well as universal targets that you can customize to invoke over 6,000 API operations across more than 270 services. You can only specify one templated or universal target for a schedule.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Target {
/// <p>The Amazon Resource Name (ARN) of the target.</p>
#[doc(hidden)]
pub arn: std::option::Option<std::string::String>,
/// <p>The Amazon Resource Name (ARN) of the IAM role that EventBridge Scheduler will use for this target when the schedule is invoked.</p>
#[doc(hidden)]
pub role_arn: std::option::Option<std::string::String>,
/// <p>An object that contains information about an Amazon SQS queue that EventBridge Scheduler uses as a dead-letter queue for your schedule. If specified, EventBridge Scheduler delivers failed events that could not be successfully delivered to a target to the queue.</p>
#[doc(hidden)]
pub dead_letter_config: std::option::Option<crate::model::DeadLetterConfig>,
/// <p>A <code>RetryPolicy</code> object that includes information about the retry policy settings, including the maximum age of an event, and the maximum number of times EventBridge Scheduler will try to deliver the event to a target.</p>
#[doc(hidden)]
pub retry_policy: std::option::Option<crate::model::RetryPolicy>,
/// <p>The text, or well-formed JSON, passed to the target. If you are configuring a templated Lambda, AWS Step Functions, or Amazon EventBridge target, the input must be a well-formed JSON. For all other target types, a JSON is not required. If you do not specify anything for this field, EventBridge Scheduler delivers a default notification to the target.</p>
#[doc(hidden)]
pub input: std::option::Option<std::string::String>,
/// <p>The templated target type for the Amazon ECS <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RunTask.html"> <code>RunTask</code> </a> API operation.</p>
#[doc(hidden)]
pub ecs_parameters: std::option::Option<crate::model::EcsParameters>,
/// <p>The templated target type for the EventBridge <a href="https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_PutEvents.html"> <code>PutEvents</code> </a> API operation.</p>
#[doc(hidden)]
pub event_bridge_parameters: std::option::Option<crate::model::EventBridgeParameters>,
/// <p>The templated target type for the Amazon Kinesis <a href="kinesis/latest/APIReference/API_PutRecord.html"> <code>PutRecord</code> </a> API operation.</p>
#[doc(hidden)]
pub kinesis_parameters: std::option::Option<crate::model::KinesisParameters>,
/// <p>The templated target type for the Amazon SageMaker <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_StartPipelineExecution.html"> <code>StartPipelineExecution</code> </a> API operation.</p>
#[doc(hidden)]
pub sage_maker_pipeline_parameters:
std::option::Option<crate::model::SageMakerPipelineParameters>,
/// <p>The templated target type for the Amazon SQS <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_SendMessage.html"> <code>SendMessage</code> </a> API operation. Contains the message group ID to use when the target is a FIFO queue. If you specify an Amazon SQS FIFO queue as a target, the queue must have content-based deduplication enabled. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagededuplicationid-property.html">Using the Amazon SQS message deduplication ID</a> in the <i>Amazon SQS Developer Guide</i>.</p>
#[doc(hidden)]
pub sqs_parameters: std::option::Option<crate::model::SqsParameters>,
}
impl Target {
/// <p>The Amazon Resource Name (ARN) of the target.</p>
pub fn arn(&self) -> std::option::Option<&str> {
self.arn.as_deref()
}
/// <p>The Amazon Resource Name (ARN) of the IAM role that EventBridge Scheduler will use for this target when the schedule is invoked.</p>
pub fn role_arn(&self) -> std::option::Option<&str> {
self.role_arn.as_deref()
}
/// <p>An object that contains information about an Amazon SQS queue that EventBridge Scheduler uses as a dead-letter queue for your schedule. If specified, EventBridge Scheduler delivers failed events that could not be successfully delivered to a target to the queue.</p>
pub fn dead_letter_config(&self) -> std::option::Option<&crate::model::DeadLetterConfig> {
self.dead_letter_config.as_ref()
}
/// <p>A <code>RetryPolicy</code> object that includes information about the retry policy settings, including the maximum age of an event, and the maximum number of times EventBridge Scheduler will try to deliver the event to a target.</p>
pub fn retry_policy(&self) -> std::option::Option<&crate::model::RetryPolicy> {
self.retry_policy.as_ref()
}
/// <p>The text, or well-formed JSON, passed to the target. If you are configuring a templated Lambda, AWS Step Functions, or Amazon EventBridge target, the input must be a well-formed JSON. For all other target types, a JSON is not required. If you do not specify anything for this field, EventBridge Scheduler delivers a default notification to the target.</p>
pub fn input(&self) -> std::option::Option<&str> {
self.input.as_deref()
}
/// <p>The templated target type for the Amazon ECS <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RunTask.html"> <code>RunTask</code> </a> API operation.</p>
pub fn ecs_parameters(&self) -> std::option::Option<&crate::model::EcsParameters> {
self.ecs_parameters.as_ref()
}
/// <p>The templated target type for the EventBridge <a href="https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_PutEvents.html"> <code>PutEvents</code> </a> API operation.</p>
pub fn event_bridge_parameters(
&self,
) -> std::option::Option<&crate::model::EventBridgeParameters> {
self.event_bridge_parameters.as_ref()
}
/// <p>The templated target type for the Amazon Kinesis <a href="kinesis/latest/APIReference/API_PutRecord.html"> <code>PutRecord</code> </a> API operation.</p>
pub fn kinesis_parameters(&self) -> std::option::Option<&crate::model::KinesisParameters> {
self.kinesis_parameters.as_ref()
}
/// <p>The templated target type for the Amazon SageMaker <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_StartPipelineExecution.html"> <code>StartPipelineExecution</code> </a> API operation.</p>
pub fn sage_maker_pipeline_parameters(
&self,
) -> std::option::Option<&crate::model::SageMakerPipelineParameters> {
self.sage_maker_pipeline_parameters.as_ref()
}
/// <p>The templated target type for the Amazon SQS <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_SendMessage.html"> <code>SendMessage</code> </a> API operation. Contains the message group ID to use when the target is a FIFO queue. If you specify an Amazon SQS FIFO queue as a target, the queue must have content-based deduplication enabled. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagededuplicationid-property.html">Using the Amazon SQS message deduplication ID</a> in the <i>Amazon SQS Developer Guide</i>.</p>
pub fn sqs_parameters(&self) -> std::option::Option<&crate::model::SqsParameters> {
self.sqs_parameters.as_ref()
}
}
/// See [`Target`](crate::model::Target).
pub mod target {
/// A builder for [`Target`](crate::model::Target).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) arn: std::option::Option<std::string::String>,
pub(crate) role_arn: std::option::Option<std::string::String>,
pub(crate) dead_letter_config: std::option::Option<crate::model::DeadLetterConfig>,
pub(crate) retry_policy: std::option::Option<crate::model::RetryPolicy>,
pub(crate) input: std::option::Option<std::string::String>,
pub(crate) ecs_parameters: std::option::Option<crate::model::EcsParameters>,
pub(crate) event_bridge_parameters:
std::option::Option<crate::model::EventBridgeParameters>,
pub(crate) kinesis_parameters: std::option::Option<crate::model::KinesisParameters>,
pub(crate) sage_maker_pipeline_parameters:
std::option::Option<crate::model::SageMakerPipelineParameters>,
pub(crate) sqs_parameters: std::option::Option<crate::model::SqsParameters>,
}
impl Builder {
/// <p>The Amazon Resource Name (ARN) of the target.</p>
pub fn arn(mut self, input: impl Into<std::string::String>) -> Self {
self.arn = Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the target.</p>
pub fn set_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.arn = input;
self
}
/// <p>The Amazon Resource Name (ARN) of the IAM role that EventBridge Scheduler will use for this target when the schedule is invoked.</p>
pub fn role_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.role_arn = Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the IAM role that EventBridge Scheduler will use for this target when the schedule is invoked.</p>
pub fn set_role_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.role_arn = input;
self
}
/// <p>An object that contains information about an Amazon SQS queue that EventBridge Scheduler uses as a dead-letter queue for your schedule. If specified, EventBridge Scheduler delivers failed events that could not be successfully delivered to a target to the queue.</p>
pub fn dead_letter_config(mut self, input: crate::model::DeadLetterConfig) -> Self {
self.dead_letter_config = Some(input);
self
}
/// <p>An object that contains information about an Amazon SQS queue that EventBridge Scheduler uses as a dead-letter queue for your schedule. If specified, EventBridge Scheduler delivers failed events that could not be successfully delivered to a target to the queue.</p>
pub fn set_dead_letter_config(
mut self,
input: std::option::Option<crate::model::DeadLetterConfig>,
) -> Self {
self.dead_letter_config = input;
self
}
/// <p>A <code>RetryPolicy</code> object that includes information about the retry policy settings, including the maximum age of an event, and the maximum number of times EventBridge Scheduler will try to deliver the event to a target.</p>
pub fn retry_policy(mut self, input: crate::model::RetryPolicy) -> Self {
self.retry_policy = Some(input);
self
}
/// <p>A <code>RetryPolicy</code> object that includes information about the retry policy settings, including the maximum age of an event, and the maximum number of times EventBridge Scheduler will try to deliver the event to a target.</p>
pub fn set_retry_policy(
mut self,
input: std::option::Option<crate::model::RetryPolicy>,
) -> Self {
self.retry_policy = input;
self
}
/// <p>The text, or well-formed JSON, passed to the target. If you are configuring a templated Lambda, AWS Step Functions, or Amazon EventBridge target, the input must be a well-formed JSON. For all other target types, a JSON is not required. If you do not specify anything for this field, EventBridge Scheduler delivers a default notification to the target.</p>
pub fn input(mut self, input: impl Into<std::string::String>) -> Self {
self.input = Some(input.into());
self
}
/// <p>The text, or well-formed JSON, passed to the target. If you are configuring a templated Lambda, AWS Step Functions, or Amazon EventBridge target, the input must be a well-formed JSON. For all other target types, a JSON is not required. If you do not specify anything for this field, EventBridge Scheduler delivers a default notification to the target.</p>
pub fn set_input(mut self, input: std::option::Option<std::string::String>) -> Self {
self.input = input;
self
}
/// <p>The templated target type for the Amazon ECS <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RunTask.html"> <code>RunTask</code> </a> API operation.</p>
pub fn ecs_parameters(mut self, input: crate::model::EcsParameters) -> Self {
self.ecs_parameters = Some(input);
self
}
/// <p>The templated target type for the Amazon ECS <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RunTask.html"> <code>RunTask</code> </a> API operation.</p>
pub fn set_ecs_parameters(
mut self,
input: std::option::Option<crate::model::EcsParameters>,
) -> Self {
self.ecs_parameters = input;
self
}
/// <p>The templated target type for the EventBridge <a href="https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_PutEvents.html"> <code>PutEvents</code> </a> API operation.</p>
pub fn event_bridge_parameters(
mut self,
input: crate::model::EventBridgeParameters,
) -> Self {
self.event_bridge_parameters = Some(input);
self
}
/// <p>The templated target type for the EventBridge <a href="https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_PutEvents.html"> <code>PutEvents</code> </a> API operation.</p>
pub fn set_event_bridge_parameters(
mut self,
input: std::option::Option<crate::model::EventBridgeParameters>,
) -> Self {
self.event_bridge_parameters = input;
self
}
/// <p>The templated target type for the Amazon Kinesis <a href="kinesis/latest/APIReference/API_PutRecord.html"> <code>PutRecord</code> </a> API operation.</p>
pub fn kinesis_parameters(mut self, input: crate::model::KinesisParameters) -> Self {
self.kinesis_parameters = Some(input);
self
}
/// <p>The templated target type for the Amazon Kinesis <a href="kinesis/latest/APIReference/API_PutRecord.html"> <code>PutRecord</code> </a> API operation.</p>
pub fn set_kinesis_parameters(
mut self,
input: std::option::Option<crate::model::KinesisParameters>,
) -> Self {
self.kinesis_parameters = input;
self
}
/// <p>The templated target type for the Amazon SageMaker <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_StartPipelineExecution.html"> <code>StartPipelineExecution</code> </a> API operation.</p>
pub fn sage_maker_pipeline_parameters(
mut self,
input: crate::model::SageMakerPipelineParameters,
) -> Self {
self.sage_maker_pipeline_parameters = Some(input);
self
}
/// <p>The templated target type for the Amazon SageMaker <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_StartPipelineExecution.html"> <code>StartPipelineExecution</code> </a> API operation.</p>
pub fn set_sage_maker_pipeline_parameters(
mut self,
input: std::option::Option<crate::model::SageMakerPipelineParameters>,
) -> Self {
self.sage_maker_pipeline_parameters = input;
self
}
/// <p>The templated target type for the Amazon SQS <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_SendMessage.html"> <code>SendMessage</code> </a> API operation. Contains the message group ID to use when the target is a FIFO queue. If you specify an Amazon SQS FIFO queue as a target, the queue must have content-based deduplication enabled. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagededuplicationid-property.html">Using the Amazon SQS message deduplication ID</a> in the <i>Amazon SQS Developer Guide</i>.</p>
pub fn sqs_parameters(mut self, input: crate::model::SqsParameters) -> Self {
self.sqs_parameters = Some(input);
self
}
/// <p>The templated target type for the Amazon SQS <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_SendMessage.html"> <code>SendMessage</code> </a> API operation. Contains the message group ID to use when the target is a FIFO queue. If you specify an Amazon SQS FIFO queue as a target, the queue must have content-based deduplication enabled. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagededuplicationid-property.html">Using the Amazon SQS message deduplication ID</a> in the <i>Amazon SQS Developer Guide</i>.</p>
pub fn set_sqs_parameters(
mut self,
input: std::option::Option<crate::model::SqsParameters>,
) -> Self {
self.sqs_parameters = input;
self
}
/// Consumes the builder and constructs a [`Target`](crate::model::Target).
pub fn build(self) -> crate::model::Target {
crate::model::Target {
arn: self.arn,
role_arn: self.role_arn,
dead_letter_config: self.dead_letter_config,
retry_policy: self.retry_policy,
input: self.input,
ecs_parameters: self.ecs_parameters,
event_bridge_parameters: self.event_bridge_parameters,
kinesis_parameters: self.kinesis_parameters,
sage_maker_pipeline_parameters: self.sage_maker_pipeline_parameters,
sqs_parameters: self.sqs_parameters,
}
}
}
}
impl Target {
/// Creates a new builder-style object to manufacture [`Target`](crate::model::Target).
pub fn builder() -> crate::model::target::Builder {
crate::model::target::Builder::default()
}
}
/// <p>The templated target type for the Amazon SQS <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_SendMessage.html"> <code>SendMessage</code> </a> API operation. Contains the message group ID to use when the target is a FIFO queue. If you specify an Amazon SQS FIFO queue as a target, the queue must have content-based deduplication enabled. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagededuplicationid-property.html">Using the Amazon SQS message deduplication ID</a> in the <i>Amazon SQS Developer Guide</i>. </p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct SqsParameters {
/// <p>The FIFO message group ID to use as the target.</p>
#[doc(hidden)]
pub message_group_id: std::option::Option<std::string::String>,
}
impl SqsParameters {
/// <p>The FIFO message group ID to use as the target.</p>
pub fn message_group_id(&self) -> std::option::Option<&str> {
self.message_group_id.as_deref()
}
}
/// See [`SqsParameters`](crate::model::SqsParameters).
pub mod sqs_parameters {
/// A builder for [`SqsParameters`](crate::model::SqsParameters).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) message_group_id: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The FIFO message group ID to use as the target.</p>
pub fn message_group_id(mut self, input: impl Into<std::string::String>) -> Self {
self.message_group_id = Some(input.into());
self
}
/// <p>The FIFO message group ID to use as the target.</p>
pub fn set_message_group_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.message_group_id = input;
self
}
/// Consumes the builder and constructs a [`SqsParameters`](crate::model::SqsParameters).
pub fn build(self) -> crate::model::SqsParameters {
crate::model::SqsParameters {
message_group_id: self.message_group_id,
}
}
}
}
impl SqsParameters {
/// Creates a new builder-style object to manufacture [`SqsParameters`](crate::model::SqsParameters).
pub fn builder() -> crate::model::sqs_parameters::Builder {
crate::model::sqs_parameters::Builder::default()
}
}
/// <p>The templated target type for the Amazon SageMaker <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_StartPipelineExecution.html"> <code>StartPipelineExecution</code> </a> API operation.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct SageMakerPipelineParameters {
/// <p>List of parameter names and values to use when executing the SageMaker Model Building Pipeline.</p>
#[doc(hidden)]
pub pipeline_parameter_list:
std::option::Option<std::vec::Vec<crate::model::SageMakerPipelineParameter>>,
}
impl SageMakerPipelineParameters {
/// <p>List of parameter names and values to use when executing the SageMaker Model Building Pipeline.</p>
pub fn pipeline_parameter_list(
&self,
) -> std::option::Option<&[crate::model::SageMakerPipelineParameter]> {
self.pipeline_parameter_list.as_deref()
}
}
/// See [`SageMakerPipelineParameters`](crate::model::SageMakerPipelineParameters).
pub mod sage_maker_pipeline_parameters {
/// A builder for [`SageMakerPipelineParameters`](crate::model::SageMakerPipelineParameters).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) pipeline_parameter_list:
std::option::Option<std::vec::Vec<crate::model::SageMakerPipelineParameter>>,
}
impl Builder {
/// Appends an item to `pipeline_parameter_list`.
///
/// To override the contents of this collection use [`set_pipeline_parameter_list`](Self::set_pipeline_parameter_list).
///
/// <p>List of parameter names and values to use when executing the SageMaker Model Building Pipeline.</p>
pub fn pipeline_parameter_list(
mut self,
input: crate::model::SageMakerPipelineParameter,
) -> Self {
let mut v = self.pipeline_parameter_list.unwrap_or_default();
v.push(input);
self.pipeline_parameter_list = Some(v);
self
}
/// <p>List of parameter names and values to use when executing the SageMaker Model Building Pipeline.</p>
pub fn set_pipeline_parameter_list(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::SageMakerPipelineParameter>>,
) -> Self {
self.pipeline_parameter_list = input;
self
}
/// Consumes the builder and constructs a [`SageMakerPipelineParameters`](crate::model::SageMakerPipelineParameters).
pub fn build(self) -> crate::model::SageMakerPipelineParameters {
crate::model::SageMakerPipelineParameters {
pipeline_parameter_list: self.pipeline_parameter_list,
}
}
}
}
impl SageMakerPipelineParameters {
/// Creates a new builder-style object to manufacture [`SageMakerPipelineParameters`](crate::model::SageMakerPipelineParameters).
pub fn builder() -> crate::model::sage_maker_pipeline_parameters::Builder {
crate::model::sage_maker_pipeline_parameters::Builder::default()
}
}
/// <p>The name and value pair of a parameter to use to start execution of a SageMaker Model Building Pipeline.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct SageMakerPipelineParameter {
/// <p>Name of parameter to start execution of a SageMaker Model Building Pipeline.</p>
#[doc(hidden)]
pub name: std::option::Option<std::string::String>,
/// <p>Value of parameter to start execution of a SageMaker Model Building Pipeline.</p>
#[doc(hidden)]
pub value: std::option::Option<std::string::String>,
}
impl SageMakerPipelineParameter {
/// <p>Name of parameter to start execution of a SageMaker Model Building Pipeline.</p>
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
/// <p>Value of parameter to start execution of a SageMaker Model Building Pipeline.</p>
pub fn value(&self) -> std::option::Option<&str> {
self.value.as_deref()
}
}
/// See [`SageMakerPipelineParameter`](crate::model::SageMakerPipelineParameter).
pub mod sage_maker_pipeline_parameter {
/// A builder for [`SageMakerPipelineParameter`](crate::model::SageMakerPipelineParameter).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) value: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>Name of parameter to start execution of a SageMaker Model Building Pipeline.</p>
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
/// <p>Name of parameter to start execution of a SageMaker Model Building Pipeline.</p>
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
/// <p>Value of parameter to start execution of a SageMaker Model Building Pipeline.</p>
pub fn value(mut self, input: impl Into<std::string::String>) -> Self {
self.value = Some(input.into());
self
}
/// <p>Value of parameter to start execution of a SageMaker Model Building Pipeline.</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 [`SageMakerPipelineParameter`](crate::model::SageMakerPipelineParameter).
pub fn build(self) -> crate::model::SageMakerPipelineParameter {
crate::model::SageMakerPipelineParameter {
name: self.name,
value: self.value,
}
}
}
}
impl SageMakerPipelineParameter {
/// Creates a new builder-style object to manufacture [`SageMakerPipelineParameter`](crate::model::SageMakerPipelineParameter).
pub fn builder() -> crate::model::sage_maker_pipeline_parameter::Builder {
crate::model::sage_maker_pipeline_parameter::Builder::default()
}
}
/// <p>The templated target type for the Amazon Kinesis <a href="kinesis/latest/APIReference/API_PutRecord.html"> <code>PutRecord</code> </a> API operation.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct KinesisParameters {
/// <p>Specifies the shard to which EventBridge Scheduler sends the event. For more information, see <a href="https://docs.aws.amazon.com/streams/latest/dev/key-concepts.html">Amazon Kinesis Data Streams terminology and concepts</a> in the <i>Amazon Kinesis Streams Developer Guide</i>.</p>
#[doc(hidden)]
pub partition_key: std::option::Option<std::string::String>,
}
impl KinesisParameters {
/// <p>Specifies the shard to which EventBridge Scheduler sends the event. For more information, see <a href="https://docs.aws.amazon.com/streams/latest/dev/key-concepts.html">Amazon Kinesis Data Streams terminology and concepts</a> in the <i>Amazon Kinesis Streams Developer Guide</i>.</p>
pub fn partition_key(&self) -> std::option::Option<&str> {
self.partition_key.as_deref()
}
}
/// See [`KinesisParameters`](crate::model::KinesisParameters).
pub mod kinesis_parameters {
/// A builder for [`KinesisParameters`](crate::model::KinesisParameters).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) partition_key: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>Specifies the shard to which EventBridge Scheduler sends the event. For more information, see <a href="https://docs.aws.amazon.com/streams/latest/dev/key-concepts.html">Amazon Kinesis Data Streams terminology and concepts</a> in the <i>Amazon Kinesis Streams Developer Guide</i>.</p>
pub fn partition_key(mut self, input: impl Into<std::string::String>) -> Self {
self.partition_key = Some(input.into());
self
}
/// <p>Specifies the shard to which EventBridge Scheduler sends the event. For more information, see <a href="https://docs.aws.amazon.com/streams/latest/dev/key-concepts.html">Amazon Kinesis Data Streams terminology and concepts</a> in the <i>Amazon Kinesis Streams Developer Guide</i>.</p>
pub fn set_partition_key(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.partition_key = input;
self
}
/// Consumes the builder and constructs a [`KinesisParameters`](crate::model::KinesisParameters).
pub fn build(self) -> crate::model::KinesisParameters {
crate::model::KinesisParameters {
partition_key: self.partition_key,
}
}
}
}
impl KinesisParameters {
/// Creates a new builder-style object to manufacture [`KinesisParameters`](crate::model::KinesisParameters).
pub fn builder() -> crate::model::kinesis_parameters::Builder {
crate::model::kinesis_parameters::Builder::default()
}
}
/// <p>The templated target type for the EventBridge <a href="https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_PutEvents.html"> <code>PutEvents</code> </a> API operation.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct EventBridgeParameters {
/// <p>A free-form string, with a maximum of 128 characters, used to decide what fields to expect in the event detail.</p>
#[doc(hidden)]
pub detail_type: std::option::Option<std::string::String>,
/// <p>The source of the event.</p>
#[doc(hidden)]
pub source: std::option::Option<std::string::String>,
}
impl EventBridgeParameters {
/// <p>A free-form string, with a maximum of 128 characters, used to decide what fields to expect in the event detail.</p>
pub fn detail_type(&self) -> std::option::Option<&str> {
self.detail_type.as_deref()
}
/// <p>The source of the event.</p>
pub fn source(&self) -> std::option::Option<&str> {
self.source.as_deref()
}
}
/// See [`EventBridgeParameters`](crate::model::EventBridgeParameters).
pub mod event_bridge_parameters {
/// A builder for [`EventBridgeParameters`](crate::model::EventBridgeParameters).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) detail_type: std::option::Option<std::string::String>,
pub(crate) source: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>A free-form string, with a maximum of 128 characters, used to decide what fields to expect in the event detail.</p>
pub fn detail_type(mut self, input: impl Into<std::string::String>) -> Self {
self.detail_type = Some(input.into());
self
}
/// <p>A free-form string, with a maximum of 128 characters, used to decide what fields to expect in the event detail.</p>
pub fn set_detail_type(mut self, input: std::option::Option<std::string::String>) -> Self {
self.detail_type = input;
self
}
/// <p>The source of the event.</p>
pub fn source(mut self, input: impl Into<std::string::String>) -> Self {
self.source = Some(input.into());
self
}
/// <p>The source of the event.</p>
pub fn set_source(mut self, input: std::option::Option<std::string::String>) -> Self {
self.source = input;
self
}
/// Consumes the builder and constructs a [`EventBridgeParameters`](crate::model::EventBridgeParameters).
pub fn build(self) -> crate::model::EventBridgeParameters {
crate::model::EventBridgeParameters {
detail_type: self.detail_type,
source: self.source,
}
}
}
}
impl EventBridgeParameters {
/// Creates a new builder-style object to manufacture [`EventBridgeParameters`](crate::model::EventBridgeParameters).
pub fn builder() -> crate::model::event_bridge_parameters::Builder {
crate::model::event_bridge_parameters::Builder::default()
}
}
/// <p>The templated target type for the Amazon ECS <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RunTask.html"> <code>RunTask</code> </a> API operation.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct EcsParameters {
/// <p>The Amazon Resource Name (ARN) of the task definition to use if the event target is an Amazon ECS task.</p>
#[doc(hidden)]
pub task_definition_arn: std::option::Option<std::string::String>,
/// <p>The number of tasks to create based on <code>TaskDefinition</code>. The default is <code>1</code>.</p>
#[doc(hidden)]
pub task_count: std::option::Option<i32>,
/// <p>Specifies the launch type on which your task is running. The launch type that you specify here must match one of the launch type (compatibilities) of the target task. The <code>FARGATE</code> value is supported only in the Regions where Fargate with Amazon ECS is supported. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS_Fargate.html">AWS Fargate on Amazon ECS</a> in the <i>Amazon ECS Developer Guide</i>.</p>
#[doc(hidden)]
pub launch_type: std::option::Option<crate::model::LaunchType>,
/// <p>This structure specifies the network configuration for an ECS task.</p>
#[doc(hidden)]
pub network_configuration: std::option::Option<crate::model::NetworkConfiguration>,
/// <p>Specifies the platform version for the task. Specify only the numeric portion of the platform version, such as <code>1.1.0</code>.</p>
#[doc(hidden)]
pub platform_version: std::option::Option<std::string::String>,
/// <p>Specifies an ECS task group for the task. The maximum length is 255 characters.</p>
#[doc(hidden)]
pub group: std::option::Option<std::string::String>,
/// <p>The capacity provider strategy to use for the task.</p>
#[doc(hidden)]
pub capacity_provider_strategy:
std::option::Option<std::vec::Vec<crate::model::CapacityProviderStrategyItem>>,
/// <p>Specifies whether to enable Amazon ECS managed tags for the task. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html">Tagging Your Amazon ECS Resources</a> in the <i>Amazon ECS Developer Guide</i>.</p>
#[doc(hidden)]
pub enable_ecs_managed_tags: std::option::Option<bool>,
/// <p>Whether or not to enable the execute command functionality for the containers in this task. If true, this enables execute command functionality on all containers in the task.</p>
#[doc(hidden)]
pub enable_execute_command: std::option::Option<bool>,
/// <p>An array of placement constraint objects to use for the task. You can specify up to 10 constraints per task (including constraints in the task definition and those specified at runtime).</p>
#[doc(hidden)]
pub placement_constraints:
std::option::Option<std::vec::Vec<crate::model::PlacementConstraint>>,
/// <p>The task placement strategy for a task or service.</p>
#[doc(hidden)]
pub placement_strategy: std::option::Option<std::vec::Vec<crate::model::PlacementStrategy>>,
/// <p>Specifies whether to propagate the tags from the task definition to the task. If no value is specified, the tags are not propagated. Tags can only be propagated to the task during task creation. To add tags to a task after task creation, use Amazon ECS's <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_TagResource.html"> <code>TagResource</code> </a> API action. </p>
#[doc(hidden)]
pub propagate_tags: std::option::Option<crate::model::PropagateTags>,
/// <p>The reference ID to use for the task.</p>
#[doc(hidden)]
pub reference_id: std::option::Option<std::string::String>,
/// <p>The metadata that you apply to the task to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RunTask.html"> <code>RunTask</code> </a> in the <i>Amazon ECS API Reference</i>.</p>
#[doc(hidden)]
pub tags: std::option::Option<
std::vec::Vec<std::collections::HashMap<std::string::String, std::string::String>>,
>,
}
impl EcsParameters {
/// <p>The Amazon Resource Name (ARN) of the task definition to use if the event target is an Amazon ECS task.</p>
pub fn task_definition_arn(&self) -> std::option::Option<&str> {
self.task_definition_arn.as_deref()
}
/// <p>The number of tasks to create based on <code>TaskDefinition</code>. The default is <code>1</code>.</p>
pub fn task_count(&self) -> std::option::Option<i32> {
self.task_count
}
/// <p>Specifies the launch type on which your task is running. The launch type that you specify here must match one of the launch type (compatibilities) of the target task. The <code>FARGATE</code> value is supported only in the Regions where Fargate with Amazon ECS is supported. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS_Fargate.html">AWS Fargate on Amazon ECS</a> in the <i>Amazon ECS Developer Guide</i>.</p>
pub fn launch_type(&self) -> std::option::Option<&crate::model::LaunchType> {
self.launch_type.as_ref()
}
/// <p>This structure specifies the network configuration for an ECS task.</p>
pub fn network_configuration(
&self,
) -> std::option::Option<&crate::model::NetworkConfiguration> {
self.network_configuration.as_ref()
}
/// <p>Specifies the platform version for the task. Specify only the numeric portion of the platform version, such as <code>1.1.0</code>.</p>
pub fn platform_version(&self) -> std::option::Option<&str> {
self.platform_version.as_deref()
}
/// <p>Specifies an ECS task group for the task. The maximum length is 255 characters.</p>
pub fn group(&self) -> std::option::Option<&str> {
self.group.as_deref()
}
/// <p>The capacity provider strategy to use for the task.</p>
pub fn capacity_provider_strategy(
&self,
) -> std::option::Option<&[crate::model::CapacityProviderStrategyItem]> {
self.capacity_provider_strategy.as_deref()
}
/// <p>Specifies whether to enable Amazon ECS managed tags for the task. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html">Tagging Your Amazon ECS Resources</a> in the <i>Amazon ECS Developer Guide</i>.</p>
pub fn enable_ecs_managed_tags(&self) -> std::option::Option<bool> {
self.enable_ecs_managed_tags
}
/// <p>Whether or not to enable the execute command functionality for the containers in this task. If true, this enables execute command functionality on all containers in the task.</p>
pub fn enable_execute_command(&self) -> std::option::Option<bool> {
self.enable_execute_command
}
/// <p>An array of placement constraint objects to use for the task. You can specify up to 10 constraints per task (including constraints in the task definition and those specified at runtime).</p>
pub fn placement_constraints(
&self,
) -> std::option::Option<&[crate::model::PlacementConstraint]> {
self.placement_constraints.as_deref()
}
/// <p>The task placement strategy for a task or service.</p>
pub fn placement_strategy(&self) -> std::option::Option<&[crate::model::PlacementStrategy]> {
self.placement_strategy.as_deref()
}
/// <p>Specifies whether to propagate the tags from the task definition to the task. If no value is specified, the tags are not propagated. Tags can only be propagated to the task during task creation. To add tags to a task after task creation, use Amazon ECS's <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_TagResource.html"> <code>TagResource</code> </a> API action. </p>
pub fn propagate_tags(&self) -> std::option::Option<&crate::model::PropagateTags> {
self.propagate_tags.as_ref()
}
/// <p>The reference ID to use for the task.</p>
pub fn reference_id(&self) -> std::option::Option<&str> {
self.reference_id.as_deref()
}
/// <p>The metadata that you apply to the task to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RunTask.html"> <code>RunTask</code> </a> in the <i>Amazon ECS API Reference</i>.</p>
pub fn tags(
&self,
) -> std::option::Option<&[std::collections::HashMap<std::string::String, std::string::String>]>
{
self.tags.as_deref()
}
}
/// See [`EcsParameters`](crate::model::EcsParameters).
pub mod ecs_parameters {
/// A builder for [`EcsParameters`](crate::model::EcsParameters).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) task_definition_arn: std::option::Option<std::string::String>,
pub(crate) task_count: std::option::Option<i32>,
pub(crate) launch_type: std::option::Option<crate::model::LaunchType>,
pub(crate) network_configuration: std::option::Option<crate::model::NetworkConfiguration>,
pub(crate) platform_version: std::option::Option<std::string::String>,
pub(crate) group: std::option::Option<std::string::String>,
pub(crate) capacity_provider_strategy:
std::option::Option<std::vec::Vec<crate::model::CapacityProviderStrategyItem>>,
pub(crate) enable_ecs_managed_tags: std::option::Option<bool>,
pub(crate) enable_execute_command: std::option::Option<bool>,
pub(crate) placement_constraints:
std::option::Option<std::vec::Vec<crate::model::PlacementConstraint>>,
pub(crate) placement_strategy:
std::option::Option<std::vec::Vec<crate::model::PlacementStrategy>>,
pub(crate) propagate_tags: std::option::Option<crate::model::PropagateTags>,
pub(crate) reference_id: std::option::Option<std::string::String>,
pub(crate) tags: std::option::Option<
std::vec::Vec<std::collections::HashMap<std::string::String, std::string::String>>,
>,
}
impl Builder {
/// <p>The Amazon Resource Name (ARN) of the task definition to use if the event target is an Amazon ECS task.</p>
pub fn task_definition_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.task_definition_arn = Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the task definition to use if the event target is an Amazon ECS task.</p>
pub fn set_task_definition_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.task_definition_arn = input;
self
}
/// <p>The number of tasks to create based on <code>TaskDefinition</code>. The default is <code>1</code>.</p>
pub fn task_count(mut self, input: i32) -> Self {
self.task_count = Some(input);
self
}
/// <p>The number of tasks to create based on <code>TaskDefinition</code>. The default is <code>1</code>.</p>
pub fn set_task_count(mut self, input: std::option::Option<i32>) -> Self {
self.task_count = input;
self
}
/// <p>Specifies the launch type on which your task is running. The launch type that you specify here must match one of the launch type (compatibilities) of the target task. The <code>FARGATE</code> value is supported only in the Regions where Fargate with Amazon ECS is supported. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS_Fargate.html">AWS Fargate on Amazon ECS</a> in the <i>Amazon ECS Developer Guide</i>.</p>
pub fn launch_type(mut self, input: crate::model::LaunchType) -> Self {
self.launch_type = Some(input);
self
}
/// <p>Specifies the launch type on which your task is running. The launch type that you specify here must match one of the launch type (compatibilities) of the target task. The <code>FARGATE</code> value is supported only in the Regions where Fargate with Amazon ECS is supported. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS_Fargate.html">AWS Fargate on Amazon ECS</a> in the <i>Amazon ECS Developer Guide</i>.</p>
pub fn set_launch_type(
mut self,
input: std::option::Option<crate::model::LaunchType>,
) -> Self {
self.launch_type = input;
self
}
/// <p>This structure specifies the network configuration for an ECS task.</p>
pub fn network_configuration(mut self, input: crate::model::NetworkConfiguration) -> Self {
self.network_configuration = Some(input);
self
}
/// <p>This structure specifies the network configuration for an ECS task.</p>
pub fn set_network_configuration(
mut self,
input: std::option::Option<crate::model::NetworkConfiguration>,
) -> Self {
self.network_configuration = input;
self
}
/// <p>Specifies the platform version for the task. Specify only the numeric portion of the platform version, such as <code>1.1.0</code>.</p>
pub fn platform_version(mut self, input: impl Into<std::string::String>) -> Self {
self.platform_version = Some(input.into());
self
}
/// <p>Specifies the platform version for the task. Specify only the numeric portion of the platform version, such as <code>1.1.0</code>.</p>
pub fn set_platform_version(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.platform_version = input;
self
}
/// <p>Specifies an ECS task group for the task. The maximum length is 255 characters.</p>
pub fn group(mut self, input: impl Into<std::string::String>) -> Self {
self.group = Some(input.into());
self
}
/// <p>Specifies an ECS task group for the task. The maximum length is 255 characters.</p>
pub fn set_group(mut self, input: std::option::Option<std::string::String>) -> Self {
self.group = input;
self
}
/// Appends an item to `capacity_provider_strategy`.
///
/// To override the contents of this collection use [`set_capacity_provider_strategy`](Self::set_capacity_provider_strategy).
///
/// <p>The capacity provider strategy to use for the task.</p>
pub fn capacity_provider_strategy(
mut self,
input: crate::model::CapacityProviderStrategyItem,
) -> Self {
let mut v = self.capacity_provider_strategy.unwrap_or_default();
v.push(input);
self.capacity_provider_strategy = Some(v);
self
}
/// <p>The capacity provider strategy to use for the task.</p>
pub fn set_capacity_provider_strategy(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::CapacityProviderStrategyItem>>,
) -> Self {
self.capacity_provider_strategy = input;
self
}
/// <p>Specifies whether to enable Amazon ECS managed tags for the task. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html">Tagging Your Amazon ECS Resources</a> in the <i>Amazon ECS Developer Guide</i>.</p>
pub fn enable_ecs_managed_tags(mut self, input: bool) -> Self {
self.enable_ecs_managed_tags = Some(input);
self
}
/// <p>Specifies whether to enable Amazon ECS managed tags for the task. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html">Tagging Your Amazon ECS Resources</a> in the <i>Amazon ECS Developer Guide</i>.</p>
pub fn set_enable_ecs_managed_tags(mut self, input: std::option::Option<bool>) -> Self {
self.enable_ecs_managed_tags = input;
self
}
/// <p>Whether or not to enable the execute command functionality for the containers in this task. If true, this enables execute command functionality on all containers in the task.</p>
pub fn enable_execute_command(mut self, input: bool) -> Self {
self.enable_execute_command = Some(input);
self
}
/// <p>Whether or not to enable the execute command functionality for the containers in this task. If true, this enables execute command functionality on all containers in the task.</p>
pub fn set_enable_execute_command(mut self, input: std::option::Option<bool>) -> Self {
self.enable_execute_command = input;
self
}
/// Appends an item to `placement_constraints`.
///
/// To override the contents of this collection use [`set_placement_constraints`](Self::set_placement_constraints).
///
/// <p>An array of placement constraint objects to use for the task. You can specify up to 10 constraints per task (including constraints in the task definition and those specified at runtime).</p>
pub fn placement_constraints(mut self, input: crate::model::PlacementConstraint) -> Self {
let mut v = self.placement_constraints.unwrap_or_default();
v.push(input);
self.placement_constraints = Some(v);
self
}
/// <p>An array of placement constraint objects to use for the task. You can specify up to 10 constraints per task (including constraints in the task definition and those specified at runtime).</p>
pub fn set_placement_constraints(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::PlacementConstraint>>,
) -> Self {
self.placement_constraints = input;
self
}
/// Appends an item to `placement_strategy`.
///
/// To override the contents of this collection use [`set_placement_strategy`](Self::set_placement_strategy).
///
/// <p>The task placement strategy for a task or service.</p>
pub fn placement_strategy(mut self, input: crate::model::PlacementStrategy) -> Self {
let mut v = self.placement_strategy.unwrap_or_default();
v.push(input);
self.placement_strategy = Some(v);
self
}
/// <p>The task placement strategy for a task or service.</p>
pub fn set_placement_strategy(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::PlacementStrategy>>,
) -> Self {
self.placement_strategy = input;
self
}
/// <p>Specifies whether to propagate the tags from the task definition to the task. If no value is specified, the tags are not propagated. Tags can only be propagated to the task during task creation. To add tags to a task after task creation, use Amazon ECS's <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_TagResource.html"> <code>TagResource</code> </a> API action. </p>
pub fn propagate_tags(mut self, input: crate::model::PropagateTags) -> Self {
self.propagate_tags = Some(input);
self
}
/// <p>Specifies whether to propagate the tags from the task definition to the task. If no value is specified, the tags are not propagated. Tags can only be propagated to the task during task creation. To add tags to a task after task creation, use Amazon ECS's <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_TagResource.html"> <code>TagResource</code> </a> API action. </p>
pub fn set_propagate_tags(
mut self,
input: std::option::Option<crate::model::PropagateTags>,
) -> Self {
self.propagate_tags = input;
self
}
/// <p>The reference ID to use for the task.</p>
pub fn reference_id(mut self, input: impl Into<std::string::String>) -> Self {
self.reference_id = Some(input.into());
self
}
/// <p>The reference ID to use for the task.</p>
pub fn set_reference_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.reference_id = input;
self
}
/// Appends an item to `tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <p>The metadata that you apply to the task to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RunTask.html"> <code>RunTask</code> </a> in the <i>Amazon ECS API Reference</i>.</p>
pub fn tags(
mut self,
input: std::collections::HashMap<std::string::String, std::string::String>,
) -> Self {
let mut v = self.tags.unwrap_or_default();
v.push(input);
self.tags = Some(v);
self
}
/// <p>The metadata that you apply to the task to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RunTask.html"> <code>RunTask</code> </a> in the <i>Amazon ECS API Reference</i>.</p>
pub fn set_tags(
mut self,
input: std::option::Option<
std::vec::Vec<std::collections::HashMap<std::string::String, std::string::String>>,
>,
) -> Self {
self.tags = input;
self
}
/// Consumes the builder and constructs a [`EcsParameters`](crate::model::EcsParameters).
pub fn build(self) -> crate::model::EcsParameters {
crate::model::EcsParameters {
task_definition_arn: self.task_definition_arn,
task_count: self.task_count,
launch_type: self.launch_type,
network_configuration: self.network_configuration,
platform_version: self.platform_version,
group: self.group,
capacity_provider_strategy: self.capacity_provider_strategy,
enable_ecs_managed_tags: self.enable_ecs_managed_tags,
enable_execute_command: self.enable_execute_command,
placement_constraints: self.placement_constraints,
placement_strategy: self.placement_strategy,
propagate_tags: self.propagate_tags,
reference_id: self.reference_id,
tags: self.tags,
}
}
}
}
impl EcsParameters {
/// Creates a new builder-style object to manufacture [`EcsParameters`](crate::model::EcsParameters).
pub fn builder() -> crate::model::ecs_parameters::Builder {
crate::model::ecs_parameters::Builder::default()
}
}
/// When writing a match expression against `PropagateTags`, it is important to ensure
/// your code is forward-compatible. That is, if a match arm handles a case for a
/// feature that is supported by the service but has not been represented as an enum
/// variant in a current version of SDK, your code should continue to work when you
/// upgrade SDK to a future version in which the enum does include a variant for that
/// feature.
///
/// Here is an example of how you can make a match expression forward-compatible:
///
/// ```text
/// # let propagatetags = unimplemented!();
/// match propagatetags {
/// PropagateTags::TaskDefinition => { /* ... */ },
/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
/// _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `propagatetags` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `PropagateTags::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `PropagateTags::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
/// and calling `as_str` on it yields `"NewFeature"`.
/// This match expression is forward-compatible when executed with a newer
/// version of SDK where the variant `PropagateTags::NewFeature` is defined.
/// Specifically, when `propagatetags` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `PropagateTags::NewFeature` also yielding `"NewFeature"`.
///
/// Explicitly matching on the `Unknown` variant should
/// be avoided for two reasons:
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
/// - It might inadvertently shadow other intended match arms.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum PropagateTags {
#[allow(missing_docs)] // documentation missing in model
TaskDefinition,
/// `Unknown` contains new variants that have been added since this code was generated.
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for PropagateTags {
fn from(s: &str) -> Self {
match s {
"TASK_DEFINITION" => PropagateTags::TaskDefinition,
other => PropagateTags::Unknown(crate::types::UnknownVariantValue(other.to_owned())),
}
}
}
impl std::str::FromStr for PropagateTags {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(PropagateTags::from(s))
}
}
impl PropagateTags {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
PropagateTags::TaskDefinition => "TASK_DEFINITION",
PropagateTags::Unknown(value) => value.as_str(),
}
}
/// Returns all the `&str` values of the enum members.
pub const fn values() -> &'static [&'static str] {
&["TASK_DEFINITION"]
}
}
impl AsRef<str> for PropagateTags {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>The task placement strategy for a task or service.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct PlacementStrategy {
/// <p>The type of placement strategy. The random placement strategy randomly places tasks on available candidates. The spread placement strategy spreads placement across available candidates evenly based on the field parameter. The binpack strategy places tasks on available candidates that have the least available amount of the resource that is specified with the field parameter. For example, if you binpack on memory, a task is placed on the instance with the least amount of remaining memory (but still enough to run the task).</p>
#[doc(hidden)]
pub r#type: std::option::Option<crate::model::PlacementStrategyType>,
/// <p>The field to apply the placement strategy against. For the spread placement strategy, valid values are <code>instanceId</code> (or <code>instanceId</code>, which has the same effect), or any platform or custom attribute that is applied to a container instance, such as <code>attribute:ecs.availability-zone</code>. For the binpack placement strategy, valid values are <code>cpu</code> and <code>memory</code>. For the random placement strategy, this field is not used.</p>
#[doc(hidden)]
pub field: std::option::Option<std::string::String>,
}
impl PlacementStrategy {
/// <p>The type of placement strategy. The random placement strategy randomly places tasks on available candidates. The spread placement strategy spreads placement across available candidates evenly based on the field parameter. The binpack strategy places tasks on available candidates that have the least available amount of the resource that is specified with the field parameter. For example, if you binpack on memory, a task is placed on the instance with the least amount of remaining memory (but still enough to run the task).</p>
pub fn r#type(&self) -> std::option::Option<&crate::model::PlacementStrategyType> {
self.r#type.as_ref()
}
/// <p>The field to apply the placement strategy against. For the spread placement strategy, valid values are <code>instanceId</code> (or <code>instanceId</code>, which has the same effect), or any platform or custom attribute that is applied to a container instance, such as <code>attribute:ecs.availability-zone</code>. For the binpack placement strategy, valid values are <code>cpu</code> and <code>memory</code>. For the random placement strategy, this field is not used.</p>
pub fn field(&self) -> std::option::Option<&str> {
self.field.as_deref()
}
}
/// See [`PlacementStrategy`](crate::model::PlacementStrategy).
pub mod placement_strategy {
/// A builder for [`PlacementStrategy`](crate::model::PlacementStrategy).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) r#type: std::option::Option<crate::model::PlacementStrategyType>,
pub(crate) field: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The type of placement strategy. The random placement strategy randomly places tasks on available candidates. The spread placement strategy spreads placement across available candidates evenly based on the field parameter. The binpack strategy places tasks on available candidates that have the least available amount of the resource that is specified with the field parameter. For example, if you binpack on memory, a task is placed on the instance with the least amount of remaining memory (but still enough to run the task).</p>
pub fn r#type(mut self, input: crate::model::PlacementStrategyType) -> Self {
self.r#type = Some(input);
self
}
/// <p>The type of placement strategy. The random placement strategy randomly places tasks on available candidates. The spread placement strategy spreads placement across available candidates evenly based on the field parameter. The binpack strategy places tasks on available candidates that have the least available amount of the resource that is specified with the field parameter. For example, if you binpack on memory, a task is placed on the instance with the least amount of remaining memory (but still enough to run the task).</p>
pub fn set_type(
mut self,
input: std::option::Option<crate::model::PlacementStrategyType>,
) -> Self {
self.r#type = input;
self
}
/// <p>The field to apply the placement strategy against. For the spread placement strategy, valid values are <code>instanceId</code> (or <code>instanceId</code>, which has the same effect), or any platform or custom attribute that is applied to a container instance, such as <code>attribute:ecs.availability-zone</code>. For the binpack placement strategy, valid values are <code>cpu</code> and <code>memory</code>. For the random placement strategy, this field is not used.</p>
pub fn field(mut self, input: impl Into<std::string::String>) -> Self {
self.field = Some(input.into());
self
}
/// <p>The field to apply the placement strategy against. For the spread placement strategy, valid values are <code>instanceId</code> (or <code>instanceId</code>, which has the same effect), or any platform or custom attribute that is applied to a container instance, such as <code>attribute:ecs.availability-zone</code>. For the binpack placement strategy, valid values are <code>cpu</code> and <code>memory</code>. For the random placement strategy, this field is not used.</p>
pub fn set_field(mut self, input: std::option::Option<std::string::String>) -> Self {
self.field = input;
self
}
/// Consumes the builder and constructs a [`PlacementStrategy`](crate::model::PlacementStrategy).
pub fn build(self) -> crate::model::PlacementStrategy {
crate::model::PlacementStrategy {
r#type: self.r#type,
field: self.field,
}
}
}
}
impl PlacementStrategy {
/// Creates a new builder-style object to manufacture [`PlacementStrategy`](crate::model::PlacementStrategy).
pub fn builder() -> crate::model::placement_strategy::Builder {
crate::model::placement_strategy::Builder::default()
}
}
/// When writing a match expression against `PlacementStrategyType`, it is important to ensure
/// your code is forward-compatible. That is, if a match arm handles a case for a
/// feature that is supported by the service but has not been represented as an enum
/// variant in a current version of SDK, your code should continue to work when you
/// upgrade SDK to a future version in which the enum does include a variant for that
/// feature.
///
/// Here is an example of how you can make a match expression forward-compatible:
///
/// ```text
/// # let placementstrategytype = unimplemented!();
/// match placementstrategytype {
/// PlacementStrategyType::Binpack => { /* ... */ },
/// PlacementStrategyType::Random => { /* ... */ },
/// PlacementStrategyType::Spread => { /* ... */ },
/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
/// _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `placementstrategytype` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `PlacementStrategyType::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `PlacementStrategyType::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
/// and calling `as_str` on it yields `"NewFeature"`.
/// This match expression is forward-compatible when executed with a newer
/// version of SDK where the variant `PlacementStrategyType::NewFeature` is defined.
/// Specifically, when `placementstrategytype` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `PlacementStrategyType::NewFeature` also yielding `"NewFeature"`.
///
/// Explicitly matching on the `Unknown` variant should
/// be avoided for two reasons:
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
/// - It might inadvertently shadow other intended match arms.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum PlacementStrategyType {
#[allow(missing_docs)] // documentation missing in model
Binpack,
#[allow(missing_docs)] // documentation missing in model
Random,
#[allow(missing_docs)] // documentation missing in model
Spread,
/// `Unknown` contains new variants that have been added since this code was generated.
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for PlacementStrategyType {
fn from(s: &str) -> Self {
match s {
"binpack" => PlacementStrategyType::Binpack,
"random" => PlacementStrategyType::Random,
"spread" => PlacementStrategyType::Spread,
other => {
PlacementStrategyType::Unknown(crate::types::UnknownVariantValue(other.to_owned()))
}
}
}
}
impl std::str::FromStr for PlacementStrategyType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(PlacementStrategyType::from(s))
}
}
impl PlacementStrategyType {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
PlacementStrategyType::Binpack => "binpack",
PlacementStrategyType::Random => "random",
PlacementStrategyType::Spread => "spread",
PlacementStrategyType::Unknown(value) => value.as_str(),
}
}
/// Returns all the `&str` values of the enum members.
pub const fn values() -> &'static [&'static str] {
&["binpack", "random", "spread"]
}
}
impl AsRef<str> for PlacementStrategyType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>An object representing a constraint on task placement.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct PlacementConstraint {
/// <p>The type of constraint. Use <code>distinctInstance</code> to ensure that each task in a particular group is running on a different container instance. Use <code>memberOf</code> to restrict the selection to a group of valid candidates.</p>
#[doc(hidden)]
pub r#type: std::option::Option<crate::model::PlacementConstraintType>,
/// <p>A cluster query language expression to apply to the constraint. You cannot specify an expression if the constraint type is <code>distinctInstance</code>. For more information, see <a href="https://docs.aws.amazon.com/latest/developerguide/cluster-query-language.html">Cluster query language</a> in the <i>Amazon ECS Developer Guide</i>.</p>
#[doc(hidden)]
pub expression: std::option::Option<std::string::String>,
}
impl PlacementConstraint {
/// <p>The type of constraint. Use <code>distinctInstance</code> to ensure that each task in a particular group is running on a different container instance. Use <code>memberOf</code> to restrict the selection to a group of valid candidates.</p>
pub fn r#type(&self) -> std::option::Option<&crate::model::PlacementConstraintType> {
self.r#type.as_ref()
}
/// <p>A cluster query language expression to apply to the constraint. You cannot specify an expression if the constraint type is <code>distinctInstance</code>. For more information, see <a href="https://docs.aws.amazon.com/latest/developerguide/cluster-query-language.html">Cluster query language</a> in the <i>Amazon ECS Developer Guide</i>.</p>
pub fn expression(&self) -> std::option::Option<&str> {
self.expression.as_deref()
}
}
/// See [`PlacementConstraint`](crate::model::PlacementConstraint).
pub mod placement_constraint {
/// A builder for [`PlacementConstraint`](crate::model::PlacementConstraint).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) r#type: std::option::Option<crate::model::PlacementConstraintType>,
pub(crate) expression: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The type of constraint. Use <code>distinctInstance</code> to ensure that each task in a particular group is running on a different container instance. Use <code>memberOf</code> to restrict the selection to a group of valid candidates.</p>
pub fn r#type(mut self, input: crate::model::PlacementConstraintType) -> Self {
self.r#type = Some(input);
self
}
/// <p>The type of constraint. Use <code>distinctInstance</code> to ensure that each task in a particular group is running on a different container instance. Use <code>memberOf</code> to restrict the selection to a group of valid candidates.</p>
pub fn set_type(
mut self,
input: std::option::Option<crate::model::PlacementConstraintType>,
) -> Self {
self.r#type = input;
self
}
/// <p>A cluster query language expression to apply to the constraint. You cannot specify an expression if the constraint type is <code>distinctInstance</code>. For more information, see <a href="https://docs.aws.amazon.com/latest/developerguide/cluster-query-language.html">Cluster query language</a> in the <i>Amazon ECS Developer Guide</i>.</p>
pub fn expression(mut self, input: impl Into<std::string::String>) -> Self {
self.expression = Some(input.into());
self
}
/// <p>A cluster query language expression to apply to the constraint. You cannot specify an expression if the constraint type is <code>distinctInstance</code>. For more information, see <a href="https://docs.aws.amazon.com/latest/developerguide/cluster-query-language.html">Cluster query language</a> in the <i>Amazon ECS Developer Guide</i>.</p>
pub fn set_expression(mut self, input: std::option::Option<std::string::String>) -> Self {
self.expression = input;
self
}
/// Consumes the builder and constructs a [`PlacementConstraint`](crate::model::PlacementConstraint).
pub fn build(self) -> crate::model::PlacementConstraint {
crate::model::PlacementConstraint {
r#type: self.r#type,
expression: self.expression,
}
}
}
}
impl PlacementConstraint {
/// Creates a new builder-style object to manufacture [`PlacementConstraint`](crate::model::PlacementConstraint).
pub fn builder() -> crate::model::placement_constraint::Builder {
crate::model::placement_constraint::Builder::default()
}
}
/// When writing a match expression against `PlacementConstraintType`, it is important to ensure
/// your code is forward-compatible. That is, if a match arm handles a case for a
/// feature that is supported by the service but has not been represented as an enum
/// variant in a current version of SDK, your code should continue to work when you
/// upgrade SDK to a future version in which the enum does include a variant for that
/// feature.
///
/// Here is an example of how you can make a match expression forward-compatible:
///
/// ```text
/// # let placementconstrainttype = unimplemented!();
/// match placementconstrainttype {
/// PlacementConstraintType::DistinctInstance => { /* ... */ },
/// PlacementConstraintType::MemberOf => { /* ... */ },
/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
/// _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `placementconstrainttype` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `PlacementConstraintType::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `PlacementConstraintType::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
/// and calling `as_str` on it yields `"NewFeature"`.
/// This match expression is forward-compatible when executed with a newer
/// version of SDK where the variant `PlacementConstraintType::NewFeature` is defined.
/// Specifically, when `placementconstrainttype` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `PlacementConstraintType::NewFeature` also yielding `"NewFeature"`.
///
/// Explicitly matching on the `Unknown` variant should
/// be avoided for two reasons:
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
/// - It might inadvertently shadow other intended match arms.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum PlacementConstraintType {
#[allow(missing_docs)] // documentation missing in model
DistinctInstance,
#[allow(missing_docs)] // documentation missing in model
MemberOf,
/// `Unknown` contains new variants that have been added since this code was generated.
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for PlacementConstraintType {
fn from(s: &str) -> Self {
match s {
"distinctInstance" => PlacementConstraintType::DistinctInstance,
"memberOf" => PlacementConstraintType::MemberOf,
other => PlacementConstraintType::Unknown(crate::types::UnknownVariantValue(
other.to_owned(),
)),
}
}
}
impl std::str::FromStr for PlacementConstraintType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(PlacementConstraintType::from(s))
}
}
impl PlacementConstraintType {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
PlacementConstraintType::DistinctInstance => "distinctInstance",
PlacementConstraintType::MemberOf => "memberOf",
PlacementConstraintType::Unknown(value) => value.as_str(),
}
}
/// Returns all the `&str` values of the enum members.
pub const fn values() -> &'static [&'static str] {
&["distinctInstance", "memberOf"]
}
}
impl AsRef<str> for PlacementConstraintType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>The details of a capacity provider strategy.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CapacityProviderStrategyItem {
/// <p>The short name of the capacity provider.</p>
#[doc(hidden)]
pub capacity_provider: std::option::Option<std::string::String>,
/// <p>The weight value designates the relative percentage of the total number of tasks launched that should use the specified capacity provider. The weight value is taken into consideration after the base value, if defined, is satisfied.</p>
#[doc(hidden)]
pub weight: i32,
/// <p>The base value designates how many tasks, at a minimum, to run on the specified capacity provider. Only one capacity provider in a capacity provider strategy can have a base defined. If no value is specified, the default value of <code>0</code> is used.</p>
#[doc(hidden)]
pub base: i32,
}
impl CapacityProviderStrategyItem {
/// <p>The short name of the capacity provider.</p>
pub fn capacity_provider(&self) -> std::option::Option<&str> {
self.capacity_provider.as_deref()
}
/// <p>The weight value designates the relative percentage of the total number of tasks launched that should use the specified capacity provider. The weight value is taken into consideration after the base value, if defined, is satisfied.</p>
pub fn weight(&self) -> i32 {
self.weight
}
/// <p>The base value designates how many tasks, at a minimum, to run on the specified capacity provider. Only one capacity provider in a capacity provider strategy can have a base defined. If no value is specified, the default value of <code>0</code> is used.</p>
pub fn base(&self) -> i32 {
self.base
}
}
/// See [`CapacityProviderStrategyItem`](crate::model::CapacityProviderStrategyItem).
pub mod capacity_provider_strategy_item {
/// A builder for [`CapacityProviderStrategyItem`](crate::model::CapacityProviderStrategyItem).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) capacity_provider: std::option::Option<std::string::String>,
pub(crate) weight: std::option::Option<i32>,
pub(crate) base: std::option::Option<i32>,
}
impl Builder {
/// <p>The short name of the capacity provider.</p>
pub fn capacity_provider(mut self, input: impl Into<std::string::String>) -> Self {
self.capacity_provider = Some(input.into());
self
}
/// <p>The short name of the capacity provider.</p>
pub fn set_capacity_provider(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.capacity_provider = input;
self
}
/// <p>The weight value designates the relative percentage of the total number of tasks launched that should use the specified capacity provider. The weight value is taken into consideration after the base value, if defined, is satisfied.</p>
pub fn weight(mut self, input: i32) -> Self {
self.weight = Some(input);
self
}
/// <p>The weight value designates the relative percentage of the total number of tasks launched that should use the specified capacity provider. The weight value is taken into consideration after the base value, if defined, is satisfied.</p>
pub fn set_weight(mut self, input: std::option::Option<i32>) -> Self {
self.weight = input;
self
}
/// <p>The base value designates how many tasks, at a minimum, to run on the specified capacity provider. Only one capacity provider in a capacity provider strategy can have a base defined. If no value is specified, the default value of <code>0</code> is used.</p>
pub fn base(mut self, input: i32) -> Self {
self.base = Some(input);
self
}
/// <p>The base value designates how many tasks, at a minimum, to run on the specified capacity provider. Only one capacity provider in a capacity provider strategy can have a base defined. If no value is specified, the default value of <code>0</code> is used.</p>
pub fn set_base(mut self, input: std::option::Option<i32>) -> Self {
self.base = input;
self
}
/// Consumes the builder and constructs a [`CapacityProviderStrategyItem`](crate::model::CapacityProviderStrategyItem).
pub fn build(self) -> crate::model::CapacityProviderStrategyItem {
crate::model::CapacityProviderStrategyItem {
capacity_provider: self.capacity_provider,
weight: self.weight.unwrap_or_default(),
base: self.base.unwrap_or_default(),
}
}
}
}
impl CapacityProviderStrategyItem {
/// Creates a new builder-style object to manufacture [`CapacityProviderStrategyItem`](crate::model::CapacityProviderStrategyItem).
pub fn builder() -> crate::model::capacity_provider_strategy_item::Builder {
crate::model::capacity_provider_strategy_item::Builder::default()
}
}
/// <p>Specifies the network configuration for an ECS task.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct NetworkConfiguration {
/// <p>Specifies the Amazon VPC subnets and security groups for the task, and whether a public IP address is to be used. This structure is relevant only for ECS tasks that use the awsvpc network mode.</p>
#[doc(hidden)]
pub awsvpc_configuration: std::option::Option<crate::model::AwsVpcConfiguration>,
}
impl NetworkConfiguration {
/// <p>Specifies the Amazon VPC subnets and security groups for the task, and whether a public IP address is to be used. This structure is relevant only for ECS tasks that use the awsvpc network mode.</p>
pub fn awsvpc_configuration(&self) -> std::option::Option<&crate::model::AwsVpcConfiguration> {
self.awsvpc_configuration.as_ref()
}
}
/// See [`NetworkConfiguration`](crate::model::NetworkConfiguration).
pub mod network_configuration {
/// A builder for [`NetworkConfiguration`](crate::model::NetworkConfiguration).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) awsvpc_configuration: std::option::Option<crate::model::AwsVpcConfiguration>,
}
impl Builder {
/// <p>Specifies the Amazon VPC subnets and security groups for the task, and whether a public IP address is to be used. This structure is relevant only for ECS tasks that use the awsvpc network mode.</p>
pub fn awsvpc_configuration(mut self, input: crate::model::AwsVpcConfiguration) -> Self {
self.awsvpc_configuration = Some(input);
self
}
/// <p>Specifies the Amazon VPC subnets and security groups for the task, and whether a public IP address is to be used. This structure is relevant only for ECS tasks that use the awsvpc network mode.</p>
pub fn set_awsvpc_configuration(
mut self,
input: std::option::Option<crate::model::AwsVpcConfiguration>,
) -> Self {
self.awsvpc_configuration = input;
self
}
/// Consumes the builder and constructs a [`NetworkConfiguration`](crate::model::NetworkConfiguration).
pub fn build(self) -> crate::model::NetworkConfiguration {
crate::model::NetworkConfiguration {
awsvpc_configuration: self.awsvpc_configuration,
}
}
}
}
impl NetworkConfiguration {
/// Creates a new builder-style object to manufacture [`NetworkConfiguration`](crate::model::NetworkConfiguration).
pub fn builder() -> crate::model::network_configuration::Builder {
crate::model::network_configuration::Builder::default()
}
}
/// <p>This structure specifies the VPC subnets and security groups for the task, and whether a public IP address is to be used. This structure is relevant only for ECS tasks that use the awsvpc network mode.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct AwsVpcConfiguration {
/// <p>Specifies the subnets associated with the task. These subnets must all be in the same VPC. You can specify as many as 16 subnets.</p>
#[doc(hidden)]
pub subnets: std::option::Option<std::vec::Vec<std::string::String>>,
/// <p>Specifies the security groups associated with the task. These security groups must all be in the same VPC. You can specify as many as five security groups. If you do not specify a security group, the default security group for the VPC is used.</p>
#[doc(hidden)]
pub security_groups: std::option::Option<std::vec::Vec<std::string::String>>,
/// <p>Specifies whether the task's elastic network interface receives a public IP address. You can specify <code>ENABLED</code> only when <code>LaunchType</code> in <code>EcsParameters</code> is set to <code>FARGATE</code>.</p>
#[doc(hidden)]
pub assign_public_ip: std::option::Option<crate::model::AssignPublicIp>,
}
impl AwsVpcConfiguration {
/// <p>Specifies the subnets associated with the task. These subnets must all be in the same VPC. You can specify as many as 16 subnets.</p>
pub fn subnets(&self) -> std::option::Option<&[std::string::String]> {
self.subnets.as_deref()
}
/// <p>Specifies the security groups associated with the task. These security groups must all be in the same VPC. You can specify as many as five security groups. If you do not specify a security group, the default security group for the VPC is used.</p>
pub fn security_groups(&self) -> std::option::Option<&[std::string::String]> {
self.security_groups.as_deref()
}
/// <p>Specifies whether the task's elastic network interface receives a public IP address. You can specify <code>ENABLED</code> only when <code>LaunchType</code> in <code>EcsParameters</code> is set to <code>FARGATE</code>.</p>
pub fn assign_public_ip(&self) -> std::option::Option<&crate::model::AssignPublicIp> {
self.assign_public_ip.as_ref()
}
}
/// See [`AwsVpcConfiguration`](crate::model::AwsVpcConfiguration).
pub mod aws_vpc_configuration {
/// A builder for [`AwsVpcConfiguration`](crate::model::AwsVpcConfiguration).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) subnets: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) security_groups: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) assign_public_ip: std::option::Option<crate::model::AssignPublicIp>,
}
impl Builder {
/// Appends an item to `subnets`.
///
/// To override the contents of this collection use [`set_subnets`](Self::set_subnets).
///
/// <p>Specifies the subnets associated with the task. These subnets must all be in the same VPC. You can specify as many as 16 subnets.</p>
pub fn subnets(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.subnets.unwrap_or_default();
v.push(input.into());
self.subnets = Some(v);
self
}
/// <p>Specifies the subnets associated with the task. These subnets must all be in the same VPC. You can specify as many as 16 subnets.</p>
pub fn set_subnets(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.subnets = input;
self
}
/// Appends an item to `security_groups`.
///
/// To override the contents of this collection use [`set_security_groups`](Self::set_security_groups).
///
/// <p>Specifies the security groups associated with the task. These security groups must all be in the same VPC. You can specify as many as five security groups. If you do not specify a security group, the default security group for the VPC is used.</p>
pub fn security_groups(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.security_groups.unwrap_or_default();
v.push(input.into());
self.security_groups = Some(v);
self
}
/// <p>Specifies the security groups associated with the task. These security groups must all be in the same VPC. You can specify as many as five security groups. If you do not specify a security group, the default security group for the VPC is used.</p>
pub fn set_security_groups(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.security_groups = input;
self
}
/// <p>Specifies whether the task's elastic network interface receives a public IP address. You can specify <code>ENABLED</code> only when <code>LaunchType</code> in <code>EcsParameters</code> is set to <code>FARGATE</code>.</p>
pub fn assign_public_ip(mut self, input: crate::model::AssignPublicIp) -> Self {
self.assign_public_ip = Some(input);
self
}
/// <p>Specifies whether the task's elastic network interface receives a public IP address. You can specify <code>ENABLED</code> only when <code>LaunchType</code> in <code>EcsParameters</code> is set to <code>FARGATE</code>.</p>
pub fn set_assign_public_ip(
mut self,
input: std::option::Option<crate::model::AssignPublicIp>,
) -> Self {
self.assign_public_ip = input;
self
}
/// Consumes the builder and constructs a [`AwsVpcConfiguration`](crate::model::AwsVpcConfiguration).
pub fn build(self) -> crate::model::AwsVpcConfiguration {
crate::model::AwsVpcConfiguration {
subnets: self.subnets,
security_groups: self.security_groups,
assign_public_ip: self.assign_public_ip,
}
}
}
}
impl AwsVpcConfiguration {
/// Creates a new builder-style object to manufacture [`AwsVpcConfiguration`](crate::model::AwsVpcConfiguration).
pub fn builder() -> crate::model::aws_vpc_configuration::Builder {
crate::model::aws_vpc_configuration::Builder::default()
}
}
/// When writing a match expression against `AssignPublicIp`, it is important to ensure
/// your code is forward-compatible. That is, if a match arm handles a case for a
/// feature that is supported by the service but has not been represented as an enum
/// variant in a current version of SDK, your code should continue to work when you
/// upgrade SDK to a future version in which the enum does include a variant for that
/// feature.
///
/// Here is an example of how you can make a match expression forward-compatible:
///
/// ```text
/// # let assignpublicip = unimplemented!();
/// match assignpublicip {
/// AssignPublicIp::Disabled => { /* ... */ },
/// AssignPublicIp::Enabled => { /* ... */ },
/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
/// _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `assignpublicip` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `AssignPublicIp::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `AssignPublicIp::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
/// and calling `as_str` on it yields `"NewFeature"`.
/// This match expression is forward-compatible when executed with a newer
/// version of SDK where the variant `AssignPublicIp::NewFeature` is defined.
/// Specifically, when `assignpublicip` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `AssignPublicIp::NewFeature` also yielding `"NewFeature"`.
///
/// Explicitly matching on the `Unknown` variant should
/// be avoided for two reasons:
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
/// - It might inadvertently shadow other intended match arms.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum AssignPublicIp {
#[allow(missing_docs)] // documentation missing in model
Disabled,
#[allow(missing_docs)] // documentation missing in model
Enabled,
/// `Unknown` contains new variants that have been added since this code was generated.
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for AssignPublicIp {
fn from(s: &str) -> Self {
match s {
"DISABLED" => AssignPublicIp::Disabled,
"ENABLED" => AssignPublicIp::Enabled,
other => AssignPublicIp::Unknown(crate::types::UnknownVariantValue(other.to_owned())),
}
}
}
impl std::str::FromStr for AssignPublicIp {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(AssignPublicIp::from(s))
}
}
impl AssignPublicIp {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
AssignPublicIp::Disabled => "DISABLED",
AssignPublicIp::Enabled => "ENABLED",
AssignPublicIp::Unknown(value) => value.as_str(),
}
}
/// Returns all the `&str` values of the enum members.
pub const fn values() -> &'static [&'static str] {
&["DISABLED", "ENABLED"]
}
}
impl AsRef<str> for AssignPublicIp {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// When writing a match expression against `LaunchType`, it is important to ensure
/// your code is forward-compatible. That is, if a match arm handles a case for a
/// feature that is supported by the service but has not been represented as an enum
/// variant in a current version of SDK, your code should continue to work when you
/// upgrade SDK to a future version in which the enum does include a variant for that
/// feature.
///
/// Here is an example of how you can make a match expression forward-compatible:
///
/// ```text
/// # let launchtype = unimplemented!();
/// match launchtype {
/// LaunchType::Ec2 => { /* ... */ },
/// LaunchType::External => { /* ... */ },
/// LaunchType::Fargate => { /* ... */ },
/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
/// _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `launchtype` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `LaunchType::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `LaunchType::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
/// and calling `as_str` on it yields `"NewFeature"`.
/// This match expression is forward-compatible when executed with a newer
/// version of SDK where the variant `LaunchType::NewFeature` is defined.
/// Specifically, when `launchtype` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `LaunchType::NewFeature` also yielding `"NewFeature"`.
///
/// Explicitly matching on the `Unknown` variant should
/// be avoided for two reasons:
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
/// - It might inadvertently shadow other intended match arms.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum LaunchType {
#[allow(missing_docs)] // documentation missing in model
Ec2,
#[allow(missing_docs)] // documentation missing in model
External,
#[allow(missing_docs)] // documentation missing in model
Fargate,
/// `Unknown` contains new variants that have been added since this code was generated.
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for LaunchType {
fn from(s: &str) -> Self {
match s {
"EC2" => LaunchType::Ec2,
"EXTERNAL" => LaunchType::External,
"FARGATE" => LaunchType::Fargate,
other => LaunchType::Unknown(crate::types::UnknownVariantValue(other.to_owned())),
}
}
}
impl std::str::FromStr for LaunchType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(LaunchType::from(s))
}
}
impl LaunchType {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
LaunchType::Ec2 => "EC2",
LaunchType::External => "EXTERNAL",
LaunchType::Fargate => "FARGATE",
LaunchType::Unknown(value) => value.as_str(),
}
}
/// Returns all the `&str` values of the enum members.
pub const fn values() -> &'static [&'static str] {
&["EC2", "EXTERNAL", "FARGATE"]
}
}
impl AsRef<str> for LaunchType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>A <code>RetryPolicy</code> object that includes information about the retry policy settings, including the maximum age of an event, and the maximum number of times EventBridge Scheduler will try to deliver the event to a target.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct RetryPolicy {
/// <p>The maximum amount of time, in seconds, to continue to make retry attempts.</p>
#[doc(hidden)]
pub maximum_event_age_in_seconds: std::option::Option<i32>,
/// <p>The maximum number of retry attempts to make before the request fails. Retry attempts with exponential backoff continue until either the maximum number of attempts is made or until the duration of the <code>MaximumEventAgeInSeconds</code> is reached.</p>
#[doc(hidden)]
pub maximum_retry_attempts: std::option::Option<i32>,
}
impl RetryPolicy {
/// <p>The maximum amount of time, in seconds, to continue to make retry attempts.</p>
pub fn maximum_event_age_in_seconds(&self) -> std::option::Option<i32> {
self.maximum_event_age_in_seconds
}
/// <p>The maximum number of retry attempts to make before the request fails. Retry attempts with exponential backoff continue until either the maximum number of attempts is made or until the duration of the <code>MaximumEventAgeInSeconds</code> is reached.</p>
pub fn maximum_retry_attempts(&self) -> std::option::Option<i32> {
self.maximum_retry_attempts
}
}
/// See [`RetryPolicy`](crate::model::RetryPolicy).
pub mod retry_policy {
/// A builder for [`RetryPolicy`](crate::model::RetryPolicy).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) maximum_event_age_in_seconds: std::option::Option<i32>,
pub(crate) maximum_retry_attempts: std::option::Option<i32>,
}
impl Builder {
/// <p>The maximum amount of time, in seconds, to continue to make retry attempts.</p>
pub fn maximum_event_age_in_seconds(mut self, input: i32) -> Self {
self.maximum_event_age_in_seconds = Some(input);
self
}
/// <p>The maximum amount of time, in seconds, to continue to make retry attempts.</p>
pub fn set_maximum_event_age_in_seconds(mut self, input: std::option::Option<i32>) -> Self {
self.maximum_event_age_in_seconds = input;
self
}
/// <p>The maximum number of retry attempts to make before the request fails. Retry attempts with exponential backoff continue until either the maximum number of attempts is made or until the duration of the <code>MaximumEventAgeInSeconds</code> is reached.</p>
pub fn maximum_retry_attempts(mut self, input: i32) -> Self {
self.maximum_retry_attempts = Some(input);
self
}
/// <p>The maximum number of retry attempts to make before the request fails. Retry attempts with exponential backoff continue until either the maximum number of attempts is made or until the duration of the <code>MaximumEventAgeInSeconds</code> is reached.</p>
pub fn set_maximum_retry_attempts(mut self, input: std::option::Option<i32>) -> Self {
self.maximum_retry_attempts = input;
self
}
/// Consumes the builder and constructs a [`RetryPolicy`](crate::model::RetryPolicy).
pub fn build(self) -> crate::model::RetryPolicy {
crate::model::RetryPolicy {
maximum_event_age_in_seconds: self.maximum_event_age_in_seconds,
maximum_retry_attempts: self.maximum_retry_attempts,
}
}
}
}
impl RetryPolicy {
/// Creates a new builder-style object to manufacture [`RetryPolicy`](crate::model::RetryPolicy).
pub fn builder() -> crate::model::retry_policy::Builder {
crate::model::retry_policy::Builder::default()
}
}
/// <p>An object that contains information about an Amazon SQS queue that EventBridge Scheduler uses as a dead-letter queue for your schedule. If specified, EventBridge Scheduler delivers failed events that could not be successfully delivered to a target to the queue.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeadLetterConfig {
/// <p>The Amazon Resource Name (ARN) of the SQS queue specified as the destination for the dead-letter queue.</p>
#[doc(hidden)]
pub arn: std::option::Option<std::string::String>,
}
impl DeadLetterConfig {
/// <p>The Amazon Resource Name (ARN) of the SQS queue specified as the destination for the dead-letter queue.</p>
pub fn arn(&self) -> std::option::Option<&str> {
self.arn.as_deref()
}
}
/// See [`DeadLetterConfig`](crate::model::DeadLetterConfig).
pub mod dead_letter_config {
/// A builder for [`DeadLetterConfig`](crate::model::DeadLetterConfig).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) arn: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The Amazon Resource Name (ARN) of the SQS queue specified as the destination for the dead-letter queue.</p>
pub fn arn(mut self, input: impl Into<std::string::String>) -> Self {
self.arn = Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the SQS queue specified as the destination for the dead-letter queue.</p>
pub fn set_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.arn = input;
self
}
/// Consumes the builder and constructs a [`DeadLetterConfig`](crate::model::DeadLetterConfig).
pub fn build(self) -> crate::model::DeadLetterConfig {
crate::model::DeadLetterConfig { arn: self.arn }
}
}
}
impl DeadLetterConfig {
/// Creates a new builder-style object to manufacture [`DeadLetterConfig`](crate::model::DeadLetterConfig).
pub fn builder() -> crate::model::dead_letter_config::Builder {
crate::model::dead_letter_config::Builder::default()
}
}