1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[derive(Debug)]
pub(crate) struct Handle<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
client: aws_smithy_client::Client<C, M, R>,
conf: crate::Config,
}
/// Client for Amazon Kinesis
///
/// Client for invoking operations on Amazon Kinesis. Each operation on Amazon Kinesis is a method on this
/// this struct. `.send()` MUST be invoked on the generated operations to dispatch the request to the service.
///
/// # Examples
/// **Constructing a client and invoking an operation**
/// ```rust,no_run
/// # async fn docs() {
/// // create a shared configuration. This can be used & shared between multiple service clients.
/// let shared_config = aws_config::load_from_env().await;
/// let client = aws_sdk_kinesis::Client::new(&shared_config);
/// // invoke an operation
/// /* let rsp = client
/// .<operation_name>().
/// .<param>("some value")
/// .send().await; */
/// # }
/// ```
/// **Constructing a client with custom configuration**
/// ```rust,no_run
/// use aws_config::RetryConfig;
/// # async fn docs() {
/// let shared_config = aws_config::load_from_env().await;
/// let config = aws_sdk_kinesis::config::Builder::from(&shared_config)
/// .retry_config(RetryConfig::disabled())
/// .build();
/// let client = aws_sdk_kinesis::Client::from_conf(config);
/// # }
#[derive(std::fmt::Debug)]
pub struct Client<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<Handle<C, M, R>>,
}
impl<C, M, R> std::clone::Clone for Client<C, M, R> {
fn clone(&self) -> Self {
Self {
handle: self.handle.clone(),
}
}
}
#[doc(inline)]
pub use aws_smithy_client::Builder;
impl<C, M, R> From<aws_smithy_client::Client<C, M, R>> for Client<C, M, R> {
fn from(client: aws_smithy_client::Client<C, M, R>) -> Self {
Self::with_config(client, crate::Config::builder().build())
}
}
impl<C, M, R> Client<C, M, R> {
/// Creates a client with the given service configuration.
pub fn with_config(client: aws_smithy_client::Client<C, M, R>, conf: crate::Config) -> Self {
Self {
handle: std::sync::Arc::new(Handle { client, conf }),
}
}
/// Returns the client's configuration.
pub fn conf(&self) -> &crate::Config {
&self.handle.conf
}
}
impl<C, M, R> Client<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Constructs a fluent builder for the `AddTagsToStream` operation.
///
/// See [`AddTagsToStream`](crate::client::fluent_builders::AddTagsToStream) for more information about the
/// operation and its arguments.
pub fn add_tags_to_stream(&self) -> fluent_builders::AddTagsToStream<C, M, R> {
fluent_builders::AddTagsToStream::new(self.handle.clone())
}
/// Constructs a fluent builder for the `CreateStream` operation.
///
/// See [`CreateStream`](crate::client::fluent_builders::CreateStream) for more information about the
/// operation and its arguments.
pub fn create_stream(&self) -> fluent_builders::CreateStream<C, M, R> {
fluent_builders::CreateStream::new(self.handle.clone())
}
/// Constructs a fluent builder for the `DecreaseStreamRetentionPeriod` operation.
///
/// See [`DecreaseStreamRetentionPeriod`](crate::client::fluent_builders::DecreaseStreamRetentionPeriod) for more information about the
/// operation and its arguments.
pub fn decrease_stream_retention_period(
&self,
) -> fluent_builders::DecreaseStreamRetentionPeriod<C, M, R> {
fluent_builders::DecreaseStreamRetentionPeriod::new(self.handle.clone())
}
/// Constructs a fluent builder for the `DeleteStream` operation.
///
/// See [`DeleteStream`](crate::client::fluent_builders::DeleteStream) for more information about the
/// operation and its arguments.
pub fn delete_stream(&self) -> fluent_builders::DeleteStream<C, M, R> {
fluent_builders::DeleteStream::new(self.handle.clone())
}
/// Constructs a fluent builder for the `DeregisterStreamConsumer` operation.
///
/// See [`DeregisterStreamConsumer`](crate::client::fluent_builders::DeregisterStreamConsumer) for more information about the
/// operation and its arguments.
pub fn deregister_stream_consumer(&self) -> fluent_builders::DeregisterStreamConsumer<C, M, R> {
fluent_builders::DeregisterStreamConsumer::new(self.handle.clone())
}
/// Constructs a fluent builder for the `DescribeLimits` operation.
///
/// See [`DescribeLimits`](crate::client::fluent_builders::DescribeLimits) for more information about the
/// operation and its arguments.
pub fn describe_limits(&self) -> fluent_builders::DescribeLimits<C, M, R> {
fluent_builders::DescribeLimits::new(self.handle.clone())
}
/// Constructs a fluent builder for the `DescribeStream` operation.
///
/// See [`DescribeStream`](crate::client::fluent_builders::DescribeStream) for more information about the
/// operation and its arguments.
pub fn describe_stream(&self) -> fluent_builders::DescribeStream<C, M, R> {
fluent_builders::DescribeStream::new(self.handle.clone())
}
/// Constructs a fluent builder for the `DescribeStreamConsumer` operation.
///
/// See [`DescribeStreamConsumer`](crate::client::fluent_builders::DescribeStreamConsumer) for more information about the
/// operation and its arguments.
pub fn describe_stream_consumer(&self) -> fluent_builders::DescribeStreamConsumer<C, M, R> {
fluent_builders::DescribeStreamConsumer::new(self.handle.clone())
}
/// Constructs a fluent builder for the `DescribeStreamSummary` operation.
///
/// See [`DescribeStreamSummary`](crate::client::fluent_builders::DescribeStreamSummary) for more information about the
/// operation and its arguments.
pub fn describe_stream_summary(&self) -> fluent_builders::DescribeStreamSummary<C, M, R> {
fluent_builders::DescribeStreamSummary::new(self.handle.clone())
}
/// Constructs a fluent builder for the `DisableEnhancedMonitoring` operation.
///
/// See [`DisableEnhancedMonitoring`](crate::client::fluent_builders::DisableEnhancedMonitoring) for more information about the
/// operation and its arguments.
pub fn disable_enhanced_monitoring(
&self,
) -> fluent_builders::DisableEnhancedMonitoring<C, M, R> {
fluent_builders::DisableEnhancedMonitoring::new(self.handle.clone())
}
/// Constructs a fluent builder for the `EnableEnhancedMonitoring` operation.
///
/// See [`EnableEnhancedMonitoring`](crate::client::fluent_builders::EnableEnhancedMonitoring) for more information about the
/// operation and its arguments.
pub fn enable_enhanced_monitoring(&self) -> fluent_builders::EnableEnhancedMonitoring<C, M, R> {
fluent_builders::EnableEnhancedMonitoring::new(self.handle.clone())
}
/// Constructs a fluent builder for the `GetRecords` operation.
///
/// See [`GetRecords`](crate::client::fluent_builders::GetRecords) for more information about the
/// operation and its arguments.
pub fn get_records(&self) -> fluent_builders::GetRecords<C, M, R> {
fluent_builders::GetRecords::new(self.handle.clone())
}
/// Constructs a fluent builder for the `GetShardIterator` operation.
///
/// See [`GetShardIterator`](crate::client::fluent_builders::GetShardIterator) for more information about the
/// operation and its arguments.
pub fn get_shard_iterator(&self) -> fluent_builders::GetShardIterator<C, M, R> {
fluent_builders::GetShardIterator::new(self.handle.clone())
}
/// Constructs a fluent builder for the `IncreaseStreamRetentionPeriod` operation.
///
/// See [`IncreaseStreamRetentionPeriod`](crate::client::fluent_builders::IncreaseStreamRetentionPeriod) for more information about the
/// operation and its arguments.
pub fn increase_stream_retention_period(
&self,
) -> fluent_builders::IncreaseStreamRetentionPeriod<C, M, R> {
fluent_builders::IncreaseStreamRetentionPeriod::new(self.handle.clone())
}
/// Constructs a fluent builder for the `ListShards` operation.
///
/// See [`ListShards`](crate::client::fluent_builders::ListShards) for more information about the
/// operation and its arguments.
pub fn list_shards(&self) -> fluent_builders::ListShards<C, M, R> {
fluent_builders::ListShards::new(self.handle.clone())
}
/// Constructs a fluent builder for the `ListStreamConsumers` operation.
///
/// See [`ListStreamConsumers`](crate::client::fluent_builders::ListStreamConsumers) for more information about the
/// operation and its arguments.
pub fn list_stream_consumers(&self) -> fluent_builders::ListStreamConsumers<C, M, R> {
fluent_builders::ListStreamConsumers::new(self.handle.clone())
}
/// Constructs a fluent builder for the `ListStreams` operation.
///
/// See [`ListStreams`](crate::client::fluent_builders::ListStreams) for more information about the
/// operation and its arguments.
pub fn list_streams(&self) -> fluent_builders::ListStreams<C, M, R> {
fluent_builders::ListStreams::new(self.handle.clone())
}
/// Constructs a fluent builder for the `ListTagsForStream` operation.
///
/// See [`ListTagsForStream`](crate::client::fluent_builders::ListTagsForStream) for more information about the
/// operation and its arguments.
pub fn list_tags_for_stream(&self) -> fluent_builders::ListTagsForStream<C, M, R> {
fluent_builders::ListTagsForStream::new(self.handle.clone())
}
/// Constructs a fluent builder for the `MergeShards` operation.
///
/// See [`MergeShards`](crate::client::fluent_builders::MergeShards) for more information about the
/// operation and its arguments.
pub fn merge_shards(&self) -> fluent_builders::MergeShards<C, M, R> {
fluent_builders::MergeShards::new(self.handle.clone())
}
/// Constructs a fluent builder for the `PutRecord` operation.
///
/// See [`PutRecord`](crate::client::fluent_builders::PutRecord) for more information about the
/// operation and its arguments.
pub fn put_record(&self) -> fluent_builders::PutRecord<C, M, R> {
fluent_builders::PutRecord::new(self.handle.clone())
}
/// Constructs a fluent builder for the `PutRecords` operation.
///
/// See [`PutRecords`](crate::client::fluent_builders::PutRecords) for more information about the
/// operation and its arguments.
pub fn put_records(&self) -> fluent_builders::PutRecords<C, M, R> {
fluent_builders::PutRecords::new(self.handle.clone())
}
/// Constructs a fluent builder for the `RegisterStreamConsumer` operation.
///
/// See [`RegisterStreamConsumer`](crate::client::fluent_builders::RegisterStreamConsumer) for more information about the
/// operation and its arguments.
pub fn register_stream_consumer(&self) -> fluent_builders::RegisterStreamConsumer<C, M, R> {
fluent_builders::RegisterStreamConsumer::new(self.handle.clone())
}
/// Constructs a fluent builder for the `RemoveTagsFromStream` operation.
///
/// See [`RemoveTagsFromStream`](crate::client::fluent_builders::RemoveTagsFromStream) for more information about the
/// operation and its arguments.
pub fn remove_tags_from_stream(&self) -> fluent_builders::RemoveTagsFromStream<C, M, R> {
fluent_builders::RemoveTagsFromStream::new(self.handle.clone())
}
/// Constructs a fluent builder for the `SplitShard` operation.
///
/// See [`SplitShard`](crate::client::fluent_builders::SplitShard) for more information about the
/// operation and its arguments.
pub fn split_shard(&self) -> fluent_builders::SplitShard<C, M, R> {
fluent_builders::SplitShard::new(self.handle.clone())
}
/// Constructs a fluent builder for the `StartStreamEncryption` operation.
///
/// See [`StartStreamEncryption`](crate::client::fluent_builders::StartStreamEncryption) for more information about the
/// operation and its arguments.
pub fn start_stream_encryption(&self) -> fluent_builders::StartStreamEncryption<C, M, R> {
fluent_builders::StartStreamEncryption::new(self.handle.clone())
}
/// Constructs a fluent builder for the `StopStreamEncryption` operation.
///
/// See [`StopStreamEncryption`](crate::client::fluent_builders::StopStreamEncryption) for more information about the
/// operation and its arguments.
pub fn stop_stream_encryption(&self) -> fluent_builders::StopStreamEncryption<C, M, R> {
fluent_builders::StopStreamEncryption::new(self.handle.clone())
}
/// Constructs a fluent builder for the `UpdateShardCount` operation.
///
/// See [`UpdateShardCount`](crate::client::fluent_builders::UpdateShardCount) for more information about the
/// operation and its arguments.
pub fn update_shard_count(&self) -> fluent_builders::UpdateShardCount<C, M, R> {
fluent_builders::UpdateShardCount::new(self.handle.clone())
}
/// Constructs a fluent builder for the `UpdateStreamMode` operation.
///
/// See [`UpdateStreamMode`](crate::client::fluent_builders::UpdateStreamMode) for more information about the
/// operation and its arguments.
pub fn update_stream_mode(&self) -> fluent_builders::UpdateStreamMode<C, M, R> {
fluent_builders::UpdateStreamMode::new(self.handle.clone())
}
}
pub mod fluent_builders {
//!
//! Utilities to ergonomically construct a request to the service.
//!
//! Fluent builders are created through the [`Client`](crate::client::Client) by calling
//! one if its operation methods. After parameters are set using the builder methods,
//! the `send` method can be called to initiate the request.
//!
/// Fluent builder constructing a request to `AddTagsToStream`.
///
/// <p>Adds or updates tags for the specified Kinesis data stream. You can assign up to 50
/// tags to a data stream.</p>
/// <p>If tags have already been assigned to the stream, <code>AddTagsToStream</code>
/// overwrites any existing tags that correspond to the specified tag keys.</p>
/// <p>
/// <a>AddTagsToStream</a> has a limit of five transactions per second per
/// account.</p>
#[derive(std::fmt::Debug)]
pub struct AddTagsToStream<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::add_tags_to_stream_input::Builder,
}
impl<C, M, R> AddTagsToStream<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `AddTagsToStream`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::AddTagsToStreamOutput,
aws_smithy_http::result::SdkError<crate::error::AddTagsToStreamError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::AddTagsToStreamInputOperationOutputAlias,
crate::output::AddTagsToStreamOutput,
crate::error::AddTagsToStreamError,
crate::input::AddTagsToStreamInputOperationRetryAlias,
>,
{
let input = self.inner.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
let op = input
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The name of the stream.</p>
pub fn stream_name(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.stream_name(inp);
self
}
/// <p>The name of the stream.</p>
pub fn set_stream_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_stream_name(input);
self
}
/// Adds a key-value pair to `Tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <p>A set of up to 10 key-value pairs to use to create the tags.</p>
pub fn tags(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
self.inner = self.inner.tags(k, v);
self
}
/// <p>A set of up to 10 key-value pairs to use to create the tags.</p>
pub fn set_tags(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.inner = self.inner.set_tags(input);
self
}
}
/// Fluent builder constructing a request to `CreateStream`.
///
/// <p>Creates a Kinesis data stream. A stream captures and transports data records that are
/// continuously emitted from different data sources or <i>producers</i>.
/// Scale-out within a stream is explicitly supported by means of shards, which are uniquely
/// identified groups of data records in a stream.</p>
/// <p>You specify and control the number of shards that a stream is composed of. Each shard
/// can support reads up to five transactions per second, up to a maximum data read total of
/// 2 MiB per second. Each shard can support writes up to 1,000 records per second, up to a
/// maximum data write total of 1 MiB per second. If the amount of data input increases or
/// decreases, you can add or remove shards.</p>
/// <p>The stream name identifies the stream. The name is scoped to the Amazon Web Services
/// account used by the application. It is also scoped by Amazon Web Services Region. That
/// is, two streams in two different accounts can have the same name, and two streams in the
/// same account, but in two different Regions, can have the same name.</p>
/// <p>
/// <code>CreateStream</code> is an asynchronous operation. Upon receiving a
/// <code>CreateStream</code> request, Kinesis Data Streams immediately returns and sets
/// the stream status to <code>CREATING</code>. After the stream is created, Kinesis Data
/// Streams sets the stream status to <code>ACTIVE</code>. You should perform read and write
/// operations only on an <code>ACTIVE</code> stream. </p>
/// <p>You receive a <code>LimitExceededException</code> when making a
/// <code>CreateStream</code> request when you try to do one of the following:</p>
/// <ul>
/// <li>
///
/// <p>Have more than five streams in the <code>CREATING</code> state at any point in
/// time.</p>
/// </li>
/// <li>
///
/// <p>Create more shards than are authorized for your account.</p>
/// </li>
/// </ul>
/// <p>For the default shard limit for an Amazon Web Services account, see <a href="https://docs.aws.amazon.com/kinesis/latest/dev/service-sizes-and-limits.html">Amazon
/// Kinesis Data Streams Limits</a> in the <i>Amazon Kinesis Data Streams
/// Developer Guide</i>. To increase this limit, <a href="https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html">contact Amazon Web Services
/// Support</a>.</p>
/// <p>You can use <a>DescribeStreamSummary</a> to check the stream status, which
/// is returned in <code>StreamStatus</code>.</p>
/// <p>
/// <a>CreateStream</a> has a limit of five transactions per second per
/// account.</p>
#[derive(std::fmt::Debug)]
pub struct CreateStream<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::create_stream_input::Builder,
}
impl<C, M, R> CreateStream<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `CreateStream`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::CreateStreamOutput,
aws_smithy_http::result::SdkError<crate::error::CreateStreamError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::CreateStreamInputOperationOutputAlias,
crate::output::CreateStreamOutput,
crate::error::CreateStreamError,
crate::input::CreateStreamInputOperationRetryAlias,
>,
{
let input = self.inner.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
let op = input
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>A name to identify the stream. The stream name is scoped to the Amazon Web Services
/// account used by the application that creates the stream. It is also scoped by Amazon Web Services Region. That is, two streams in two different Amazon Web Services accounts
/// can have the same name. Two streams in the same Amazon Web Services account but in two
/// different Regions can also have the same name.</p>
pub fn stream_name(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.stream_name(inp);
self
}
/// <p>A name to identify the stream. The stream name is scoped to the Amazon Web Services
/// account used by the application that creates the stream. It is also scoped by Amazon Web Services Region. That is, two streams in two different Amazon Web Services accounts
/// can have the same name. Two streams in the same Amazon Web Services account but in two
/// different Regions can also have the same name.</p>
pub fn set_stream_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_stream_name(input);
self
}
/// <p>The number of shards that the stream will use. The throughput of the stream is a
/// function of the number of shards; more shards are required for greater provisioned
/// throughput.</p>
pub fn shard_count(mut self, inp: i32) -> Self {
self.inner = self.inner.shard_count(inp);
self
}
/// <p>The number of shards that the stream will use. The throughput of the stream is a
/// function of the number of shards; more shards are required for greater provisioned
/// throughput.</p>
pub fn set_shard_count(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_shard_count(input);
self
}
/// <p> Indicates the capacity mode of the data stream. Currently, in Kinesis Data Streams,
/// you can choose between an <b>on-demand</b> capacity mode and a
/// <b>provisioned</b> capacity mode for your data
/// streams.</p>
pub fn stream_mode_details(mut self, inp: crate::model::StreamModeDetails) -> Self {
self.inner = self.inner.stream_mode_details(inp);
self
}
/// <p> Indicates the capacity mode of the data stream. Currently, in Kinesis Data Streams,
/// you can choose between an <b>on-demand</b> capacity mode and a
/// <b>provisioned</b> capacity mode for your data
/// streams.</p>
pub fn set_stream_mode_details(
mut self,
input: std::option::Option<crate::model::StreamModeDetails>,
) -> Self {
self.inner = self.inner.set_stream_mode_details(input);
self
}
}
/// Fluent builder constructing a request to `DecreaseStreamRetentionPeriod`.
///
/// <p>Decreases the Kinesis data stream's retention period, which is the length of time data
/// records are accessible after they are added to the stream. The minimum value of a
/// stream's retention period is 24 hours.</p>
/// <p>This operation may result in lost data. For example, if the stream's retention period
/// is 48 hours and is decreased to 24 hours, any data already in the stream that is older
/// than 24 hours is inaccessible.</p>
#[derive(std::fmt::Debug)]
pub struct DecreaseStreamRetentionPeriod<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::decrease_stream_retention_period_input::Builder,
}
impl<C, M, R> DecreaseStreamRetentionPeriod<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `DecreaseStreamRetentionPeriod`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::DecreaseStreamRetentionPeriodOutput,
aws_smithy_http::result::SdkError<crate::error::DecreaseStreamRetentionPeriodError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::DecreaseStreamRetentionPeriodInputOperationOutputAlias,
crate::output::DecreaseStreamRetentionPeriodOutput,
crate::error::DecreaseStreamRetentionPeriodError,
crate::input::DecreaseStreamRetentionPeriodInputOperationRetryAlias,
>,
{
let input = self.inner.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
let op = input
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The name of the stream to modify.</p>
pub fn stream_name(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.stream_name(inp);
self
}
/// <p>The name of the stream to modify.</p>
pub fn set_stream_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_stream_name(input);
self
}
/// <p>The new retention period of the stream, in hours. Must be less than the current
/// retention period.</p>
pub fn retention_period_hours(mut self, inp: i32) -> Self {
self.inner = self.inner.retention_period_hours(inp);
self
}
/// <p>The new retention period of the stream, in hours. Must be less than the current
/// retention period.</p>
pub fn set_retention_period_hours(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_retention_period_hours(input);
self
}
}
/// Fluent builder constructing a request to `DeleteStream`.
///
/// <p>Deletes a Kinesis data stream and all its shards and data. You must shut down any
/// applications that are operating on the stream before you delete the stream. If an
/// application attempts to operate on a deleted stream, it receives the exception
/// <code>ResourceNotFoundException</code>.</p>
/// <p>If the stream is in the <code>ACTIVE</code> state, you can delete it. After a
/// <code>DeleteStream</code> request, the specified stream is in the
/// <code>DELETING</code> state until Kinesis Data Streams completes the
/// deletion.</p>
/// <p>
/// <b>Note:</b> Kinesis Data Streams might continue to accept
/// data read and write operations, such as <a>PutRecord</a>, <a>PutRecords</a>, and <a>GetRecords</a>, on a stream in the
/// <code>DELETING</code> state until the stream deletion is complete.</p>
/// <p>When you delete a stream, any shards in that stream are also deleted, and any tags are
/// dissociated from the stream.</p>
/// <p>You can use the <a>DescribeStreamSummary</a> operation to check the state
/// of the stream, which is returned in <code>StreamStatus</code>.</p>
///
/// <p>
/// <a>DeleteStream</a> has a limit of five transactions per second per
/// account.</p>
#[derive(std::fmt::Debug)]
pub struct DeleteStream<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::delete_stream_input::Builder,
}
impl<C, M, R> DeleteStream<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `DeleteStream`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::DeleteStreamOutput,
aws_smithy_http::result::SdkError<crate::error::DeleteStreamError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::DeleteStreamInputOperationOutputAlias,
crate::output::DeleteStreamOutput,
crate::error::DeleteStreamError,
crate::input::DeleteStreamInputOperationRetryAlias,
>,
{
let input = self.inner.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
let op = input
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The name of the stream to delete.</p>
pub fn stream_name(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.stream_name(inp);
self
}
/// <p>The name of the stream to delete.</p>
pub fn set_stream_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_stream_name(input);
self
}
/// <p>If this parameter is unset (<code>null</code>) or if you set it to <code>false</code>,
/// and the stream has registered consumers, the call to <code>DeleteStream</code> fails
/// with a <code>ResourceInUseException</code>. </p>
pub fn enforce_consumer_deletion(mut self, inp: bool) -> Self {
self.inner = self.inner.enforce_consumer_deletion(inp);
self
}
/// <p>If this parameter is unset (<code>null</code>) or if you set it to <code>false</code>,
/// and the stream has registered consumers, the call to <code>DeleteStream</code> fails
/// with a <code>ResourceInUseException</code>. </p>
pub fn set_enforce_consumer_deletion(mut self, input: std::option::Option<bool>) -> Self {
self.inner = self.inner.set_enforce_consumer_deletion(input);
self
}
}
/// Fluent builder constructing a request to `DeregisterStreamConsumer`.
///
/// <p>To deregister a consumer, provide its ARN. Alternatively, you can provide the ARN of
/// the data stream and the name you gave the consumer when you registered it. You may also
/// provide all three parameters, as long as they don't conflict with each other. If you
/// don't know the name or ARN of the consumer that you want to deregister, you can use the
/// <a>ListStreamConsumers</a> operation to get a list of the descriptions of
/// all the consumers that are currently registered with a given data stream. The
/// description of a consumer contains its name and ARN.</p>
/// <p>This operation has a limit of five transactions per second per stream.</p>
#[derive(std::fmt::Debug)]
pub struct DeregisterStreamConsumer<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::deregister_stream_consumer_input::Builder,
}
impl<C, M, R> DeregisterStreamConsumer<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `DeregisterStreamConsumer`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::DeregisterStreamConsumerOutput,
aws_smithy_http::result::SdkError<crate::error::DeregisterStreamConsumerError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::DeregisterStreamConsumerInputOperationOutputAlias,
crate::output::DeregisterStreamConsumerOutput,
crate::error::DeregisterStreamConsumerError,
crate::input::DeregisterStreamConsumerInputOperationRetryAlias,
>,
{
let input = self.inner.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
let op = input
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The ARN of the Kinesis data stream that the consumer is registered with. For more
/// information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-kinesis-streams">Amazon Resource Names (ARNs) and Amazon Web Services Service
/// Namespaces</a>.</p>
pub fn stream_arn(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.stream_arn(inp);
self
}
/// <p>The ARN of the Kinesis data stream that the consumer is registered with. For more
/// information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-kinesis-streams">Amazon Resource Names (ARNs) and Amazon Web Services Service
/// Namespaces</a>.</p>
pub fn set_stream_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_stream_arn(input);
self
}
/// <p>The name that you gave to the consumer.</p>
pub fn consumer_name(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.consumer_name(inp);
self
}
/// <p>The name that you gave to the consumer.</p>
pub fn set_consumer_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_consumer_name(input);
self
}
/// <p>The ARN returned by Kinesis Data Streams when you registered the consumer. If you
/// don't know the ARN of the consumer that you want to deregister, you can use the
/// ListStreamConsumers operation to get a list of the descriptions of all the consumers
/// that are currently registered with a given data stream. The description of a consumer
/// contains its ARN.</p>
pub fn consumer_arn(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.consumer_arn(inp);
self
}
/// <p>The ARN returned by Kinesis Data Streams when you registered the consumer. If you
/// don't know the ARN of the consumer that you want to deregister, you can use the
/// ListStreamConsumers operation to get a list of the descriptions of all the consumers
/// that are currently registered with a given data stream. The description of a consumer
/// contains its ARN.</p>
pub fn set_consumer_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_consumer_arn(input);
self
}
}
/// Fluent builder constructing a request to `DescribeLimits`.
///
/// <p>Describes the shard limits and usage for the account.</p>
/// <p>If you update your account limits, the old limits might be returned for a few
/// minutes.</p>
/// <p>This operation has a limit of one transaction per second per account.</p>
#[derive(std::fmt::Debug)]
pub struct DescribeLimits<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::describe_limits_input::Builder,
}
impl<C, M, R> DescribeLimits<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `DescribeLimits`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::DescribeLimitsOutput,
aws_smithy_http::result::SdkError<crate::error::DescribeLimitsError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::DescribeLimitsInputOperationOutputAlias,
crate::output::DescribeLimitsOutput,
crate::error::DescribeLimitsError,
crate::input::DescribeLimitsInputOperationRetryAlias,
>,
{
let input = self.inner.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
let op = input
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
}
/// Fluent builder constructing a request to `DescribeStream`.
///
/// <p>Describes the specified Kinesis data stream.</p>
/// <note>
/// <p>This API has been revised. It's highly recommended that you use the <a>DescribeStreamSummary</a> API to get a summarized description of the
/// specified Kinesis data stream and the <a>ListShards</a> API to list the
/// shards in a specified data stream and obtain information about each shard. </p>
/// </note>
/// <p>The information returned includes the stream name, Amazon Resource Name (ARN),
/// creation time, enhanced metric configuration, and shard map. The shard map is an array
/// of shard objects. For each shard object, there is the hash key and sequence number
/// ranges that the shard spans, and the IDs of any earlier shards that played in a role in
/// creating the shard. Every record ingested in the stream is identified by a sequence
/// number, which is assigned when the record is put into the stream.</p>
///
/// <p>You can limit the number of shards returned by each call. For more information, see
/// <a href="https://docs.aws.amazon.com/kinesis/latest/dev/kinesis-using-sdk-java-retrieve-shards.html">Retrieving
/// Shards from a Stream</a> in the <i>Amazon Kinesis Data Streams Developer
/// Guide</i>.</p>
/// <p>There are no guarantees about the chronological order shards returned. To process
/// shards in chronological order, use the ID of the parent shard to track the lineage to
/// the oldest shard.</p>
/// <p>This operation has a limit of 10 transactions per second per account.</p>
#[derive(std::fmt::Debug)]
pub struct DescribeStream<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::describe_stream_input::Builder,
}
impl<C, M, R> DescribeStream<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `DescribeStream`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::DescribeStreamOutput,
aws_smithy_http::result::SdkError<crate::error::DescribeStreamError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::DescribeStreamInputOperationOutputAlias,
crate::output::DescribeStreamOutput,
crate::error::DescribeStreamError,
crate::input::DescribeStreamInputOperationRetryAlias,
>,
{
let input = self.inner.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
let op = input
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The name of the stream to describe.</p>
pub fn stream_name(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.stream_name(inp);
self
}
/// <p>The name of the stream to describe.</p>
pub fn set_stream_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_stream_name(input);
self
}
/// <p>The maximum number of shards to return in a single call. The default value is 100. If
/// you specify a value greater than 100, at most 100 results are returned.</p>
pub fn limit(mut self, inp: i32) -> Self {
self.inner = self.inner.limit(inp);
self
}
/// <p>The maximum number of shards to return in a single call. The default value is 100. If
/// you specify a value greater than 100, at most 100 results are returned.</p>
pub fn set_limit(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_limit(input);
self
}
/// <p>The shard ID of the shard to start with.</p>
/// <p>Specify this parameter to indicate that you want to describe the stream starting with
/// the shard whose ID immediately follows <code>ExclusiveStartShardId</code>.</p>
/// <p>If you don't specify this parameter, the default behavior for
/// <code>DescribeStream</code> is to describe the stream starting with the first shard
/// in the stream.</p>
pub fn exclusive_start_shard_id(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.exclusive_start_shard_id(inp);
self
}
/// <p>The shard ID of the shard to start with.</p>
/// <p>Specify this parameter to indicate that you want to describe the stream starting with
/// the shard whose ID immediately follows <code>ExclusiveStartShardId</code>.</p>
/// <p>If you don't specify this parameter, the default behavior for
/// <code>DescribeStream</code> is to describe the stream starting with the first shard
/// in the stream.</p>
pub fn set_exclusive_start_shard_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_exclusive_start_shard_id(input);
self
}
}
/// Fluent builder constructing a request to `DescribeStreamConsumer`.
///
/// <p>To get the description of a registered consumer, provide the ARN of the consumer.
/// Alternatively, you can provide the ARN of the data stream and the name you gave the
/// consumer when you registered it. You may also provide all three parameters, as long as
/// they don't conflict with each other. If you don't know the name or ARN of the consumer
/// that you want to describe, you can use the <a>ListStreamConsumers</a>
/// operation to get a list of the descriptions of all the consumers that are currently
/// registered with a given data stream.</p>
/// <p>This operation has a limit of 20 transactions per second per stream.</p>
#[derive(std::fmt::Debug)]
pub struct DescribeStreamConsumer<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::describe_stream_consumer_input::Builder,
}
impl<C, M, R> DescribeStreamConsumer<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `DescribeStreamConsumer`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::DescribeStreamConsumerOutput,
aws_smithy_http::result::SdkError<crate::error::DescribeStreamConsumerError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::DescribeStreamConsumerInputOperationOutputAlias,
crate::output::DescribeStreamConsumerOutput,
crate::error::DescribeStreamConsumerError,
crate::input::DescribeStreamConsumerInputOperationRetryAlias,
>,
{
let input = self.inner.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
let op = input
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The ARN of the Kinesis data stream that the consumer is registered with. For more
/// information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-kinesis-streams">Amazon Resource Names (ARNs) and Amazon Web Services Service
/// Namespaces</a>.</p>
pub fn stream_arn(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.stream_arn(inp);
self
}
/// <p>The ARN of the Kinesis data stream that the consumer is registered with. For more
/// information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-kinesis-streams">Amazon Resource Names (ARNs) and Amazon Web Services Service
/// Namespaces</a>.</p>
pub fn set_stream_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_stream_arn(input);
self
}
/// <p>The name that you gave to the consumer.</p>
pub fn consumer_name(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.consumer_name(inp);
self
}
/// <p>The name that you gave to the consumer.</p>
pub fn set_consumer_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_consumer_name(input);
self
}
/// <p>The ARN returned by Kinesis Data Streams when you registered the consumer.</p>
pub fn consumer_arn(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.consumer_arn(inp);
self
}
/// <p>The ARN returned by Kinesis Data Streams when you registered the consumer.</p>
pub fn set_consumer_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_consumer_arn(input);
self
}
}
/// Fluent builder constructing a request to `DescribeStreamSummary`.
///
/// <p>Provides a summarized description of the specified Kinesis data stream without the
/// shard list.</p>
/// <p>The information returned includes the stream name, Amazon Resource Name (ARN), status,
/// record retention period, approximate creation time, monitoring, encryption details, and
/// open shard count. </p>
/// <p>
/// <a>DescribeStreamSummary</a> has a limit of 20 transactions per second per
/// account.</p>
#[derive(std::fmt::Debug)]
pub struct DescribeStreamSummary<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::describe_stream_summary_input::Builder,
}
impl<C, M, R> DescribeStreamSummary<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `DescribeStreamSummary`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::DescribeStreamSummaryOutput,
aws_smithy_http::result::SdkError<crate::error::DescribeStreamSummaryError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::DescribeStreamSummaryInputOperationOutputAlias,
crate::output::DescribeStreamSummaryOutput,
crate::error::DescribeStreamSummaryError,
crate::input::DescribeStreamSummaryInputOperationRetryAlias,
>,
{
let input = self.inner.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
let op = input
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The name of the stream to describe.</p>
pub fn stream_name(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.stream_name(inp);
self
}
/// <p>The name of the stream to describe.</p>
pub fn set_stream_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_stream_name(input);
self
}
}
/// Fluent builder constructing a request to `DisableEnhancedMonitoring`.
///
/// <p>Disables enhanced monitoring.</p>
#[derive(std::fmt::Debug)]
pub struct DisableEnhancedMonitoring<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::disable_enhanced_monitoring_input::Builder,
}
impl<C, M, R> DisableEnhancedMonitoring<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `DisableEnhancedMonitoring`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::DisableEnhancedMonitoringOutput,
aws_smithy_http::result::SdkError<crate::error::DisableEnhancedMonitoringError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::DisableEnhancedMonitoringInputOperationOutputAlias,
crate::output::DisableEnhancedMonitoringOutput,
crate::error::DisableEnhancedMonitoringError,
crate::input::DisableEnhancedMonitoringInputOperationRetryAlias,
>,
{
let input = self.inner.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
let op = input
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The name of the Kinesis data stream for which to disable enhanced monitoring.</p>
pub fn stream_name(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.stream_name(inp);
self
}
/// <p>The name of the Kinesis data stream for which to disable enhanced monitoring.</p>
pub fn set_stream_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_stream_name(input);
self
}
/// Appends an item to `ShardLevelMetrics`.
///
/// To override the contents of this collection use [`set_shard_level_metrics`](Self::set_shard_level_metrics).
///
/// <p>List of shard-level metrics to disable.</p>
/// <p>The following are the valid shard-level metrics. The value "<code>ALL</code>" disables
/// every metric.</p>
/// <ul>
/// <li>
/// <p>
/// <code>IncomingBytes</code>
/// </p>
/// </li>
/// <li>
/// <p>
/// <code>IncomingRecords</code>
/// </p>
/// </li>
/// <li>
/// <p>
/// <code>OutgoingBytes</code>
/// </p>
/// </li>
/// <li>
/// <p>
/// <code>OutgoingRecords</code>
/// </p>
/// </li>
/// <li>
/// <p>
/// <code>WriteProvisionedThroughputExceeded</code>
/// </p>
/// </li>
/// <li>
/// <p>
/// <code>ReadProvisionedThroughputExceeded</code>
/// </p>
/// </li>
/// <li>
/// <p>
/// <code>IteratorAgeMilliseconds</code>
/// </p>
/// </li>
/// <li>
/// <p>
/// <code>ALL</code>
/// </p>
/// </li>
/// </ul>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/kinesis/latest/dev/monitoring-with-cloudwatch.html">Monitoring the Amazon
/// Kinesis Data Streams Service with Amazon CloudWatch</a> in the <i>Amazon
/// Kinesis Data Streams Developer Guide</i>.</p>
pub fn shard_level_metrics(mut self, inp: impl Into<crate::model::MetricsName>) -> Self {
self.inner = self.inner.shard_level_metrics(inp);
self
}
/// <p>List of shard-level metrics to disable.</p>
/// <p>The following are the valid shard-level metrics. The value "<code>ALL</code>" disables
/// every metric.</p>
/// <ul>
/// <li>
/// <p>
/// <code>IncomingBytes</code>
/// </p>
/// </li>
/// <li>
/// <p>
/// <code>IncomingRecords</code>
/// </p>
/// </li>
/// <li>
/// <p>
/// <code>OutgoingBytes</code>
/// </p>
/// </li>
/// <li>
/// <p>
/// <code>OutgoingRecords</code>
/// </p>
/// </li>
/// <li>
/// <p>
/// <code>WriteProvisionedThroughputExceeded</code>
/// </p>
/// </li>
/// <li>
/// <p>
/// <code>ReadProvisionedThroughputExceeded</code>
/// </p>
/// </li>
/// <li>
/// <p>
/// <code>IteratorAgeMilliseconds</code>
/// </p>
/// </li>
/// <li>
/// <p>
/// <code>ALL</code>
/// </p>
/// </li>
/// </ul>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/kinesis/latest/dev/monitoring-with-cloudwatch.html">Monitoring the Amazon
/// Kinesis Data Streams Service with Amazon CloudWatch</a> in the <i>Amazon
/// Kinesis Data Streams Developer Guide</i>.</p>
pub fn set_shard_level_metrics(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::MetricsName>>,
) -> Self {
self.inner = self.inner.set_shard_level_metrics(input);
self
}
}
/// Fluent builder constructing a request to `EnableEnhancedMonitoring`.
///
/// <p>Enables enhanced Kinesis data stream monitoring for shard-level metrics.</p>
#[derive(std::fmt::Debug)]
pub struct EnableEnhancedMonitoring<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::enable_enhanced_monitoring_input::Builder,
}
impl<C, M, R> EnableEnhancedMonitoring<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `EnableEnhancedMonitoring`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::EnableEnhancedMonitoringOutput,
aws_smithy_http::result::SdkError<crate::error::EnableEnhancedMonitoringError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::EnableEnhancedMonitoringInputOperationOutputAlias,
crate::output::EnableEnhancedMonitoringOutput,
crate::error::EnableEnhancedMonitoringError,
crate::input::EnableEnhancedMonitoringInputOperationRetryAlias,
>,
{
let input = self.inner.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
let op = input
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The name of the stream for which to enable enhanced monitoring.</p>
pub fn stream_name(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.stream_name(inp);
self
}
/// <p>The name of the stream for which to enable enhanced monitoring.</p>
pub fn set_stream_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_stream_name(input);
self
}
/// Appends an item to `ShardLevelMetrics`.
///
/// To override the contents of this collection use [`set_shard_level_metrics`](Self::set_shard_level_metrics).
///
/// <p>List of shard-level metrics to enable.</p>
/// <p>The following are the valid shard-level metrics. The value "<code>ALL</code>" enables
/// every metric.</p>
/// <ul>
/// <li>
/// <p>
/// <code>IncomingBytes</code>
/// </p>
/// </li>
/// <li>
/// <p>
/// <code>IncomingRecords</code>
/// </p>
/// </li>
/// <li>
/// <p>
/// <code>OutgoingBytes</code>
/// </p>
/// </li>
/// <li>
/// <p>
/// <code>OutgoingRecords</code>
/// </p>
/// </li>
/// <li>
/// <p>
/// <code>WriteProvisionedThroughputExceeded</code>
/// </p>
/// </li>
/// <li>
/// <p>
/// <code>ReadProvisionedThroughputExceeded</code>
/// </p>
/// </li>
/// <li>
/// <p>
/// <code>IteratorAgeMilliseconds</code>
/// </p>
/// </li>
/// <li>
/// <p>
/// <code>ALL</code>
/// </p>
/// </li>
/// </ul>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/kinesis/latest/dev/monitoring-with-cloudwatch.html">Monitoring the Amazon
/// Kinesis Data Streams Service with Amazon CloudWatch</a> in the <i>Amazon
/// Kinesis Data Streams Developer Guide</i>.</p>
pub fn shard_level_metrics(mut self, inp: impl Into<crate::model::MetricsName>) -> Self {
self.inner = self.inner.shard_level_metrics(inp);
self
}
/// <p>List of shard-level metrics to enable.</p>
/// <p>The following are the valid shard-level metrics. The value "<code>ALL</code>" enables
/// every metric.</p>
/// <ul>
/// <li>
/// <p>
/// <code>IncomingBytes</code>
/// </p>
/// </li>
/// <li>
/// <p>
/// <code>IncomingRecords</code>
/// </p>
/// </li>
/// <li>
/// <p>
/// <code>OutgoingBytes</code>
/// </p>
/// </li>
/// <li>
/// <p>
/// <code>OutgoingRecords</code>
/// </p>
/// </li>
/// <li>
/// <p>
/// <code>WriteProvisionedThroughputExceeded</code>
/// </p>
/// </li>
/// <li>
/// <p>
/// <code>ReadProvisionedThroughputExceeded</code>
/// </p>
/// </li>
/// <li>
/// <p>
/// <code>IteratorAgeMilliseconds</code>
/// </p>
/// </li>
/// <li>
/// <p>
/// <code>ALL</code>
/// </p>
/// </li>
/// </ul>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/kinesis/latest/dev/monitoring-with-cloudwatch.html">Monitoring the Amazon
/// Kinesis Data Streams Service with Amazon CloudWatch</a> in the <i>Amazon
/// Kinesis Data Streams Developer Guide</i>.</p>
pub fn set_shard_level_metrics(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::MetricsName>>,
) -> Self {
self.inner = self.inner.set_shard_level_metrics(input);
self
}
}
/// Fluent builder constructing a request to `GetRecords`.
///
/// <p>Gets data records from a Kinesis data stream's shard.</p>
/// <p>Specify a shard iterator using the <code>ShardIterator</code> parameter. The shard
/// iterator specifies the position in the shard from which you want to start reading data
/// records sequentially. If there are no records available in the portion of the shard that
/// the iterator points to, <a>GetRecords</a> returns an empty list. It might
/// take multiple calls to get to a portion of the shard that contains records.</p>
/// <p>You can scale by provisioning multiple shards per stream while considering service
/// limits (for more information, see <a href="https://docs.aws.amazon.com/kinesis/latest/dev/service-sizes-and-limits.html">Amazon Kinesis Data Streams
/// Limits</a> in the <i>Amazon Kinesis Data Streams Developer
/// Guide</i>). Your application should have one thread per shard, each reading
/// continuously from its stream. To read from a stream continually, call <a>GetRecords</a> in a loop. Use <a>GetShardIterator</a> to get the
/// shard iterator to specify in the first <a>GetRecords</a> call. <a>GetRecords</a> returns a new shard iterator in
/// <code>NextShardIterator</code>. Specify the shard iterator returned in
/// <code>NextShardIterator</code> in subsequent calls to <a>GetRecords</a>.
/// If the shard has been closed, the shard iterator can't return more data and <a>GetRecords</a> returns <code>null</code> in <code>NextShardIterator</code>.
/// You can terminate the loop when the shard is closed, or when the shard iterator reaches
/// the record with the sequence number or other attribute that marks it as the last record
/// to process.</p>
/// <p>Each data record can be up to 1 MiB in size, and each shard can read up to 2 MiB per
/// second. You can ensure that your calls don't exceed the maximum supported size or
/// throughput by using the <code>Limit</code> parameter to specify the maximum number of
/// records that <a>GetRecords</a> can return. Consider your average record size
/// when determining this limit. The maximum number of records that can be returned per call
/// is 10,000.</p>
///
/// <p>The size of the data returned by <a>GetRecords</a> varies depending on the
/// utilization of the shard. It is recommended that consumer applications retrieve records
/// via the <code>GetRecords</code> command using the 5 TPS limit to remain caught up.
/// Retrieving records less frequently can lead to consumer applications falling behind. The
/// maximum size of data that <a>GetRecords</a> can return is 10 MiB. If a call
/// returns this amount of data, subsequent calls made within the next 5 seconds throw
/// <code>ProvisionedThroughputExceededException</code>. If there is insufficient
/// provisioned throughput on the stream, subsequent calls made within the next 1 second
/// throw <code>ProvisionedThroughputExceededException</code>. <a>GetRecords</a>
/// doesn't return any data when it throws an exception. For this reason, we recommend that
/// you wait 1 second between calls to <a>GetRecords</a>. However, it's possible
/// that the application will get exceptions for longer than 1 second.</p>
///
///
///
///
///
///
///
///
/// <p>To detect whether the application is falling behind in processing, you can use the
/// <code>MillisBehindLatest</code> response attribute. You can also monitor the stream
/// using CloudWatch metrics and other mechanisms (see <a href="https://docs.aws.amazon.com/kinesis/latest/dev/monitoring.html">Monitoring</a> in the <i>Amazon
/// Kinesis Data Streams Developer Guide</i>).</p>
/// <p>Each Amazon Kinesis record includes a value, <code>ApproximateArrivalTimestamp</code>,
/// that is set when a stream successfully receives and stores a record. This is commonly
/// referred to as a server-side time stamp, whereas a client-side time stamp is set when a
/// data producer creates or sends the record to a stream (a data producer is any data
/// source putting data records into a stream, for example with <a>PutRecords</a>). The time stamp has millisecond precision. There are no guarantees about the time
/// stamp accuracy, or that the time stamp is always increasing. For example, records in a
/// shard or across a stream might have time stamps that are out of order.</p>
/// <p>This operation has a limit of five transactions per second per shard.</p>
#[derive(std::fmt::Debug)]
pub struct GetRecords<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::get_records_input::Builder,
}
impl<C, M, R> GetRecords<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `GetRecords`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::GetRecordsOutput,
aws_smithy_http::result::SdkError<crate::error::GetRecordsError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::GetRecordsInputOperationOutputAlias,
crate::output::GetRecordsOutput,
crate::error::GetRecordsError,
crate::input::GetRecordsInputOperationRetryAlias,
>,
{
let input = self.inner.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
let op = input
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The position in the shard from which you want to start sequentially reading data
/// records. A shard iterator specifies this position using the sequence number of a data
/// record in the shard.</p>
pub fn shard_iterator(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.shard_iterator(inp);
self
}
/// <p>The position in the shard from which you want to start sequentially reading data
/// records. A shard iterator specifies this position using the sequence number of a data
/// record in the shard.</p>
pub fn set_shard_iterator(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_shard_iterator(input);
self
}
/// <p>The maximum number of records to return. Specify a value of up to 10,000. If you
/// specify a value that is greater than 10,000, <a>GetRecords</a> throws
/// <code>InvalidArgumentException</code>. The default value is 10,000.</p>
pub fn limit(mut self, inp: i32) -> Self {
self.inner = self.inner.limit(inp);
self
}
/// <p>The maximum number of records to return. Specify a value of up to 10,000. If you
/// specify a value that is greater than 10,000, <a>GetRecords</a> throws
/// <code>InvalidArgumentException</code>. The default value is 10,000.</p>
pub fn set_limit(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_limit(input);
self
}
}
/// Fluent builder constructing a request to `GetShardIterator`.
///
/// <p>Gets an Amazon Kinesis shard iterator. A shard iterator expires 5 minutes after it is
/// returned to the requester.</p>
/// <p>A shard iterator specifies the shard position from which to start reading data records
/// sequentially. The position is specified using the sequence number of a data record in a
/// shard. A sequence number is the identifier associated with every record ingested in the
/// stream, and is assigned when a record is put into the stream. Each stream has one or
/// more shards.</p>
/// <p>You must specify the shard iterator type. For example, you can set the
/// <code>ShardIteratorType</code> parameter to read exactly from the position denoted
/// by a specific sequence number by using the <code>AT_SEQUENCE_NUMBER</code> shard
/// iterator type. Alternatively, the parameter can read right after the sequence number by
/// using the <code>AFTER_SEQUENCE_NUMBER</code> shard iterator type, using sequence numbers
/// returned by earlier calls to <a>PutRecord</a>, <a>PutRecords</a>,
/// <a>GetRecords</a>, or <a>DescribeStream</a>. In the request,
/// you can specify the shard iterator type <code>AT_TIMESTAMP</code> to read records from
/// an arbitrary point in time, <code>TRIM_HORIZON</code> to cause
/// <code>ShardIterator</code> to point to the last untrimmed record in the shard in the
/// system (the oldest data record in the shard), or <code>LATEST</code> so that you always
/// read the most recent data in the shard. </p>
/// <p>When you read repeatedly from a stream, use a <a>GetShardIterator</a>
/// request to get the first shard iterator for use in your first <a>GetRecords</a> request and for subsequent reads use the shard iterator returned by the <a>GetRecords</a> request in <code>NextShardIterator</code>. A new shard
/// iterator is returned by every <a>GetRecords</a> request in
/// <code>NextShardIterator</code>, which you use in the <code>ShardIterator</code>
/// parameter of the next <a>GetRecords</a> request. </p>
/// <p>If a <a>GetShardIterator</a> request is made too often, you receive a
/// <code>ProvisionedThroughputExceededException</code>. For more information about
/// throughput limits, see <a>GetRecords</a>, and <a href="https://docs.aws.amazon.com/kinesis/latest/dev/service-sizes-and-limits.html">Streams Limits</a> in the
/// <i>Amazon Kinesis Data Streams Developer Guide</i>.</p>
/// <p>If the shard is closed, <a>GetShardIterator</a> returns a valid iterator
/// for the last sequence number of the shard. A shard can be closed as a result of using
/// <a>SplitShard</a> or <a>MergeShards</a>.</p>
/// <p>
/// <a>GetShardIterator</a> has a limit of five transactions per second per
/// account per open shard.</p>
#[derive(std::fmt::Debug)]
pub struct GetShardIterator<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::get_shard_iterator_input::Builder,
}
impl<C, M, R> GetShardIterator<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `GetShardIterator`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::GetShardIteratorOutput,
aws_smithy_http::result::SdkError<crate::error::GetShardIteratorError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::GetShardIteratorInputOperationOutputAlias,
crate::output::GetShardIteratorOutput,
crate::error::GetShardIteratorError,
crate::input::GetShardIteratorInputOperationRetryAlias,
>,
{
let input = self.inner.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
let op = input
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The name of the Amazon Kinesis data stream.</p>
pub fn stream_name(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.stream_name(inp);
self
}
/// <p>The name of the Amazon Kinesis data stream.</p>
pub fn set_stream_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_stream_name(input);
self
}
/// <p>The shard ID of the Kinesis Data Streams shard to get the iterator for.</p>
pub fn shard_id(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.shard_id(inp);
self
}
/// <p>The shard ID of the Kinesis Data Streams shard to get the iterator for.</p>
pub fn set_shard_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_shard_id(input);
self
}
/// <p>Determines how the shard iterator is used to start reading data records from the
/// shard.</p>
/// <p>The following are the valid Amazon Kinesis shard iterator types:</p>
/// <ul>
/// <li>
///
/// <p>AT_SEQUENCE_NUMBER - Start reading from the position denoted by a specific
/// sequence number, provided in the value
/// <code>StartingSequenceNumber</code>.</p>
/// </li>
/// <li>
///
/// <p>AFTER_SEQUENCE_NUMBER - Start reading right after the position denoted by a
/// specific sequence number, provided in the value
/// <code>StartingSequenceNumber</code>.</p>
/// </li>
/// <li>
///
/// <p>AT_TIMESTAMP - Start reading from the position denoted by a specific time
/// stamp, provided in the value <code>Timestamp</code>.</p>
/// </li>
/// <li>
///
/// <p>TRIM_HORIZON - Start reading at the last untrimmed record in the shard in the
/// system, which is the oldest data record in the shard.</p>
/// </li>
/// <li>
///
/// <p>LATEST - Start reading just after the most recent record in the shard, so that
/// you always read the most recent data in the shard.</p>
/// </li>
/// </ul>
pub fn shard_iterator_type(mut self, inp: crate::model::ShardIteratorType) -> Self {
self.inner = self.inner.shard_iterator_type(inp);
self
}
/// <p>Determines how the shard iterator is used to start reading data records from the
/// shard.</p>
/// <p>The following are the valid Amazon Kinesis shard iterator types:</p>
/// <ul>
/// <li>
///
/// <p>AT_SEQUENCE_NUMBER - Start reading from the position denoted by a specific
/// sequence number, provided in the value
/// <code>StartingSequenceNumber</code>.</p>
/// </li>
/// <li>
///
/// <p>AFTER_SEQUENCE_NUMBER - Start reading right after the position denoted by a
/// specific sequence number, provided in the value
/// <code>StartingSequenceNumber</code>.</p>
/// </li>
/// <li>
///
/// <p>AT_TIMESTAMP - Start reading from the position denoted by a specific time
/// stamp, provided in the value <code>Timestamp</code>.</p>
/// </li>
/// <li>
///
/// <p>TRIM_HORIZON - Start reading at the last untrimmed record in the shard in the
/// system, which is the oldest data record in the shard.</p>
/// </li>
/// <li>
///
/// <p>LATEST - Start reading just after the most recent record in the shard, so that
/// you always read the most recent data in the shard.</p>
/// </li>
/// </ul>
pub fn set_shard_iterator_type(
mut self,
input: std::option::Option<crate::model::ShardIteratorType>,
) -> Self {
self.inner = self.inner.set_shard_iterator_type(input);
self
}
/// <p>The sequence number of the data record in the shard from which to start reading. Used
/// with shard iterator type AT_SEQUENCE_NUMBER and AFTER_SEQUENCE_NUMBER.</p>
pub fn starting_sequence_number(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.starting_sequence_number(inp);
self
}
/// <p>The sequence number of the data record in the shard from which to start reading. Used
/// with shard iterator type AT_SEQUENCE_NUMBER and AFTER_SEQUENCE_NUMBER.</p>
pub fn set_starting_sequence_number(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_starting_sequence_number(input);
self
}
/// <p>The time stamp of the data record from which to start reading. Used with shard
/// iterator type AT_TIMESTAMP. A time stamp is the Unix epoch date with precision in
/// milliseconds. For example, <code>2016-04-04T19:58:46.480-00:00</code> or
/// <code>1459799926.480</code>. If a record with this exact time stamp does not exist,
/// the iterator returned is for the next (later) record. If the time stamp is older than
/// the current trim horizon, the iterator returned is for the oldest untrimmed data record
/// (TRIM_HORIZON).</p>
pub fn timestamp(mut self, inp: aws_smithy_types::DateTime) -> Self {
self.inner = self.inner.timestamp(inp);
self
}
/// <p>The time stamp of the data record from which to start reading. Used with shard
/// iterator type AT_TIMESTAMP. A time stamp is the Unix epoch date with precision in
/// milliseconds. For example, <code>2016-04-04T19:58:46.480-00:00</code> or
/// <code>1459799926.480</code>. If a record with this exact time stamp does not exist,
/// the iterator returned is for the next (later) record. If the time stamp is older than
/// the current trim horizon, the iterator returned is for the oldest untrimmed data record
/// (TRIM_HORIZON).</p>
pub fn set_timestamp(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.inner = self.inner.set_timestamp(input);
self
}
}
/// Fluent builder constructing a request to `IncreaseStreamRetentionPeriod`.
///
/// <p>Increases the Kinesis data stream's retention period, which is the length of time data
/// records are accessible after they are added to the stream. The maximum value of a
/// stream's retention period is 8760 hours (365 days).</p>
/// <p>If you choose a longer stream retention period, this operation increases the time
/// period during which records that have not yet expired are accessible. However, it does
/// not make previous, expired data (older than the stream's previous retention period)
/// accessible after the operation has been called. For example, if a stream's retention
/// period is set to 24 hours and is increased to 168 hours, any data that is older than 24
/// hours remains inaccessible to consumer applications.</p>
#[derive(std::fmt::Debug)]
pub struct IncreaseStreamRetentionPeriod<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::increase_stream_retention_period_input::Builder,
}
impl<C, M, R> IncreaseStreamRetentionPeriod<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `IncreaseStreamRetentionPeriod`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::IncreaseStreamRetentionPeriodOutput,
aws_smithy_http::result::SdkError<crate::error::IncreaseStreamRetentionPeriodError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::IncreaseStreamRetentionPeriodInputOperationOutputAlias,
crate::output::IncreaseStreamRetentionPeriodOutput,
crate::error::IncreaseStreamRetentionPeriodError,
crate::input::IncreaseStreamRetentionPeriodInputOperationRetryAlias,
>,
{
let input = self.inner.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
let op = input
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The name of the stream to modify.</p>
pub fn stream_name(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.stream_name(inp);
self
}
/// <p>The name of the stream to modify.</p>
pub fn set_stream_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_stream_name(input);
self
}
/// <p>The new retention period of the stream, in hours. Must be more than the current
/// retention period.</p>
pub fn retention_period_hours(mut self, inp: i32) -> Self {
self.inner = self.inner.retention_period_hours(inp);
self
}
/// <p>The new retention period of the stream, in hours. Must be more than the current
/// retention period.</p>
pub fn set_retention_period_hours(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_retention_period_hours(input);
self
}
}
/// Fluent builder constructing a request to `ListShards`.
///
/// <p>Lists the shards in a stream and provides information about each shard. This operation
/// has a limit of 1000 transactions per second per data stream.</p>
/// <p>This action does not list expired shards. For information about expired shards, see
/// <a href="https://docs.aws.amazon.com/streams/latest/dev/kinesis-using-sdk-java-after-resharding.html#kinesis-using-sdk-java-resharding-data-routing">Data Routing, Data Persistence, and Shard State after a Reshard</a>. </p>
/// <important>
/// <p>This API is a new operation that is used by the Amazon Kinesis Client Library
/// (KCL). If you have a fine-grained IAM policy that only allows specific operations,
/// you must update your policy to allow calls to this API. For more information, see
/// <a href="https://docs.aws.amazon.com/streams/latest/dev/controlling-access.html">Controlling Access to Amazon Kinesis Data Streams Resources Using
/// IAM</a>.</p>
/// </important>
#[derive(std::fmt::Debug)]
pub struct ListShards<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::list_shards_input::Builder,
}
impl<C, M, R> ListShards<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `ListShards`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::ListShardsOutput,
aws_smithy_http::result::SdkError<crate::error::ListShardsError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::ListShardsInputOperationOutputAlias,
crate::output::ListShardsOutput,
crate::error::ListShardsError,
crate::input::ListShardsInputOperationRetryAlias,
>,
{
let input = self.inner.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
let op = input
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The name of the data stream whose shards you want to list. </p>
/// <p>You cannot specify this parameter if you specify the <code>NextToken</code>
/// parameter.</p>
pub fn stream_name(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.stream_name(inp);
self
}
/// <p>The name of the data stream whose shards you want to list. </p>
/// <p>You cannot specify this parameter if you specify the <code>NextToken</code>
/// parameter.</p>
pub fn set_stream_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_stream_name(input);
self
}
/// <p>When the number of shards in the data stream is greater than the default value for the
/// <code>MaxResults</code> parameter, or if you explicitly specify a value for
/// <code>MaxResults</code> that is less than the number of shards in the data stream,
/// the response includes a pagination token named <code>NextToken</code>. You can specify
/// this <code>NextToken</code> value in a subsequent call to <code>ListShards</code> to
/// list the next set of shards.</p>
/// <p>Don't specify <code>StreamName</code> or <code>StreamCreationTimestamp</code> if you
/// specify <code>NextToken</code> because the latter unambiguously identifies the
/// stream.</p>
/// <p>You can optionally specify a value for the <code>MaxResults</code> parameter when you
/// specify <code>NextToken</code>. If you specify a <code>MaxResults</code> value that is
/// less than the number of shards that the operation returns if you don't specify
/// <code>MaxResults</code>, the response will contain a new <code>NextToken</code>
/// value. You can use the new <code>NextToken</code> value in a subsequent call to the
/// <code>ListShards</code> operation.</p>
/// <important>
/// <p>Tokens expire after 300 seconds. When you obtain a value for
/// <code>NextToken</code> in the response to a call to <code>ListShards</code>, you
/// have 300 seconds to use that value. If you specify an expired token in a call to
/// <code>ListShards</code>, you get <code>ExpiredNextTokenException</code>.</p>
/// </important>
pub fn next_token(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.next_token(inp);
self
}
/// <p>When the number of shards in the data stream is greater than the default value for the
/// <code>MaxResults</code> parameter, or if you explicitly specify a value for
/// <code>MaxResults</code> that is less than the number of shards in the data stream,
/// the response includes a pagination token named <code>NextToken</code>. You can specify
/// this <code>NextToken</code> value in a subsequent call to <code>ListShards</code> to
/// list the next set of shards.</p>
/// <p>Don't specify <code>StreamName</code> or <code>StreamCreationTimestamp</code> if you
/// specify <code>NextToken</code> because the latter unambiguously identifies the
/// stream.</p>
/// <p>You can optionally specify a value for the <code>MaxResults</code> parameter when you
/// specify <code>NextToken</code>. If you specify a <code>MaxResults</code> value that is
/// less than the number of shards that the operation returns if you don't specify
/// <code>MaxResults</code>, the response will contain a new <code>NextToken</code>
/// value. You can use the new <code>NextToken</code> value in a subsequent call to the
/// <code>ListShards</code> operation.</p>
/// <important>
/// <p>Tokens expire after 300 seconds. When you obtain a value for
/// <code>NextToken</code> in the response to a call to <code>ListShards</code>, you
/// have 300 seconds to use that value. If you specify an expired token in a call to
/// <code>ListShards</code>, you get <code>ExpiredNextTokenException</code>.</p>
/// </important>
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_next_token(input);
self
}
/// <p>Specify this parameter to indicate that you want to list the shards starting with the
/// shard whose ID immediately follows <code>ExclusiveStartShardId</code>.</p>
/// <p>If you don't specify this parameter, the default behavior is for
/// <code>ListShards</code> to list the shards starting with the first one in the
/// stream.</p>
/// <p>You cannot specify this parameter if you specify <code>NextToken</code>.</p>
pub fn exclusive_start_shard_id(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.exclusive_start_shard_id(inp);
self
}
/// <p>Specify this parameter to indicate that you want to list the shards starting with the
/// shard whose ID immediately follows <code>ExclusiveStartShardId</code>.</p>
/// <p>If you don't specify this parameter, the default behavior is for
/// <code>ListShards</code> to list the shards starting with the first one in the
/// stream.</p>
/// <p>You cannot specify this parameter if you specify <code>NextToken</code>.</p>
pub fn set_exclusive_start_shard_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_exclusive_start_shard_id(input);
self
}
/// <p>The maximum number of shards to return in a single call to <code>ListShards</code>.
/// The maximum number of shards to return in a single call. The default value is 1000. If
/// you specify a value greater than 1000, at most 1000 results are returned. </p>
/// <p>When the number of shards to be listed is greater than the value of
/// <code>MaxResults</code>, the response contains a <code>NextToken</code> value that
/// you can use in a subsequent call to <code>ListShards</code> to list the next set of
/// shards.</p>
pub fn max_results(mut self, inp: i32) -> Self {
self.inner = self.inner.max_results(inp);
self
}
/// <p>The maximum number of shards to return in a single call to <code>ListShards</code>.
/// The maximum number of shards to return in a single call. The default value is 1000. If
/// you specify a value greater than 1000, at most 1000 results are returned. </p>
/// <p>When the number of shards to be listed is greater than the value of
/// <code>MaxResults</code>, the response contains a <code>NextToken</code> value that
/// you can use in a subsequent call to <code>ListShards</code> to list the next set of
/// shards.</p>
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_max_results(input);
self
}
/// <p>Specify this input parameter to distinguish data streams that have the same name. For
/// example, if you create a data stream and then delete it, and you later create another
/// data stream with the same name, you can use this input parameter to specify which of the
/// two streams you want to list the shards for.</p>
/// <p>You cannot specify this parameter if you specify the <code>NextToken</code>
/// parameter.</p>
pub fn stream_creation_timestamp(mut self, inp: aws_smithy_types::DateTime) -> Self {
self.inner = self.inner.stream_creation_timestamp(inp);
self
}
/// <p>Specify this input parameter to distinguish data streams that have the same name. For
/// example, if you create a data stream and then delete it, and you later create another
/// data stream with the same name, you can use this input parameter to specify which of the
/// two streams you want to list the shards for.</p>
/// <p>You cannot specify this parameter if you specify the <code>NextToken</code>
/// parameter.</p>
pub fn set_stream_creation_timestamp(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.inner = self.inner.set_stream_creation_timestamp(input);
self
}
/// <p>Enables you to filter out the response of the <code>ListShards</code> API. You can
/// only specify one filter at a time. </p>
/// <p>If you use the <code>ShardFilter</code> parameter when invoking the ListShards API,
/// the <code>Type</code> is the required property and must be specified. If you specify the
/// <code>AT_TRIM_HORIZON</code>, <code>FROM_TRIM_HORIZON</code>, or
/// <code>AT_LATEST</code> types, you do not need to specify either the
/// <code>ShardId</code> or the <code>Timestamp</code> optional properties. </p>
/// <p>If you specify the <code>AFTER_SHARD_ID</code> type, you must also provide the value
/// for the optional <code>ShardId</code> property. The <code>ShardId</code> property is
/// identical in fuctionality to the <code>ExclusiveStartShardId</code> parameter of the
/// <code>ListShards</code> API. When <code>ShardId</code> property is specified, the
/// response includes the shards starting with the shard whose ID immediately follows the
/// <code>ShardId</code> that you provided. </p>
/// <p>If you specify the <code>AT_TIMESTAMP</code> or <code>FROM_TIMESTAMP_ID</code> type,
/// you must also provide the value for the optional <code>Timestamp</code> property. If you
/// specify the AT_TIMESTAMP type, then all shards that were open at the provided timestamp
/// are returned. If you specify the FROM_TIMESTAMP type, then all shards starting from the
/// provided timestamp to TIP are returned. </p>
pub fn shard_filter(mut self, inp: crate::model::ShardFilter) -> Self {
self.inner = self.inner.shard_filter(inp);
self
}
/// <p>Enables you to filter out the response of the <code>ListShards</code> API. You can
/// only specify one filter at a time. </p>
/// <p>If you use the <code>ShardFilter</code> parameter when invoking the ListShards API,
/// the <code>Type</code> is the required property and must be specified. If you specify the
/// <code>AT_TRIM_HORIZON</code>, <code>FROM_TRIM_HORIZON</code>, or
/// <code>AT_LATEST</code> types, you do not need to specify either the
/// <code>ShardId</code> or the <code>Timestamp</code> optional properties. </p>
/// <p>If you specify the <code>AFTER_SHARD_ID</code> type, you must also provide the value
/// for the optional <code>ShardId</code> property. The <code>ShardId</code> property is
/// identical in fuctionality to the <code>ExclusiveStartShardId</code> parameter of the
/// <code>ListShards</code> API. When <code>ShardId</code> property is specified, the
/// response includes the shards starting with the shard whose ID immediately follows the
/// <code>ShardId</code> that you provided. </p>
/// <p>If you specify the <code>AT_TIMESTAMP</code> or <code>FROM_TIMESTAMP_ID</code> type,
/// you must also provide the value for the optional <code>Timestamp</code> property. If you
/// specify the AT_TIMESTAMP type, then all shards that were open at the provided timestamp
/// are returned. If you specify the FROM_TIMESTAMP type, then all shards starting from the
/// provided timestamp to TIP are returned. </p>
pub fn set_shard_filter(
mut self,
input: std::option::Option<crate::model::ShardFilter>,
) -> Self {
self.inner = self.inner.set_shard_filter(input);
self
}
}
/// Fluent builder constructing a request to `ListStreamConsumers`.
///
/// <p>Lists the consumers registered to receive data from a stream using enhanced fan-out,
/// and provides information about each consumer.</p>
/// <p>This operation has a limit of 5 transactions per second per stream.</p>
#[derive(std::fmt::Debug)]
pub struct ListStreamConsumers<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::list_stream_consumers_input::Builder,
}
impl<C, M, R> ListStreamConsumers<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `ListStreamConsumers`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::ListStreamConsumersOutput,
aws_smithy_http::result::SdkError<crate::error::ListStreamConsumersError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::ListStreamConsumersInputOperationOutputAlias,
crate::output::ListStreamConsumersOutput,
crate::error::ListStreamConsumersError,
crate::input::ListStreamConsumersInputOperationRetryAlias,
>,
{
let input = self.inner.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
let op = input
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The ARN of the Kinesis data stream for which you want to list the registered
/// consumers. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-kinesis-streams">Amazon Resource Names (ARNs) and Amazon Web Services Service
/// Namespaces</a>.</p>
pub fn stream_arn(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.stream_arn(inp);
self
}
/// <p>The ARN of the Kinesis data stream for which you want to list the registered
/// consumers. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-kinesis-streams">Amazon Resource Names (ARNs) and Amazon Web Services Service
/// Namespaces</a>.</p>
pub fn set_stream_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_stream_arn(input);
self
}
/// <p>When the number of consumers that are registered with the data stream is greater than
/// the default value for the <code>MaxResults</code> parameter, or if you explicitly
/// specify a value for <code>MaxResults</code> that is less than the number of consumers
/// that are registered with the data stream, the response includes a pagination token named
/// <code>NextToken</code>. You can specify this <code>NextToken</code> value in a
/// subsequent call to <code>ListStreamConsumers</code> to list the next set of registered
/// consumers.</p>
/// <p>Don't specify <code>StreamName</code> or <code>StreamCreationTimestamp</code> if you
/// specify <code>NextToken</code> because the latter unambiguously identifies the
/// stream.</p>
/// <p>You can optionally specify a value for the <code>MaxResults</code> parameter when you
/// specify <code>NextToken</code>. If you specify a <code>MaxResults</code> value that is
/// less than the number of consumers that the operation returns if you don't specify
/// <code>MaxResults</code>, the response will contain a new <code>NextToken</code>
/// value. You can use the new <code>NextToken</code> value in a subsequent call to the
/// <code>ListStreamConsumers</code> operation to list the next set of consumers.</p>
/// <important>
/// <p>Tokens expire after 300 seconds. When you obtain a value for
/// <code>NextToken</code> in the response to a call to
/// <code>ListStreamConsumers</code>, you have 300 seconds to use that value. If you
/// specify an expired token in a call to <code>ListStreamConsumers</code>, you get
/// <code>ExpiredNextTokenException</code>.</p>
/// </important>
pub fn next_token(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.next_token(inp);
self
}
/// <p>When the number of consumers that are registered with the data stream is greater than
/// the default value for the <code>MaxResults</code> parameter, or if you explicitly
/// specify a value for <code>MaxResults</code> that is less than the number of consumers
/// that are registered with the data stream, the response includes a pagination token named
/// <code>NextToken</code>. You can specify this <code>NextToken</code> value in a
/// subsequent call to <code>ListStreamConsumers</code> to list the next set of registered
/// consumers.</p>
/// <p>Don't specify <code>StreamName</code> or <code>StreamCreationTimestamp</code> if you
/// specify <code>NextToken</code> because the latter unambiguously identifies the
/// stream.</p>
/// <p>You can optionally specify a value for the <code>MaxResults</code> parameter when you
/// specify <code>NextToken</code>. If you specify a <code>MaxResults</code> value that is
/// less than the number of consumers that the operation returns if you don't specify
/// <code>MaxResults</code>, the response will contain a new <code>NextToken</code>
/// value. You can use the new <code>NextToken</code> value in a subsequent call to the
/// <code>ListStreamConsumers</code> operation to list the next set of consumers.</p>
/// <important>
/// <p>Tokens expire after 300 seconds. When you obtain a value for
/// <code>NextToken</code> in the response to a call to
/// <code>ListStreamConsumers</code>, you have 300 seconds to use that value. If you
/// specify an expired token in a call to <code>ListStreamConsumers</code>, you get
/// <code>ExpiredNextTokenException</code>.</p>
/// </important>
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_next_token(input);
self
}
/// <p>The maximum number of consumers that you want a single call of
/// <code>ListStreamConsumers</code> to return. The default value is 100. If you specify
/// a value greater than 100, at most 100 results are returned. </p>
pub fn max_results(mut self, inp: i32) -> Self {
self.inner = self.inner.max_results(inp);
self
}
/// <p>The maximum number of consumers that you want a single call of
/// <code>ListStreamConsumers</code> to return. The default value is 100. If you specify
/// a value greater than 100, at most 100 results are returned. </p>
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_max_results(input);
self
}
/// <p>Specify this input parameter to distinguish data streams that have the same name. For
/// example, if you create a data stream and then delete it, and you later create another
/// data stream with the same name, you can use this input parameter to specify which of the
/// two streams you want to list the consumers for. </p>
/// <p>You can't specify this parameter if you specify the NextToken parameter. </p>
pub fn stream_creation_timestamp(mut self, inp: aws_smithy_types::DateTime) -> Self {
self.inner = self.inner.stream_creation_timestamp(inp);
self
}
/// <p>Specify this input parameter to distinguish data streams that have the same name. For
/// example, if you create a data stream and then delete it, and you later create another
/// data stream with the same name, you can use this input parameter to specify which of the
/// two streams you want to list the consumers for. </p>
/// <p>You can't specify this parameter if you specify the NextToken parameter. </p>
pub fn set_stream_creation_timestamp(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.inner = self.inner.set_stream_creation_timestamp(input);
self
}
}
/// Fluent builder constructing a request to `ListStreams`.
///
/// <p>Lists your Kinesis data streams.</p>
/// <p>The number of streams may be too large to return from a single call to
/// <code>ListStreams</code>. You can limit the number of returned streams using the
/// <code>Limit</code> parameter. If you do not specify a value for the
/// <code>Limit</code> parameter, Kinesis Data Streams uses the default limit, which is
/// currently 100.</p>
/// <p>You can detect if there are more streams available to list by using the
/// <code>HasMoreStreams</code> flag from the returned output. If there are more streams
/// available, you can request more streams by using the name of the last stream returned by
/// the <code>ListStreams</code> request in the <code>ExclusiveStartStreamName</code>
/// parameter in a subsequent request to <code>ListStreams</code>. The group of stream names
/// returned by the subsequent request is then added to the list. You can continue this
/// process until all the stream names have been collected in the list. </p>
/// <p>
/// <a>ListStreams</a> has a limit of five transactions per second per
/// account.</p>
#[derive(std::fmt::Debug)]
pub struct ListStreams<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::list_streams_input::Builder,
}
impl<C, M, R> ListStreams<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `ListStreams`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::ListStreamsOutput,
aws_smithy_http::result::SdkError<crate::error::ListStreamsError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::ListStreamsInputOperationOutputAlias,
crate::output::ListStreamsOutput,
crate::error::ListStreamsError,
crate::input::ListStreamsInputOperationRetryAlias,
>,
{
let input = self.inner.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
let op = input
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The maximum number of streams to list. The default value is 100. If you specify a
/// value greater than 100, at most 100 results are returned.</p>
pub fn limit(mut self, inp: i32) -> Self {
self.inner = self.inner.limit(inp);
self
}
/// <p>The maximum number of streams to list. The default value is 100. If you specify a
/// value greater than 100, at most 100 results are returned.</p>
pub fn set_limit(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_limit(input);
self
}
/// <p>The name of the stream to start the list with.</p>
pub fn exclusive_start_stream_name(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.exclusive_start_stream_name(inp);
self
}
/// <p>The name of the stream to start the list with.</p>
pub fn set_exclusive_start_stream_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_exclusive_start_stream_name(input);
self
}
}
/// Fluent builder constructing a request to `ListTagsForStream`.
///
/// <p>Lists the tags for the specified Kinesis data stream. This operation has a limit of
/// five transactions per second per account.</p>
#[derive(std::fmt::Debug)]
pub struct ListTagsForStream<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::list_tags_for_stream_input::Builder,
}
impl<C, M, R> ListTagsForStream<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `ListTagsForStream`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::ListTagsForStreamOutput,
aws_smithy_http::result::SdkError<crate::error::ListTagsForStreamError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::ListTagsForStreamInputOperationOutputAlias,
crate::output::ListTagsForStreamOutput,
crate::error::ListTagsForStreamError,
crate::input::ListTagsForStreamInputOperationRetryAlias,
>,
{
let input = self.inner.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
let op = input
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The name of the stream.</p>
pub fn stream_name(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.stream_name(inp);
self
}
/// <p>The name of the stream.</p>
pub fn set_stream_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_stream_name(input);
self
}
/// <p>The key to use as the starting point for the list of tags. If this parameter is set,
/// <code>ListTagsForStream</code> gets all tags that occur after
/// <code>ExclusiveStartTagKey</code>. </p>
pub fn exclusive_start_tag_key(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.exclusive_start_tag_key(inp);
self
}
/// <p>The key to use as the starting point for the list of tags. If this parameter is set,
/// <code>ListTagsForStream</code> gets all tags that occur after
/// <code>ExclusiveStartTagKey</code>. </p>
pub fn set_exclusive_start_tag_key(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_exclusive_start_tag_key(input);
self
}
/// <p>The number of tags to return. If this number is less than the total number of tags
/// associated with the stream, <code>HasMoreTags</code> is set to <code>true</code>. To
/// list additional tags, set <code>ExclusiveStartTagKey</code> to the last key in the
/// response.</p>
pub fn limit(mut self, inp: i32) -> Self {
self.inner = self.inner.limit(inp);
self
}
/// <p>The number of tags to return. If this number is less than the total number of tags
/// associated with the stream, <code>HasMoreTags</code> is set to <code>true</code>. To
/// list additional tags, set <code>ExclusiveStartTagKey</code> to the last key in the
/// response.</p>
pub fn set_limit(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_limit(input);
self
}
}
/// Fluent builder constructing a request to `MergeShards`.
///
/// <p>Merges two adjacent shards in a Kinesis data stream and combines them into a single
/// shard to reduce the stream's capacity to ingest and transport data. Two shards are
/// considered adjacent if the union of the hash key ranges for the two shards form a
/// contiguous set with no gaps. For example, if you have two shards, one with a hash key
/// range of 276...381 and the other with a hash key range of 382...454, then you could
/// merge these two shards into a single shard that would have a hash key range of
/// 276...454. After the merge, the single child shard receives data for all hash key values
/// covered by the two parent shards.</p>
/// <p>
/// <code>MergeShards</code> is called when there is a need to reduce the overall capacity
/// of a stream because of excess capacity that is not being used. You must specify the
/// shard to be merged and the adjacent shard for a stream. For more information about
/// merging shards, see <a href="https://docs.aws.amazon.com/kinesis/latest/dev/kinesis-using-sdk-java-resharding-merge.html">Merge Two
/// Shards</a> in the <i>Amazon Kinesis Data Streams Developer
/// Guide</i>.</p>
/// <p>If the stream is in the <code>ACTIVE</code> state, you can call
/// <code>MergeShards</code>. If a stream is in the <code>CREATING</code>,
/// <code>UPDATING</code>, or <code>DELETING</code> state, <code>MergeShards</code>
/// returns a <code>ResourceInUseException</code>. If the specified stream does not exist,
/// <code>MergeShards</code> returns a <code>ResourceNotFoundException</code>. </p>
/// <p>You can use <a>DescribeStreamSummary</a> to check the state of the stream,
/// which is returned in <code>StreamStatus</code>.</p>
/// <p>
/// <code>MergeShards</code> is an asynchronous operation. Upon receiving a
/// <code>MergeShards</code> request, Amazon Kinesis Data Streams immediately returns a
/// response and sets the <code>StreamStatus</code> to <code>UPDATING</code>. After the
/// operation is completed, Kinesis Data Streams sets the <code>StreamStatus</code> to
/// <code>ACTIVE</code>. Read and write operations continue to work while the stream is
/// in the <code>UPDATING</code> state. </p>
/// <p>You use <a>DescribeStreamSummary</a> and the <a>ListShards</a>
/// APIs to determine the shard IDs that are specified in the <code>MergeShards</code>
/// request. </p>
/// <p>If you try to operate on too many streams in parallel using <a>CreateStream</a>, <a>DeleteStream</a>, <code>MergeShards</code>,
/// or <a>SplitShard</a>, you receive a <code>LimitExceededException</code>. </p>
/// <p>
/// <code>MergeShards</code> has a limit of five transactions per second per account.</p>
#[derive(std::fmt::Debug)]
pub struct MergeShards<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::merge_shards_input::Builder,
}
impl<C, M, R> MergeShards<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `MergeShards`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::MergeShardsOutput,
aws_smithy_http::result::SdkError<crate::error::MergeShardsError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::MergeShardsInputOperationOutputAlias,
crate::output::MergeShardsOutput,
crate::error::MergeShardsError,
crate::input::MergeShardsInputOperationRetryAlias,
>,
{
let input = self.inner.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
let op = input
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The name of the stream for the merge.</p>
pub fn stream_name(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.stream_name(inp);
self
}
/// <p>The name of the stream for the merge.</p>
pub fn set_stream_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_stream_name(input);
self
}
/// <p>The shard ID of the shard to combine with the adjacent shard for the merge.</p>
pub fn shard_to_merge(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.shard_to_merge(inp);
self
}
/// <p>The shard ID of the shard to combine with the adjacent shard for the merge.</p>
pub fn set_shard_to_merge(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_shard_to_merge(input);
self
}
/// <p>The shard ID of the adjacent shard for the merge.</p>
pub fn adjacent_shard_to_merge(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.adjacent_shard_to_merge(inp);
self
}
/// <p>The shard ID of the adjacent shard for the merge.</p>
pub fn set_adjacent_shard_to_merge(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_adjacent_shard_to_merge(input);
self
}
}
/// Fluent builder constructing a request to `PutRecord`.
///
/// <p>Writes a single data record into an Amazon Kinesis data stream. Call
/// <code>PutRecord</code> to send data into the stream for real-time ingestion and
/// subsequent processing, one record at a time. Each shard can support writes up to 1,000
/// records per second, up to a maximum data write total of 1 MiB per second.</p>
/// <p>You must specify the name of the stream that captures, stores, and transports the
/// data; a partition key; and the data blob itself.</p>
/// <p>The data blob can be any type of data; for example, a segment from a log file,
/// geographic/location data, website clickstream data, and so on.</p>
/// <p>The partition key is used by Kinesis Data Streams to distribute data across shards.
/// Kinesis Data Streams segregates the data records that belong to a stream into multiple
/// shards, using the partition key associated with each data record to determine the shard
/// to which a given data record belongs.</p>
/// <p>Partition keys are Unicode strings, with a maximum length limit of 256 characters for
/// each key. An MD5 hash function is used to map partition keys to 128-bit integer values
/// and to map associated data records to shards using the hash key ranges of the shards.
/// You can override hashing the partition key to determine the shard by explicitly
/// specifying a hash value using the <code>ExplicitHashKey</code> parameter. For more
/// information, see <a href="https://docs.aws.amazon.com/kinesis/latest/dev/developing-producers-with-sdk.html#kinesis-using-sdk-java-add-data-to-stream">Adding Data to a Stream</a> in the <i>Amazon Kinesis Data Streams
/// Developer Guide</i>.</p>
/// <p>
/// <code>PutRecord</code> returns the shard ID of where the data record was placed and the
/// sequence number that was assigned to the data record.</p>
/// <p>Sequence numbers increase over time and are specific to a shard within a stream, not
/// across all shards within a stream. To guarantee strictly increasing ordering, write
/// serially to a shard and use the <code>SequenceNumberForOrdering</code> parameter. For
/// more information, see <a href="https://docs.aws.amazon.com/kinesis/latest/dev/developing-producers-with-sdk.html#kinesis-using-sdk-java-add-data-to-stream">Adding Data to a Stream</a> in the <i>Amazon Kinesis Data Streams
/// Developer Guide</i>.</p>
/// <important>
/// <p>After you write a record to a stream, you cannot modify that record or its order
/// within the stream.</p>
/// </important>
/// <p>If a <code>PutRecord</code> request cannot be processed because of insufficient
/// provisioned throughput on the shard involved in the request, <code>PutRecord</code>
/// throws <code>ProvisionedThroughputExceededException</code>. </p>
/// <p>By default, data records are accessible for 24 hours from the time that they are added
/// to a stream. You can use <a>IncreaseStreamRetentionPeriod</a> or <a>DecreaseStreamRetentionPeriod</a> to modify this retention period.</p>
#[derive(std::fmt::Debug)]
pub struct PutRecord<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::put_record_input::Builder,
}
impl<C, M, R> PutRecord<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `PutRecord`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::PutRecordOutput,
aws_smithy_http::result::SdkError<crate::error::PutRecordError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::PutRecordInputOperationOutputAlias,
crate::output::PutRecordOutput,
crate::error::PutRecordError,
crate::input::PutRecordInputOperationRetryAlias,
>,
{
let input = self.inner.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
let op = input
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The name of the stream to put the data record into.</p>
pub fn stream_name(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.stream_name(inp);
self
}
/// <p>The name of the stream to put the data record into.</p>
pub fn set_stream_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_stream_name(input);
self
}
/// <p>The data blob to put into the record, which is base64-encoded when the blob is
/// serialized. When the data blob (the payload before base64-encoding) is added to the
/// partition key size, the total size must not exceed the maximum record size (1
/// MiB).</p>
pub fn data(mut self, inp: aws_smithy_types::Blob) -> Self {
self.inner = self.inner.data(inp);
self
}
/// <p>The data blob to put into the record, which is base64-encoded when the blob is
/// serialized. When the data blob (the payload before base64-encoding) is added to the
/// partition key size, the total size must not exceed the maximum record size (1
/// MiB).</p>
pub fn set_data(mut self, input: std::option::Option<aws_smithy_types::Blob>) -> Self {
self.inner = self.inner.set_data(input);
self
}
/// <p>Determines which shard in the stream the data record is assigned to. Partition keys
/// are Unicode strings with a maximum length limit of 256 characters for each key. Amazon
/// Kinesis Data Streams uses the partition key as input to a hash function that maps the
/// partition key and associated data to a specific shard. Specifically, an MD5 hash
/// function is used to map partition keys to 128-bit integer values and to map associated
/// data records to shards. As a result of this hashing mechanism, all data records with the
/// same partition key map to the same shard within the stream.</p>
pub fn partition_key(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.partition_key(inp);
self
}
/// <p>Determines which shard in the stream the data record is assigned to. Partition keys
/// are Unicode strings with a maximum length limit of 256 characters for each key. Amazon
/// Kinesis Data Streams uses the partition key as input to a hash function that maps the
/// partition key and associated data to a specific shard. Specifically, an MD5 hash
/// function is used to map partition keys to 128-bit integer values and to map associated
/// data records to shards. As a result of this hashing mechanism, all data records with the
/// same partition key map to the same shard within the stream.</p>
pub fn set_partition_key(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_partition_key(input);
self
}
/// <p>The hash value used to explicitly determine the shard the data record is assigned to
/// by overriding the partition key hash.</p>
pub fn explicit_hash_key(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.explicit_hash_key(inp);
self
}
/// <p>The hash value used to explicitly determine the shard the data record is assigned to
/// by overriding the partition key hash.</p>
pub fn set_explicit_hash_key(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_explicit_hash_key(input);
self
}
/// <p>Guarantees strictly increasing sequence numbers, for puts from the same client and to
/// the same partition key. Usage: set the <code>SequenceNumberForOrdering</code> of record
/// <i>n</i> to the sequence number of record <i>n-1</i> (as
/// returned in the result when putting record <i>n-1</i>). If this parameter
/// is not set, records are coarsely ordered based on arrival time.</p>
pub fn sequence_number_for_ordering(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.sequence_number_for_ordering(inp);
self
}
/// <p>Guarantees strictly increasing sequence numbers, for puts from the same client and to
/// the same partition key. Usage: set the <code>SequenceNumberForOrdering</code> of record
/// <i>n</i> to the sequence number of record <i>n-1</i> (as
/// returned in the result when putting record <i>n-1</i>). If this parameter
/// is not set, records are coarsely ordered based on arrival time.</p>
pub fn set_sequence_number_for_ordering(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_sequence_number_for_ordering(input);
self
}
}
/// Fluent builder constructing a request to `PutRecords`.
///
/// <p>Writes multiple data records into a Kinesis data stream in a single call (also
/// referred to as a <code>PutRecords</code> request). Use this operation to send data into
/// the stream for data ingestion and processing. </p>
/// <p>Each <code>PutRecords</code> request can support up to 500 records. Each record in the
/// request can be as large as 1 MiB, up to a limit of 5 MiB for the entire request,
/// including partition keys. Each shard can support writes up to 1,000 records per second,
/// up to a maximum data write total of 1 MiB per second.</p>
/// <p>You must specify the name of the stream that captures, stores, and transports the
/// data; and an array of request <code>Records</code>, with each record in the array
/// requiring a partition key and data blob. The record size limit applies to the total size
/// of the partition key and data blob.</p>
/// <p>The data blob can be any type of data; for example, a segment from a log file,
/// geographic/location data, website clickstream data, and so on.</p>
/// <p>The partition key is used by Kinesis Data Streams as input to a hash function that
/// maps the partition key and associated data to a specific shard. An MD5 hash function is
/// used to map partition keys to 128-bit integer values and to map associated data records
/// to shards. As a result of this hashing mechanism, all data records with the same
/// partition key map to the same shard within the stream. For more information, see <a href="https://docs.aws.amazon.com/kinesis/latest/dev/developing-producers-with-sdk.html#kinesis-using-sdk-java-add-data-to-stream">Adding Data to a Stream</a> in the <i>Amazon Kinesis Data Streams
/// Developer Guide</i>.</p>
/// <p>Each record in the <code>Records</code> array may include an optional parameter,
/// <code>ExplicitHashKey</code>, which overrides the partition key to shard mapping.
/// This parameter allows a data producer to determine explicitly the shard where the record
/// is stored. For more information, see <a href="https://docs.aws.amazon.com/kinesis/latest/dev/developing-producers-with-sdk.html#kinesis-using-sdk-java-putrecords">Adding Multiple Records with PutRecords</a> in the <i>Amazon Kinesis
/// Data Streams Developer Guide</i>.</p>
/// <p>The <code>PutRecords</code> response includes an array of response
/// <code>Records</code>. Each record in the response array directly correlates with a
/// record in the request array using natural ordering, from the top to the bottom of the
/// request and response. The response <code>Records</code> array always includes the same
/// number of records as the request array.</p>
/// <p>The response <code>Records</code> array includes both successfully and unsuccessfully
/// processed records. Kinesis Data Streams attempts to process all records in each
/// <code>PutRecords</code> request. A single record failure does not stop the
/// processing of subsequent records. As a result, PutRecords doesn't guarantee the ordering
/// of records. If you need to read records in the same order they are written to the
/// stream, use <a>PutRecord</a> instead of <code>PutRecords</code>, and write to
/// the same shard.</p>
/// <p>A successfully processed record includes <code>ShardId</code> and
/// <code>SequenceNumber</code> values. The <code>ShardId</code> parameter identifies
/// the shard in the stream where the record is stored. The <code>SequenceNumber</code>
/// parameter is an identifier assigned to the put record, unique to all records in the
/// stream.</p>
/// <p>An unsuccessfully processed record includes <code>ErrorCode</code> and
/// <code>ErrorMessage</code> values. <code>ErrorCode</code> reflects the type of error
/// and can be one of the following values:
/// <code>ProvisionedThroughputExceededException</code> or <code>InternalFailure</code>.
/// <code>ErrorMessage</code> provides more detailed information about the
/// <code>ProvisionedThroughputExceededException</code> exception including the account
/// ID, stream name, and shard ID of the record that was throttled. For more information
/// about partially successful responses, see <a href="https://docs.aws.amazon.com/kinesis/latest/dev/kinesis-using-sdk-java-add-data-to-stream.html#kinesis-using-sdk-java-putrecords">Adding Multiple Records with PutRecords</a> in the <i>Amazon Kinesis
/// Data Streams Developer Guide</i>.</p>
/// <important>
/// <p>After you write a record to a stream, you cannot modify that record or its order
/// within the stream.</p>
/// </important>
/// <p>By default, data records are accessible for 24 hours from the time that they are added
/// to a stream. You can use <a>IncreaseStreamRetentionPeriod</a> or <a>DecreaseStreamRetentionPeriod</a> to modify this retention period.</p>
#[derive(std::fmt::Debug)]
pub struct PutRecords<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::put_records_input::Builder,
}
impl<C, M, R> PutRecords<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `PutRecords`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::PutRecordsOutput,
aws_smithy_http::result::SdkError<crate::error::PutRecordsError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::PutRecordsInputOperationOutputAlias,
crate::output::PutRecordsOutput,
crate::error::PutRecordsError,
crate::input::PutRecordsInputOperationRetryAlias,
>,
{
let input = self.inner.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
let op = input
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// Appends an item to `Records`.
///
/// To override the contents of this collection use [`set_records`](Self::set_records).
///
/// <p>The records associated with the request.</p>
pub fn records(mut self, inp: impl Into<crate::model::PutRecordsRequestEntry>) -> Self {
self.inner = self.inner.records(inp);
self
}
/// <p>The records associated with the request.</p>
pub fn set_records(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::PutRecordsRequestEntry>>,
) -> Self {
self.inner = self.inner.set_records(input);
self
}
/// <p>The stream name associated with the request.</p>
pub fn stream_name(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.stream_name(inp);
self
}
/// <p>The stream name associated with the request.</p>
pub fn set_stream_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_stream_name(input);
self
}
}
/// Fluent builder constructing a request to `RegisterStreamConsumer`.
///
/// <p>Registers a consumer with a Kinesis data stream. When you use this operation, the
/// consumer you register can then call <a>SubscribeToShard</a> to receive data
/// from the stream using enhanced fan-out, at a rate of up to 2 MiB per second for every
/// shard you subscribe to. This rate is unaffected by the total number of consumers that
/// read from the same stream.</p>
/// <p>You can register up to 20 consumers per stream. A given consumer can only be
/// registered with one stream at a time.</p>
/// <p>For an example of how to use this operations, see <a href="/streams/latest/dev/building-enhanced-consumers-api.html">Enhanced Fan-Out
/// Using the Kinesis Data Streams API</a>.</p>
/// <p>The use of this operation has a limit of five transactions per second per account.
/// Also, only 5 consumers can be created simultaneously. In other words, you cannot have
/// more than 5 consumers in a <code>CREATING</code> status at the same time. Registering a
/// 6th consumer while there are 5 in a <code>CREATING</code> status results in a
/// <code>LimitExceededException</code>.</p>
#[derive(std::fmt::Debug)]
pub struct RegisterStreamConsumer<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::register_stream_consumer_input::Builder,
}
impl<C, M, R> RegisterStreamConsumer<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `RegisterStreamConsumer`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::RegisterStreamConsumerOutput,
aws_smithy_http::result::SdkError<crate::error::RegisterStreamConsumerError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::RegisterStreamConsumerInputOperationOutputAlias,
crate::output::RegisterStreamConsumerOutput,
crate::error::RegisterStreamConsumerError,
crate::input::RegisterStreamConsumerInputOperationRetryAlias,
>,
{
let input = self.inner.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
let op = input
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The ARN of the Kinesis data stream that you want to register the consumer with. For
/// more info, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-kinesis-streams">Amazon Resource Names (ARNs) and Amazon Web Services Service
/// Namespaces</a>.</p>
pub fn stream_arn(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.stream_arn(inp);
self
}
/// <p>The ARN of the Kinesis data stream that you want to register the consumer with. For
/// more info, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-kinesis-streams">Amazon Resource Names (ARNs) and Amazon Web Services Service
/// Namespaces</a>.</p>
pub fn set_stream_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_stream_arn(input);
self
}
/// <p>For a given Kinesis data stream, each consumer must have a unique name. However,
/// consumer names don't have to be unique across data streams.</p>
pub fn consumer_name(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.consumer_name(inp);
self
}
/// <p>For a given Kinesis data stream, each consumer must have a unique name. However,
/// consumer names don't have to be unique across data streams.</p>
pub fn set_consumer_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_consumer_name(input);
self
}
}
/// Fluent builder constructing a request to `RemoveTagsFromStream`.
///
/// <p>Removes tags from the specified Kinesis data stream. Removed tags are deleted and
/// cannot be recovered after this operation successfully completes.</p>
/// <p>If you specify a tag that does not exist, it is ignored.</p>
/// <p>
/// <a>RemoveTagsFromStream</a> has a limit of five transactions per second per
/// account.</p>
#[derive(std::fmt::Debug)]
pub struct RemoveTagsFromStream<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::remove_tags_from_stream_input::Builder,
}
impl<C, M, R> RemoveTagsFromStream<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `RemoveTagsFromStream`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::RemoveTagsFromStreamOutput,
aws_smithy_http::result::SdkError<crate::error::RemoveTagsFromStreamError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::RemoveTagsFromStreamInputOperationOutputAlias,
crate::output::RemoveTagsFromStreamOutput,
crate::error::RemoveTagsFromStreamError,
crate::input::RemoveTagsFromStreamInputOperationRetryAlias,
>,
{
let input = self.inner.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
let op = input
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The name of the stream.</p>
pub fn stream_name(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.stream_name(inp);
self
}
/// <p>The name of the stream.</p>
pub fn set_stream_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_stream_name(input);
self
}
/// Appends an item to `TagKeys`.
///
/// To override the contents of this collection use [`set_tag_keys`](Self::set_tag_keys).
///
/// <p>A list of tag keys. Each corresponding tag is removed from the stream.</p>
pub fn tag_keys(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.tag_keys(inp);
self
}
/// <p>A list of tag keys. Each corresponding tag is removed from the stream.</p>
pub fn set_tag_keys(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.inner = self.inner.set_tag_keys(input);
self
}
}
/// Fluent builder constructing a request to `SplitShard`.
///
/// <p>Splits a shard into two new shards in the Kinesis data stream, to increase the
/// stream's capacity to ingest and transport data. <code>SplitShard</code> is called when
/// there is a need to increase the overall capacity of a stream because of an expected
/// increase in the volume of data records being ingested. </p>
/// <p>You can also use <code>SplitShard</code> when a shard appears to be approaching its
/// maximum utilization; for example, the producers sending data into the specific shard are
/// suddenly sending more than previously anticipated. You can also call
/// <code>SplitShard</code> to increase stream capacity, so that more Kinesis Data
/// Streams applications can simultaneously read data from the stream for real-time
/// processing. </p>
/// <p>You must specify the shard to be split and the new hash key, which is the position in
/// the shard where the shard gets split in two. In many cases, the new hash key might be
/// the average of the beginning and ending hash key, but it can be any hash key value in
/// the range being mapped into the shard. For more information, see <a href="https://docs.aws.amazon.com/kinesis/latest/dev/kinesis-using-sdk-java-resharding-split.html">Split a
/// Shard</a> in the <i>Amazon Kinesis Data Streams Developer
/// Guide</i>.</p>
/// <p>You can use <a>DescribeStreamSummary</a> and the <a>ListShards</a> APIs to determine the shard ID and hash key values for the <code>ShardToSplit</code>
/// and <code>NewStartingHashKey</code> parameters that are specified in the
/// <code>SplitShard</code> request.</p>
/// <p>
/// <code>SplitShard</code> is an asynchronous operation. Upon receiving a
/// <code>SplitShard</code> request, Kinesis Data Streams immediately returns a response
/// and sets the stream status to <code>UPDATING</code>. After the operation is completed,
/// Kinesis Data Streams sets the stream status to <code>ACTIVE</code>. Read and write
/// operations continue to work while the stream is in the <code>UPDATING</code> state. </p>
/// <p>You can use <a>DescribeStreamSummary</a> to check the status of the stream,
/// which is returned in <code>StreamStatus</code>. If the stream is in the
/// <code>ACTIVE</code> state, you can call <code>SplitShard</code>.
/// </p>
/// <p>If the specified stream does not exist, <a>DescribeStreamSummary</a>
/// returns a <code>ResourceNotFoundException</code>. If you try to create more shards than
/// are authorized for your account, you receive a <code>LimitExceededException</code>. </p>
/// <p>For the default shard limit for an Amazon Web Services account, see <a href="https://docs.aws.amazon.com/kinesis/latest/dev/service-sizes-and-limits.html">Kinesis
/// Data Streams Limits</a> in the <i>Amazon Kinesis Data Streams Developer
/// Guide</i>. To increase this limit, <a href="https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html">contact Amazon Web Services
/// Support</a>.</p>
/// <p>If you try to operate on too many streams simultaneously using <a>CreateStream</a>, <a>DeleteStream</a>, <a>MergeShards</a>, and/or <a>SplitShard</a>, you receive a
/// <code>LimitExceededException</code>. </p>
/// <p>
/// <code>SplitShard</code> has a limit of five transactions per second per account.</p>
#[derive(std::fmt::Debug)]
pub struct SplitShard<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::split_shard_input::Builder,
}
impl<C, M, R> SplitShard<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `SplitShard`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::SplitShardOutput,
aws_smithy_http::result::SdkError<crate::error::SplitShardError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::SplitShardInputOperationOutputAlias,
crate::output::SplitShardOutput,
crate::error::SplitShardError,
crate::input::SplitShardInputOperationRetryAlias,
>,
{
let input = self.inner.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
let op = input
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The name of the stream for the shard split.</p>
pub fn stream_name(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.stream_name(inp);
self
}
/// <p>The name of the stream for the shard split.</p>
pub fn set_stream_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_stream_name(input);
self
}
/// <p>The shard ID of the shard to split.</p>
pub fn shard_to_split(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.shard_to_split(inp);
self
}
/// <p>The shard ID of the shard to split.</p>
pub fn set_shard_to_split(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_shard_to_split(input);
self
}
/// <p>A hash key value for the starting hash key of one of the child shards created by the
/// split. The hash key range for a given shard constitutes a set of ordered contiguous
/// positive integers. The value for <code>NewStartingHashKey</code> must be in the range of
/// hash keys being mapped into the shard. The <code>NewStartingHashKey</code> hash key
/// value and all higher hash key values in hash key range are distributed to one of the
/// child shards. All the lower hash key values in the range are distributed to the other
/// child shard.</p>
pub fn new_starting_hash_key(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.new_starting_hash_key(inp);
self
}
/// <p>A hash key value for the starting hash key of one of the child shards created by the
/// split. The hash key range for a given shard constitutes a set of ordered contiguous
/// positive integers. The value for <code>NewStartingHashKey</code> must be in the range of
/// hash keys being mapped into the shard. The <code>NewStartingHashKey</code> hash key
/// value and all higher hash key values in hash key range are distributed to one of the
/// child shards. All the lower hash key values in the range are distributed to the other
/// child shard.</p>
pub fn set_new_starting_hash_key(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_new_starting_hash_key(input);
self
}
}
/// Fluent builder constructing a request to `StartStreamEncryption`.
///
/// <p>Enables or updates server-side encryption using an Amazon Web Services KMS key for a
/// specified stream. </p>
/// <p>Starting encryption is an asynchronous operation. Upon receiving the request, Kinesis
/// Data Streams returns immediately and sets the status of the stream to
/// <code>UPDATING</code>. After the update is complete, Kinesis Data Streams sets the
/// status of the stream back to <code>ACTIVE</code>. Updating or applying encryption
/// normally takes a few seconds to complete, but it can take minutes. You can continue to
/// read and write data to your stream while its status is <code>UPDATING</code>. Once the
/// status of the stream is <code>ACTIVE</code>, encryption begins for records written to
/// the stream. </p>
/// <p>API Limits: You can successfully apply a new Amazon Web Services KMS key for
/// server-side encryption 25 times in a rolling 24-hour period.</p>
/// <p>Note: It can take up to 5 seconds after the stream is in an <code>ACTIVE</code> status
/// before all records written to the stream are encrypted. After you enable encryption, you
/// can verify that encryption is applied by inspecting the API response from
/// <code>PutRecord</code> or <code>PutRecords</code>.</p>
#[derive(std::fmt::Debug)]
pub struct StartStreamEncryption<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::start_stream_encryption_input::Builder,
}
impl<C, M, R> StartStreamEncryption<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `StartStreamEncryption`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::StartStreamEncryptionOutput,
aws_smithy_http::result::SdkError<crate::error::StartStreamEncryptionError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::StartStreamEncryptionInputOperationOutputAlias,
crate::output::StartStreamEncryptionOutput,
crate::error::StartStreamEncryptionError,
crate::input::StartStreamEncryptionInputOperationRetryAlias,
>,
{
let input = self.inner.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
let op = input
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The name of the stream for which to start encrypting records.</p>
pub fn stream_name(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.stream_name(inp);
self
}
/// <p>The name of the stream for which to start encrypting records.</p>
pub fn set_stream_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_stream_name(input);
self
}
/// <p>The encryption type to use. The only valid value is <code>KMS</code>.</p>
pub fn encryption_type(mut self, inp: crate::model::EncryptionType) -> Self {
self.inner = self.inner.encryption_type(inp);
self
}
/// <p>The encryption type to use. The only valid value is <code>KMS</code>.</p>
pub fn set_encryption_type(
mut self,
input: std::option::Option<crate::model::EncryptionType>,
) -> Self {
self.inner = self.inner.set_encryption_type(input);
self
}
/// <p>The GUID for the customer-managed Amazon Web Services KMS key to use for encryption.
/// This value can be a globally unique identifier, a fully specified Amazon Resource Name
/// (ARN) to either an alias or a key, or an alias name prefixed by "alias/".You can also
/// use a master key owned by Kinesis Data Streams by specifying the alias
/// <code>aws/kinesis</code>.</p>
/// <ul>
/// <li>
/// <p>Key ARN example:
/// <code>arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012</code>
/// </p>
/// </li>
/// <li>
/// <p>Alias ARN example:
/// <code>arn:aws:kms:us-east-1:123456789012:alias/MyAliasName</code>
/// </p>
/// </li>
/// <li>
/// <p>Globally unique key ID example:
/// <code>12345678-1234-1234-1234-123456789012</code>
/// </p>
/// </li>
/// <li>
/// <p>Alias name example: <code>alias/MyAliasName</code>
/// </p>
/// </li>
/// <li>
/// <p>Master key owned by Kinesis Data Streams:
/// <code>alias/aws/kinesis</code>
/// </p>
/// </li>
/// </ul>
pub fn key_id(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.key_id(inp);
self
}
/// <p>The GUID for the customer-managed Amazon Web Services KMS key to use for encryption.
/// This value can be a globally unique identifier, a fully specified Amazon Resource Name
/// (ARN) to either an alias or a key, or an alias name prefixed by "alias/".You can also
/// use a master key owned by Kinesis Data Streams by specifying the alias
/// <code>aws/kinesis</code>.</p>
/// <ul>
/// <li>
/// <p>Key ARN example:
/// <code>arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012</code>
/// </p>
/// </li>
/// <li>
/// <p>Alias ARN example:
/// <code>arn:aws:kms:us-east-1:123456789012:alias/MyAliasName</code>
/// </p>
/// </li>
/// <li>
/// <p>Globally unique key ID example:
/// <code>12345678-1234-1234-1234-123456789012</code>
/// </p>
/// </li>
/// <li>
/// <p>Alias name example: <code>alias/MyAliasName</code>
/// </p>
/// </li>
/// <li>
/// <p>Master key owned by Kinesis Data Streams:
/// <code>alias/aws/kinesis</code>
/// </p>
/// </li>
/// </ul>
pub fn set_key_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_key_id(input);
self
}
}
/// Fluent builder constructing a request to `StopStreamEncryption`.
///
/// <p>Disables server-side encryption for a specified stream. </p>
/// <p>Stopping encryption is an asynchronous operation. Upon receiving the request, Kinesis
/// Data Streams returns immediately and sets the status of the stream to
/// <code>UPDATING</code>. After the update is complete, Kinesis Data Streams sets the
/// status of the stream back to <code>ACTIVE</code>. Stopping encryption normally takes a
/// few seconds to complete, but it can take minutes. You can continue to read and write
/// data to your stream while its status is <code>UPDATING</code>. Once the status of the
/// stream is <code>ACTIVE</code>, records written to the stream are no longer encrypted by
/// Kinesis Data Streams. </p>
/// <p>API Limits: You can successfully disable server-side encryption 25 times in a rolling
/// 24-hour period. </p>
/// <p>Note: It can take up to 5 seconds after the stream is in an <code>ACTIVE</code> status
/// before all records written to the stream are no longer subject to encryption. After you
/// disabled encryption, you can verify that encryption is not applied by inspecting the API
/// response from <code>PutRecord</code> or <code>PutRecords</code>.</p>
#[derive(std::fmt::Debug)]
pub struct StopStreamEncryption<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::stop_stream_encryption_input::Builder,
}
impl<C, M, R> StopStreamEncryption<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `StopStreamEncryption`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::StopStreamEncryptionOutput,
aws_smithy_http::result::SdkError<crate::error::StopStreamEncryptionError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::StopStreamEncryptionInputOperationOutputAlias,
crate::output::StopStreamEncryptionOutput,
crate::error::StopStreamEncryptionError,
crate::input::StopStreamEncryptionInputOperationRetryAlias,
>,
{
let input = self.inner.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
let op = input
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The name of the stream on which to stop encrypting records.</p>
pub fn stream_name(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.stream_name(inp);
self
}
/// <p>The name of the stream on which to stop encrypting records.</p>
pub fn set_stream_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_stream_name(input);
self
}
/// <p>The encryption type. The only valid value is <code>KMS</code>.</p>
pub fn encryption_type(mut self, inp: crate::model::EncryptionType) -> Self {
self.inner = self.inner.encryption_type(inp);
self
}
/// <p>The encryption type. The only valid value is <code>KMS</code>.</p>
pub fn set_encryption_type(
mut self,
input: std::option::Option<crate::model::EncryptionType>,
) -> Self {
self.inner = self.inner.set_encryption_type(input);
self
}
/// <p>The GUID for the customer-managed Amazon Web Services KMS key to use for encryption.
/// This value can be a globally unique identifier, a fully specified Amazon Resource Name
/// (ARN) to either an alias or a key, or an alias name prefixed by "alias/".You can also
/// use a master key owned by Kinesis Data Streams by specifying the alias
/// <code>aws/kinesis</code>.</p>
/// <ul>
/// <li>
/// <p>Key ARN example:
/// <code>arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012</code>
/// </p>
/// </li>
/// <li>
/// <p>Alias ARN example:
/// <code>arn:aws:kms:us-east-1:123456789012:alias/MyAliasName</code>
/// </p>
/// </li>
/// <li>
/// <p>Globally unique key ID example:
/// <code>12345678-1234-1234-1234-123456789012</code>
/// </p>
/// </li>
/// <li>
/// <p>Alias name example: <code>alias/MyAliasName</code>
/// </p>
/// </li>
/// <li>
/// <p>Master key owned by Kinesis Data Streams:
/// <code>alias/aws/kinesis</code>
/// </p>
/// </li>
/// </ul>
pub fn key_id(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.key_id(inp);
self
}
/// <p>The GUID for the customer-managed Amazon Web Services KMS key to use for encryption.
/// This value can be a globally unique identifier, a fully specified Amazon Resource Name
/// (ARN) to either an alias or a key, or an alias name prefixed by "alias/".You can also
/// use a master key owned by Kinesis Data Streams by specifying the alias
/// <code>aws/kinesis</code>.</p>
/// <ul>
/// <li>
/// <p>Key ARN example:
/// <code>arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012</code>
/// </p>
/// </li>
/// <li>
/// <p>Alias ARN example:
/// <code>arn:aws:kms:us-east-1:123456789012:alias/MyAliasName</code>
/// </p>
/// </li>
/// <li>
/// <p>Globally unique key ID example:
/// <code>12345678-1234-1234-1234-123456789012</code>
/// </p>
/// </li>
/// <li>
/// <p>Alias name example: <code>alias/MyAliasName</code>
/// </p>
/// </li>
/// <li>
/// <p>Master key owned by Kinesis Data Streams:
/// <code>alias/aws/kinesis</code>
/// </p>
/// </li>
/// </ul>
pub fn set_key_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_key_id(input);
self
}
}
/// Fluent builder constructing a request to `UpdateShardCount`.
///
/// <p>Updates the shard count of the specified stream to the specified number of
/// shards.</p>
/// <p>Updating the shard count is an asynchronous operation. Upon receiving the request,
/// Kinesis Data Streams returns immediately and sets the status of the stream to
/// <code>UPDATING</code>. After the update is complete, Kinesis Data Streams sets the
/// status of the stream back to <code>ACTIVE</code>. Depending on the size of the stream,
/// the scaling action could take a few minutes to complete. You can continue to read and
/// write data to your stream while its status is <code>UPDATING</code>.</p>
/// <p>To update the shard count, Kinesis Data Streams performs splits or merges on
/// individual shards. This can cause short-lived shards to be created, in addition to the
/// final shards. These short-lived shards count towards your total shard limit for your
/// account in the Region.</p>
/// <p>When using this operation, we recommend that you specify a target shard count that is
/// a multiple of 25% (25%, 50%, 75%, 100%). You can specify any target value within your
/// shard limit. However, if you specify a target that isn't a multiple of 25%, the scaling
/// action might take longer to complete. </p>
/// <p>This operation has the following default limits. By default, you cannot do the
/// following:</p>
/// <ul>
/// <li>
/// <p>Scale more than ten times per rolling 24-hour period per stream</p>
/// </li>
/// <li>
/// <p>Scale up to more than double your current shard count for a stream</p>
/// </li>
/// <li>
/// <p>Scale down below half your current shard count for a stream</p>
/// </li>
/// <li>
/// <p>Scale up to more than 10000 shards in a stream</p>
/// </li>
/// <li>
/// <p>Scale a stream with more than 10000 shards down unless the result is less than
/// 10000 shards</p>
/// </li>
/// <li>
/// <p>Scale up to more than the shard limit for your account</p>
/// </li>
/// </ul>
/// <p>For the default limits for an Amazon Web Services account, see <a href="https://docs.aws.amazon.com/kinesis/latest/dev/service-sizes-and-limits.html">Streams
/// Limits</a> in the <i>Amazon Kinesis Data Streams Developer
/// Guide</i>. To request an increase in the call rate limit, the shard limit for
/// this API, or your overall shard limit, use the <a href="https://console.aws.amazon.com/support/v1#/case/create?issueType=service-limit-increase&limitType=service-code-kinesis">limits form</a>.</p>
#[derive(std::fmt::Debug)]
pub struct UpdateShardCount<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::update_shard_count_input::Builder,
}
impl<C, M, R> UpdateShardCount<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `UpdateShardCount`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::UpdateShardCountOutput,
aws_smithy_http::result::SdkError<crate::error::UpdateShardCountError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::UpdateShardCountInputOperationOutputAlias,
crate::output::UpdateShardCountOutput,
crate::error::UpdateShardCountError,
crate::input::UpdateShardCountInputOperationRetryAlias,
>,
{
let input = self.inner.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
let op = input
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The name of the stream.</p>
pub fn stream_name(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.stream_name(inp);
self
}
/// <p>The name of the stream.</p>
pub fn set_stream_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_stream_name(input);
self
}
/// <p>The new number of shards. This value has the following default limits. By default, you
/// cannot do the following: </p>
/// <ul>
/// <li>
/// <p>Set this value to more than double your current shard count for a
/// stream.</p>
/// </li>
/// <li>
/// <p>Set this value below half your current shard count for a stream.</p>
/// </li>
/// <li>
/// <p>Set this value to more than 10000 shards in a stream (the default limit for
/// shard count per stream is 10000 per account per region), unless you request a
/// limit increase.</p>
/// </li>
/// <li>
/// <p>Scale a stream with more than 10000 shards down unless you set this value to
/// less than 10000 shards.</p>
/// </li>
/// </ul>
pub fn target_shard_count(mut self, inp: i32) -> Self {
self.inner = self.inner.target_shard_count(inp);
self
}
/// <p>The new number of shards. This value has the following default limits. By default, you
/// cannot do the following: </p>
/// <ul>
/// <li>
/// <p>Set this value to more than double your current shard count for a
/// stream.</p>
/// </li>
/// <li>
/// <p>Set this value below half your current shard count for a stream.</p>
/// </li>
/// <li>
/// <p>Set this value to more than 10000 shards in a stream (the default limit for
/// shard count per stream is 10000 per account per region), unless you request a
/// limit increase.</p>
/// </li>
/// <li>
/// <p>Scale a stream with more than 10000 shards down unless you set this value to
/// less than 10000 shards.</p>
/// </li>
/// </ul>
pub fn set_target_shard_count(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_target_shard_count(input);
self
}
/// <p>The scaling type. Uniform scaling creates shards of equal size.</p>
pub fn scaling_type(mut self, inp: crate::model::ScalingType) -> Self {
self.inner = self.inner.scaling_type(inp);
self
}
/// <p>The scaling type. Uniform scaling creates shards of equal size.</p>
pub fn set_scaling_type(
mut self,
input: std::option::Option<crate::model::ScalingType>,
) -> Self {
self.inner = self.inner.set_scaling_type(input);
self
}
}
/// Fluent builder constructing a request to `UpdateStreamMode`.
///
/// <p> Updates the capacity mode of the data stream. Currently, in Kinesis Data Streams, you
/// can choose between an <b>on-demand</b> capacity mode and a
/// <b>provisioned</b> capacity mode for your data stream.
/// </p>
#[derive(std::fmt::Debug)]
pub struct UpdateStreamMode<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::update_stream_mode_input::Builder,
}
impl<C, M, R> UpdateStreamMode<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `UpdateStreamMode`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::UpdateStreamModeOutput,
aws_smithy_http::result::SdkError<crate::error::UpdateStreamModeError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::UpdateStreamModeInputOperationOutputAlias,
crate::output::UpdateStreamModeOutput,
crate::error::UpdateStreamModeError,
crate::input::UpdateStreamModeInputOperationRetryAlias,
>,
{
let input = self.inner.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
let op = input
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p> Specifies the ARN of the data stream whose capacity mode you want to update. </p>
pub fn stream_arn(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.stream_arn(inp);
self
}
/// <p> Specifies the ARN of the data stream whose capacity mode you want to update. </p>
pub fn set_stream_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_stream_arn(input);
self
}
/// <p> Specifies the capacity mode to which you want to set your data stream. Currently, in
/// Kinesis Data Streams, you can choose between an <b>on-demand</b> capacity mode and a <b>provisioned</b> capacity mode for your data streams. </p>
pub fn stream_mode_details(mut self, inp: crate::model::StreamModeDetails) -> Self {
self.inner = self.inner.stream_mode_details(inp);
self
}
/// <p> Specifies the capacity mode to which you want to set your data stream. Currently, in
/// Kinesis Data Streams, you can choose between an <b>on-demand</b> capacity mode and a <b>provisioned</b> capacity mode for your data streams. </p>
pub fn set_stream_mode_details(
mut self,
input: std::option::Option<crate::model::StreamModeDetails>,
) -> Self {
self.inner = self.inner.set_stream_mode_details(input);
self
}
}
}
impl<C> Client<C, crate::middleware::DefaultMiddleware, aws_smithy_client::retry::Standard> {
/// Creates a client with the given service config and connector override.
pub fn from_conf_conn(conf: crate::Config, conn: C) -> Self {
let retry_config = conf.retry_config.as_ref().cloned().unwrap_or_default();
let timeout_config = conf.timeout_config.as_ref().cloned().unwrap_or_default();
let sleep_impl = conf.sleep_impl.clone();
let mut builder = aws_smithy_client::Builder::new()
.connector(conn)
.middleware(crate::middleware::DefaultMiddleware::new());
builder.set_retry_config(retry_config.into());
builder.set_timeout_config(timeout_config);
if let Some(sleep_impl) = sleep_impl {
builder.set_sleep_impl(Some(sleep_impl));
}
let client = builder.build();
Self {
handle: std::sync::Arc::new(Handle { client, conf }),
}
}
}
impl
Client<
aws_smithy_client::erase::DynConnector,
crate::middleware::DefaultMiddleware,
aws_smithy_client::retry::Standard,
>
{
/// Creates a new client from a shared config.
#[cfg(any(feature = "rustls", feature = "native-tls"))]
pub fn new(config: &aws_types::config::Config) -> Self {
Self::from_conf(config.into())
}
/// Creates a new client from the service [`Config`](crate::Config).
#[cfg(any(feature = "rustls", feature = "native-tls"))]
pub fn from_conf(conf: crate::Config) -> Self {
let retry_config = conf.retry_config.as_ref().cloned().unwrap_or_default();
let timeout_config = conf.timeout_config.as_ref().cloned().unwrap_or_default();
let sleep_impl = conf.sleep_impl.clone();
let mut builder = aws_smithy_client::Builder::dyn_https()
.middleware(crate::middleware::DefaultMiddleware::new());
builder.set_retry_config(retry_config.into());
builder.set_timeout_config(timeout_config);
// the builder maintains a try-state. To avoid suppressing the warning when sleep is unset,
// only set it if we actually have a sleep impl.
if let Some(sleep_impl) = sleep_impl {
builder.set_sleep_impl(Some(sleep_impl));
}
let client = builder.build();
Self {
handle: std::sync::Arc::new(Handle { client, conf }),
}
}
}