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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Sets whether or not your output will go to a user created bucket. Used to set the name of the bucket, and the prefix on the output file.</p>
/// <p> <code>OutputConfig</code> is an optional parameter which lets you adjust where your output will be placed. By default, Amazon Textract will store the results internally and can only be accessed by the Get API operations. With OutputConfig enabled, you can set the name of the bucket the output will be sent to and the file prefix of the results where you can download your results. Additionally, you can set the <code>KMSKeyID</code> parameter to a customer master key (CMK) to encrypt your output. Without this parameter set Amazon Textract will encrypt server-side using the AWS managed CMK for Amazon S3.</p>
/// <p>Decryption of Customer Content is necessary for processing of the documents by Amazon Textract. If your account is opted out under an AI services opt out policy then all unencrypted Customer Content is immediately and permanently deleted after the Customer Content has been processed by the service. No copy of of the output is retained by Amazon Textract. For information about how to opt out, see <a href="https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_ai-opt-out.html"> Managing AI services opt-out policy. </a> </p>
/// <p>For more information on data privacy, see the <a href="https://aws.amazon.com/compliance/data-privacy-faq/">Data Privacy FAQ</a>.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct OutputConfig {
/// <p>The name of the bucket your output will go to.</p>
pub s3_bucket: std::option::Option<std::string::String>,
/// <p>The prefix of the object key that the output will be saved to. When not enabled, the prefix will be “textract_output".</p>
pub s3_prefix: std::option::Option<std::string::String>,
}
impl OutputConfig {
/// <p>The name of the bucket your output will go to.</p>
pub fn s3_bucket(&self) -> std::option::Option<&str> {
self.s3_bucket.as_deref()
}
/// <p>The prefix of the object key that the output will be saved to. When not enabled, the prefix will be “textract_output".</p>
pub fn s3_prefix(&self) -> std::option::Option<&str> {
self.s3_prefix.as_deref()
}
}
impl std::fmt::Debug for OutputConfig {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("OutputConfig");
formatter.field("s3_bucket", &self.s3_bucket);
formatter.field("s3_prefix", &self.s3_prefix);
formatter.finish()
}
}
/// See [`OutputConfig`](crate::model::OutputConfig)
pub mod output_config {
/// A builder for [`OutputConfig`](crate::model::OutputConfig)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) s3_bucket: std::option::Option<std::string::String>,
pub(crate) s3_prefix: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The name of the bucket your output will go to.</p>
pub fn s3_bucket(mut self, input: impl Into<std::string::String>) -> Self {
self.s3_bucket = Some(input.into());
self
}
/// <p>The name of the bucket your output will go to.</p>
pub fn set_s3_bucket(mut self, input: std::option::Option<std::string::String>) -> Self {
self.s3_bucket = input;
self
}
/// <p>The prefix of the object key that the output will be saved to. When not enabled, the prefix will be “textract_output".</p>
pub fn s3_prefix(mut self, input: impl Into<std::string::String>) -> Self {
self.s3_prefix = Some(input.into());
self
}
/// <p>The prefix of the object key that the output will be saved to. When not enabled, the prefix will be “textract_output".</p>
pub fn set_s3_prefix(mut self, input: std::option::Option<std::string::String>) -> Self {
self.s3_prefix = input;
self
}
/// Consumes the builder and constructs a [`OutputConfig`](crate::model::OutputConfig)
pub fn build(self) -> crate::model::OutputConfig {
crate::model::OutputConfig {
s3_bucket: self.s3_bucket,
s3_prefix: self.s3_prefix,
}
}
}
}
impl OutputConfig {
/// Creates a new builder-style object to manufacture [`OutputConfig`](crate::model::OutputConfig)
pub fn builder() -> crate::model::output_config::Builder {
crate::model::output_config::Builder::default()
}
}
/// <p>The Amazon Simple Notification Service (Amazon SNS) topic to which Amazon Textract publishes the completion status of an asynchronous document operation, such as <code>StartDocumentTextDetection</code>. </p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct NotificationChannel {
/// <p>The Amazon SNS topic that Amazon Textract posts the completion status to.</p>
pub sns_topic_arn: std::option::Option<std::string::String>,
/// <p>The Amazon Resource Name (ARN) of an IAM role that gives Amazon Textract publishing permissions to the Amazon SNS topic. </p>
pub role_arn: std::option::Option<std::string::String>,
}
impl NotificationChannel {
/// <p>The Amazon SNS topic that Amazon Textract posts the completion status to.</p>
pub fn sns_topic_arn(&self) -> std::option::Option<&str> {
self.sns_topic_arn.as_deref()
}
/// <p>The Amazon Resource Name (ARN) of an IAM role that gives Amazon Textract publishing permissions to the Amazon SNS topic. </p>
pub fn role_arn(&self) -> std::option::Option<&str> {
self.role_arn.as_deref()
}
}
impl std::fmt::Debug for NotificationChannel {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("NotificationChannel");
formatter.field("sns_topic_arn", &self.sns_topic_arn);
formatter.field("role_arn", &self.role_arn);
formatter.finish()
}
}
/// See [`NotificationChannel`](crate::model::NotificationChannel)
pub mod notification_channel {
/// A builder for [`NotificationChannel`](crate::model::NotificationChannel)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) sns_topic_arn: std::option::Option<std::string::String>,
pub(crate) role_arn: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The Amazon SNS topic that Amazon Textract posts the completion status to.</p>
pub fn sns_topic_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.sns_topic_arn = Some(input.into());
self
}
/// <p>The Amazon SNS topic that Amazon Textract posts the completion status to.</p>
pub fn set_sns_topic_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.sns_topic_arn = input;
self
}
/// <p>The Amazon Resource Name (ARN) of an IAM role that gives Amazon Textract publishing permissions to the Amazon SNS topic. </p>
pub fn role_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.role_arn = Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of an IAM role that gives Amazon Textract publishing permissions to the Amazon SNS topic. </p>
pub fn set_role_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.role_arn = input;
self
}
/// Consumes the builder and constructs a [`NotificationChannel`](crate::model::NotificationChannel)
pub fn build(self) -> crate::model::NotificationChannel {
crate::model::NotificationChannel {
sns_topic_arn: self.sns_topic_arn,
role_arn: self.role_arn,
}
}
}
}
impl NotificationChannel {
/// Creates a new builder-style object to manufacture [`NotificationChannel`](crate::model::NotificationChannel)
pub fn builder() -> crate::model::notification_channel::Builder {
crate::model::notification_channel::Builder::default()
}
}
/// <p>The Amazon S3 bucket that contains the document to be processed. It's used by asynchronous operations such as <code>StartDocumentTextDetection</code>.</p>
/// <p>The input document can be an image file in JPEG or PNG format. It can also be a file in PDF format.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct DocumentLocation {
/// <p>The Amazon S3 bucket that contains the input document.</p>
pub s3_object: std::option::Option<crate::model::S3Object>,
}
impl DocumentLocation {
/// <p>The Amazon S3 bucket that contains the input document.</p>
pub fn s3_object(&self) -> std::option::Option<&crate::model::S3Object> {
self.s3_object.as_ref()
}
}
impl std::fmt::Debug for DocumentLocation {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("DocumentLocation");
formatter.field("s3_object", &self.s3_object);
formatter.finish()
}
}
/// See [`DocumentLocation`](crate::model::DocumentLocation)
pub mod document_location {
/// A builder for [`DocumentLocation`](crate::model::DocumentLocation)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) s3_object: std::option::Option<crate::model::S3Object>,
}
impl Builder {
/// <p>The Amazon S3 bucket that contains the input document.</p>
pub fn s3_object(mut self, input: crate::model::S3Object) -> Self {
self.s3_object = Some(input);
self
}
/// <p>The Amazon S3 bucket that contains the input document.</p>
pub fn set_s3_object(mut self, input: std::option::Option<crate::model::S3Object>) -> Self {
self.s3_object = input;
self
}
/// Consumes the builder and constructs a [`DocumentLocation`](crate::model::DocumentLocation)
pub fn build(self) -> crate::model::DocumentLocation {
crate::model::DocumentLocation {
s3_object: self.s3_object,
}
}
}
}
impl DocumentLocation {
/// Creates a new builder-style object to manufacture [`DocumentLocation`](crate::model::DocumentLocation)
pub fn builder() -> crate::model::document_location::Builder {
crate::model::document_location::Builder::default()
}
}
/// <p>The S3 bucket name and file name that identifies the document.</p>
/// <p>The AWS Region for the S3 bucket that contains the document must match the Region that you use for Amazon Textract operations.</p>
/// <p>For Amazon Textract to process a file in an S3 bucket, the user must have permission to access the S3 bucket and file. </p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct S3Object {
/// <p>The name of the S3 bucket. Note that the # character is not valid in the file name.</p>
pub bucket: std::option::Option<std::string::String>,
/// <p>The file name of the input document. Synchronous operations can use image files that are in JPEG or PNG format. Asynchronous operations also support PDF and TIFF format files.</p>
pub name: std::option::Option<std::string::String>,
/// <p>If the bucket has versioning enabled, you can specify the object version. </p>
pub version: std::option::Option<std::string::String>,
}
impl S3Object {
/// <p>The name of the S3 bucket. Note that the # character is not valid in the file name.</p>
pub fn bucket(&self) -> std::option::Option<&str> {
self.bucket.as_deref()
}
/// <p>The file name of the input document. Synchronous operations can use image files that are in JPEG or PNG format. Asynchronous operations also support PDF and TIFF format files.</p>
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
/// <p>If the bucket has versioning enabled, you can specify the object version. </p>
pub fn version(&self) -> std::option::Option<&str> {
self.version.as_deref()
}
}
impl std::fmt::Debug for S3Object {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("S3Object");
formatter.field("bucket", &self.bucket);
formatter.field("name", &self.name);
formatter.field("version", &self.version);
formatter.finish()
}
}
/// See [`S3Object`](crate::model::S3Object)
pub mod s3_object {
/// A builder for [`S3Object`](crate::model::S3Object)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) bucket: std::option::Option<std::string::String>,
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) version: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The name of the S3 bucket. Note that the # character is not valid in the file name.</p>
pub fn bucket(mut self, input: impl Into<std::string::String>) -> Self {
self.bucket = Some(input.into());
self
}
/// <p>The name of the S3 bucket. Note that the # character is not valid in the file name.</p>
pub fn set_bucket(mut self, input: std::option::Option<std::string::String>) -> Self {
self.bucket = input;
self
}
/// <p>The file name of the input document. Synchronous operations can use image files that are in JPEG or PNG format. Asynchronous operations also support PDF and TIFF format files.</p>
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
/// <p>The file name of the input document. Synchronous operations can use image files that are in JPEG or PNG format. Asynchronous operations also support PDF and TIFF format files.</p>
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
/// <p>If the bucket has versioning enabled, you can specify the object version. </p>
pub fn version(mut self, input: impl Into<std::string::String>) -> Self {
self.version = Some(input.into());
self
}
/// <p>If the bucket has versioning enabled, you can specify the object version. </p>
pub fn set_version(mut self, input: std::option::Option<std::string::String>) -> Self {
self.version = input;
self
}
/// Consumes the builder and constructs a [`S3Object`](crate::model::S3Object)
pub fn build(self) -> crate::model::S3Object {
crate::model::S3Object {
bucket: self.bucket,
name: self.name,
version: self.version,
}
}
}
}
impl S3Object {
/// Creates a new builder-style object to manufacture [`S3Object`](crate::model::S3Object)
pub fn builder() -> crate::model::s3_object::Builder {
crate::model::s3_object::Builder::default()
}
}
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum FeatureType {
#[allow(missing_docs)] // documentation missing in model
Forms,
#[allow(missing_docs)] // documentation missing in model
Tables,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for FeatureType {
fn from(s: &str) -> Self {
match s {
"FORMS" => FeatureType::Forms,
"TABLES" => FeatureType::Tables,
other => FeatureType::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for FeatureType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(FeatureType::from(s))
}
}
impl FeatureType {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
FeatureType::Forms => "FORMS",
FeatureType::Tables => "TABLES",
FeatureType::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&["FORMS", "TABLES"]
}
}
impl AsRef<str> for FeatureType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>A warning about an issue that occurred during asynchronous text analysis (<code>StartDocumentAnalysis</code>) or asynchronous document text detection (<code>StartDocumentTextDetection</code>). </p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct Warning {
/// <p>The error code for the warning.</p>
pub error_code: std::option::Option<std::string::String>,
/// <p>A list of the pages that the warning applies to.</p>
pub pages: std::option::Option<std::vec::Vec<i32>>,
}
impl Warning {
/// <p>The error code for the warning.</p>
pub fn error_code(&self) -> std::option::Option<&str> {
self.error_code.as_deref()
}
/// <p>A list of the pages that the warning applies to.</p>
pub fn pages(&self) -> std::option::Option<&[i32]> {
self.pages.as_deref()
}
}
impl std::fmt::Debug for Warning {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Warning");
formatter.field("error_code", &self.error_code);
formatter.field("pages", &self.pages);
formatter.finish()
}
}
/// See [`Warning`](crate::model::Warning)
pub mod warning {
/// A builder for [`Warning`](crate::model::Warning)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) error_code: std::option::Option<std::string::String>,
pub(crate) pages: std::option::Option<std::vec::Vec<i32>>,
}
impl Builder {
/// <p>The error code for the warning.</p>
pub fn error_code(mut self, input: impl Into<std::string::String>) -> Self {
self.error_code = Some(input.into());
self
}
/// <p>The error code for the warning.</p>
pub fn set_error_code(mut self, input: std::option::Option<std::string::String>) -> Self {
self.error_code = input;
self
}
/// Appends an item to `pages`.
///
/// To override the contents of this collection use [`set_pages`](Self::set_pages).
///
/// <p>A list of the pages that the warning applies to.</p>
pub fn pages(mut self, input: i32) -> Self {
let mut v = self.pages.unwrap_or_default();
v.push(input);
self.pages = Some(v);
self
}
/// <p>A list of the pages that the warning applies to.</p>
pub fn set_pages(mut self, input: std::option::Option<std::vec::Vec<i32>>) -> Self {
self.pages = input;
self
}
/// Consumes the builder and constructs a [`Warning`](crate::model::Warning)
pub fn build(self) -> crate::model::Warning {
crate::model::Warning {
error_code: self.error_code,
pages: self.pages,
}
}
}
}
impl Warning {
/// Creates a new builder-style object to manufacture [`Warning`](crate::model::Warning)
pub fn builder() -> crate::model::warning::Builder {
crate::model::warning::Builder::default()
}
}
/// <p>The structure holding all the information returned by AnalyzeExpense</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ExpenseDocument {
/// <p>Denotes which invoice or receipt in the document the information is coming from. First document will be 1, the second 2, and so on.</p>
pub expense_index: std::option::Option<i32>,
/// <p>Any information found outside of a table by Amazon Textract.</p>
pub summary_fields: std::option::Option<std::vec::Vec<crate::model::ExpenseField>>,
/// <p>Information detected on each table of a document, seperated into <code>LineItems</code>.</p>
pub line_item_groups: std::option::Option<std::vec::Vec<crate::model::LineItemGroup>>,
}
impl ExpenseDocument {
/// <p>Denotes which invoice or receipt in the document the information is coming from. First document will be 1, the second 2, and so on.</p>
pub fn expense_index(&self) -> std::option::Option<i32> {
self.expense_index
}
/// <p>Any information found outside of a table by Amazon Textract.</p>
pub fn summary_fields(&self) -> std::option::Option<&[crate::model::ExpenseField]> {
self.summary_fields.as_deref()
}
/// <p>Information detected on each table of a document, seperated into <code>LineItems</code>.</p>
pub fn line_item_groups(&self) -> std::option::Option<&[crate::model::LineItemGroup]> {
self.line_item_groups.as_deref()
}
}
impl std::fmt::Debug for ExpenseDocument {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ExpenseDocument");
formatter.field("expense_index", &self.expense_index);
formatter.field("summary_fields", &self.summary_fields);
formatter.field("line_item_groups", &self.line_item_groups);
formatter.finish()
}
}
/// See [`ExpenseDocument`](crate::model::ExpenseDocument)
pub mod expense_document {
/// A builder for [`ExpenseDocument`](crate::model::ExpenseDocument)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) expense_index: std::option::Option<i32>,
pub(crate) summary_fields: std::option::Option<std::vec::Vec<crate::model::ExpenseField>>,
pub(crate) line_item_groups:
std::option::Option<std::vec::Vec<crate::model::LineItemGroup>>,
}
impl Builder {
/// <p>Denotes which invoice or receipt in the document the information is coming from. First document will be 1, the second 2, and so on.</p>
pub fn expense_index(mut self, input: i32) -> Self {
self.expense_index = Some(input);
self
}
/// <p>Denotes which invoice or receipt in the document the information is coming from. First document will be 1, the second 2, and so on.</p>
pub fn set_expense_index(mut self, input: std::option::Option<i32>) -> Self {
self.expense_index = input;
self
}
/// Appends an item to `summary_fields`.
///
/// To override the contents of this collection use [`set_summary_fields`](Self::set_summary_fields).
///
/// <p>Any information found outside of a table by Amazon Textract.</p>
pub fn summary_fields(mut self, input: crate::model::ExpenseField) -> Self {
let mut v = self.summary_fields.unwrap_or_default();
v.push(input);
self.summary_fields = Some(v);
self
}
/// <p>Any information found outside of a table by Amazon Textract.</p>
pub fn set_summary_fields(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::ExpenseField>>,
) -> Self {
self.summary_fields = input;
self
}
/// Appends an item to `line_item_groups`.
///
/// To override the contents of this collection use [`set_line_item_groups`](Self::set_line_item_groups).
///
/// <p>Information detected on each table of a document, seperated into <code>LineItems</code>.</p>
pub fn line_item_groups(mut self, input: crate::model::LineItemGroup) -> Self {
let mut v = self.line_item_groups.unwrap_or_default();
v.push(input);
self.line_item_groups = Some(v);
self
}
/// <p>Information detected on each table of a document, seperated into <code>LineItems</code>.</p>
pub fn set_line_item_groups(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::LineItemGroup>>,
) -> Self {
self.line_item_groups = input;
self
}
/// Consumes the builder and constructs a [`ExpenseDocument`](crate::model::ExpenseDocument)
pub fn build(self) -> crate::model::ExpenseDocument {
crate::model::ExpenseDocument {
expense_index: self.expense_index,
summary_fields: self.summary_fields,
line_item_groups: self.line_item_groups,
}
}
}
}
impl ExpenseDocument {
/// Creates a new builder-style object to manufacture [`ExpenseDocument`](crate::model::ExpenseDocument)
pub fn builder() -> crate::model::expense_document::Builder {
crate::model::expense_document::Builder::default()
}
}
/// <p>A grouping of tables which contain LineItems, with each table identified by the table's <code>LineItemGroupIndex</code>.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct LineItemGroup {
/// <p>The number used to identify a specific table in a document. The first table encountered will have a LineItemGroupIndex of 1, the second 2, etc.</p>
pub line_item_group_index: std::option::Option<i32>,
/// <p>The breakdown of information on a particular line of a table. </p>
pub line_items: std::option::Option<std::vec::Vec<crate::model::LineItemFields>>,
}
impl LineItemGroup {
/// <p>The number used to identify a specific table in a document. The first table encountered will have a LineItemGroupIndex of 1, the second 2, etc.</p>
pub fn line_item_group_index(&self) -> std::option::Option<i32> {
self.line_item_group_index
}
/// <p>The breakdown of information on a particular line of a table. </p>
pub fn line_items(&self) -> std::option::Option<&[crate::model::LineItemFields]> {
self.line_items.as_deref()
}
}
impl std::fmt::Debug for LineItemGroup {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("LineItemGroup");
formatter.field("line_item_group_index", &self.line_item_group_index);
formatter.field("line_items", &self.line_items);
formatter.finish()
}
}
/// See [`LineItemGroup`](crate::model::LineItemGroup)
pub mod line_item_group {
/// A builder for [`LineItemGroup`](crate::model::LineItemGroup)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) line_item_group_index: std::option::Option<i32>,
pub(crate) line_items: std::option::Option<std::vec::Vec<crate::model::LineItemFields>>,
}
impl Builder {
/// <p>The number used to identify a specific table in a document. The first table encountered will have a LineItemGroupIndex of 1, the second 2, etc.</p>
pub fn line_item_group_index(mut self, input: i32) -> Self {
self.line_item_group_index = Some(input);
self
}
/// <p>The number used to identify a specific table in a document. The first table encountered will have a LineItemGroupIndex of 1, the second 2, etc.</p>
pub fn set_line_item_group_index(mut self, input: std::option::Option<i32>) -> Self {
self.line_item_group_index = input;
self
}
/// Appends an item to `line_items`.
///
/// To override the contents of this collection use [`set_line_items`](Self::set_line_items).
///
/// <p>The breakdown of information on a particular line of a table. </p>
pub fn line_items(mut self, input: crate::model::LineItemFields) -> Self {
let mut v = self.line_items.unwrap_or_default();
v.push(input);
self.line_items = Some(v);
self
}
/// <p>The breakdown of information on a particular line of a table. </p>
pub fn set_line_items(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::LineItemFields>>,
) -> Self {
self.line_items = input;
self
}
/// Consumes the builder and constructs a [`LineItemGroup`](crate::model::LineItemGroup)
pub fn build(self) -> crate::model::LineItemGroup {
crate::model::LineItemGroup {
line_item_group_index: self.line_item_group_index,
line_items: self.line_items,
}
}
}
}
impl LineItemGroup {
/// Creates a new builder-style object to manufacture [`LineItemGroup`](crate::model::LineItemGroup)
pub fn builder() -> crate::model::line_item_group::Builder {
crate::model::line_item_group::Builder::default()
}
}
/// <p>A structure that holds information about the different lines found in a document's tables.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct LineItemFields {
/// <p>ExpenseFields used to show information from detected lines on a table.</p>
pub line_item_expense_fields: std::option::Option<std::vec::Vec<crate::model::ExpenseField>>,
}
impl LineItemFields {
/// <p>ExpenseFields used to show information from detected lines on a table.</p>
pub fn line_item_expense_fields(&self) -> std::option::Option<&[crate::model::ExpenseField]> {
self.line_item_expense_fields.as_deref()
}
}
impl std::fmt::Debug for LineItemFields {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("LineItemFields");
formatter.field("line_item_expense_fields", &self.line_item_expense_fields);
formatter.finish()
}
}
/// See [`LineItemFields`](crate::model::LineItemFields)
pub mod line_item_fields {
/// A builder for [`LineItemFields`](crate::model::LineItemFields)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) line_item_expense_fields:
std::option::Option<std::vec::Vec<crate::model::ExpenseField>>,
}
impl Builder {
/// Appends an item to `line_item_expense_fields`.
///
/// To override the contents of this collection use [`set_line_item_expense_fields`](Self::set_line_item_expense_fields).
///
/// <p>ExpenseFields used to show information from detected lines on a table.</p>
pub fn line_item_expense_fields(mut self, input: crate::model::ExpenseField) -> Self {
let mut v = self.line_item_expense_fields.unwrap_or_default();
v.push(input);
self.line_item_expense_fields = Some(v);
self
}
/// <p>ExpenseFields used to show information from detected lines on a table.</p>
pub fn set_line_item_expense_fields(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::ExpenseField>>,
) -> Self {
self.line_item_expense_fields = input;
self
}
/// Consumes the builder and constructs a [`LineItemFields`](crate::model::LineItemFields)
pub fn build(self) -> crate::model::LineItemFields {
crate::model::LineItemFields {
line_item_expense_fields: self.line_item_expense_fields,
}
}
}
}
impl LineItemFields {
/// Creates a new builder-style object to manufacture [`LineItemFields`](crate::model::LineItemFields)
pub fn builder() -> crate::model::line_item_fields::Builder {
crate::model::line_item_fields::Builder::default()
}
}
/// <p>Breakdown of detected information, seperated into the catagories Type, LabelDetection, and ValueDetection</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ExpenseField {
/// <p>The implied label of a detected element. Present alongside LabelDetection for explicit elements.</p>
pub r#type: std::option::Option<crate::model::ExpenseType>,
/// <p>The explicitly stated label of a detected element.</p>
pub label_detection: std::option::Option<crate::model::ExpenseDetection>,
/// <p>The value of a detected element. Present in explicit and implicit elements.</p>
pub value_detection: std::option::Option<crate::model::ExpenseDetection>,
/// <p>The page number the value was detected on.</p>
pub page_number: std::option::Option<i32>,
}
impl ExpenseField {
/// <p>The implied label of a detected element. Present alongside LabelDetection for explicit elements.</p>
pub fn r#type(&self) -> std::option::Option<&crate::model::ExpenseType> {
self.r#type.as_ref()
}
/// <p>The explicitly stated label of a detected element.</p>
pub fn label_detection(&self) -> std::option::Option<&crate::model::ExpenseDetection> {
self.label_detection.as_ref()
}
/// <p>The value of a detected element. Present in explicit and implicit elements.</p>
pub fn value_detection(&self) -> std::option::Option<&crate::model::ExpenseDetection> {
self.value_detection.as_ref()
}
/// <p>The page number the value was detected on.</p>
pub fn page_number(&self) -> std::option::Option<i32> {
self.page_number
}
}
impl std::fmt::Debug for ExpenseField {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ExpenseField");
formatter.field("r#type", &self.r#type);
formatter.field("label_detection", &self.label_detection);
formatter.field("value_detection", &self.value_detection);
formatter.field("page_number", &self.page_number);
formatter.finish()
}
}
/// See [`ExpenseField`](crate::model::ExpenseField)
pub mod expense_field {
/// A builder for [`ExpenseField`](crate::model::ExpenseField)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) r#type: std::option::Option<crate::model::ExpenseType>,
pub(crate) label_detection: std::option::Option<crate::model::ExpenseDetection>,
pub(crate) value_detection: std::option::Option<crate::model::ExpenseDetection>,
pub(crate) page_number: std::option::Option<i32>,
}
impl Builder {
/// <p>The implied label of a detected element. Present alongside LabelDetection for explicit elements.</p>
pub fn r#type(mut self, input: crate::model::ExpenseType) -> Self {
self.r#type = Some(input);
self
}
/// <p>The implied label of a detected element. Present alongside LabelDetection for explicit elements.</p>
pub fn set_type(mut self, input: std::option::Option<crate::model::ExpenseType>) -> Self {
self.r#type = input;
self
}
/// <p>The explicitly stated label of a detected element.</p>
pub fn label_detection(mut self, input: crate::model::ExpenseDetection) -> Self {
self.label_detection = Some(input);
self
}
/// <p>The explicitly stated label of a detected element.</p>
pub fn set_label_detection(
mut self,
input: std::option::Option<crate::model::ExpenseDetection>,
) -> Self {
self.label_detection = input;
self
}
/// <p>The value of a detected element. Present in explicit and implicit elements.</p>
pub fn value_detection(mut self, input: crate::model::ExpenseDetection) -> Self {
self.value_detection = Some(input);
self
}
/// <p>The value of a detected element. Present in explicit and implicit elements.</p>
pub fn set_value_detection(
mut self,
input: std::option::Option<crate::model::ExpenseDetection>,
) -> Self {
self.value_detection = input;
self
}
/// <p>The page number the value was detected on.</p>
pub fn page_number(mut self, input: i32) -> Self {
self.page_number = Some(input);
self
}
/// <p>The page number the value was detected on.</p>
pub fn set_page_number(mut self, input: std::option::Option<i32>) -> Self {
self.page_number = input;
self
}
/// Consumes the builder and constructs a [`ExpenseField`](crate::model::ExpenseField)
pub fn build(self) -> crate::model::ExpenseField {
crate::model::ExpenseField {
r#type: self.r#type,
label_detection: self.label_detection,
value_detection: self.value_detection,
page_number: self.page_number,
}
}
}
}
impl ExpenseField {
/// Creates a new builder-style object to manufacture [`ExpenseField`](crate::model::ExpenseField)
pub fn builder() -> crate::model::expense_field::Builder {
crate::model::expense_field::Builder::default()
}
}
/// <p>An object used to store information about the Value or Label detected by Amazon Textract.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ExpenseDetection {
/// <p>The word or line of text recognized by Amazon Textract</p>
pub text: std::option::Option<std::string::String>,
/// <p>Information about where the following items are located on a document page: detected page, text, key-value pairs, tables, table cells, and selection elements.</p>
pub geometry: std::option::Option<crate::model::Geometry>,
/// <p>The confidence in detection, as a percentage</p>
pub confidence: std::option::Option<f32>,
}
impl ExpenseDetection {
/// <p>The word or line of text recognized by Amazon Textract</p>
pub fn text(&self) -> std::option::Option<&str> {
self.text.as_deref()
}
/// <p>Information about where the following items are located on a document page: detected page, text, key-value pairs, tables, table cells, and selection elements.</p>
pub fn geometry(&self) -> std::option::Option<&crate::model::Geometry> {
self.geometry.as_ref()
}
/// <p>The confidence in detection, as a percentage</p>
pub fn confidence(&self) -> std::option::Option<f32> {
self.confidence
}
}
impl std::fmt::Debug for ExpenseDetection {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ExpenseDetection");
formatter.field("text", &self.text);
formatter.field("geometry", &self.geometry);
formatter.field("confidence", &self.confidence);
formatter.finish()
}
}
/// See [`ExpenseDetection`](crate::model::ExpenseDetection)
pub mod expense_detection {
/// A builder for [`ExpenseDetection`](crate::model::ExpenseDetection)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) text: std::option::Option<std::string::String>,
pub(crate) geometry: std::option::Option<crate::model::Geometry>,
pub(crate) confidence: std::option::Option<f32>,
}
impl Builder {
/// <p>The word or line of text recognized by Amazon Textract</p>
pub fn text(mut self, input: impl Into<std::string::String>) -> Self {
self.text = Some(input.into());
self
}
/// <p>The word or line of text recognized by Amazon Textract</p>
pub fn set_text(mut self, input: std::option::Option<std::string::String>) -> Self {
self.text = input;
self
}
/// <p>Information about where the following items are located on a document page: detected page, text, key-value pairs, tables, table cells, and selection elements.</p>
pub fn geometry(mut self, input: crate::model::Geometry) -> Self {
self.geometry = Some(input);
self
}
/// <p>Information about where the following items are located on a document page: detected page, text, key-value pairs, tables, table cells, and selection elements.</p>
pub fn set_geometry(mut self, input: std::option::Option<crate::model::Geometry>) -> Self {
self.geometry = input;
self
}
/// <p>The confidence in detection, as a percentage</p>
pub fn confidence(mut self, input: f32) -> Self {
self.confidence = Some(input);
self
}
/// <p>The confidence in detection, as a percentage</p>
pub fn set_confidence(mut self, input: std::option::Option<f32>) -> Self {
self.confidence = input;
self
}
/// Consumes the builder and constructs a [`ExpenseDetection`](crate::model::ExpenseDetection)
pub fn build(self) -> crate::model::ExpenseDetection {
crate::model::ExpenseDetection {
text: self.text,
geometry: self.geometry,
confidence: self.confidence,
}
}
}
}
impl ExpenseDetection {
/// Creates a new builder-style object to manufacture [`ExpenseDetection`](crate::model::ExpenseDetection)
pub fn builder() -> crate::model::expense_detection::Builder {
crate::model::expense_detection::Builder::default()
}
}
/// <p>Information about where the following items are located on a document page: detected page, text, key-value pairs, tables, table cells, and selection elements.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct Geometry {
/// <p>An axis-aligned coarse representation of the location of the recognized item on the document page.</p>
pub bounding_box: std::option::Option<crate::model::BoundingBox>,
/// <p>Within the bounding box, a fine-grained polygon around the recognized item.</p>
pub polygon: std::option::Option<std::vec::Vec<crate::model::Point>>,
}
impl Geometry {
/// <p>An axis-aligned coarse representation of the location of the recognized item on the document page.</p>
pub fn bounding_box(&self) -> std::option::Option<&crate::model::BoundingBox> {
self.bounding_box.as_ref()
}
/// <p>Within the bounding box, a fine-grained polygon around the recognized item.</p>
pub fn polygon(&self) -> std::option::Option<&[crate::model::Point]> {
self.polygon.as_deref()
}
}
impl std::fmt::Debug for Geometry {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Geometry");
formatter.field("bounding_box", &self.bounding_box);
formatter.field("polygon", &self.polygon);
formatter.finish()
}
}
/// See [`Geometry`](crate::model::Geometry)
pub mod geometry {
/// A builder for [`Geometry`](crate::model::Geometry)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) bounding_box: std::option::Option<crate::model::BoundingBox>,
pub(crate) polygon: std::option::Option<std::vec::Vec<crate::model::Point>>,
}
impl Builder {
/// <p>An axis-aligned coarse representation of the location of the recognized item on the document page.</p>
pub fn bounding_box(mut self, input: crate::model::BoundingBox) -> Self {
self.bounding_box = Some(input);
self
}
/// <p>An axis-aligned coarse representation of the location of the recognized item on the document page.</p>
pub fn set_bounding_box(
mut self,
input: std::option::Option<crate::model::BoundingBox>,
) -> Self {
self.bounding_box = input;
self
}
/// Appends an item to `polygon`.
///
/// To override the contents of this collection use [`set_polygon`](Self::set_polygon).
///
/// <p>Within the bounding box, a fine-grained polygon around the recognized item.</p>
pub fn polygon(mut self, input: crate::model::Point) -> Self {
let mut v = self.polygon.unwrap_or_default();
v.push(input);
self.polygon = Some(v);
self
}
/// <p>Within the bounding box, a fine-grained polygon around the recognized item.</p>
pub fn set_polygon(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Point>>,
) -> Self {
self.polygon = input;
self
}
/// Consumes the builder and constructs a [`Geometry`](crate::model::Geometry)
pub fn build(self) -> crate::model::Geometry {
crate::model::Geometry {
bounding_box: self.bounding_box,
polygon: self.polygon,
}
}
}
}
impl Geometry {
/// Creates a new builder-style object to manufacture [`Geometry`](crate::model::Geometry)
pub fn builder() -> crate::model::geometry::Builder {
crate::model::geometry::Builder::default()
}
}
/// <p>The X and Y coordinates of a point on a document page. The X and Y values that are returned are ratios of the overall document page size. For example, if the input document is 700 x 200 and the operation returns X=0.5 and Y=0.25, then the point is at the (350,50) pixel coordinate on the document page.</p>
/// <p>An array of <code>Point</code> objects, <code>Polygon</code>, is returned by <code>DetectDocumentText</code>. <code>Polygon</code> represents a fine-grained polygon around detected text. For more information, see Geometry in the Amazon Textract Developer Guide. </p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct Point {
/// <p>The value of the X coordinate for a point on a <code>Polygon</code>.</p>
pub x: f32,
/// <p>The value of the Y coordinate for a point on a <code>Polygon</code>.</p>
pub y: f32,
}
impl Point {
/// <p>The value of the X coordinate for a point on a <code>Polygon</code>.</p>
pub fn x(&self) -> f32 {
self.x
}
/// <p>The value of the Y coordinate for a point on a <code>Polygon</code>.</p>
pub fn y(&self) -> f32 {
self.y
}
}
impl std::fmt::Debug for Point {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Point");
formatter.field("x", &self.x);
formatter.field("y", &self.y);
formatter.finish()
}
}
/// See [`Point`](crate::model::Point)
pub mod point {
/// A builder for [`Point`](crate::model::Point)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) x: std::option::Option<f32>,
pub(crate) y: std::option::Option<f32>,
}
impl Builder {
/// <p>The value of the X coordinate for a point on a <code>Polygon</code>.</p>
pub fn x(mut self, input: f32) -> Self {
self.x = Some(input);
self
}
/// <p>The value of the X coordinate for a point on a <code>Polygon</code>.</p>
pub fn set_x(mut self, input: std::option::Option<f32>) -> Self {
self.x = input;
self
}
/// <p>The value of the Y coordinate for a point on a <code>Polygon</code>.</p>
pub fn y(mut self, input: f32) -> Self {
self.y = Some(input);
self
}
/// <p>The value of the Y coordinate for a point on a <code>Polygon</code>.</p>
pub fn set_y(mut self, input: std::option::Option<f32>) -> Self {
self.y = input;
self
}
/// Consumes the builder and constructs a [`Point`](crate::model::Point)
pub fn build(self) -> crate::model::Point {
crate::model::Point {
x: self.x.unwrap_or_default(),
y: self.y.unwrap_or_default(),
}
}
}
}
impl Point {
/// Creates a new builder-style object to manufacture [`Point`](crate::model::Point)
pub fn builder() -> crate::model::point::Builder {
crate::model::point::Builder::default()
}
}
/// <p>The bounding box around the detected page, text, key-value pair, table, table cell, or selection element on a document page. The <code>left</code> (x-coordinate) and <code>top</code> (y-coordinate) are coordinates that represent the top and left sides of the bounding box. Note that the upper-left corner of the image is the origin (0,0). </p>
/// <p>The <code>top</code> and <code>left</code> values returned are ratios of the overall document page size. For example, if the input image is 700 x 200 pixels, and the top-left coordinate of the bounding box is 350 x 50 pixels, the API returns a <code>left</code> value of 0.5 (350/700) and a <code>top</code> value of 0.25 (50/200).</p>
/// <p>The <code>width</code> and <code>height</code> values represent the dimensions of the bounding box as a ratio of the overall document page dimension. For example, if the document page size is 700 x 200 pixels, and the bounding box width is 70 pixels, the width returned is 0.1. </p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct BoundingBox {
/// <p>The width of the bounding box as a ratio of the overall document page width.</p>
pub width: f32,
/// <p>The height of the bounding box as a ratio of the overall document page height.</p>
pub height: f32,
/// <p>The left coordinate of the bounding box as a ratio of overall document page width.</p>
pub left: f32,
/// <p>The top coordinate of the bounding box as a ratio of overall document page height.</p>
pub top: f32,
}
impl BoundingBox {
/// <p>The width of the bounding box as a ratio of the overall document page width.</p>
pub fn width(&self) -> f32 {
self.width
}
/// <p>The height of the bounding box as a ratio of the overall document page height.</p>
pub fn height(&self) -> f32 {
self.height
}
/// <p>The left coordinate of the bounding box as a ratio of overall document page width.</p>
pub fn left(&self) -> f32 {
self.left
}
/// <p>The top coordinate of the bounding box as a ratio of overall document page height.</p>
pub fn top(&self) -> f32 {
self.top
}
}
impl std::fmt::Debug for BoundingBox {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("BoundingBox");
formatter.field("width", &self.width);
formatter.field("height", &self.height);
formatter.field("left", &self.left);
formatter.field("top", &self.top);
formatter.finish()
}
}
/// See [`BoundingBox`](crate::model::BoundingBox)
pub mod bounding_box {
/// A builder for [`BoundingBox`](crate::model::BoundingBox)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) width: std::option::Option<f32>,
pub(crate) height: std::option::Option<f32>,
pub(crate) left: std::option::Option<f32>,
pub(crate) top: std::option::Option<f32>,
}
impl Builder {
/// <p>The width of the bounding box as a ratio of the overall document page width.</p>
pub fn width(mut self, input: f32) -> Self {
self.width = Some(input);
self
}
/// <p>The width of the bounding box as a ratio of the overall document page width.</p>
pub fn set_width(mut self, input: std::option::Option<f32>) -> Self {
self.width = input;
self
}
/// <p>The height of the bounding box as a ratio of the overall document page height.</p>
pub fn height(mut self, input: f32) -> Self {
self.height = Some(input);
self
}
/// <p>The height of the bounding box as a ratio of the overall document page height.</p>
pub fn set_height(mut self, input: std::option::Option<f32>) -> Self {
self.height = input;
self
}
/// <p>The left coordinate of the bounding box as a ratio of overall document page width.</p>
pub fn left(mut self, input: f32) -> Self {
self.left = Some(input);
self
}
/// <p>The left coordinate of the bounding box as a ratio of overall document page width.</p>
pub fn set_left(mut self, input: std::option::Option<f32>) -> Self {
self.left = input;
self
}
/// <p>The top coordinate of the bounding box as a ratio of overall document page height.</p>
pub fn top(mut self, input: f32) -> Self {
self.top = Some(input);
self
}
/// <p>The top coordinate of the bounding box as a ratio of overall document page height.</p>
pub fn set_top(mut self, input: std::option::Option<f32>) -> Self {
self.top = input;
self
}
/// Consumes the builder and constructs a [`BoundingBox`](crate::model::BoundingBox)
pub fn build(self) -> crate::model::BoundingBox {
crate::model::BoundingBox {
width: self.width.unwrap_or_default(),
height: self.height.unwrap_or_default(),
left: self.left.unwrap_or_default(),
top: self.top.unwrap_or_default(),
}
}
}
}
impl BoundingBox {
/// Creates a new builder-style object to manufacture [`BoundingBox`](crate::model::BoundingBox)
pub fn builder() -> crate::model::bounding_box::Builder {
crate::model::bounding_box::Builder::default()
}
}
/// <p>An object used to store information about the Type detected by Amazon Textract.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ExpenseType {
/// <p>The word or line of text detected by Amazon Textract.</p>
pub text: std::option::Option<std::string::String>,
/// <p>The confidence of accuracy, as a percentage.</p>
pub confidence: std::option::Option<f32>,
}
impl ExpenseType {
/// <p>The word or line of text detected by Amazon Textract.</p>
pub fn text(&self) -> std::option::Option<&str> {
self.text.as_deref()
}
/// <p>The confidence of accuracy, as a percentage.</p>
pub fn confidence(&self) -> std::option::Option<f32> {
self.confidence
}
}
impl std::fmt::Debug for ExpenseType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ExpenseType");
formatter.field("text", &self.text);
formatter.field("confidence", &self.confidence);
formatter.finish()
}
}
/// See [`ExpenseType`](crate::model::ExpenseType)
pub mod expense_type {
/// A builder for [`ExpenseType`](crate::model::ExpenseType)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) text: std::option::Option<std::string::String>,
pub(crate) confidence: std::option::Option<f32>,
}
impl Builder {
/// <p>The word or line of text detected by Amazon Textract.</p>
pub fn text(mut self, input: impl Into<std::string::String>) -> Self {
self.text = Some(input.into());
self
}
/// <p>The word or line of text detected by Amazon Textract.</p>
pub fn set_text(mut self, input: std::option::Option<std::string::String>) -> Self {
self.text = input;
self
}
/// <p>The confidence of accuracy, as a percentage.</p>
pub fn confidence(mut self, input: f32) -> Self {
self.confidence = Some(input);
self
}
/// <p>The confidence of accuracy, as a percentage.</p>
pub fn set_confidence(mut self, input: std::option::Option<f32>) -> Self {
self.confidence = input;
self
}
/// Consumes the builder and constructs a [`ExpenseType`](crate::model::ExpenseType)
pub fn build(self) -> crate::model::ExpenseType {
crate::model::ExpenseType {
text: self.text,
confidence: self.confidence,
}
}
}
}
impl ExpenseType {
/// Creates a new builder-style object to manufacture [`ExpenseType`](crate::model::ExpenseType)
pub fn builder() -> crate::model::expense_type::Builder {
crate::model::expense_type::Builder::default()
}
}
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum JobStatus {
#[allow(missing_docs)] // documentation missing in model
Failed,
#[allow(missing_docs)] // documentation missing in model
InProgress,
#[allow(missing_docs)] // documentation missing in model
PartialSuccess,
#[allow(missing_docs)] // documentation missing in model
Succeeded,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for JobStatus {
fn from(s: &str) -> Self {
match s {
"FAILED" => JobStatus::Failed,
"IN_PROGRESS" => JobStatus::InProgress,
"PARTIAL_SUCCESS" => JobStatus::PartialSuccess,
"SUCCEEDED" => JobStatus::Succeeded,
other => JobStatus::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for JobStatus {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(JobStatus::from(s))
}
}
impl JobStatus {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
JobStatus::Failed => "FAILED",
JobStatus::InProgress => "IN_PROGRESS",
JobStatus::PartialSuccess => "PARTIAL_SUCCESS",
JobStatus::Succeeded => "SUCCEEDED",
JobStatus::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&["FAILED", "IN_PROGRESS", "PARTIAL_SUCCESS", "SUCCEEDED"]
}
}
impl AsRef<str> for JobStatus {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>Information about the input document.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct DocumentMetadata {
/// <p>The number of pages that are detected in the document.</p>
pub pages: std::option::Option<i32>,
}
impl DocumentMetadata {
/// <p>The number of pages that are detected in the document.</p>
pub fn pages(&self) -> std::option::Option<i32> {
self.pages
}
}
impl std::fmt::Debug for DocumentMetadata {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("DocumentMetadata");
formatter.field("pages", &self.pages);
formatter.finish()
}
}
/// See [`DocumentMetadata`](crate::model::DocumentMetadata)
pub mod document_metadata {
/// A builder for [`DocumentMetadata`](crate::model::DocumentMetadata)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) pages: std::option::Option<i32>,
}
impl Builder {
/// <p>The number of pages that are detected in the document.</p>
pub fn pages(mut self, input: i32) -> Self {
self.pages = Some(input);
self
}
/// <p>The number of pages that are detected in the document.</p>
pub fn set_pages(mut self, input: std::option::Option<i32>) -> Self {
self.pages = input;
self
}
/// Consumes the builder and constructs a [`DocumentMetadata`](crate::model::DocumentMetadata)
pub fn build(self) -> crate::model::DocumentMetadata {
crate::model::DocumentMetadata { pages: self.pages }
}
}
}
impl DocumentMetadata {
/// Creates a new builder-style object to manufacture [`DocumentMetadata`](crate::model::DocumentMetadata)
pub fn builder() -> crate::model::document_metadata::Builder {
crate::model::document_metadata::Builder::default()
}
}
/// <p>A <code>Block</code> represents items that are recognized in a document within a group of pixels close to each other. The information returned in a <code>Block</code> object depends on the type of operation. In text detection for documents (for example <code>DetectDocumentText</code>), you get information about the detected words and lines of text. In text analysis (for example <code>AnalyzeDocument</code>), you can also get information about the fields, tables, and selection elements that are detected in the document.</p>
/// <p>An array of <code>Block</code> objects is returned by both synchronous and asynchronous operations. In synchronous operations, such as <code>DetectDocumentText</code>, the array of <code>Block</code> objects is the entire set of results. In asynchronous operations, such as <code>GetDocumentAnalysis</code>, the array is returned over one or more responses.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/textract/latest/dg/how-it-works.html">How Amazon Textract Works</a>.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct Block {
/// <p>The type of text item that's recognized. In operations for text detection, the following types are returned:</p>
/// <ul>
/// <li> <p> <i>PAGE</i> - Contains a list of the LINE <code>Block</code> objects that are detected on a document page.</p> </li>
/// <li> <p> <i>WORD</i> - A word detected on a document page. A word is one or more ISO basic Latin script characters that aren't separated by spaces.</p> </li>
/// <li> <p> <i>LINE</i> - A string of tab-delimited, contiguous words that are detected on a document page.</p> </li>
/// </ul>
/// <p>In text analysis operations, the following types are returned:</p>
/// <ul>
/// <li> <p> <i>PAGE</i> - Contains a list of child <code>Block</code> objects that are detected on a document page.</p> </li>
/// <li> <p> <i>KEY_VALUE_SET</i> - Stores the KEY and VALUE <code>Block</code> objects for linked text that's detected on a document page. Use the <code>EntityType</code> field to determine if a KEY_VALUE_SET object is a KEY <code>Block</code> object or a VALUE <code>Block</code> object. </p> </li>
/// <li> <p> <i>WORD</i> - A word that's detected on a document page. A word is one or more ISO basic Latin script characters that aren't separated by spaces.</p> </li>
/// <li> <p> <i>LINE</i> - A string of tab-delimited, contiguous words that are detected on a document page.</p> </li>
/// <li> <p> <i>TABLE</i> - A table that's detected on a document page. A table is grid-based information with two or more rows or columns, with a cell span of one row and one column each. </p> </li>
/// <li> <p> <i>CELL</i> - A cell within a detected table. The cell is the parent of the block that contains the text in the cell.</p> </li>
/// <li> <p> <i>SELECTION_ELEMENT</i> - A selection element such as an option button (radio button) or a check box that's detected on a document page. Use the value of <code>SelectionStatus</code> to determine the status of the selection element.</p> </li>
/// </ul>
pub block_type: std::option::Option<crate::model::BlockType>,
/// <p>The confidence score that Amazon Textract has in the accuracy of the recognized text and the accuracy of the geometry points around the recognized text.</p>
pub confidence: std::option::Option<f32>,
/// <p>The word or line of text that's recognized by Amazon Textract. </p>
pub text: std::option::Option<std::string::String>,
/// <p>The kind of text that Amazon Textract has detected. Can check for handwritten text and printed text.</p>
pub text_type: std::option::Option<crate::model::TextType>,
/// <p>The row in which a table cell is located. The first row position is 1. <code>RowIndex</code> isn't returned by <code>DetectDocumentText</code> and <code>GetDocumentTextDetection</code>.</p>
pub row_index: std::option::Option<i32>,
/// <p>The column in which a table cell appears. The first column position is 1. <code>ColumnIndex</code> isn't returned by <code>DetectDocumentText</code> and <code>GetDocumentTextDetection</code>.</p>
pub column_index: std::option::Option<i32>,
/// <p>The number of rows that a table cell spans. Currently this value is always 1, even if the number of rows spanned is greater than 1. <code>RowSpan</code> isn't returned by <code>DetectDocumentText</code> and <code>GetDocumentTextDetection</code>.</p>
pub row_span: std::option::Option<i32>,
/// <p>The number of columns that a table cell spans. Currently this value is always 1, even if the number of columns spanned is greater than 1. <code>ColumnSpan</code> isn't returned by <code>DetectDocumentText</code> and <code>GetDocumentTextDetection</code>. </p>
pub column_span: std::option::Option<i32>,
/// <p>The location of the recognized text on the image. It includes an axis-aligned, coarse bounding box that surrounds the text, and a finer-grain polygon for more accurate spatial information. </p>
pub geometry: std::option::Option<crate::model::Geometry>,
/// <p>The identifier for the recognized text. The identifier is only unique for a single operation. </p>
pub id: std::option::Option<std::string::String>,
/// <p>A list of child blocks of the current block. For example, a LINE object has child blocks for each WORD block that's part of the line of text. There aren't Relationship objects in the list for relationships that don't exist, such as when the current block has no child blocks. The list size can be the following:</p>
/// <ul>
/// <li> <p>0 - The block has no child blocks.</p> </li>
/// <li> <p>1 - The block has child blocks.</p> </li>
/// </ul>
pub relationships: std::option::Option<std::vec::Vec<crate::model::Relationship>>,
/// <p>The type of entity. The following can be returned:</p>
/// <ul>
/// <li> <p> <i>KEY</i> - An identifier for a field on the document.</p> </li>
/// <li> <p> <i>VALUE</i> - The field text.</p> </li>
/// </ul>
/// <p> <code>EntityTypes</code> isn't returned by <code>DetectDocumentText</code> and <code>GetDocumentTextDetection</code>.</p>
pub entity_types: std::option::Option<std::vec::Vec<crate::model::EntityType>>,
/// <p>The selection status of a selection element, such as an option button or check box. </p>
pub selection_status: std::option::Option<crate::model::SelectionStatus>,
/// <p>The page on which a block was detected. <code>Page</code> is returned by asynchronous operations. Page values greater than 1 are only returned for multipage documents that are in PDF or TIFF format. A scanned image (JPEG/PNG), even if it contains multiple document pages, is considered to be a single-page document. The value of <code>Page</code> is always 1. Synchronous operations don't return <code>Page</code> because every input document is considered to be a single-page document.</p>
pub page: std::option::Option<i32>,
}
impl Block {
/// <p>The type of text item that's recognized. In operations for text detection, the following types are returned:</p>
/// <ul>
/// <li> <p> <i>PAGE</i> - Contains a list of the LINE <code>Block</code> objects that are detected on a document page.</p> </li>
/// <li> <p> <i>WORD</i> - A word detected on a document page. A word is one or more ISO basic Latin script characters that aren't separated by spaces.</p> </li>
/// <li> <p> <i>LINE</i> - A string of tab-delimited, contiguous words that are detected on a document page.</p> </li>
/// </ul>
/// <p>In text analysis operations, the following types are returned:</p>
/// <ul>
/// <li> <p> <i>PAGE</i> - Contains a list of child <code>Block</code> objects that are detected on a document page.</p> </li>
/// <li> <p> <i>KEY_VALUE_SET</i> - Stores the KEY and VALUE <code>Block</code> objects for linked text that's detected on a document page. Use the <code>EntityType</code> field to determine if a KEY_VALUE_SET object is a KEY <code>Block</code> object or a VALUE <code>Block</code> object. </p> </li>
/// <li> <p> <i>WORD</i> - A word that's detected on a document page. A word is one or more ISO basic Latin script characters that aren't separated by spaces.</p> </li>
/// <li> <p> <i>LINE</i> - A string of tab-delimited, contiguous words that are detected on a document page.</p> </li>
/// <li> <p> <i>TABLE</i> - A table that's detected on a document page. A table is grid-based information with two or more rows or columns, with a cell span of one row and one column each. </p> </li>
/// <li> <p> <i>CELL</i> - A cell within a detected table. The cell is the parent of the block that contains the text in the cell.</p> </li>
/// <li> <p> <i>SELECTION_ELEMENT</i> - A selection element such as an option button (radio button) or a check box that's detected on a document page. Use the value of <code>SelectionStatus</code> to determine the status of the selection element.</p> </li>
/// </ul>
pub fn block_type(&self) -> std::option::Option<&crate::model::BlockType> {
self.block_type.as_ref()
}
/// <p>The confidence score that Amazon Textract has in the accuracy of the recognized text and the accuracy of the geometry points around the recognized text.</p>
pub fn confidence(&self) -> std::option::Option<f32> {
self.confidence
}
/// <p>The word or line of text that's recognized by Amazon Textract. </p>
pub fn text(&self) -> std::option::Option<&str> {
self.text.as_deref()
}
/// <p>The kind of text that Amazon Textract has detected. Can check for handwritten text and printed text.</p>
pub fn text_type(&self) -> std::option::Option<&crate::model::TextType> {
self.text_type.as_ref()
}
/// <p>The row in which a table cell is located. The first row position is 1. <code>RowIndex</code> isn't returned by <code>DetectDocumentText</code> and <code>GetDocumentTextDetection</code>.</p>
pub fn row_index(&self) -> std::option::Option<i32> {
self.row_index
}
/// <p>The column in which a table cell appears. The first column position is 1. <code>ColumnIndex</code> isn't returned by <code>DetectDocumentText</code> and <code>GetDocumentTextDetection</code>.</p>
pub fn column_index(&self) -> std::option::Option<i32> {
self.column_index
}
/// <p>The number of rows that a table cell spans. Currently this value is always 1, even if the number of rows spanned is greater than 1. <code>RowSpan</code> isn't returned by <code>DetectDocumentText</code> and <code>GetDocumentTextDetection</code>.</p>
pub fn row_span(&self) -> std::option::Option<i32> {
self.row_span
}
/// <p>The number of columns that a table cell spans. Currently this value is always 1, even if the number of columns spanned is greater than 1. <code>ColumnSpan</code> isn't returned by <code>DetectDocumentText</code> and <code>GetDocumentTextDetection</code>. </p>
pub fn column_span(&self) -> std::option::Option<i32> {
self.column_span
}
/// <p>The location of the recognized text on the image. It includes an axis-aligned, coarse bounding box that surrounds the text, and a finer-grain polygon for more accurate spatial information. </p>
pub fn geometry(&self) -> std::option::Option<&crate::model::Geometry> {
self.geometry.as_ref()
}
/// <p>The identifier for the recognized text. The identifier is only unique for a single operation. </p>
pub fn id(&self) -> std::option::Option<&str> {
self.id.as_deref()
}
/// <p>A list of child blocks of the current block. For example, a LINE object has child blocks for each WORD block that's part of the line of text. There aren't Relationship objects in the list for relationships that don't exist, such as when the current block has no child blocks. The list size can be the following:</p>
/// <ul>
/// <li> <p>0 - The block has no child blocks.</p> </li>
/// <li> <p>1 - The block has child blocks.</p> </li>
/// </ul>
pub fn relationships(&self) -> std::option::Option<&[crate::model::Relationship]> {
self.relationships.as_deref()
}
/// <p>The type of entity. The following can be returned:</p>
/// <ul>
/// <li> <p> <i>KEY</i> - An identifier for a field on the document.</p> </li>
/// <li> <p> <i>VALUE</i> - The field text.</p> </li>
/// </ul>
/// <p> <code>EntityTypes</code> isn't returned by <code>DetectDocumentText</code> and <code>GetDocumentTextDetection</code>.</p>
pub fn entity_types(&self) -> std::option::Option<&[crate::model::EntityType]> {
self.entity_types.as_deref()
}
/// <p>The selection status of a selection element, such as an option button or check box. </p>
pub fn selection_status(&self) -> std::option::Option<&crate::model::SelectionStatus> {
self.selection_status.as_ref()
}
/// <p>The page on which a block was detected. <code>Page</code> is returned by asynchronous operations. Page values greater than 1 are only returned for multipage documents that are in PDF or TIFF format. A scanned image (JPEG/PNG), even if it contains multiple document pages, is considered to be a single-page document. The value of <code>Page</code> is always 1. Synchronous operations don't return <code>Page</code> because every input document is considered to be a single-page document.</p>
pub fn page(&self) -> std::option::Option<i32> {
self.page
}
}
impl std::fmt::Debug for Block {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Block");
formatter.field("block_type", &self.block_type);
formatter.field("confidence", &self.confidence);
formatter.field("text", &self.text);
formatter.field("text_type", &self.text_type);
formatter.field("row_index", &self.row_index);
formatter.field("column_index", &self.column_index);
formatter.field("row_span", &self.row_span);
formatter.field("column_span", &self.column_span);
formatter.field("geometry", &self.geometry);
formatter.field("id", &self.id);
formatter.field("relationships", &self.relationships);
formatter.field("entity_types", &self.entity_types);
formatter.field("selection_status", &self.selection_status);
formatter.field("page", &self.page);
formatter.finish()
}
}
/// See [`Block`](crate::model::Block)
pub mod block {
/// A builder for [`Block`](crate::model::Block)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) block_type: std::option::Option<crate::model::BlockType>,
pub(crate) confidence: std::option::Option<f32>,
pub(crate) text: std::option::Option<std::string::String>,
pub(crate) text_type: std::option::Option<crate::model::TextType>,
pub(crate) row_index: std::option::Option<i32>,
pub(crate) column_index: std::option::Option<i32>,
pub(crate) row_span: std::option::Option<i32>,
pub(crate) column_span: std::option::Option<i32>,
pub(crate) geometry: std::option::Option<crate::model::Geometry>,
pub(crate) id: std::option::Option<std::string::String>,
pub(crate) relationships: std::option::Option<std::vec::Vec<crate::model::Relationship>>,
pub(crate) entity_types: std::option::Option<std::vec::Vec<crate::model::EntityType>>,
pub(crate) selection_status: std::option::Option<crate::model::SelectionStatus>,
pub(crate) page: std::option::Option<i32>,
}
impl Builder {
/// <p>The type of text item that's recognized. In operations for text detection, the following types are returned:</p>
/// <ul>
/// <li> <p> <i>PAGE</i> - Contains a list of the LINE <code>Block</code> objects that are detected on a document page.</p> </li>
/// <li> <p> <i>WORD</i> - A word detected on a document page. A word is one or more ISO basic Latin script characters that aren't separated by spaces.</p> </li>
/// <li> <p> <i>LINE</i> - A string of tab-delimited, contiguous words that are detected on a document page.</p> </li>
/// </ul>
/// <p>In text analysis operations, the following types are returned:</p>
/// <ul>
/// <li> <p> <i>PAGE</i> - Contains a list of child <code>Block</code> objects that are detected on a document page.</p> </li>
/// <li> <p> <i>KEY_VALUE_SET</i> - Stores the KEY and VALUE <code>Block</code> objects for linked text that's detected on a document page. Use the <code>EntityType</code> field to determine if a KEY_VALUE_SET object is a KEY <code>Block</code> object or a VALUE <code>Block</code> object. </p> </li>
/// <li> <p> <i>WORD</i> - A word that's detected on a document page. A word is one or more ISO basic Latin script characters that aren't separated by spaces.</p> </li>
/// <li> <p> <i>LINE</i> - A string of tab-delimited, contiguous words that are detected on a document page.</p> </li>
/// <li> <p> <i>TABLE</i> - A table that's detected on a document page. A table is grid-based information with two or more rows or columns, with a cell span of one row and one column each. </p> </li>
/// <li> <p> <i>CELL</i> - A cell within a detected table. The cell is the parent of the block that contains the text in the cell.</p> </li>
/// <li> <p> <i>SELECTION_ELEMENT</i> - A selection element such as an option button (radio button) or a check box that's detected on a document page. Use the value of <code>SelectionStatus</code> to determine the status of the selection element.</p> </li>
/// </ul>
pub fn block_type(mut self, input: crate::model::BlockType) -> Self {
self.block_type = Some(input);
self
}
/// <p>The type of text item that's recognized. In operations for text detection, the following types are returned:</p>
/// <ul>
/// <li> <p> <i>PAGE</i> - Contains a list of the LINE <code>Block</code> objects that are detected on a document page.</p> </li>
/// <li> <p> <i>WORD</i> - A word detected on a document page. A word is one or more ISO basic Latin script characters that aren't separated by spaces.</p> </li>
/// <li> <p> <i>LINE</i> - A string of tab-delimited, contiguous words that are detected on a document page.</p> </li>
/// </ul>
/// <p>In text analysis operations, the following types are returned:</p>
/// <ul>
/// <li> <p> <i>PAGE</i> - Contains a list of child <code>Block</code> objects that are detected on a document page.</p> </li>
/// <li> <p> <i>KEY_VALUE_SET</i> - Stores the KEY and VALUE <code>Block</code> objects for linked text that's detected on a document page. Use the <code>EntityType</code> field to determine if a KEY_VALUE_SET object is a KEY <code>Block</code> object or a VALUE <code>Block</code> object. </p> </li>
/// <li> <p> <i>WORD</i> - A word that's detected on a document page. A word is one or more ISO basic Latin script characters that aren't separated by spaces.</p> </li>
/// <li> <p> <i>LINE</i> - A string of tab-delimited, contiguous words that are detected on a document page.</p> </li>
/// <li> <p> <i>TABLE</i> - A table that's detected on a document page. A table is grid-based information with two or more rows or columns, with a cell span of one row and one column each. </p> </li>
/// <li> <p> <i>CELL</i> - A cell within a detected table. The cell is the parent of the block that contains the text in the cell.</p> </li>
/// <li> <p> <i>SELECTION_ELEMENT</i> - A selection element such as an option button (radio button) or a check box that's detected on a document page. Use the value of <code>SelectionStatus</code> to determine the status of the selection element.</p> </li>
/// </ul>
pub fn set_block_type(
mut self,
input: std::option::Option<crate::model::BlockType>,
) -> Self {
self.block_type = input;
self
}
/// <p>The confidence score that Amazon Textract has in the accuracy of the recognized text and the accuracy of the geometry points around the recognized text.</p>
pub fn confidence(mut self, input: f32) -> Self {
self.confidence = Some(input);
self
}
/// <p>The confidence score that Amazon Textract has in the accuracy of the recognized text and the accuracy of the geometry points around the recognized text.</p>
pub fn set_confidence(mut self, input: std::option::Option<f32>) -> Self {
self.confidence = input;
self
}
/// <p>The word or line of text that's recognized by Amazon Textract. </p>
pub fn text(mut self, input: impl Into<std::string::String>) -> Self {
self.text = Some(input.into());
self
}
/// <p>The word or line of text that's recognized by Amazon Textract. </p>
pub fn set_text(mut self, input: std::option::Option<std::string::String>) -> Self {
self.text = input;
self
}
/// <p>The kind of text that Amazon Textract has detected. Can check for handwritten text and printed text.</p>
pub fn text_type(mut self, input: crate::model::TextType) -> Self {
self.text_type = Some(input);
self
}
/// <p>The kind of text that Amazon Textract has detected. Can check for handwritten text and printed text.</p>
pub fn set_text_type(mut self, input: std::option::Option<crate::model::TextType>) -> Self {
self.text_type = input;
self
}
/// <p>The row in which a table cell is located. The first row position is 1. <code>RowIndex</code> isn't returned by <code>DetectDocumentText</code> and <code>GetDocumentTextDetection</code>.</p>
pub fn row_index(mut self, input: i32) -> Self {
self.row_index = Some(input);
self
}
/// <p>The row in which a table cell is located. The first row position is 1. <code>RowIndex</code> isn't returned by <code>DetectDocumentText</code> and <code>GetDocumentTextDetection</code>.</p>
pub fn set_row_index(mut self, input: std::option::Option<i32>) -> Self {
self.row_index = input;
self
}
/// <p>The column in which a table cell appears. The first column position is 1. <code>ColumnIndex</code> isn't returned by <code>DetectDocumentText</code> and <code>GetDocumentTextDetection</code>.</p>
pub fn column_index(mut self, input: i32) -> Self {
self.column_index = Some(input);
self
}
/// <p>The column in which a table cell appears. The first column position is 1. <code>ColumnIndex</code> isn't returned by <code>DetectDocumentText</code> and <code>GetDocumentTextDetection</code>.</p>
pub fn set_column_index(mut self, input: std::option::Option<i32>) -> Self {
self.column_index = input;
self
}
/// <p>The number of rows that a table cell spans. Currently this value is always 1, even if the number of rows spanned is greater than 1. <code>RowSpan</code> isn't returned by <code>DetectDocumentText</code> and <code>GetDocumentTextDetection</code>.</p>
pub fn row_span(mut self, input: i32) -> Self {
self.row_span = Some(input);
self
}
/// <p>The number of rows that a table cell spans. Currently this value is always 1, even if the number of rows spanned is greater than 1. <code>RowSpan</code> isn't returned by <code>DetectDocumentText</code> and <code>GetDocumentTextDetection</code>.</p>
pub fn set_row_span(mut self, input: std::option::Option<i32>) -> Self {
self.row_span = input;
self
}
/// <p>The number of columns that a table cell spans. Currently this value is always 1, even if the number of columns spanned is greater than 1. <code>ColumnSpan</code> isn't returned by <code>DetectDocumentText</code> and <code>GetDocumentTextDetection</code>. </p>
pub fn column_span(mut self, input: i32) -> Self {
self.column_span = Some(input);
self
}
/// <p>The number of columns that a table cell spans. Currently this value is always 1, even if the number of columns spanned is greater than 1. <code>ColumnSpan</code> isn't returned by <code>DetectDocumentText</code> and <code>GetDocumentTextDetection</code>. </p>
pub fn set_column_span(mut self, input: std::option::Option<i32>) -> Self {
self.column_span = input;
self
}
/// <p>The location of the recognized text on the image. It includes an axis-aligned, coarse bounding box that surrounds the text, and a finer-grain polygon for more accurate spatial information. </p>
pub fn geometry(mut self, input: crate::model::Geometry) -> Self {
self.geometry = Some(input);
self
}
/// <p>The location of the recognized text on the image. It includes an axis-aligned, coarse bounding box that surrounds the text, and a finer-grain polygon for more accurate spatial information. </p>
pub fn set_geometry(mut self, input: std::option::Option<crate::model::Geometry>) -> Self {
self.geometry = input;
self
}
/// <p>The identifier for the recognized text. The identifier is only unique for a single operation. </p>
pub fn id(mut self, input: impl Into<std::string::String>) -> Self {
self.id = Some(input.into());
self
}
/// <p>The identifier for the recognized text. The identifier is only unique for a single operation. </p>
pub fn set_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.id = input;
self
}
/// Appends an item to `relationships`.
///
/// To override the contents of this collection use [`set_relationships`](Self::set_relationships).
///
/// <p>A list of child blocks of the current block. For example, a LINE object has child blocks for each WORD block that's part of the line of text. There aren't Relationship objects in the list for relationships that don't exist, such as when the current block has no child blocks. The list size can be the following:</p>
/// <ul>
/// <li> <p>0 - The block has no child blocks.</p> </li>
/// <li> <p>1 - The block has child blocks.</p> </li>
/// </ul>
pub fn relationships(mut self, input: crate::model::Relationship) -> Self {
let mut v = self.relationships.unwrap_or_default();
v.push(input);
self.relationships = Some(v);
self
}
/// <p>A list of child blocks of the current block. For example, a LINE object has child blocks for each WORD block that's part of the line of text. There aren't Relationship objects in the list for relationships that don't exist, such as when the current block has no child blocks. The list size can be the following:</p>
/// <ul>
/// <li> <p>0 - The block has no child blocks.</p> </li>
/// <li> <p>1 - The block has child blocks.</p> </li>
/// </ul>
pub fn set_relationships(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Relationship>>,
) -> Self {
self.relationships = input;
self
}
/// Appends an item to `entity_types`.
///
/// To override the contents of this collection use [`set_entity_types`](Self::set_entity_types).
///
/// <p>The type of entity. The following can be returned:</p>
/// <ul>
/// <li> <p> <i>KEY</i> - An identifier for a field on the document.</p> </li>
/// <li> <p> <i>VALUE</i> - The field text.</p> </li>
/// </ul>
/// <p> <code>EntityTypes</code> isn't returned by <code>DetectDocumentText</code> and <code>GetDocumentTextDetection</code>.</p>
pub fn entity_types(mut self, input: crate::model::EntityType) -> Self {
let mut v = self.entity_types.unwrap_or_default();
v.push(input);
self.entity_types = Some(v);
self
}
/// <p>The type of entity. The following can be returned:</p>
/// <ul>
/// <li> <p> <i>KEY</i> - An identifier for a field on the document.</p> </li>
/// <li> <p> <i>VALUE</i> - The field text.</p> </li>
/// </ul>
/// <p> <code>EntityTypes</code> isn't returned by <code>DetectDocumentText</code> and <code>GetDocumentTextDetection</code>.</p>
pub fn set_entity_types(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::EntityType>>,
) -> Self {
self.entity_types = input;
self
}
/// <p>The selection status of a selection element, such as an option button or check box. </p>
pub fn selection_status(mut self, input: crate::model::SelectionStatus) -> Self {
self.selection_status = Some(input);
self
}
/// <p>The selection status of a selection element, such as an option button or check box. </p>
pub fn set_selection_status(
mut self,
input: std::option::Option<crate::model::SelectionStatus>,
) -> Self {
self.selection_status = input;
self
}
/// <p>The page on which a block was detected. <code>Page</code> is returned by asynchronous operations. Page values greater than 1 are only returned for multipage documents that are in PDF or TIFF format. A scanned image (JPEG/PNG), even if it contains multiple document pages, is considered to be a single-page document. The value of <code>Page</code> is always 1. Synchronous operations don't return <code>Page</code> because every input document is considered to be a single-page document.</p>
pub fn page(mut self, input: i32) -> Self {
self.page = Some(input);
self
}
/// <p>The page on which a block was detected. <code>Page</code> is returned by asynchronous operations. Page values greater than 1 are only returned for multipage documents that are in PDF or TIFF format. A scanned image (JPEG/PNG), even if it contains multiple document pages, is considered to be a single-page document. The value of <code>Page</code> is always 1. Synchronous operations don't return <code>Page</code> because every input document is considered to be a single-page document.</p>
pub fn set_page(mut self, input: std::option::Option<i32>) -> Self {
self.page = input;
self
}
/// Consumes the builder and constructs a [`Block`](crate::model::Block)
pub fn build(self) -> crate::model::Block {
crate::model::Block {
block_type: self.block_type,
confidence: self.confidence,
text: self.text,
text_type: self.text_type,
row_index: self.row_index,
column_index: self.column_index,
row_span: self.row_span,
column_span: self.column_span,
geometry: self.geometry,
id: self.id,
relationships: self.relationships,
entity_types: self.entity_types,
selection_status: self.selection_status,
page: self.page,
}
}
}
}
impl Block {
/// Creates a new builder-style object to manufacture [`Block`](crate::model::Block)
pub fn builder() -> crate::model::block::Builder {
crate::model::block::Builder::default()
}
}
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum SelectionStatus {
#[allow(missing_docs)] // documentation missing in model
NotSelected,
#[allow(missing_docs)] // documentation missing in model
Selected,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for SelectionStatus {
fn from(s: &str) -> Self {
match s {
"NOT_SELECTED" => SelectionStatus::NotSelected,
"SELECTED" => SelectionStatus::Selected,
other => SelectionStatus::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for SelectionStatus {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(SelectionStatus::from(s))
}
}
impl SelectionStatus {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
SelectionStatus::NotSelected => "NOT_SELECTED",
SelectionStatus::Selected => "SELECTED",
SelectionStatus::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&["NOT_SELECTED", "SELECTED"]
}
}
impl AsRef<str> for SelectionStatus {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum EntityType {
#[allow(missing_docs)] // documentation missing in model
Key,
#[allow(missing_docs)] // documentation missing in model
Value,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for EntityType {
fn from(s: &str) -> Self {
match s {
"KEY" => EntityType::Key,
"VALUE" => EntityType::Value,
other => EntityType::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for EntityType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(EntityType::from(s))
}
}
impl EntityType {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
EntityType::Key => "KEY",
EntityType::Value => "VALUE",
EntityType::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&["KEY", "VALUE"]
}
}
impl AsRef<str> for EntityType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>Information about how blocks are related to each other. A <code>Block</code> object contains 0 or more <code>Relation</code> objects in a list, <code>Relationships</code>. For more information, see <code>Block</code>.</p>
/// <p>The <code>Type</code> element provides the type of the relationship for all blocks in the <code>IDs</code> array. </p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct Relationship {
/// <p>The type of relationship that the blocks in the IDs array have with the current block. The relationship can be <code>VALUE</code> or <code>CHILD</code>. A relationship of type VALUE is a list that contains the ID of the VALUE block that's associated with the KEY of a key-value pair. A relationship of type CHILD is a list of IDs that identify WORD blocks in the case of lines Cell blocks in the case of Tables, and WORD blocks in the case of Selection Elements.</p>
pub r#type: std::option::Option<crate::model::RelationshipType>,
/// <p>An array of IDs for related blocks. You can get the type of the relationship from the <code>Type</code> element.</p>
pub ids: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl Relationship {
/// <p>The type of relationship that the blocks in the IDs array have with the current block. The relationship can be <code>VALUE</code> or <code>CHILD</code>. A relationship of type VALUE is a list that contains the ID of the VALUE block that's associated with the KEY of a key-value pair. A relationship of type CHILD is a list of IDs that identify WORD blocks in the case of lines Cell blocks in the case of Tables, and WORD blocks in the case of Selection Elements.</p>
pub fn r#type(&self) -> std::option::Option<&crate::model::RelationshipType> {
self.r#type.as_ref()
}
/// <p>An array of IDs for related blocks. You can get the type of the relationship from the <code>Type</code> element.</p>
pub fn ids(&self) -> std::option::Option<&[std::string::String]> {
self.ids.as_deref()
}
}
impl std::fmt::Debug for Relationship {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Relationship");
formatter.field("r#type", &self.r#type);
formatter.field("ids", &self.ids);
formatter.finish()
}
}
/// See [`Relationship`](crate::model::Relationship)
pub mod relationship {
/// A builder for [`Relationship`](crate::model::Relationship)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) r#type: std::option::Option<crate::model::RelationshipType>,
pub(crate) ids: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl Builder {
/// <p>The type of relationship that the blocks in the IDs array have with the current block. The relationship can be <code>VALUE</code> or <code>CHILD</code>. A relationship of type VALUE is a list that contains the ID of the VALUE block that's associated with the KEY of a key-value pair. A relationship of type CHILD is a list of IDs that identify WORD blocks in the case of lines Cell blocks in the case of Tables, and WORD blocks in the case of Selection Elements.</p>
pub fn r#type(mut self, input: crate::model::RelationshipType) -> Self {
self.r#type = Some(input);
self
}
/// <p>The type of relationship that the blocks in the IDs array have with the current block. The relationship can be <code>VALUE</code> or <code>CHILD</code>. A relationship of type VALUE is a list that contains the ID of the VALUE block that's associated with the KEY of a key-value pair. A relationship of type CHILD is a list of IDs that identify WORD blocks in the case of lines Cell blocks in the case of Tables, and WORD blocks in the case of Selection Elements.</p>
pub fn set_type(
mut self,
input: std::option::Option<crate::model::RelationshipType>,
) -> Self {
self.r#type = input;
self
}
/// Appends an item to `ids`.
///
/// To override the contents of this collection use [`set_ids`](Self::set_ids).
///
/// <p>An array of IDs for related blocks. You can get the type of the relationship from the <code>Type</code> element.</p>
pub fn ids(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.ids.unwrap_or_default();
v.push(input.into());
self.ids = Some(v);
self
}
/// <p>An array of IDs for related blocks. You can get the type of the relationship from the <code>Type</code> element.</p>
pub fn set_ids(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.ids = input;
self
}
/// Consumes the builder and constructs a [`Relationship`](crate::model::Relationship)
pub fn build(self) -> crate::model::Relationship {
crate::model::Relationship {
r#type: self.r#type,
ids: self.ids,
}
}
}
}
impl Relationship {
/// Creates a new builder-style object to manufacture [`Relationship`](crate::model::Relationship)
pub fn builder() -> crate::model::relationship::Builder {
crate::model::relationship::Builder::default()
}
}
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum RelationshipType {
#[allow(missing_docs)] // documentation missing in model
Child,
#[allow(missing_docs)] // documentation missing in model
ComplexFeatures,
#[allow(missing_docs)] // documentation missing in model
Value,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for RelationshipType {
fn from(s: &str) -> Self {
match s {
"CHILD" => RelationshipType::Child,
"COMPLEX_FEATURES" => RelationshipType::ComplexFeatures,
"VALUE" => RelationshipType::Value,
other => RelationshipType::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for RelationshipType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(RelationshipType::from(s))
}
}
impl RelationshipType {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
RelationshipType::Child => "CHILD",
RelationshipType::ComplexFeatures => "COMPLEX_FEATURES",
RelationshipType::Value => "VALUE",
RelationshipType::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&["CHILD", "COMPLEX_FEATURES", "VALUE"]
}
}
impl AsRef<str> for RelationshipType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum TextType {
#[allow(missing_docs)] // documentation missing in model
Handwriting,
#[allow(missing_docs)] // documentation missing in model
Printed,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for TextType {
fn from(s: &str) -> Self {
match s {
"HANDWRITING" => TextType::Handwriting,
"PRINTED" => TextType::Printed,
other => TextType::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for TextType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(TextType::from(s))
}
}
impl TextType {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
TextType::Handwriting => "HANDWRITING",
TextType::Printed => "PRINTED",
TextType::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&["HANDWRITING", "PRINTED"]
}
}
impl AsRef<str> for TextType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum BlockType {
#[allow(missing_docs)] // documentation missing in model
Cell,
#[allow(missing_docs)] // documentation missing in model
KeyValueSet,
#[allow(missing_docs)] // documentation missing in model
Line,
#[allow(missing_docs)] // documentation missing in model
Page,
#[allow(missing_docs)] // documentation missing in model
SelectionElement,
#[allow(missing_docs)] // documentation missing in model
Table,
#[allow(missing_docs)] // documentation missing in model
Word,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for BlockType {
fn from(s: &str) -> Self {
match s {
"CELL" => BlockType::Cell,
"KEY_VALUE_SET" => BlockType::KeyValueSet,
"LINE" => BlockType::Line,
"PAGE" => BlockType::Page,
"SELECTION_ELEMENT" => BlockType::SelectionElement,
"TABLE" => BlockType::Table,
"WORD" => BlockType::Word,
other => BlockType::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for BlockType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(BlockType::from(s))
}
}
impl BlockType {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
BlockType::Cell => "CELL",
BlockType::KeyValueSet => "KEY_VALUE_SET",
BlockType::Line => "LINE",
BlockType::Page => "PAGE",
BlockType::SelectionElement => "SELECTION_ELEMENT",
BlockType::Table => "TABLE",
BlockType::Word => "WORD",
BlockType::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&[
"CELL",
"KEY_VALUE_SET",
"LINE",
"PAGE",
"SELECTION_ELEMENT",
"TABLE",
"WORD",
]
}
}
impl AsRef<str> for BlockType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>The input document, either as bytes or as an S3 object.</p>
/// <p>You pass image bytes to an Amazon Textract API operation by using the <code>Bytes</code> property. For example, you would use the <code>Bytes</code> property to pass a document loaded from a local file system. Image bytes passed by using the <code>Bytes</code> property must be base64 encoded. Your code might not need to encode document file bytes if you're using an AWS SDK to call Amazon Textract API operations. </p>
/// <p>You pass images stored in an S3 bucket to an Amazon Textract API operation by using the <code>S3Object</code> property. Documents stored in an S3 bucket don't need to be base64 encoded.</p>
/// <p>The AWS Region for the S3 bucket that contains the S3 object must match the AWS Region that you use for Amazon Textract operations.</p>
/// <p>If you use the AWS CLI to call Amazon Textract operations, passing image bytes using the Bytes property isn't supported. You must first upload the document to an Amazon S3 bucket, and then call the operation using the S3Object property.</p>
/// <p>For Amazon Textract to process an S3 object, the user must have permission to access the S3 object. </p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct Document {
/// <p>A blob of base64-encoded document bytes. The maximum size of a document that's provided in a blob of bytes is 5 MB. The document bytes must be in PNG or JPEG format.</p>
/// <p>If you're using an AWS SDK to call Amazon Textract, you might not need to base64-encode image bytes passed using the <code>Bytes</code> field. </p>
pub bytes: std::option::Option<aws_smithy_types::Blob>,
/// <p>Identifies an S3 object as the document source. The maximum size of a document that's stored in an S3 bucket is 5 MB.</p>
pub s3_object: std::option::Option<crate::model::S3Object>,
}
impl Document {
/// <p>A blob of base64-encoded document bytes. The maximum size of a document that's provided in a blob of bytes is 5 MB. The document bytes must be in PNG or JPEG format.</p>
/// <p>If you're using an AWS SDK to call Amazon Textract, you might not need to base64-encode image bytes passed using the <code>Bytes</code> field. </p>
pub fn bytes(&self) -> std::option::Option<&aws_smithy_types::Blob> {
self.bytes.as_ref()
}
/// <p>Identifies an S3 object as the document source. The maximum size of a document that's stored in an S3 bucket is 5 MB.</p>
pub fn s3_object(&self) -> std::option::Option<&crate::model::S3Object> {
self.s3_object.as_ref()
}
}
impl std::fmt::Debug for Document {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Document");
formatter.field("bytes", &self.bytes);
formatter.field("s3_object", &self.s3_object);
formatter.finish()
}
}
/// See [`Document`](crate::model::Document)
pub mod document {
/// A builder for [`Document`](crate::model::Document)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) bytes: std::option::Option<aws_smithy_types::Blob>,
pub(crate) s3_object: std::option::Option<crate::model::S3Object>,
}
impl Builder {
/// <p>A blob of base64-encoded document bytes. The maximum size of a document that's provided in a blob of bytes is 5 MB. The document bytes must be in PNG or JPEG format.</p>
/// <p>If you're using an AWS SDK to call Amazon Textract, you might not need to base64-encode image bytes passed using the <code>Bytes</code> field. </p>
pub fn bytes(mut self, input: aws_smithy_types::Blob) -> Self {
self.bytes = Some(input);
self
}
/// <p>A blob of base64-encoded document bytes. The maximum size of a document that's provided in a blob of bytes is 5 MB. The document bytes must be in PNG or JPEG format.</p>
/// <p>If you're using an AWS SDK to call Amazon Textract, you might not need to base64-encode image bytes passed using the <code>Bytes</code> field. </p>
pub fn set_bytes(mut self, input: std::option::Option<aws_smithy_types::Blob>) -> Self {
self.bytes = input;
self
}
/// <p>Identifies an S3 object as the document source. The maximum size of a document that's stored in an S3 bucket is 5 MB.</p>
pub fn s3_object(mut self, input: crate::model::S3Object) -> Self {
self.s3_object = Some(input);
self
}
/// <p>Identifies an S3 object as the document source. The maximum size of a document that's stored in an S3 bucket is 5 MB.</p>
pub fn set_s3_object(mut self, input: std::option::Option<crate::model::S3Object>) -> Self {
self.s3_object = input;
self
}
/// Consumes the builder and constructs a [`Document`](crate::model::Document)
pub fn build(self) -> crate::model::Document {
crate::model::Document {
bytes: self.bytes,
s3_object: self.s3_object,
}
}
}
}
impl Document {
/// Creates a new builder-style object to manufacture [`Document`](crate::model::Document)
pub fn builder() -> crate::model::document::Builder {
crate::model::document::Builder::default()
}
}
/// <p>The structure that lists each document processed in an AnalyzeID operation.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct IdentityDocument {
/// <p>Denotes the placement of a document in the IdentityDocument list. The first document is marked 1, the second 2 and so on.</p>
pub document_index: std::option::Option<i32>,
/// <p>The structure used to record information extracted from identity documents. Contains both normalized field and value of the extracted text.</p>
pub identity_document_fields:
std::option::Option<std::vec::Vec<crate::model::IdentityDocumentField>>,
}
impl IdentityDocument {
/// <p>Denotes the placement of a document in the IdentityDocument list. The first document is marked 1, the second 2 and so on.</p>
pub fn document_index(&self) -> std::option::Option<i32> {
self.document_index
}
/// <p>The structure used to record information extracted from identity documents. Contains both normalized field and value of the extracted text.</p>
pub fn identity_document_fields(
&self,
) -> std::option::Option<&[crate::model::IdentityDocumentField]> {
self.identity_document_fields.as_deref()
}
}
impl std::fmt::Debug for IdentityDocument {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("IdentityDocument");
formatter.field("document_index", &self.document_index);
formatter.field("identity_document_fields", &self.identity_document_fields);
formatter.finish()
}
}
/// See [`IdentityDocument`](crate::model::IdentityDocument)
pub mod identity_document {
/// A builder for [`IdentityDocument`](crate::model::IdentityDocument)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) document_index: std::option::Option<i32>,
pub(crate) identity_document_fields:
std::option::Option<std::vec::Vec<crate::model::IdentityDocumentField>>,
}
impl Builder {
/// <p>Denotes the placement of a document in the IdentityDocument list. The first document is marked 1, the second 2 and so on.</p>
pub fn document_index(mut self, input: i32) -> Self {
self.document_index = Some(input);
self
}
/// <p>Denotes the placement of a document in the IdentityDocument list. The first document is marked 1, the second 2 and so on.</p>
pub fn set_document_index(mut self, input: std::option::Option<i32>) -> Self {
self.document_index = input;
self
}
/// Appends an item to `identity_document_fields`.
///
/// To override the contents of this collection use [`set_identity_document_fields`](Self::set_identity_document_fields).
///
/// <p>The structure used to record information extracted from identity documents. Contains both normalized field and value of the extracted text.</p>
pub fn identity_document_fields(
mut self,
input: crate::model::IdentityDocumentField,
) -> Self {
let mut v = self.identity_document_fields.unwrap_or_default();
v.push(input);
self.identity_document_fields = Some(v);
self
}
/// <p>The structure used to record information extracted from identity documents. Contains both normalized field and value of the extracted text.</p>
pub fn set_identity_document_fields(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::IdentityDocumentField>>,
) -> Self {
self.identity_document_fields = input;
self
}
/// Consumes the builder and constructs a [`IdentityDocument`](crate::model::IdentityDocument)
pub fn build(self) -> crate::model::IdentityDocument {
crate::model::IdentityDocument {
document_index: self.document_index,
identity_document_fields: self.identity_document_fields,
}
}
}
}
impl IdentityDocument {
/// Creates a new builder-style object to manufacture [`IdentityDocument`](crate::model::IdentityDocument)
pub fn builder() -> crate::model::identity_document::Builder {
crate::model::identity_document::Builder::default()
}
}
/// <p>Structure containing both the normalized type of the extracted information and the text associated with it. These are extracted as Type and Value respectively.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct IdentityDocumentField {
/// <p>Used to contain the information detected by an AnalyzeID operation.</p>
pub r#type: std::option::Option<crate::model::AnalyzeIdDetections>,
/// <p>Used to contain the information detected by an AnalyzeID operation.</p>
pub value_detection: std::option::Option<crate::model::AnalyzeIdDetections>,
}
impl IdentityDocumentField {
/// <p>Used to contain the information detected by an AnalyzeID operation.</p>
pub fn r#type(&self) -> std::option::Option<&crate::model::AnalyzeIdDetections> {
self.r#type.as_ref()
}
/// <p>Used to contain the information detected by an AnalyzeID operation.</p>
pub fn value_detection(&self) -> std::option::Option<&crate::model::AnalyzeIdDetections> {
self.value_detection.as_ref()
}
}
impl std::fmt::Debug for IdentityDocumentField {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("IdentityDocumentField");
formatter.field("r#type", &self.r#type);
formatter.field("value_detection", &self.value_detection);
formatter.finish()
}
}
/// See [`IdentityDocumentField`](crate::model::IdentityDocumentField)
pub mod identity_document_field {
/// A builder for [`IdentityDocumentField`](crate::model::IdentityDocumentField)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) r#type: std::option::Option<crate::model::AnalyzeIdDetections>,
pub(crate) value_detection: std::option::Option<crate::model::AnalyzeIdDetections>,
}
impl Builder {
/// <p>Used to contain the information detected by an AnalyzeID operation.</p>
pub fn r#type(mut self, input: crate::model::AnalyzeIdDetections) -> Self {
self.r#type = Some(input);
self
}
/// <p>Used to contain the information detected by an AnalyzeID operation.</p>
pub fn set_type(
mut self,
input: std::option::Option<crate::model::AnalyzeIdDetections>,
) -> Self {
self.r#type = input;
self
}
/// <p>Used to contain the information detected by an AnalyzeID operation.</p>
pub fn value_detection(mut self, input: crate::model::AnalyzeIdDetections) -> Self {
self.value_detection = Some(input);
self
}
/// <p>Used to contain the information detected by an AnalyzeID operation.</p>
pub fn set_value_detection(
mut self,
input: std::option::Option<crate::model::AnalyzeIdDetections>,
) -> Self {
self.value_detection = input;
self
}
/// Consumes the builder and constructs a [`IdentityDocumentField`](crate::model::IdentityDocumentField)
pub fn build(self) -> crate::model::IdentityDocumentField {
crate::model::IdentityDocumentField {
r#type: self.r#type,
value_detection: self.value_detection,
}
}
}
}
impl IdentityDocumentField {
/// Creates a new builder-style object to manufacture [`IdentityDocumentField`](crate::model::IdentityDocumentField)
pub fn builder() -> crate::model::identity_document_field::Builder {
crate::model::identity_document_field::Builder::default()
}
}
/// <p>Used to contain the information detected by an AnalyzeID operation.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct AnalyzeIdDetections {
/// <p>Text of either the normalized field or value associated with it.</p>
pub text: std::option::Option<std::string::String>,
/// <p>Only returned for dates, returns the type of value detected and the date written in a more machine readable way.</p>
pub normalized_value: std::option::Option<crate::model::NormalizedValue>,
/// <p>The confidence score of the detected text.</p>
pub confidence: std::option::Option<f32>,
}
impl AnalyzeIdDetections {
/// <p>Text of either the normalized field or value associated with it.</p>
pub fn text(&self) -> std::option::Option<&str> {
self.text.as_deref()
}
/// <p>Only returned for dates, returns the type of value detected and the date written in a more machine readable way.</p>
pub fn normalized_value(&self) -> std::option::Option<&crate::model::NormalizedValue> {
self.normalized_value.as_ref()
}
/// <p>The confidence score of the detected text.</p>
pub fn confidence(&self) -> std::option::Option<f32> {
self.confidence
}
}
impl std::fmt::Debug for AnalyzeIdDetections {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("AnalyzeIdDetections");
formatter.field("text", &self.text);
formatter.field("normalized_value", &self.normalized_value);
formatter.field("confidence", &self.confidence);
formatter.finish()
}
}
/// See [`AnalyzeIdDetections`](crate::model::AnalyzeIdDetections)
pub mod analyze_id_detections {
/// A builder for [`AnalyzeIdDetections`](crate::model::AnalyzeIdDetections)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) text: std::option::Option<std::string::String>,
pub(crate) normalized_value: std::option::Option<crate::model::NormalizedValue>,
pub(crate) confidence: std::option::Option<f32>,
}
impl Builder {
/// <p>Text of either the normalized field or value associated with it.</p>
pub fn text(mut self, input: impl Into<std::string::String>) -> Self {
self.text = Some(input.into());
self
}
/// <p>Text of either the normalized field or value associated with it.</p>
pub fn set_text(mut self, input: std::option::Option<std::string::String>) -> Self {
self.text = input;
self
}
/// <p>Only returned for dates, returns the type of value detected and the date written in a more machine readable way.</p>
pub fn normalized_value(mut self, input: crate::model::NormalizedValue) -> Self {
self.normalized_value = Some(input);
self
}
/// <p>Only returned for dates, returns the type of value detected and the date written in a more machine readable way.</p>
pub fn set_normalized_value(
mut self,
input: std::option::Option<crate::model::NormalizedValue>,
) -> Self {
self.normalized_value = input;
self
}
/// <p>The confidence score of the detected text.</p>
pub fn confidence(mut self, input: f32) -> Self {
self.confidence = Some(input);
self
}
/// <p>The confidence score of the detected text.</p>
pub fn set_confidence(mut self, input: std::option::Option<f32>) -> Self {
self.confidence = input;
self
}
/// Consumes the builder and constructs a [`AnalyzeIdDetections`](crate::model::AnalyzeIdDetections)
pub fn build(self) -> crate::model::AnalyzeIdDetections {
crate::model::AnalyzeIdDetections {
text: self.text,
normalized_value: self.normalized_value,
confidence: self.confidence,
}
}
}
}
impl AnalyzeIdDetections {
/// Creates a new builder-style object to manufacture [`AnalyzeIdDetections`](crate::model::AnalyzeIdDetections)
pub fn builder() -> crate::model::analyze_id_detections::Builder {
crate::model::analyze_id_detections::Builder::default()
}
}
/// <p>Contains information relating to dates in a document, including the type of value, and the value.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct NormalizedValue {
/// <p>The value of the date, written as Year-Month-DayTHour:Minute:Second.</p>
pub value: std::option::Option<std::string::String>,
/// <p>The normalized type of the value detected. In this case, DATE.</p>
pub value_type: std::option::Option<crate::model::ValueType>,
}
impl NormalizedValue {
/// <p>The value of the date, written as Year-Month-DayTHour:Minute:Second.</p>
pub fn value(&self) -> std::option::Option<&str> {
self.value.as_deref()
}
/// <p>The normalized type of the value detected. In this case, DATE.</p>
pub fn value_type(&self) -> std::option::Option<&crate::model::ValueType> {
self.value_type.as_ref()
}
}
impl std::fmt::Debug for NormalizedValue {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("NormalizedValue");
formatter.field("value", &self.value);
formatter.field("value_type", &self.value_type);
formatter.finish()
}
}
/// See [`NormalizedValue`](crate::model::NormalizedValue)
pub mod normalized_value {
/// A builder for [`NormalizedValue`](crate::model::NormalizedValue)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) value: std::option::Option<std::string::String>,
pub(crate) value_type: std::option::Option<crate::model::ValueType>,
}
impl Builder {
/// <p>The value of the date, written as Year-Month-DayTHour:Minute:Second.</p>
pub fn value(mut self, input: impl Into<std::string::String>) -> Self {
self.value = Some(input.into());
self
}
/// <p>The value of the date, written as Year-Month-DayTHour:Minute:Second.</p>
pub fn set_value(mut self, input: std::option::Option<std::string::String>) -> Self {
self.value = input;
self
}
/// <p>The normalized type of the value detected. In this case, DATE.</p>
pub fn value_type(mut self, input: crate::model::ValueType) -> Self {
self.value_type = Some(input);
self
}
/// <p>The normalized type of the value detected. In this case, DATE.</p>
pub fn set_value_type(
mut self,
input: std::option::Option<crate::model::ValueType>,
) -> Self {
self.value_type = input;
self
}
/// Consumes the builder and constructs a [`NormalizedValue`](crate::model::NormalizedValue)
pub fn build(self) -> crate::model::NormalizedValue {
crate::model::NormalizedValue {
value: self.value,
value_type: self.value_type,
}
}
}
}
impl NormalizedValue {
/// Creates a new builder-style object to manufacture [`NormalizedValue`](crate::model::NormalizedValue)
pub fn builder() -> crate::model::normalized_value::Builder {
crate::model::normalized_value::Builder::default()
}
}
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum ValueType {
#[allow(missing_docs)] // documentation missing in model
Date,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for ValueType {
fn from(s: &str) -> Self {
match s {
"DATE" => ValueType::Date,
other => ValueType::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for ValueType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(ValueType::from(s))
}
}
impl ValueType {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
ValueType::Date => "DATE",
ValueType::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&["DATE"]
}
}
impl AsRef<str> for ValueType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>Shows the results of the human in the loop evaluation. If there is no HumanLoopArn, the input did not trigger human review.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct HumanLoopActivationOutput {
/// <p>The Amazon Resource Name (ARN) of the HumanLoop created.</p>
pub human_loop_arn: std::option::Option<std::string::String>,
/// <p>Shows if and why human review was needed.</p>
pub human_loop_activation_reasons: std::option::Option<std::vec::Vec<std::string::String>>,
/// <p>Shows the result of condition evaluations, including those conditions which activated a human review.</p>
pub human_loop_activation_conditions_evaluation_results:
std::option::Option<std::string::String>,
}
impl HumanLoopActivationOutput {
/// <p>The Amazon Resource Name (ARN) of the HumanLoop created.</p>
pub fn human_loop_arn(&self) -> std::option::Option<&str> {
self.human_loop_arn.as_deref()
}
/// <p>Shows if and why human review was needed.</p>
pub fn human_loop_activation_reasons(&self) -> std::option::Option<&[std::string::String]> {
self.human_loop_activation_reasons.as_deref()
}
/// <p>Shows the result of condition evaluations, including those conditions which activated a human review.</p>
pub fn human_loop_activation_conditions_evaluation_results(&self) -> std::option::Option<&str> {
self.human_loop_activation_conditions_evaluation_results
.as_deref()
}
}
impl std::fmt::Debug for HumanLoopActivationOutput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("HumanLoopActivationOutput");
formatter.field("human_loop_arn", &self.human_loop_arn);
formatter.field(
"human_loop_activation_reasons",
&self.human_loop_activation_reasons,
);
formatter.field(
"human_loop_activation_conditions_evaluation_results",
&self.human_loop_activation_conditions_evaluation_results,
);
formatter.finish()
}
}
/// See [`HumanLoopActivationOutput`](crate::model::HumanLoopActivationOutput)
pub mod human_loop_activation_output {
/// A builder for [`HumanLoopActivationOutput`](crate::model::HumanLoopActivationOutput)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) human_loop_arn: std::option::Option<std::string::String>,
pub(crate) human_loop_activation_reasons:
std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) human_loop_activation_conditions_evaluation_results:
std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The Amazon Resource Name (ARN) of the HumanLoop created.</p>
pub fn human_loop_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.human_loop_arn = Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the HumanLoop created.</p>
pub fn set_human_loop_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.human_loop_arn = input;
self
}
/// Appends an item to `human_loop_activation_reasons`.
///
/// To override the contents of this collection use [`set_human_loop_activation_reasons`](Self::set_human_loop_activation_reasons).
///
/// <p>Shows if and why human review was needed.</p>
pub fn human_loop_activation_reasons(
mut self,
input: impl Into<std::string::String>,
) -> Self {
let mut v = self.human_loop_activation_reasons.unwrap_or_default();
v.push(input.into());
self.human_loop_activation_reasons = Some(v);
self
}
/// <p>Shows if and why human review was needed.</p>
pub fn set_human_loop_activation_reasons(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.human_loop_activation_reasons = input;
self
}
/// <p>Shows the result of condition evaluations, including those conditions which activated a human review.</p>
pub fn human_loop_activation_conditions_evaluation_results(
mut self,
input: impl Into<std::string::String>,
) -> Self {
self.human_loop_activation_conditions_evaluation_results = Some(input.into());
self
}
/// <p>Shows the result of condition evaluations, including those conditions which activated a human review.</p>
pub fn set_human_loop_activation_conditions_evaluation_results(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.human_loop_activation_conditions_evaluation_results = input;
self
}
/// Consumes the builder and constructs a [`HumanLoopActivationOutput`](crate::model::HumanLoopActivationOutput)
pub fn build(self) -> crate::model::HumanLoopActivationOutput {
crate::model::HumanLoopActivationOutput {
human_loop_arn: self.human_loop_arn,
human_loop_activation_reasons: self.human_loop_activation_reasons,
human_loop_activation_conditions_evaluation_results: self
.human_loop_activation_conditions_evaluation_results,
}
}
}
}
impl HumanLoopActivationOutput {
/// Creates a new builder-style object to manufacture [`HumanLoopActivationOutput`](crate::model::HumanLoopActivationOutput)
pub fn builder() -> crate::model::human_loop_activation_output::Builder {
crate::model::human_loop_activation_output::Builder::default()
}
}
/// <p>Sets up the human review workflow the document will be sent to if one of the conditions is met. You can also set certain attributes of the image before review. </p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct HumanLoopConfig {
/// <p>The name of the human workflow used for this image. This should be kept unique within a region.</p>
pub human_loop_name: std::option::Option<std::string::String>,
/// <p>The Amazon Resource Name (ARN) of the flow definition.</p>
pub flow_definition_arn: std::option::Option<std::string::String>,
/// <p>Sets attributes of the input data.</p>
pub data_attributes: std::option::Option<crate::model::HumanLoopDataAttributes>,
}
impl HumanLoopConfig {
/// <p>The name of the human workflow used for this image. This should be kept unique within a region.</p>
pub fn human_loop_name(&self) -> std::option::Option<&str> {
self.human_loop_name.as_deref()
}
/// <p>The Amazon Resource Name (ARN) of the flow definition.</p>
pub fn flow_definition_arn(&self) -> std::option::Option<&str> {
self.flow_definition_arn.as_deref()
}
/// <p>Sets attributes of the input data.</p>
pub fn data_attributes(&self) -> std::option::Option<&crate::model::HumanLoopDataAttributes> {
self.data_attributes.as_ref()
}
}
impl std::fmt::Debug for HumanLoopConfig {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("HumanLoopConfig");
formatter.field("human_loop_name", &self.human_loop_name);
formatter.field("flow_definition_arn", &self.flow_definition_arn);
formatter.field("data_attributes", &self.data_attributes);
formatter.finish()
}
}
/// See [`HumanLoopConfig`](crate::model::HumanLoopConfig)
pub mod human_loop_config {
/// A builder for [`HumanLoopConfig`](crate::model::HumanLoopConfig)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) human_loop_name: std::option::Option<std::string::String>,
pub(crate) flow_definition_arn: std::option::Option<std::string::String>,
pub(crate) data_attributes: std::option::Option<crate::model::HumanLoopDataAttributes>,
}
impl Builder {
/// <p>The name of the human workflow used for this image. This should be kept unique within a region.</p>
pub fn human_loop_name(mut self, input: impl Into<std::string::String>) -> Self {
self.human_loop_name = Some(input.into());
self
}
/// <p>The name of the human workflow used for this image. This should be kept unique within a region.</p>
pub fn set_human_loop_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.human_loop_name = input;
self
}
/// <p>The Amazon Resource Name (ARN) of the flow definition.</p>
pub fn flow_definition_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.flow_definition_arn = Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the flow definition.</p>
pub fn set_flow_definition_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.flow_definition_arn = input;
self
}
/// <p>Sets attributes of the input data.</p>
pub fn data_attributes(mut self, input: crate::model::HumanLoopDataAttributes) -> Self {
self.data_attributes = Some(input);
self
}
/// <p>Sets attributes of the input data.</p>
pub fn set_data_attributes(
mut self,
input: std::option::Option<crate::model::HumanLoopDataAttributes>,
) -> Self {
self.data_attributes = input;
self
}
/// Consumes the builder and constructs a [`HumanLoopConfig`](crate::model::HumanLoopConfig)
pub fn build(self) -> crate::model::HumanLoopConfig {
crate::model::HumanLoopConfig {
human_loop_name: self.human_loop_name,
flow_definition_arn: self.flow_definition_arn,
data_attributes: self.data_attributes,
}
}
}
}
impl HumanLoopConfig {
/// Creates a new builder-style object to manufacture [`HumanLoopConfig`](crate::model::HumanLoopConfig)
pub fn builder() -> crate::model::human_loop_config::Builder {
crate::model::human_loop_config::Builder::default()
}
}
/// <p>Allows you to set attributes of the image. Currently, you can declare an image as free of personally identifiable information and adult content. </p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct HumanLoopDataAttributes {
/// <p>Sets whether the input image is free of personally identifiable information or adult content.</p>
pub content_classifiers: std::option::Option<std::vec::Vec<crate::model::ContentClassifier>>,
}
impl HumanLoopDataAttributes {
/// <p>Sets whether the input image is free of personally identifiable information or adult content.</p>
pub fn content_classifiers(&self) -> std::option::Option<&[crate::model::ContentClassifier]> {
self.content_classifiers.as_deref()
}
}
impl std::fmt::Debug for HumanLoopDataAttributes {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("HumanLoopDataAttributes");
formatter.field("content_classifiers", &self.content_classifiers);
formatter.finish()
}
}
/// See [`HumanLoopDataAttributes`](crate::model::HumanLoopDataAttributes)
pub mod human_loop_data_attributes {
/// A builder for [`HumanLoopDataAttributes`](crate::model::HumanLoopDataAttributes)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) content_classifiers:
std::option::Option<std::vec::Vec<crate::model::ContentClassifier>>,
}
impl Builder {
/// Appends an item to `content_classifiers`.
///
/// To override the contents of this collection use [`set_content_classifiers`](Self::set_content_classifiers).
///
/// <p>Sets whether the input image is free of personally identifiable information or adult content.</p>
pub fn content_classifiers(mut self, input: crate::model::ContentClassifier) -> Self {
let mut v = self.content_classifiers.unwrap_or_default();
v.push(input);
self.content_classifiers = Some(v);
self
}
/// <p>Sets whether the input image is free of personally identifiable information or adult content.</p>
pub fn set_content_classifiers(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::ContentClassifier>>,
) -> Self {
self.content_classifiers = input;
self
}
/// Consumes the builder and constructs a [`HumanLoopDataAttributes`](crate::model::HumanLoopDataAttributes)
pub fn build(self) -> crate::model::HumanLoopDataAttributes {
crate::model::HumanLoopDataAttributes {
content_classifiers: self.content_classifiers,
}
}
}
}
impl HumanLoopDataAttributes {
/// Creates a new builder-style object to manufacture [`HumanLoopDataAttributes`](crate::model::HumanLoopDataAttributes)
pub fn builder() -> crate::model::human_loop_data_attributes::Builder {
crate::model::human_loop_data_attributes::Builder::default()
}
}
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum ContentClassifier {
#[allow(missing_docs)] // documentation missing in model
FreeOfAdultContent,
#[allow(missing_docs)] // documentation missing in model
FreeOfPersonallyIdentifiableInformation,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for ContentClassifier {
fn from(s: &str) -> Self {
match s {
"FreeOfAdultContent" => ContentClassifier::FreeOfAdultContent,
"FreeOfPersonallyIdentifiableInformation" => {
ContentClassifier::FreeOfPersonallyIdentifiableInformation
}
other => ContentClassifier::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for ContentClassifier {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(ContentClassifier::from(s))
}
}
impl ContentClassifier {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
ContentClassifier::FreeOfAdultContent => "FreeOfAdultContent",
ContentClassifier::FreeOfPersonallyIdentifiableInformation => {
"FreeOfPersonallyIdentifiableInformation"
}
ContentClassifier::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&[
"FreeOfAdultContent",
"FreeOfPersonallyIdentifiableInformation",
]
}
}
impl AsRef<str> for ContentClassifier {
fn as_ref(&self) -> &str {
self.as_str()
}
}