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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[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 ParallelDataStatus {
#[allow(missing_docs)] // documentation missing in model
Active,
#[allow(missing_docs)] // documentation missing in model
Creating,
#[allow(missing_docs)] // documentation missing in model
Deleting,
#[allow(missing_docs)] // documentation missing in model
Failed,
#[allow(missing_docs)] // documentation missing in model
Updating,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for ParallelDataStatus {
fn from(s: &str) -> Self {
match s {
"ACTIVE" => ParallelDataStatus::Active,
"CREATING" => ParallelDataStatus::Creating,
"DELETING" => ParallelDataStatus::Deleting,
"FAILED" => ParallelDataStatus::Failed,
"UPDATING" => ParallelDataStatus::Updating,
other => ParallelDataStatus::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for ParallelDataStatus {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(ParallelDataStatus::from(s))
}
}
impl ParallelDataStatus {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
ParallelDataStatus::Active => "ACTIVE",
ParallelDataStatus::Creating => "CREATING",
ParallelDataStatus::Deleting => "DELETING",
ParallelDataStatus::Failed => "FAILED",
ParallelDataStatus::Updating => "UPDATING",
ParallelDataStatus::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&["ACTIVE", "CREATING", "DELETING", "FAILED", "UPDATING"]
}
}
impl AsRef<str> for ParallelDataStatus {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>Specifies the format and S3 location of the parallel data input file.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ParallelDataConfig {
/// <p>The URI of the Amazon S3 folder that contains the parallel data input file. The folder must be in the same Region as the API endpoint you are calling.</p>
pub s3_uri: std::option::Option<std::string::String>,
/// <p>The format of the parallel data input file.</p>
pub format: std::option::Option<crate::model::ParallelDataFormat>,
}
impl ParallelDataConfig {
/// <p>The URI of the Amazon S3 folder that contains the parallel data input file. The folder must be in the same Region as the API endpoint you are calling.</p>
pub fn s3_uri(&self) -> std::option::Option<&str> {
self.s3_uri.as_deref()
}
/// <p>The format of the parallel data input file.</p>
pub fn format(&self) -> std::option::Option<&crate::model::ParallelDataFormat> {
self.format.as_ref()
}
}
impl std::fmt::Debug for ParallelDataConfig {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ParallelDataConfig");
formatter.field("s3_uri", &self.s3_uri);
formatter.field("format", &self.format);
formatter.finish()
}
}
/// See [`ParallelDataConfig`](crate::model::ParallelDataConfig)
pub mod parallel_data_config {
/// A builder for [`ParallelDataConfig`](crate::model::ParallelDataConfig)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) s3_uri: std::option::Option<std::string::String>,
pub(crate) format: std::option::Option<crate::model::ParallelDataFormat>,
}
impl Builder {
/// <p>The URI of the Amazon S3 folder that contains the parallel data input file. The folder must be in the same Region as the API endpoint you are calling.</p>
pub fn s3_uri(mut self, input: impl Into<std::string::String>) -> Self {
self.s3_uri = Some(input.into());
self
}
/// <p>The URI of the Amazon S3 folder that contains the parallel data input file. The folder must be in the same Region as the API endpoint you are calling.</p>
pub fn set_s3_uri(mut self, input: std::option::Option<std::string::String>) -> Self {
self.s3_uri = input;
self
}
/// <p>The format of the parallel data input file.</p>
pub fn format(mut self, input: crate::model::ParallelDataFormat) -> Self {
self.format = Some(input);
self
}
/// <p>The format of the parallel data input file.</p>
pub fn set_format(
mut self,
input: std::option::Option<crate::model::ParallelDataFormat>,
) -> Self {
self.format = input;
self
}
/// Consumes the builder and constructs a [`ParallelDataConfig`](crate::model::ParallelDataConfig)
pub fn build(self) -> crate::model::ParallelDataConfig {
crate::model::ParallelDataConfig {
s3_uri: self.s3_uri,
format: self.format,
}
}
}
}
impl ParallelDataConfig {
/// Creates a new builder-style object to manufacture [`ParallelDataConfig`](crate::model::ParallelDataConfig)
pub fn builder() -> crate::model::parallel_data_config::Builder {
crate::model::parallel_data_config::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 ParallelDataFormat {
#[allow(missing_docs)] // documentation missing in model
Csv,
#[allow(missing_docs)] // documentation missing in model
Tmx,
#[allow(missing_docs)] // documentation missing in model
Tsv,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for ParallelDataFormat {
fn from(s: &str) -> Self {
match s {
"CSV" => ParallelDataFormat::Csv,
"TMX" => ParallelDataFormat::Tmx,
"TSV" => ParallelDataFormat::Tsv,
other => ParallelDataFormat::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for ParallelDataFormat {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(ParallelDataFormat::from(s))
}
}
impl ParallelDataFormat {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
ParallelDataFormat::Csv => "CSV",
ParallelDataFormat::Tmx => "TMX",
ParallelDataFormat::Tsv => "TSV",
ParallelDataFormat::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&["CSV", "TMX", "TSV"]
}
}
impl AsRef<str> for ParallelDataFormat {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>Settings that configure the translation output.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct TranslationSettings {
#[allow(missing_docs)] // documentation missing in model
pub formality: std::option::Option<crate::model::Formality>,
/// <p>Enable the profanity setting if you want Amazon Translate to mask profane words and phrases in your translation output.</p>
/// <p>To mask profane words and phrases, Amazon Translate replaces them with the grawlix string “?$#@$“. This 5-character sequence is used for each profane word or phrase, regardless of the length or number of words.</p>
/// <p>Amazon Translate does not detect profanity in all of its supported languages. For languages that support profanity detection, see <a href="https://docs.aws.amazon.com/translate/latest/dg/what-is.html#what-is-languages">Supported Languages and Language Codes in the Amazon Translate Developer Guide</a>.</p>
pub profanity: std::option::Option<crate::model::Profanity>,
}
impl TranslationSettings {
#[allow(missing_docs)] // documentation missing in model
pub fn formality(&self) -> std::option::Option<&crate::model::Formality> {
self.formality.as_ref()
}
/// <p>Enable the profanity setting if you want Amazon Translate to mask profane words and phrases in your translation output.</p>
/// <p>To mask profane words and phrases, Amazon Translate replaces them with the grawlix string “?$#@$“. This 5-character sequence is used for each profane word or phrase, regardless of the length or number of words.</p>
/// <p>Amazon Translate does not detect profanity in all of its supported languages. For languages that support profanity detection, see <a href="https://docs.aws.amazon.com/translate/latest/dg/what-is.html#what-is-languages">Supported Languages and Language Codes in the Amazon Translate Developer Guide</a>.</p>
pub fn profanity(&self) -> std::option::Option<&crate::model::Profanity> {
self.profanity.as_ref()
}
}
impl std::fmt::Debug for TranslationSettings {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("TranslationSettings");
formatter.field("formality", &self.formality);
formatter.field("profanity", &self.profanity);
formatter.finish()
}
}
/// See [`TranslationSettings`](crate::model::TranslationSettings)
pub mod translation_settings {
/// A builder for [`TranslationSettings`](crate::model::TranslationSettings)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) formality: std::option::Option<crate::model::Formality>,
pub(crate) profanity: std::option::Option<crate::model::Profanity>,
}
impl Builder {
#[allow(missing_docs)] // documentation missing in model
pub fn formality(mut self, input: crate::model::Formality) -> Self {
self.formality = Some(input);
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn set_formality(
mut self,
input: std::option::Option<crate::model::Formality>,
) -> Self {
self.formality = input;
self
}
/// <p>Enable the profanity setting if you want Amazon Translate to mask profane words and phrases in your translation output.</p>
/// <p>To mask profane words and phrases, Amazon Translate replaces them with the grawlix string “?$#@$“. This 5-character sequence is used for each profane word or phrase, regardless of the length or number of words.</p>
/// <p>Amazon Translate does not detect profanity in all of its supported languages. For languages that support profanity detection, see <a href="https://docs.aws.amazon.com/translate/latest/dg/what-is.html#what-is-languages">Supported Languages and Language Codes in the Amazon Translate Developer Guide</a>.</p>
pub fn profanity(mut self, input: crate::model::Profanity) -> Self {
self.profanity = Some(input);
self
}
/// <p>Enable the profanity setting if you want Amazon Translate to mask profane words and phrases in your translation output.</p>
/// <p>To mask profane words and phrases, Amazon Translate replaces them with the grawlix string “?$#@$“. This 5-character sequence is used for each profane word or phrase, regardless of the length or number of words.</p>
/// <p>Amazon Translate does not detect profanity in all of its supported languages. For languages that support profanity detection, see <a href="https://docs.aws.amazon.com/translate/latest/dg/what-is.html#what-is-languages">Supported Languages and Language Codes in the Amazon Translate Developer Guide</a>.</p>
pub fn set_profanity(
mut self,
input: std::option::Option<crate::model::Profanity>,
) -> Self {
self.profanity = input;
self
}
/// Consumes the builder and constructs a [`TranslationSettings`](crate::model::TranslationSettings)
pub fn build(self) -> crate::model::TranslationSettings {
crate::model::TranslationSettings {
formality: self.formality,
profanity: self.profanity,
}
}
}
}
impl TranslationSettings {
/// Creates a new builder-style object to manufacture [`TranslationSettings`](crate::model::TranslationSettings)
pub fn builder() -> crate::model::translation_settings::Builder {
crate::model::translation_settings::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 Profanity {
#[allow(missing_docs)] // documentation missing in model
Mask,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for Profanity {
fn from(s: &str) -> Self {
match s {
"MASK" => Profanity::Mask,
other => Profanity::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for Profanity {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(Profanity::from(s))
}
}
impl Profanity {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
Profanity::Mask => "MASK",
Profanity::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&["MASK"]
}
}
impl AsRef<str> for Profanity {
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 Formality {
#[allow(missing_docs)] // documentation missing in model
Formal,
#[allow(missing_docs)] // documentation missing in model
Informal,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for Formality {
fn from(s: &str) -> Self {
match s {
"FORMAL" => Formality::Formal,
"INFORMAL" => Formality::Informal,
other => Formality::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for Formality {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(Formality::from(s))
}
}
impl Formality {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
Formality::Formal => "FORMAL",
Formality::Informal => "INFORMAL",
Formality::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&["FORMAL", "INFORMAL"]
}
}
impl AsRef<str> for Formality {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>The custom terminology applied to the input text by Amazon Translate for the translated text response. This is optional in the response and will only be present if you specified terminology input in the request. Currently, only one terminology can be applied per TranslateText request.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct AppliedTerminology {
/// <p>The name of the custom terminology applied to the input text by Amazon Translate for the translated text response.</p>
pub name: std::option::Option<std::string::String>,
/// <p>The specific terms of the custom terminology applied to the input text by Amazon Translate for the translated text response. A maximum of 250 terms will be returned, and the specific terms applied will be the first 250 terms in the source text. </p>
pub terms: std::option::Option<std::vec::Vec<crate::model::Term>>,
}
impl AppliedTerminology {
/// <p>The name of the custom terminology applied to the input text by Amazon Translate for the translated text response.</p>
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
/// <p>The specific terms of the custom terminology applied to the input text by Amazon Translate for the translated text response. A maximum of 250 terms will be returned, and the specific terms applied will be the first 250 terms in the source text. </p>
pub fn terms(&self) -> std::option::Option<&[crate::model::Term]> {
self.terms.as_deref()
}
}
impl std::fmt::Debug for AppliedTerminology {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("AppliedTerminology");
formatter.field("name", &self.name);
formatter.field("terms", &self.terms);
formatter.finish()
}
}
/// See [`AppliedTerminology`](crate::model::AppliedTerminology)
pub mod applied_terminology {
/// A builder for [`AppliedTerminology`](crate::model::AppliedTerminology)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) terms: std::option::Option<std::vec::Vec<crate::model::Term>>,
}
impl Builder {
/// <p>The name of the custom terminology applied to the input text by Amazon Translate for the translated text response.</p>
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
/// <p>The name of the custom terminology applied to the input text by Amazon Translate for the translated text response.</p>
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
/// Appends an item to `terms`.
///
/// To override the contents of this collection use [`set_terms`](Self::set_terms).
///
/// <p>The specific terms of the custom terminology applied to the input text by Amazon Translate for the translated text response. A maximum of 250 terms will be returned, and the specific terms applied will be the first 250 terms in the source text. </p>
pub fn terms(mut self, input: crate::model::Term) -> Self {
let mut v = self.terms.unwrap_or_default();
v.push(input);
self.terms = Some(v);
self
}
/// <p>The specific terms of the custom terminology applied to the input text by Amazon Translate for the translated text response. A maximum of 250 terms will be returned, and the specific terms applied will be the first 250 terms in the source text. </p>
pub fn set_terms(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Term>>,
) -> Self {
self.terms = input;
self
}
/// Consumes the builder and constructs a [`AppliedTerminology`](crate::model::AppliedTerminology)
pub fn build(self) -> crate::model::AppliedTerminology {
crate::model::AppliedTerminology {
name: self.name,
terms: self.terms,
}
}
}
}
impl AppliedTerminology {
/// Creates a new builder-style object to manufacture [`AppliedTerminology`](crate::model::AppliedTerminology)
pub fn builder() -> crate::model::applied_terminology::Builder {
crate::model::applied_terminology::Builder::default()
}
}
/// <p>The term being translated by the custom terminology.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct Term {
/// <p>The source text of the term being translated by the custom terminology.</p>
pub source_text: std::option::Option<std::string::String>,
/// <p>The target text of the term being translated by the custom terminology.</p>
pub target_text: std::option::Option<std::string::String>,
}
impl Term {
/// <p>The source text of the term being translated by the custom terminology.</p>
pub fn source_text(&self) -> std::option::Option<&str> {
self.source_text.as_deref()
}
/// <p>The target text of the term being translated by the custom terminology.</p>
pub fn target_text(&self) -> std::option::Option<&str> {
self.target_text.as_deref()
}
}
impl std::fmt::Debug for Term {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Term");
formatter.field("source_text", &self.source_text);
formatter.field("target_text", &self.target_text);
formatter.finish()
}
}
/// See [`Term`](crate::model::Term)
pub mod term {
/// A builder for [`Term`](crate::model::Term)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) source_text: std::option::Option<std::string::String>,
pub(crate) target_text: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The source text of the term being translated by the custom terminology.</p>
pub fn source_text(mut self, input: impl Into<std::string::String>) -> Self {
self.source_text = Some(input.into());
self
}
/// <p>The source text of the term being translated by the custom terminology.</p>
pub fn set_source_text(mut self, input: std::option::Option<std::string::String>) -> Self {
self.source_text = input;
self
}
/// <p>The target text of the term being translated by the custom terminology.</p>
pub fn target_text(mut self, input: impl Into<std::string::String>) -> Self {
self.target_text = Some(input.into());
self
}
/// <p>The target text of the term being translated by the custom terminology.</p>
pub fn set_target_text(mut self, input: std::option::Option<std::string::String>) -> Self {
self.target_text = input;
self
}
/// Consumes the builder and constructs a [`Term`](crate::model::Term)
pub fn build(self) -> crate::model::Term {
crate::model::Term {
source_text: self.source_text,
target_text: self.target_text,
}
}
}
}
impl Term {
/// Creates a new builder-style object to manufacture [`Term`](crate::model::Term)
pub fn builder() -> crate::model::term::Builder {
crate::model::term::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
Completed,
#[allow(missing_docs)] // documentation missing in model
CompletedWithError,
#[allow(missing_docs)] // documentation missing in model
Failed,
#[allow(missing_docs)] // documentation missing in model
InProgress,
#[allow(missing_docs)] // documentation missing in model
Stopped,
#[allow(missing_docs)] // documentation missing in model
StopRequested,
#[allow(missing_docs)] // documentation missing in model
Submitted,
/// 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 {
"COMPLETED" => JobStatus::Completed,
"COMPLETED_WITH_ERROR" => JobStatus::CompletedWithError,
"FAILED" => JobStatus::Failed,
"IN_PROGRESS" => JobStatus::InProgress,
"STOPPED" => JobStatus::Stopped,
"STOP_REQUESTED" => JobStatus::StopRequested,
"SUBMITTED" => JobStatus::Submitted,
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::Completed => "COMPLETED",
JobStatus::CompletedWithError => "COMPLETED_WITH_ERROR",
JobStatus::Failed => "FAILED",
JobStatus::InProgress => "IN_PROGRESS",
JobStatus::Stopped => "STOPPED",
JobStatus::StopRequested => "STOP_REQUESTED",
JobStatus::Submitted => "SUBMITTED",
JobStatus::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&[
"COMPLETED",
"COMPLETED_WITH_ERROR",
"FAILED",
"IN_PROGRESS",
"STOPPED",
"STOP_REQUESTED",
"SUBMITTED",
]
}
}
impl AsRef<str> for JobStatus {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>The output configuration properties for a batch translation job.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct OutputDataConfig {
/// <p>The URI of the S3 folder that contains a translation job's output file. The folder must be in the same Region as the API endpoint that you are calling.</p>
pub s3_uri: std::option::Option<std::string::String>,
/// <p>The encryption key used to encrypt this object.</p>
pub encryption_key: std::option::Option<crate::model::EncryptionKey>,
}
impl OutputDataConfig {
/// <p>The URI of the S3 folder that contains a translation job's output file. The folder must be in the same Region as the API endpoint that you are calling.</p>
pub fn s3_uri(&self) -> std::option::Option<&str> {
self.s3_uri.as_deref()
}
/// <p>The encryption key used to encrypt this object.</p>
pub fn encryption_key(&self) -> std::option::Option<&crate::model::EncryptionKey> {
self.encryption_key.as_ref()
}
}
impl std::fmt::Debug for OutputDataConfig {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("OutputDataConfig");
formatter.field("s3_uri", &self.s3_uri);
formatter.field("encryption_key", &self.encryption_key);
formatter.finish()
}
}
/// See [`OutputDataConfig`](crate::model::OutputDataConfig)
pub mod output_data_config {
/// A builder for [`OutputDataConfig`](crate::model::OutputDataConfig)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) s3_uri: std::option::Option<std::string::String>,
pub(crate) encryption_key: std::option::Option<crate::model::EncryptionKey>,
}
impl Builder {
/// <p>The URI of the S3 folder that contains a translation job's output file. The folder must be in the same Region as the API endpoint that you are calling.</p>
pub fn s3_uri(mut self, input: impl Into<std::string::String>) -> Self {
self.s3_uri = Some(input.into());
self
}
/// <p>The URI of the S3 folder that contains a translation job's output file. The folder must be in the same Region as the API endpoint that you are calling.</p>
pub fn set_s3_uri(mut self, input: std::option::Option<std::string::String>) -> Self {
self.s3_uri = input;
self
}
/// <p>The encryption key used to encrypt this object.</p>
pub fn encryption_key(mut self, input: crate::model::EncryptionKey) -> Self {
self.encryption_key = Some(input);
self
}
/// <p>The encryption key used to encrypt this object.</p>
pub fn set_encryption_key(
mut self,
input: std::option::Option<crate::model::EncryptionKey>,
) -> Self {
self.encryption_key = input;
self
}
/// Consumes the builder and constructs a [`OutputDataConfig`](crate::model::OutputDataConfig)
pub fn build(self) -> crate::model::OutputDataConfig {
crate::model::OutputDataConfig {
s3_uri: self.s3_uri,
encryption_key: self.encryption_key,
}
}
}
}
impl OutputDataConfig {
/// Creates a new builder-style object to manufacture [`OutputDataConfig`](crate::model::OutputDataConfig)
pub fn builder() -> crate::model::output_data_config::Builder {
crate::model::output_data_config::Builder::default()
}
}
/// <p>The encryption key used to encrypt this object.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct EncryptionKey {
/// <p>The type of encryption key used by Amazon Translate to encrypt this object.</p>
pub r#type: std::option::Option<crate::model::EncryptionKeyType>,
/// <p>The Amazon Resource Name (ARN) of the encryption key being used to encrypt this object.</p>
pub id: std::option::Option<std::string::String>,
}
impl EncryptionKey {
/// <p>The type of encryption key used by Amazon Translate to encrypt this object.</p>
pub fn r#type(&self) -> std::option::Option<&crate::model::EncryptionKeyType> {
self.r#type.as_ref()
}
/// <p>The Amazon Resource Name (ARN) of the encryption key being used to encrypt this object.</p>
pub fn id(&self) -> std::option::Option<&str> {
self.id.as_deref()
}
}
impl std::fmt::Debug for EncryptionKey {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("EncryptionKey");
formatter.field("r#type", &self.r#type);
formatter.field("id", &self.id);
formatter.finish()
}
}
/// See [`EncryptionKey`](crate::model::EncryptionKey)
pub mod encryption_key {
/// A builder for [`EncryptionKey`](crate::model::EncryptionKey)
#[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::EncryptionKeyType>,
pub(crate) id: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The type of encryption key used by Amazon Translate to encrypt this object.</p>
pub fn r#type(mut self, input: crate::model::EncryptionKeyType) -> Self {
self.r#type = Some(input);
self
}
/// <p>The type of encryption key used by Amazon Translate to encrypt this object.</p>
pub fn set_type(
mut self,
input: std::option::Option<crate::model::EncryptionKeyType>,
) -> Self {
self.r#type = input;
self
}
/// <p>The Amazon Resource Name (ARN) of the encryption key being used to encrypt this object.</p>
pub fn id(mut self, input: impl Into<std::string::String>) -> Self {
self.id = Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the encryption key being used to encrypt this object.</p>
pub fn set_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.id = input;
self
}
/// Consumes the builder and constructs a [`EncryptionKey`](crate::model::EncryptionKey)
pub fn build(self) -> crate::model::EncryptionKey {
crate::model::EncryptionKey {
r#type: self.r#type,
id: self.id,
}
}
}
}
impl EncryptionKey {
/// Creates a new builder-style object to manufacture [`EncryptionKey`](crate::model::EncryptionKey)
pub fn builder() -> crate::model::encryption_key::Builder {
crate::model::encryption_key::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 EncryptionKeyType {
#[allow(missing_docs)] // documentation missing in model
Kms,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for EncryptionKeyType {
fn from(s: &str) -> Self {
match s {
"KMS" => EncryptionKeyType::Kms,
other => EncryptionKeyType::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for EncryptionKeyType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(EncryptionKeyType::from(s))
}
}
impl EncryptionKeyType {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
EncryptionKeyType::Kms => "KMS",
EncryptionKeyType::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&["KMS"]
}
}
impl AsRef<str> for EncryptionKeyType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>The input configuration properties for requesting a batch translation job.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct InputDataConfig {
/// <p>The URI of the AWS S3 folder that contains the input file. The folder must be in the same Region as the API endpoint you are calling.</p>
pub s3_uri: std::option::Option<std::string::String>,
/// <p>Describes the format of the data that you submit to Amazon Translate as input. You can specify one of the following multipurpose internet mail extension (MIME) types:</p>
/// <ul>
/// <li> <p> <code>text/html</code>: The input data consists of one or more HTML files. Amazon Translate translates only the text that resides in the <code>html</code> element in each file.</p> </li>
/// <li> <p> <code>text/plain</code>: The input data consists of one or more unformatted text files. Amazon Translate translates every character in this type of input.</p> </li>
/// <li> <p> <code>application/vnd.openxmlformats-officedocument.wordprocessingml.document</code>: The input data consists of one or more Word documents (.docx).</p> </li>
/// <li> <p> <code>application/vnd.openxmlformats-officedocument.presentationml.presentation</code>: The input data consists of one or more PowerPoint Presentation files (.pptx).</p> </li>
/// <li> <p> <code>application/vnd.openxmlformats-officedocument.spreadsheetml.sheet</code>: The input data consists of one or more Excel Workbook files (.xlsx).</p> </li>
/// <li> <p> <code>application/x-xliff+xml</code>: The input data consists of one or more XML Localization Interchange File Format (XLIFF) files (.xlf). Amazon Translate supports only XLIFF version 1.2.</p> </li>
/// </ul> <important>
/// <p>If you structure your input data as HTML, ensure that you set this parameter to <code>text/html</code>. By doing so, you cut costs by limiting the translation to the contents of the <code>html</code> element in each file. Otherwise, if you set this parameter to <code>text/plain</code>, your costs will cover the translation of every character.</p>
/// </important>
pub content_type: std::option::Option<std::string::String>,
}
impl InputDataConfig {
/// <p>The URI of the AWS S3 folder that contains the input file. The folder must be in the same Region as the API endpoint you are calling.</p>
pub fn s3_uri(&self) -> std::option::Option<&str> {
self.s3_uri.as_deref()
}
/// <p>Describes the format of the data that you submit to Amazon Translate as input. You can specify one of the following multipurpose internet mail extension (MIME) types:</p>
/// <ul>
/// <li> <p> <code>text/html</code>: The input data consists of one or more HTML files. Amazon Translate translates only the text that resides in the <code>html</code> element in each file.</p> </li>
/// <li> <p> <code>text/plain</code>: The input data consists of one or more unformatted text files. Amazon Translate translates every character in this type of input.</p> </li>
/// <li> <p> <code>application/vnd.openxmlformats-officedocument.wordprocessingml.document</code>: The input data consists of one or more Word documents (.docx).</p> </li>
/// <li> <p> <code>application/vnd.openxmlformats-officedocument.presentationml.presentation</code>: The input data consists of one or more PowerPoint Presentation files (.pptx).</p> </li>
/// <li> <p> <code>application/vnd.openxmlformats-officedocument.spreadsheetml.sheet</code>: The input data consists of one or more Excel Workbook files (.xlsx).</p> </li>
/// <li> <p> <code>application/x-xliff+xml</code>: The input data consists of one or more XML Localization Interchange File Format (XLIFF) files (.xlf). Amazon Translate supports only XLIFF version 1.2.</p> </li>
/// </ul> <important>
/// <p>If you structure your input data as HTML, ensure that you set this parameter to <code>text/html</code>. By doing so, you cut costs by limiting the translation to the contents of the <code>html</code> element in each file. Otherwise, if you set this parameter to <code>text/plain</code>, your costs will cover the translation of every character.</p>
/// </important>
pub fn content_type(&self) -> std::option::Option<&str> {
self.content_type.as_deref()
}
}
impl std::fmt::Debug for InputDataConfig {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("InputDataConfig");
formatter.field("s3_uri", &self.s3_uri);
formatter.field("content_type", &self.content_type);
formatter.finish()
}
}
/// See [`InputDataConfig`](crate::model::InputDataConfig)
pub mod input_data_config {
/// A builder for [`InputDataConfig`](crate::model::InputDataConfig)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) s3_uri: std::option::Option<std::string::String>,
pub(crate) content_type: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The URI of the AWS S3 folder that contains the input file. The folder must be in the same Region as the API endpoint you are calling.</p>
pub fn s3_uri(mut self, input: impl Into<std::string::String>) -> Self {
self.s3_uri = Some(input.into());
self
}
/// <p>The URI of the AWS S3 folder that contains the input file. The folder must be in the same Region as the API endpoint you are calling.</p>
pub fn set_s3_uri(mut self, input: std::option::Option<std::string::String>) -> Self {
self.s3_uri = input;
self
}
/// <p>Describes the format of the data that you submit to Amazon Translate as input. You can specify one of the following multipurpose internet mail extension (MIME) types:</p>
/// <ul>
/// <li> <p> <code>text/html</code>: The input data consists of one or more HTML files. Amazon Translate translates only the text that resides in the <code>html</code> element in each file.</p> </li>
/// <li> <p> <code>text/plain</code>: The input data consists of one or more unformatted text files. Amazon Translate translates every character in this type of input.</p> </li>
/// <li> <p> <code>application/vnd.openxmlformats-officedocument.wordprocessingml.document</code>: The input data consists of one or more Word documents (.docx).</p> </li>
/// <li> <p> <code>application/vnd.openxmlformats-officedocument.presentationml.presentation</code>: The input data consists of one or more PowerPoint Presentation files (.pptx).</p> </li>
/// <li> <p> <code>application/vnd.openxmlformats-officedocument.spreadsheetml.sheet</code>: The input data consists of one or more Excel Workbook files (.xlsx).</p> </li>
/// <li> <p> <code>application/x-xliff+xml</code>: The input data consists of one or more XML Localization Interchange File Format (XLIFF) files (.xlf). Amazon Translate supports only XLIFF version 1.2.</p> </li>
/// </ul> <important>
/// <p>If you structure your input data as HTML, ensure that you set this parameter to <code>text/html</code>. By doing so, you cut costs by limiting the translation to the contents of the <code>html</code> element in each file. Otherwise, if you set this parameter to <code>text/plain</code>, your costs will cover the translation of every character.</p>
/// </important>
pub fn content_type(mut self, input: impl Into<std::string::String>) -> Self {
self.content_type = Some(input.into());
self
}
/// <p>Describes the format of the data that you submit to Amazon Translate as input. You can specify one of the following multipurpose internet mail extension (MIME) types:</p>
/// <ul>
/// <li> <p> <code>text/html</code>: The input data consists of one or more HTML files. Amazon Translate translates only the text that resides in the <code>html</code> element in each file.</p> </li>
/// <li> <p> <code>text/plain</code>: The input data consists of one or more unformatted text files. Amazon Translate translates every character in this type of input.</p> </li>
/// <li> <p> <code>application/vnd.openxmlformats-officedocument.wordprocessingml.document</code>: The input data consists of one or more Word documents (.docx).</p> </li>
/// <li> <p> <code>application/vnd.openxmlformats-officedocument.presentationml.presentation</code>: The input data consists of one or more PowerPoint Presentation files (.pptx).</p> </li>
/// <li> <p> <code>application/vnd.openxmlformats-officedocument.spreadsheetml.sheet</code>: The input data consists of one or more Excel Workbook files (.xlsx).</p> </li>
/// <li> <p> <code>application/x-xliff+xml</code>: The input data consists of one or more XML Localization Interchange File Format (XLIFF) files (.xlf). Amazon Translate supports only XLIFF version 1.2.</p> </li>
/// </ul> <important>
/// <p>If you structure your input data as HTML, ensure that you set this parameter to <code>text/html</code>. By doing so, you cut costs by limiting the translation to the contents of the <code>html</code> element in each file. Otherwise, if you set this parameter to <code>text/plain</code>, your costs will cover the translation of every character.</p>
/// </important>
pub fn set_content_type(mut self, input: std::option::Option<std::string::String>) -> Self {
self.content_type = input;
self
}
/// Consumes the builder and constructs a [`InputDataConfig`](crate::model::InputDataConfig)
pub fn build(self) -> crate::model::InputDataConfig {
crate::model::InputDataConfig {
s3_uri: self.s3_uri,
content_type: self.content_type,
}
}
}
}
impl InputDataConfig {
/// Creates a new builder-style object to manufacture [`InputDataConfig`](crate::model::InputDataConfig)
pub fn builder() -> crate::model::input_data_config::Builder {
crate::model::input_data_config::Builder::default()
}
}
/// <p>Provides information about a translation job.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct TextTranslationJobProperties {
/// <p>The ID of the translation job.</p>
pub job_id: std::option::Option<std::string::String>,
/// <p>The user-defined name of the translation job.</p>
pub job_name: std::option::Option<std::string::String>,
/// <p>The status of the translation job.</p>
pub job_status: std::option::Option<crate::model::JobStatus>,
/// <p>The number of documents successfully and unsuccessfully processed during the translation job.</p>
pub job_details: std::option::Option<crate::model::JobDetails>,
/// <p>The language code of the language of the source text. The language must be a language supported by Amazon Translate.</p>
pub source_language_code: std::option::Option<std::string::String>,
/// <p>The language code of the language of the target text. The language must be a language supported by Amazon Translate.</p>
pub target_language_codes: std::option::Option<std::vec::Vec<std::string::String>>,
/// <p>A list containing the names of the terminologies applied to a translation job. Only one terminology can be applied per <code>StartTextTranslationJob</code> request at this time.</p>
pub terminology_names: std::option::Option<std::vec::Vec<std::string::String>>,
/// <p>A list containing the names of the parallel data resources applied to the translation job.</p>
pub parallel_data_names: std::option::Option<std::vec::Vec<std::string::String>>,
/// <p>An explanation of any errors that may have occurred during the translation job.</p>
pub message: std::option::Option<std::string::String>,
/// <p>The time at which the translation job was submitted.</p>
pub submitted_time: std::option::Option<aws_smithy_types::DateTime>,
/// <p>The time at which the translation job ended.</p>
pub end_time: std::option::Option<aws_smithy_types::DateTime>,
/// <p>The input configuration properties that were specified when the job was requested.</p>
pub input_data_config: std::option::Option<crate::model::InputDataConfig>,
/// <p>The output configuration properties that were specified when the job was requested.</p>
pub output_data_config: std::option::Option<crate::model::OutputDataConfig>,
/// <p>The Amazon Resource Name (ARN) of an AWS Identity Access and Management (IAM) role that granted Amazon Translate read access to the job's input data.</p>
pub data_access_role_arn: std::option::Option<std::string::String>,
/// <p>Settings that configure the translation output.</p>
pub settings: std::option::Option<crate::model::TranslationSettings>,
}
impl TextTranslationJobProperties {
/// <p>The ID of the translation job.</p>
pub fn job_id(&self) -> std::option::Option<&str> {
self.job_id.as_deref()
}
/// <p>The user-defined name of the translation job.</p>
pub fn job_name(&self) -> std::option::Option<&str> {
self.job_name.as_deref()
}
/// <p>The status of the translation job.</p>
pub fn job_status(&self) -> std::option::Option<&crate::model::JobStatus> {
self.job_status.as_ref()
}
/// <p>The number of documents successfully and unsuccessfully processed during the translation job.</p>
pub fn job_details(&self) -> std::option::Option<&crate::model::JobDetails> {
self.job_details.as_ref()
}
/// <p>The language code of the language of the source text. The language must be a language supported by Amazon Translate.</p>
pub fn source_language_code(&self) -> std::option::Option<&str> {
self.source_language_code.as_deref()
}
/// <p>The language code of the language of the target text. The language must be a language supported by Amazon Translate.</p>
pub fn target_language_codes(&self) -> std::option::Option<&[std::string::String]> {
self.target_language_codes.as_deref()
}
/// <p>A list containing the names of the terminologies applied to a translation job. Only one terminology can be applied per <code>StartTextTranslationJob</code> request at this time.</p>
pub fn terminology_names(&self) -> std::option::Option<&[std::string::String]> {
self.terminology_names.as_deref()
}
/// <p>A list containing the names of the parallel data resources applied to the translation job.</p>
pub fn parallel_data_names(&self) -> std::option::Option<&[std::string::String]> {
self.parallel_data_names.as_deref()
}
/// <p>An explanation of any errors that may have occurred during the translation job.</p>
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
/// <p>The time at which the translation job was submitted.</p>
pub fn submitted_time(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.submitted_time.as_ref()
}
/// <p>The time at which the translation job ended.</p>
pub fn end_time(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.end_time.as_ref()
}
/// <p>The input configuration properties that were specified when the job was requested.</p>
pub fn input_data_config(&self) -> std::option::Option<&crate::model::InputDataConfig> {
self.input_data_config.as_ref()
}
/// <p>The output configuration properties that were specified when the job was requested.</p>
pub fn output_data_config(&self) -> std::option::Option<&crate::model::OutputDataConfig> {
self.output_data_config.as_ref()
}
/// <p>The Amazon Resource Name (ARN) of an AWS Identity Access and Management (IAM) role that granted Amazon Translate read access to the job's input data.</p>
pub fn data_access_role_arn(&self) -> std::option::Option<&str> {
self.data_access_role_arn.as_deref()
}
/// <p>Settings that configure the translation output.</p>
pub fn settings(&self) -> std::option::Option<&crate::model::TranslationSettings> {
self.settings.as_ref()
}
}
impl std::fmt::Debug for TextTranslationJobProperties {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("TextTranslationJobProperties");
formatter.field("job_id", &self.job_id);
formatter.field("job_name", &self.job_name);
formatter.field("job_status", &self.job_status);
formatter.field("job_details", &self.job_details);
formatter.field("source_language_code", &self.source_language_code);
formatter.field("target_language_codes", &self.target_language_codes);
formatter.field("terminology_names", &self.terminology_names);
formatter.field("parallel_data_names", &self.parallel_data_names);
formatter.field("message", &self.message);
formatter.field("submitted_time", &self.submitted_time);
formatter.field("end_time", &self.end_time);
formatter.field("input_data_config", &self.input_data_config);
formatter.field("output_data_config", &self.output_data_config);
formatter.field("data_access_role_arn", &self.data_access_role_arn);
formatter.field("settings", &self.settings);
formatter.finish()
}
}
/// See [`TextTranslationJobProperties`](crate::model::TextTranslationJobProperties)
pub mod text_translation_job_properties {
/// A builder for [`TextTranslationJobProperties`](crate::model::TextTranslationJobProperties)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) job_id: std::option::Option<std::string::String>,
pub(crate) job_name: std::option::Option<std::string::String>,
pub(crate) job_status: std::option::Option<crate::model::JobStatus>,
pub(crate) job_details: std::option::Option<crate::model::JobDetails>,
pub(crate) source_language_code: std::option::Option<std::string::String>,
pub(crate) target_language_codes: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) terminology_names: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) parallel_data_names: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) message: std::option::Option<std::string::String>,
pub(crate) submitted_time: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) end_time: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) input_data_config: std::option::Option<crate::model::InputDataConfig>,
pub(crate) output_data_config: std::option::Option<crate::model::OutputDataConfig>,
pub(crate) data_access_role_arn: std::option::Option<std::string::String>,
pub(crate) settings: std::option::Option<crate::model::TranslationSettings>,
}
impl Builder {
/// <p>The ID of the translation job.</p>
pub fn job_id(mut self, input: impl Into<std::string::String>) -> Self {
self.job_id = Some(input.into());
self
}
/// <p>The ID of the translation job.</p>
pub fn set_job_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.job_id = input;
self
}
/// <p>The user-defined name of the translation job.</p>
pub fn job_name(mut self, input: impl Into<std::string::String>) -> Self {
self.job_name = Some(input.into());
self
}
/// <p>The user-defined name of the translation job.</p>
pub fn set_job_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.job_name = input;
self
}
/// <p>The status of the translation job.</p>
pub fn job_status(mut self, input: crate::model::JobStatus) -> Self {
self.job_status = Some(input);
self
}
/// <p>The status of the translation job.</p>
pub fn set_job_status(
mut self,
input: std::option::Option<crate::model::JobStatus>,
) -> Self {
self.job_status = input;
self
}
/// <p>The number of documents successfully and unsuccessfully processed during the translation job.</p>
pub fn job_details(mut self, input: crate::model::JobDetails) -> Self {
self.job_details = Some(input);
self
}
/// <p>The number of documents successfully and unsuccessfully processed during the translation job.</p>
pub fn set_job_details(
mut self,
input: std::option::Option<crate::model::JobDetails>,
) -> Self {
self.job_details = input;
self
}
/// <p>The language code of the language of the source text. The language must be a language supported by Amazon Translate.</p>
pub fn source_language_code(mut self, input: impl Into<std::string::String>) -> Self {
self.source_language_code = Some(input.into());
self
}
/// <p>The language code of the language of the source text. The language must be a language supported by Amazon Translate.</p>
pub fn set_source_language_code(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.source_language_code = input;
self
}
/// Appends an item to `target_language_codes`.
///
/// To override the contents of this collection use [`set_target_language_codes`](Self::set_target_language_codes).
///
/// <p>The language code of the language of the target text. The language must be a language supported by Amazon Translate.</p>
pub fn target_language_codes(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.target_language_codes.unwrap_or_default();
v.push(input.into());
self.target_language_codes = Some(v);
self
}
/// <p>The language code of the language of the target text. The language must be a language supported by Amazon Translate.</p>
pub fn set_target_language_codes(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.target_language_codes = input;
self
}
/// Appends an item to `terminology_names`.
///
/// To override the contents of this collection use [`set_terminology_names`](Self::set_terminology_names).
///
/// <p>A list containing the names of the terminologies applied to a translation job. Only one terminology can be applied per <code>StartTextTranslationJob</code> request at this time.</p>
pub fn terminology_names(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.terminology_names.unwrap_or_default();
v.push(input.into());
self.terminology_names = Some(v);
self
}
/// <p>A list containing the names of the terminologies applied to a translation job. Only one terminology can be applied per <code>StartTextTranslationJob</code> request at this time.</p>
pub fn set_terminology_names(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.terminology_names = input;
self
}
/// Appends an item to `parallel_data_names`.
///
/// To override the contents of this collection use [`set_parallel_data_names`](Self::set_parallel_data_names).
///
/// <p>A list containing the names of the parallel data resources applied to the translation job.</p>
pub fn parallel_data_names(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.parallel_data_names.unwrap_or_default();
v.push(input.into());
self.parallel_data_names = Some(v);
self
}
/// <p>A list containing the names of the parallel data resources applied to the translation job.</p>
pub fn set_parallel_data_names(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.parallel_data_names = input;
self
}
/// <p>An explanation of any errors that may have occurred during the translation job.</p>
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
/// <p>An explanation of any errors that may have occurred during the translation job.</p>
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// <p>The time at which the translation job was submitted.</p>
pub fn submitted_time(mut self, input: aws_smithy_types::DateTime) -> Self {
self.submitted_time = Some(input);
self
}
/// <p>The time at which the translation job was submitted.</p>
pub fn set_submitted_time(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.submitted_time = input;
self
}
/// <p>The time at which the translation job ended.</p>
pub fn end_time(mut self, input: aws_smithy_types::DateTime) -> Self {
self.end_time = Some(input);
self
}
/// <p>The time at which the translation job ended.</p>
pub fn set_end_time(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.end_time = input;
self
}
/// <p>The input configuration properties that were specified when the job was requested.</p>
pub fn input_data_config(mut self, input: crate::model::InputDataConfig) -> Self {
self.input_data_config = Some(input);
self
}
/// <p>The input configuration properties that were specified when the job was requested.</p>
pub fn set_input_data_config(
mut self,
input: std::option::Option<crate::model::InputDataConfig>,
) -> Self {
self.input_data_config = input;
self
}
/// <p>The output configuration properties that were specified when the job was requested.</p>
pub fn output_data_config(mut self, input: crate::model::OutputDataConfig) -> Self {
self.output_data_config = Some(input);
self
}
/// <p>The output configuration properties that were specified when the job was requested.</p>
pub fn set_output_data_config(
mut self,
input: std::option::Option<crate::model::OutputDataConfig>,
) -> Self {
self.output_data_config = input;
self
}
/// <p>The Amazon Resource Name (ARN) of an AWS Identity Access and Management (IAM) role that granted Amazon Translate read access to the job's input data.</p>
pub fn data_access_role_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.data_access_role_arn = Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of an AWS Identity Access and Management (IAM) role that granted Amazon Translate read access to the job's input data.</p>
pub fn set_data_access_role_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.data_access_role_arn = input;
self
}
/// <p>Settings that configure the translation output.</p>
pub fn settings(mut self, input: crate::model::TranslationSettings) -> Self {
self.settings = Some(input);
self
}
/// <p>Settings that configure the translation output.</p>
pub fn set_settings(
mut self,
input: std::option::Option<crate::model::TranslationSettings>,
) -> Self {
self.settings = input;
self
}
/// Consumes the builder and constructs a [`TextTranslationJobProperties`](crate::model::TextTranslationJobProperties)
pub fn build(self) -> crate::model::TextTranslationJobProperties {
crate::model::TextTranslationJobProperties {
job_id: self.job_id,
job_name: self.job_name,
job_status: self.job_status,
job_details: self.job_details,
source_language_code: self.source_language_code,
target_language_codes: self.target_language_codes,
terminology_names: self.terminology_names,
parallel_data_names: self.parallel_data_names,
message: self.message,
submitted_time: self.submitted_time,
end_time: self.end_time,
input_data_config: self.input_data_config,
output_data_config: self.output_data_config,
data_access_role_arn: self.data_access_role_arn,
settings: self.settings,
}
}
}
}
impl TextTranslationJobProperties {
/// Creates a new builder-style object to manufacture [`TextTranslationJobProperties`](crate::model::TextTranslationJobProperties)
pub fn builder() -> crate::model::text_translation_job_properties::Builder {
crate::model::text_translation_job_properties::Builder::default()
}
}
/// <p>The number of documents successfully and unsuccessfully processed during a translation job.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct JobDetails {
/// <p>The number of documents successfully processed during a translation job.</p>
pub translated_documents_count: std::option::Option<i32>,
/// <p>The number of documents that could not be processed during a translation job.</p>
pub documents_with_errors_count: std::option::Option<i32>,
/// <p>The number of documents used as input in a translation job.</p>
pub input_documents_count: std::option::Option<i32>,
}
impl JobDetails {
/// <p>The number of documents successfully processed during a translation job.</p>
pub fn translated_documents_count(&self) -> std::option::Option<i32> {
self.translated_documents_count
}
/// <p>The number of documents that could not be processed during a translation job.</p>
pub fn documents_with_errors_count(&self) -> std::option::Option<i32> {
self.documents_with_errors_count
}
/// <p>The number of documents used as input in a translation job.</p>
pub fn input_documents_count(&self) -> std::option::Option<i32> {
self.input_documents_count
}
}
impl std::fmt::Debug for JobDetails {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("JobDetails");
formatter.field(
"translated_documents_count",
&self.translated_documents_count,
);
formatter.field(
"documents_with_errors_count",
&self.documents_with_errors_count,
);
formatter.field("input_documents_count", &self.input_documents_count);
formatter.finish()
}
}
/// See [`JobDetails`](crate::model::JobDetails)
pub mod job_details {
/// A builder for [`JobDetails`](crate::model::JobDetails)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) translated_documents_count: std::option::Option<i32>,
pub(crate) documents_with_errors_count: std::option::Option<i32>,
pub(crate) input_documents_count: std::option::Option<i32>,
}
impl Builder {
/// <p>The number of documents successfully processed during a translation job.</p>
pub fn translated_documents_count(mut self, input: i32) -> Self {
self.translated_documents_count = Some(input);
self
}
/// <p>The number of documents successfully processed during a translation job.</p>
pub fn set_translated_documents_count(mut self, input: std::option::Option<i32>) -> Self {
self.translated_documents_count = input;
self
}
/// <p>The number of documents that could not be processed during a translation job.</p>
pub fn documents_with_errors_count(mut self, input: i32) -> Self {
self.documents_with_errors_count = Some(input);
self
}
/// <p>The number of documents that could not be processed during a translation job.</p>
pub fn set_documents_with_errors_count(mut self, input: std::option::Option<i32>) -> Self {
self.documents_with_errors_count = input;
self
}
/// <p>The number of documents used as input in a translation job.</p>
pub fn input_documents_count(mut self, input: i32) -> Self {
self.input_documents_count = Some(input);
self
}
/// <p>The number of documents used as input in a translation job.</p>
pub fn set_input_documents_count(mut self, input: std::option::Option<i32>) -> Self {
self.input_documents_count = input;
self
}
/// Consumes the builder and constructs a [`JobDetails`](crate::model::JobDetails)
pub fn build(self) -> crate::model::JobDetails {
crate::model::JobDetails {
translated_documents_count: self.translated_documents_count,
documents_with_errors_count: self.documents_with_errors_count,
input_documents_count: self.input_documents_count,
}
}
}
}
impl JobDetails {
/// Creates a new builder-style object to manufacture [`JobDetails`](crate::model::JobDetails)
pub fn builder() -> crate::model::job_details::Builder {
crate::model::job_details::Builder::default()
}
}
/// <p>Provides information for filtering a list of translation jobs. For more information, see <code>ListTextTranslationJobs</code>.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct TextTranslationJobFilter {
/// <p>Filters the list of jobs by name.</p>
pub job_name: std::option::Option<std::string::String>,
/// <p>Filters the list of jobs based by job status.</p>
pub job_status: std::option::Option<crate::model::JobStatus>,
/// <p>Filters the list of jobs based on the time that the job was submitted for processing and returns only the jobs submitted before the specified time. Jobs are returned in ascending order, oldest to newest.</p>
pub submitted_before_time: std::option::Option<aws_smithy_types::DateTime>,
/// <p>Filters the list of jobs based on the time that the job was submitted for processing and returns only the jobs submitted after the specified time. Jobs are returned in descending order, newest to oldest.</p>
pub submitted_after_time: std::option::Option<aws_smithy_types::DateTime>,
}
impl TextTranslationJobFilter {
/// <p>Filters the list of jobs by name.</p>
pub fn job_name(&self) -> std::option::Option<&str> {
self.job_name.as_deref()
}
/// <p>Filters the list of jobs based by job status.</p>
pub fn job_status(&self) -> std::option::Option<&crate::model::JobStatus> {
self.job_status.as_ref()
}
/// <p>Filters the list of jobs based on the time that the job was submitted for processing and returns only the jobs submitted before the specified time. Jobs are returned in ascending order, oldest to newest.</p>
pub fn submitted_before_time(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.submitted_before_time.as_ref()
}
/// <p>Filters the list of jobs based on the time that the job was submitted for processing and returns only the jobs submitted after the specified time. Jobs are returned in descending order, newest to oldest.</p>
pub fn submitted_after_time(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.submitted_after_time.as_ref()
}
}
impl std::fmt::Debug for TextTranslationJobFilter {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("TextTranslationJobFilter");
formatter.field("job_name", &self.job_name);
formatter.field("job_status", &self.job_status);
formatter.field("submitted_before_time", &self.submitted_before_time);
formatter.field("submitted_after_time", &self.submitted_after_time);
formatter.finish()
}
}
/// See [`TextTranslationJobFilter`](crate::model::TextTranslationJobFilter)
pub mod text_translation_job_filter {
/// A builder for [`TextTranslationJobFilter`](crate::model::TextTranslationJobFilter)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) job_name: std::option::Option<std::string::String>,
pub(crate) job_status: std::option::Option<crate::model::JobStatus>,
pub(crate) submitted_before_time: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) submitted_after_time: std::option::Option<aws_smithy_types::DateTime>,
}
impl Builder {
/// <p>Filters the list of jobs by name.</p>
pub fn job_name(mut self, input: impl Into<std::string::String>) -> Self {
self.job_name = Some(input.into());
self
}
/// <p>Filters the list of jobs by name.</p>
pub fn set_job_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.job_name = input;
self
}
/// <p>Filters the list of jobs based by job status.</p>
pub fn job_status(mut self, input: crate::model::JobStatus) -> Self {
self.job_status = Some(input);
self
}
/// <p>Filters the list of jobs based by job status.</p>
pub fn set_job_status(
mut self,
input: std::option::Option<crate::model::JobStatus>,
) -> Self {
self.job_status = input;
self
}
/// <p>Filters the list of jobs based on the time that the job was submitted for processing and returns only the jobs submitted before the specified time. Jobs are returned in ascending order, oldest to newest.</p>
pub fn submitted_before_time(mut self, input: aws_smithy_types::DateTime) -> Self {
self.submitted_before_time = Some(input);
self
}
/// <p>Filters the list of jobs based on the time that the job was submitted for processing and returns only the jobs submitted before the specified time. Jobs are returned in ascending order, oldest to newest.</p>
pub fn set_submitted_before_time(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.submitted_before_time = input;
self
}
/// <p>Filters the list of jobs based on the time that the job was submitted for processing and returns only the jobs submitted after the specified time. Jobs are returned in descending order, newest to oldest.</p>
pub fn submitted_after_time(mut self, input: aws_smithy_types::DateTime) -> Self {
self.submitted_after_time = Some(input);
self
}
/// <p>Filters the list of jobs based on the time that the job was submitted for processing and returns only the jobs submitted after the specified time. Jobs are returned in descending order, newest to oldest.</p>
pub fn set_submitted_after_time(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.submitted_after_time = input;
self
}
/// Consumes the builder and constructs a [`TextTranslationJobFilter`](crate::model::TextTranslationJobFilter)
pub fn build(self) -> crate::model::TextTranslationJobFilter {
crate::model::TextTranslationJobFilter {
job_name: self.job_name,
job_status: self.job_status,
submitted_before_time: self.submitted_before_time,
submitted_after_time: self.submitted_after_time,
}
}
}
}
impl TextTranslationJobFilter {
/// Creates a new builder-style object to manufacture [`TextTranslationJobFilter`](crate::model::TextTranslationJobFilter)
pub fn builder() -> crate::model::text_translation_job_filter::Builder {
crate::model::text_translation_job_filter::Builder::default()
}
}
/// <p>The properties of the custom terminology.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct TerminologyProperties {
/// <p>The name of the custom terminology.</p>
pub name: std::option::Option<std::string::String>,
/// <p>The description of the custom terminology properties.</p>
pub description: std::option::Option<std::string::String>,
/// <p> The Amazon Resource Name (ARN) of the custom terminology. </p>
pub arn: std::option::Option<std::string::String>,
/// <p>The language code for the source text of the translation request for which the custom terminology is being used.</p>
pub source_language_code: std::option::Option<std::string::String>,
/// <p>The language codes for the target languages available with the custom terminology resource. All possible target languages are returned in array.</p>
pub target_language_codes: std::option::Option<std::vec::Vec<std::string::String>>,
/// <p>The encryption key for the custom terminology.</p>
pub encryption_key: std::option::Option<crate::model::EncryptionKey>,
/// <p>The size of the file used when importing a custom terminology.</p>
pub size_bytes: std::option::Option<i32>,
/// <p>The number of terms included in the custom terminology.</p>
pub term_count: std::option::Option<i32>,
/// <p>The time at which the custom terminology was created, based on the timestamp.</p>
pub created_at: std::option::Option<aws_smithy_types::DateTime>,
/// <p>The time at which the custom terminology was last update, based on the timestamp.</p>
pub last_updated_at: std::option::Option<aws_smithy_types::DateTime>,
/// <p>The directionality of your terminology resource indicates whether it has one source language (uni-directional) or multiple (multi-directional). </p>
/// <dl>
/// <dt>
/// UNI
/// </dt>
/// <dd>
/// <p>The terminology resource has one source language (the first column in a CSV file), and all of its other languages are target languages.</p>
/// </dd>
/// <dt>
/// MULTI
/// </dt>
/// <dd>
/// <p>Any language in the terminology resource can be the source language.</p>
/// </dd>
/// </dl>
pub directionality: std::option::Option<crate::model::Directionality>,
/// <p>Additional information from Amazon Translate about the terminology resource.</p>
pub message: std::option::Option<std::string::String>,
/// <p>The number of terms in the input file that Amazon Translate skipped when you created or updated the terminology resource.</p>
pub skipped_term_count: std::option::Option<i32>,
/// <p>The format of the custom terminology input file.</p>
pub format: std::option::Option<crate::model::TerminologyDataFormat>,
}
impl TerminologyProperties {
/// <p>The name of the custom terminology.</p>
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
/// <p>The description of the custom terminology properties.</p>
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
/// <p> The Amazon Resource Name (ARN) of the custom terminology. </p>
pub fn arn(&self) -> std::option::Option<&str> {
self.arn.as_deref()
}
/// <p>The language code for the source text of the translation request for which the custom terminology is being used.</p>
pub fn source_language_code(&self) -> std::option::Option<&str> {
self.source_language_code.as_deref()
}
/// <p>The language codes for the target languages available with the custom terminology resource. All possible target languages are returned in array.</p>
pub fn target_language_codes(&self) -> std::option::Option<&[std::string::String]> {
self.target_language_codes.as_deref()
}
/// <p>The encryption key for the custom terminology.</p>
pub fn encryption_key(&self) -> std::option::Option<&crate::model::EncryptionKey> {
self.encryption_key.as_ref()
}
/// <p>The size of the file used when importing a custom terminology.</p>
pub fn size_bytes(&self) -> std::option::Option<i32> {
self.size_bytes
}
/// <p>The number of terms included in the custom terminology.</p>
pub fn term_count(&self) -> std::option::Option<i32> {
self.term_count
}
/// <p>The time at which the custom terminology was created, based on the timestamp.</p>
pub fn created_at(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.created_at.as_ref()
}
/// <p>The time at which the custom terminology was last update, based on the timestamp.</p>
pub fn last_updated_at(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.last_updated_at.as_ref()
}
/// <p>The directionality of your terminology resource indicates whether it has one source language (uni-directional) or multiple (multi-directional). </p>
/// <dl>
/// <dt>
/// UNI
/// </dt>
/// <dd>
/// <p>The terminology resource has one source language (the first column in a CSV file), and all of its other languages are target languages.</p>
/// </dd>
/// <dt>
/// MULTI
/// </dt>
/// <dd>
/// <p>Any language in the terminology resource can be the source language.</p>
/// </dd>
/// </dl>
pub fn directionality(&self) -> std::option::Option<&crate::model::Directionality> {
self.directionality.as_ref()
}
/// <p>Additional information from Amazon Translate about the terminology resource.</p>
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
/// <p>The number of terms in the input file that Amazon Translate skipped when you created or updated the terminology resource.</p>
pub fn skipped_term_count(&self) -> std::option::Option<i32> {
self.skipped_term_count
}
/// <p>The format of the custom terminology input file.</p>
pub fn format(&self) -> std::option::Option<&crate::model::TerminologyDataFormat> {
self.format.as_ref()
}
}
impl std::fmt::Debug for TerminologyProperties {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("TerminologyProperties");
formatter.field("name", &self.name);
formatter.field("description", &self.description);
formatter.field("arn", &self.arn);
formatter.field("source_language_code", &self.source_language_code);
formatter.field("target_language_codes", &self.target_language_codes);
formatter.field("encryption_key", &self.encryption_key);
formatter.field("size_bytes", &self.size_bytes);
formatter.field("term_count", &self.term_count);
formatter.field("created_at", &self.created_at);
formatter.field("last_updated_at", &self.last_updated_at);
formatter.field("directionality", &self.directionality);
formatter.field("message", &self.message);
formatter.field("skipped_term_count", &self.skipped_term_count);
formatter.field("format", &self.format);
formatter.finish()
}
}
/// See [`TerminologyProperties`](crate::model::TerminologyProperties)
pub mod terminology_properties {
/// A builder for [`TerminologyProperties`](crate::model::TerminologyProperties)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) arn: std::option::Option<std::string::String>,
pub(crate) source_language_code: std::option::Option<std::string::String>,
pub(crate) target_language_codes: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) encryption_key: std::option::Option<crate::model::EncryptionKey>,
pub(crate) size_bytes: std::option::Option<i32>,
pub(crate) term_count: std::option::Option<i32>,
pub(crate) created_at: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) last_updated_at: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) directionality: std::option::Option<crate::model::Directionality>,
pub(crate) message: std::option::Option<std::string::String>,
pub(crate) skipped_term_count: std::option::Option<i32>,
pub(crate) format: std::option::Option<crate::model::TerminologyDataFormat>,
}
impl Builder {
/// <p>The name of the custom terminology.</p>
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
/// <p>The name of the custom terminology.</p>
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
/// <p>The description of the custom terminology properties.</p>
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
/// <p>The description of the custom terminology properties.</p>
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
/// <p> The Amazon Resource Name (ARN) of the custom terminology. </p>
pub fn arn(mut self, input: impl Into<std::string::String>) -> Self {
self.arn = Some(input.into());
self
}
/// <p> The Amazon Resource Name (ARN) of the custom terminology. </p>
pub fn set_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.arn = input;
self
}
/// <p>The language code for the source text of the translation request for which the custom terminology is being used.</p>
pub fn source_language_code(mut self, input: impl Into<std::string::String>) -> Self {
self.source_language_code = Some(input.into());
self
}
/// <p>The language code for the source text of the translation request for which the custom terminology is being used.</p>
pub fn set_source_language_code(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.source_language_code = input;
self
}
/// Appends an item to `target_language_codes`.
///
/// To override the contents of this collection use [`set_target_language_codes`](Self::set_target_language_codes).
///
/// <p>The language codes for the target languages available with the custom terminology resource. All possible target languages are returned in array.</p>
pub fn target_language_codes(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.target_language_codes.unwrap_or_default();
v.push(input.into());
self.target_language_codes = Some(v);
self
}
/// <p>The language codes for the target languages available with the custom terminology resource. All possible target languages are returned in array.</p>
pub fn set_target_language_codes(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.target_language_codes = input;
self
}
/// <p>The encryption key for the custom terminology.</p>
pub fn encryption_key(mut self, input: crate::model::EncryptionKey) -> Self {
self.encryption_key = Some(input);
self
}
/// <p>The encryption key for the custom terminology.</p>
pub fn set_encryption_key(
mut self,
input: std::option::Option<crate::model::EncryptionKey>,
) -> Self {
self.encryption_key = input;
self
}
/// <p>The size of the file used when importing a custom terminology.</p>
pub fn size_bytes(mut self, input: i32) -> Self {
self.size_bytes = Some(input);
self
}
/// <p>The size of the file used when importing a custom terminology.</p>
pub fn set_size_bytes(mut self, input: std::option::Option<i32>) -> Self {
self.size_bytes = input;
self
}
/// <p>The number of terms included in the custom terminology.</p>
pub fn term_count(mut self, input: i32) -> Self {
self.term_count = Some(input);
self
}
/// <p>The number of terms included in the custom terminology.</p>
pub fn set_term_count(mut self, input: std::option::Option<i32>) -> Self {
self.term_count = input;
self
}
/// <p>The time at which the custom terminology was created, based on the timestamp.</p>
pub fn created_at(mut self, input: aws_smithy_types::DateTime) -> Self {
self.created_at = Some(input);
self
}
/// <p>The time at which the custom terminology was created, based on the timestamp.</p>
pub fn set_created_at(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.created_at = input;
self
}
/// <p>The time at which the custom terminology was last update, based on the timestamp.</p>
pub fn last_updated_at(mut self, input: aws_smithy_types::DateTime) -> Self {
self.last_updated_at = Some(input);
self
}
/// <p>The time at which the custom terminology was last update, based on the timestamp.</p>
pub fn set_last_updated_at(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.last_updated_at = input;
self
}
/// <p>The directionality of your terminology resource indicates whether it has one source language (uni-directional) or multiple (multi-directional). </p>
/// <dl>
/// <dt>
/// UNI
/// </dt>
/// <dd>
/// <p>The terminology resource has one source language (the first column in a CSV file), and all of its other languages are target languages.</p>
/// </dd>
/// <dt>
/// MULTI
/// </dt>
/// <dd>
/// <p>Any language in the terminology resource can be the source language.</p>
/// </dd>
/// </dl>
pub fn directionality(mut self, input: crate::model::Directionality) -> Self {
self.directionality = Some(input);
self
}
/// <p>The directionality of your terminology resource indicates whether it has one source language (uni-directional) or multiple (multi-directional). </p>
/// <dl>
/// <dt>
/// UNI
/// </dt>
/// <dd>
/// <p>The terminology resource has one source language (the first column in a CSV file), and all of its other languages are target languages.</p>
/// </dd>
/// <dt>
/// MULTI
/// </dt>
/// <dd>
/// <p>Any language in the terminology resource can be the source language.</p>
/// </dd>
/// </dl>
pub fn set_directionality(
mut self,
input: std::option::Option<crate::model::Directionality>,
) -> Self {
self.directionality = input;
self
}
/// <p>Additional information from Amazon Translate about the terminology resource.</p>
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
/// <p>Additional information from Amazon Translate about the terminology resource.</p>
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// <p>The number of terms in the input file that Amazon Translate skipped when you created or updated the terminology resource.</p>
pub fn skipped_term_count(mut self, input: i32) -> Self {
self.skipped_term_count = Some(input);
self
}
/// <p>The number of terms in the input file that Amazon Translate skipped when you created or updated the terminology resource.</p>
pub fn set_skipped_term_count(mut self, input: std::option::Option<i32>) -> Self {
self.skipped_term_count = input;
self
}
/// <p>The format of the custom terminology input file.</p>
pub fn format(mut self, input: crate::model::TerminologyDataFormat) -> Self {
self.format = Some(input);
self
}
/// <p>The format of the custom terminology input file.</p>
pub fn set_format(
mut self,
input: std::option::Option<crate::model::TerminologyDataFormat>,
) -> Self {
self.format = input;
self
}
/// Consumes the builder and constructs a [`TerminologyProperties`](crate::model::TerminologyProperties)
pub fn build(self) -> crate::model::TerminologyProperties {
crate::model::TerminologyProperties {
name: self.name,
description: self.description,
arn: self.arn,
source_language_code: self.source_language_code,
target_language_codes: self.target_language_codes,
encryption_key: self.encryption_key,
size_bytes: self.size_bytes,
term_count: self.term_count,
created_at: self.created_at,
last_updated_at: self.last_updated_at,
directionality: self.directionality,
message: self.message,
skipped_term_count: self.skipped_term_count,
format: self.format,
}
}
}
}
impl TerminologyProperties {
/// Creates a new builder-style object to manufacture [`TerminologyProperties`](crate::model::TerminologyProperties)
pub fn builder() -> crate::model::terminology_properties::Builder {
crate::model::terminology_properties::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 TerminologyDataFormat {
#[allow(missing_docs)] // documentation missing in model
Csv,
#[allow(missing_docs)] // documentation missing in model
Tmx,
#[allow(missing_docs)] // documentation missing in model
Tsv,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for TerminologyDataFormat {
fn from(s: &str) -> Self {
match s {
"CSV" => TerminologyDataFormat::Csv,
"TMX" => TerminologyDataFormat::Tmx,
"TSV" => TerminologyDataFormat::Tsv,
other => TerminologyDataFormat::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for TerminologyDataFormat {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(TerminologyDataFormat::from(s))
}
}
impl TerminologyDataFormat {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
TerminologyDataFormat::Csv => "CSV",
TerminologyDataFormat::Tmx => "TMX",
TerminologyDataFormat::Tsv => "TSV",
TerminologyDataFormat::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&["CSV", "TMX", "TSV"]
}
}
impl AsRef<str> for TerminologyDataFormat {
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 Directionality {
#[allow(missing_docs)] // documentation missing in model
Multi,
#[allow(missing_docs)] // documentation missing in model
Uni,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for Directionality {
fn from(s: &str) -> Self {
match s {
"MULTI" => Directionality::Multi,
"UNI" => Directionality::Uni,
other => Directionality::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for Directionality {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(Directionality::from(s))
}
}
impl Directionality {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
Directionality::Multi => "MULTI",
Directionality::Uni => "UNI",
Directionality::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&["MULTI", "UNI"]
}
}
impl AsRef<str> for Directionality {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>The properties of a parallel data resource.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ParallelDataProperties {
/// <p>The custom name assigned to the parallel data resource.</p>
pub name: std::option::Option<std::string::String>,
/// <p>The Amazon Resource Name (ARN) of the parallel data resource.</p>
pub arn: std::option::Option<std::string::String>,
/// <p>The description assigned to the parallel data resource.</p>
pub description: std::option::Option<std::string::String>,
/// <p>The status of the parallel data resource. When the parallel data is ready for you to use, the status is <code>ACTIVE</code>.</p>
pub status: std::option::Option<crate::model::ParallelDataStatus>,
/// <p>The source language of the translations in the parallel data file.</p>
pub source_language_code: std::option::Option<std::string::String>,
/// <p>The language codes for the target languages available in the parallel data file. All possible target languages are returned as an array.</p>
pub target_language_codes: std::option::Option<std::vec::Vec<std::string::String>>,
/// <p>Specifies the format and S3 location of the parallel data input file.</p>
pub parallel_data_config: std::option::Option<crate::model::ParallelDataConfig>,
/// <p>Additional information from Amazon Translate about the parallel data resource. </p>
pub message: std::option::Option<std::string::String>,
/// <p>The number of UTF-8 characters that Amazon Translate imported from the parallel data input file. This number includes only the characters in your translation examples. It does not include characters that are used to format your file. For example, if you provided a Translation Memory Exchange (.tmx) file, this number does not include the tags.</p>
pub imported_data_size: std::option::Option<i64>,
/// <p>The number of records successfully imported from the parallel data input file.</p>
pub imported_record_count: std::option::Option<i64>,
/// <p>The number of records unsuccessfully imported from the parallel data input file.</p>
pub failed_record_count: std::option::Option<i64>,
/// <p>The number of items in the input file that Amazon Translate skipped when you created or updated the parallel data resource. For example, Amazon Translate skips empty records, empty target texts, and empty lines.</p>
pub skipped_record_count: std::option::Option<i64>,
/// <p>The encryption key used to encrypt this object.</p>
pub encryption_key: std::option::Option<crate::model::EncryptionKey>,
/// <p>The time at which the parallel data resource was created.</p>
pub created_at: std::option::Option<aws_smithy_types::DateTime>,
/// <p>The time at which the parallel data resource was last updated.</p>
pub last_updated_at: std::option::Option<aws_smithy_types::DateTime>,
/// <p>The status of the most recent update attempt for the parallel data resource.</p>
pub latest_update_attempt_status: std::option::Option<crate::model::ParallelDataStatus>,
/// <p>The time that the most recent update was attempted.</p>
pub latest_update_attempt_at: std::option::Option<aws_smithy_types::DateTime>,
}
impl ParallelDataProperties {
/// <p>The custom name assigned to the parallel data resource.</p>
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
/// <p>The Amazon Resource Name (ARN) of the parallel data resource.</p>
pub fn arn(&self) -> std::option::Option<&str> {
self.arn.as_deref()
}
/// <p>The description assigned to the parallel data resource.</p>
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
/// <p>The status of the parallel data resource. When the parallel data is ready for you to use, the status is <code>ACTIVE</code>.</p>
pub fn status(&self) -> std::option::Option<&crate::model::ParallelDataStatus> {
self.status.as_ref()
}
/// <p>The source language of the translations in the parallel data file.</p>
pub fn source_language_code(&self) -> std::option::Option<&str> {
self.source_language_code.as_deref()
}
/// <p>The language codes for the target languages available in the parallel data file. All possible target languages are returned as an array.</p>
pub fn target_language_codes(&self) -> std::option::Option<&[std::string::String]> {
self.target_language_codes.as_deref()
}
/// <p>Specifies the format and S3 location of the parallel data input file.</p>
pub fn parallel_data_config(&self) -> std::option::Option<&crate::model::ParallelDataConfig> {
self.parallel_data_config.as_ref()
}
/// <p>Additional information from Amazon Translate about the parallel data resource. </p>
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
/// <p>The number of UTF-8 characters that Amazon Translate imported from the parallel data input file. This number includes only the characters in your translation examples. It does not include characters that are used to format your file. For example, if you provided a Translation Memory Exchange (.tmx) file, this number does not include the tags.</p>
pub fn imported_data_size(&self) -> std::option::Option<i64> {
self.imported_data_size
}
/// <p>The number of records successfully imported from the parallel data input file.</p>
pub fn imported_record_count(&self) -> std::option::Option<i64> {
self.imported_record_count
}
/// <p>The number of records unsuccessfully imported from the parallel data input file.</p>
pub fn failed_record_count(&self) -> std::option::Option<i64> {
self.failed_record_count
}
/// <p>The number of items in the input file that Amazon Translate skipped when you created or updated the parallel data resource. For example, Amazon Translate skips empty records, empty target texts, and empty lines.</p>
pub fn skipped_record_count(&self) -> std::option::Option<i64> {
self.skipped_record_count
}
/// <p>The encryption key used to encrypt this object.</p>
pub fn encryption_key(&self) -> std::option::Option<&crate::model::EncryptionKey> {
self.encryption_key.as_ref()
}
/// <p>The time at which the parallel data resource was created.</p>
pub fn created_at(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.created_at.as_ref()
}
/// <p>The time at which the parallel data resource was last updated.</p>
pub fn last_updated_at(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.last_updated_at.as_ref()
}
/// <p>The status of the most recent update attempt for the parallel data resource.</p>
pub fn latest_update_attempt_status(
&self,
) -> std::option::Option<&crate::model::ParallelDataStatus> {
self.latest_update_attempt_status.as_ref()
}
/// <p>The time that the most recent update was attempted.</p>
pub fn latest_update_attempt_at(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.latest_update_attempt_at.as_ref()
}
}
impl std::fmt::Debug for ParallelDataProperties {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ParallelDataProperties");
formatter.field("name", &self.name);
formatter.field("arn", &self.arn);
formatter.field("description", &self.description);
formatter.field("status", &self.status);
formatter.field("source_language_code", &self.source_language_code);
formatter.field("target_language_codes", &self.target_language_codes);
formatter.field("parallel_data_config", &self.parallel_data_config);
formatter.field("message", &self.message);
formatter.field("imported_data_size", &self.imported_data_size);
formatter.field("imported_record_count", &self.imported_record_count);
formatter.field("failed_record_count", &self.failed_record_count);
formatter.field("skipped_record_count", &self.skipped_record_count);
formatter.field("encryption_key", &self.encryption_key);
formatter.field("created_at", &self.created_at);
formatter.field("last_updated_at", &self.last_updated_at);
formatter.field(
"latest_update_attempt_status",
&self.latest_update_attempt_status,
);
formatter.field("latest_update_attempt_at", &self.latest_update_attempt_at);
formatter.finish()
}
}
/// See [`ParallelDataProperties`](crate::model::ParallelDataProperties)
pub mod parallel_data_properties {
/// A builder for [`ParallelDataProperties`](crate::model::ParallelDataProperties)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) arn: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) status: std::option::Option<crate::model::ParallelDataStatus>,
pub(crate) source_language_code: std::option::Option<std::string::String>,
pub(crate) target_language_codes: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) parallel_data_config: std::option::Option<crate::model::ParallelDataConfig>,
pub(crate) message: std::option::Option<std::string::String>,
pub(crate) imported_data_size: std::option::Option<i64>,
pub(crate) imported_record_count: std::option::Option<i64>,
pub(crate) failed_record_count: std::option::Option<i64>,
pub(crate) skipped_record_count: std::option::Option<i64>,
pub(crate) encryption_key: std::option::Option<crate::model::EncryptionKey>,
pub(crate) created_at: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) last_updated_at: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) latest_update_attempt_status:
std::option::Option<crate::model::ParallelDataStatus>,
pub(crate) latest_update_attempt_at: std::option::Option<aws_smithy_types::DateTime>,
}
impl Builder {
/// <p>The custom name assigned to the parallel data resource.</p>
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
/// <p>The custom name assigned to the parallel data resource.</p>
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
/// <p>The Amazon Resource Name (ARN) of the parallel data resource.</p>
pub fn arn(mut self, input: impl Into<std::string::String>) -> Self {
self.arn = Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the parallel data resource.</p>
pub fn set_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.arn = input;
self
}
/// <p>The description assigned to the parallel data resource.</p>
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
/// <p>The description assigned to the parallel data resource.</p>
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
/// <p>The status of the parallel data resource. When the parallel data is ready for you to use, the status is <code>ACTIVE</code>.</p>
pub fn status(mut self, input: crate::model::ParallelDataStatus) -> Self {
self.status = Some(input);
self
}
/// <p>The status of the parallel data resource. When the parallel data is ready for you to use, the status is <code>ACTIVE</code>.</p>
pub fn set_status(
mut self,
input: std::option::Option<crate::model::ParallelDataStatus>,
) -> Self {
self.status = input;
self
}
/// <p>The source language of the translations in the parallel data file.</p>
pub fn source_language_code(mut self, input: impl Into<std::string::String>) -> Self {
self.source_language_code = Some(input.into());
self
}
/// <p>The source language of the translations in the parallel data file.</p>
pub fn set_source_language_code(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.source_language_code = input;
self
}
/// Appends an item to `target_language_codes`.
///
/// To override the contents of this collection use [`set_target_language_codes`](Self::set_target_language_codes).
///
/// <p>The language codes for the target languages available in the parallel data file. All possible target languages are returned as an array.</p>
pub fn target_language_codes(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.target_language_codes.unwrap_or_default();
v.push(input.into());
self.target_language_codes = Some(v);
self
}
/// <p>The language codes for the target languages available in the parallel data file. All possible target languages are returned as an array.</p>
pub fn set_target_language_codes(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.target_language_codes = input;
self
}
/// <p>Specifies the format and S3 location of the parallel data input file.</p>
pub fn parallel_data_config(mut self, input: crate::model::ParallelDataConfig) -> Self {
self.parallel_data_config = Some(input);
self
}
/// <p>Specifies the format and S3 location of the parallel data input file.</p>
pub fn set_parallel_data_config(
mut self,
input: std::option::Option<crate::model::ParallelDataConfig>,
) -> Self {
self.parallel_data_config = input;
self
}
/// <p>Additional information from Amazon Translate about the parallel data resource. </p>
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
/// <p>Additional information from Amazon Translate about the parallel data resource. </p>
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// <p>The number of UTF-8 characters that Amazon Translate imported from the parallel data input file. This number includes only the characters in your translation examples. It does not include characters that are used to format your file. For example, if you provided a Translation Memory Exchange (.tmx) file, this number does not include the tags.</p>
pub fn imported_data_size(mut self, input: i64) -> Self {
self.imported_data_size = Some(input);
self
}
/// <p>The number of UTF-8 characters that Amazon Translate imported from the parallel data input file. This number includes only the characters in your translation examples. It does not include characters that are used to format your file. For example, if you provided a Translation Memory Exchange (.tmx) file, this number does not include the tags.</p>
pub fn set_imported_data_size(mut self, input: std::option::Option<i64>) -> Self {
self.imported_data_size = input;
self
}
/// <p>The number of records successfully imported from the parallel data input file.</p>
pub fn imported_record_count(mut self, input: i64) -> Self {
self.imported_record_count = Some(input);
self
}
/// <p>The number of records successfully imported from the parallel data input file.</p>
pub fn set_imported_record_count(mut self, input: std::option::Option<i64>) -> Self {
self.imported_record_count = input;
self
}
/// <p>The number of records unsuccessfully imported from the parallel data input file.</p>
pub fn failed_record_count(mut self, input: i64) -> Self {
self.failed_record_count = Some(input);
self
}
/// <p>The number of records unsuccessfully imported from the parallel data input file.</p>
pub fn set_failed_record_count(mut self, input: std::option::Option<i64>) -> Self {
self.failed_record_count = input;
self
}
/// <p>The number of items in the input file that Amazon Translate skipped when you created or updated the parallel data resource. For example, Amazon Translate skips empty records, empty target texts, and empty lines.</p>
pub fn skipped_record_count(mut self, input: i64) -> Self {
self.skipped_record_count = Some(input);
self
}
/// <p>The number of items in the input file that Amazon Translate skipped when you created or updated the parallel data resource. For example, Amazon Translate skips empty records, empty target texts, and empty lines.</p>
pub fn set_skipped_record_count(mut self, input: std::option::Option<i64>) -> Self {
self.skipped_record_count = input;
self
}
/// <p>The encryption key used to encrypt this object.</p>
pub fn encryption_key(mut self, input: crate::model::EncryptionKey) -> Self {
self.encryption_key = Some(input);
self
}
/// <p>The encryption key used to encrypt this object.</p>
pub fn set_encryption_key(
mut self,
input: std::option::Option<crate::model::EncryptionKey>,
) -> Self {
self.encryption_key = input;
self
}
/// <p>The time at which the parallel data resource was created.</p>
pub fn created_at(mut self, input: aws_smithy_types::DateTime) -> Self {
self.created_at = Some(input);
self
}
/// <p>The time at which the parallel data resource was created.</p>
pub fn set_created_at(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.created_at = input;
self
}
/// <p>The time at which the parallel data resource was last updated.</p>
pub fn last_updated_at(mut self, input: aws_smithy_types::DateTime) -> Self {
self.last_updated_at = Some(input);
self
}
/// <p>The time at which the parallel data resource was last updated.</p>
pub fn set_last_updated_at(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.last_updated_at = input;
self
}
/// <p>The status of the most recent update attempt for the parallel data resource.</p>
pub fn latest_update_attempt_status(
mut self,
input: crate::model::ParallelDataStatus,
) -> Self {
self.latest_update_attempt_status = Some(input);
self
}
/// <p>The status of the most recent update attempt for the parallel data resource.</p>
pub fn set_latest_update_attempt_status(
mut self,
input: std::option::Option<crate::model::ParallelDataStatus>,
) -> Self {
self.latest_update_attempt_status = input;
self
}
/// <p>The time that the most recent update was attempted.</p>
pub fn latest_update_attempt_at(mut self, input: aws_smithy_types::DateTime) -> Self {
self.latest_update_attempt_at = Some(input);
self
}
/// <p>The time that the most recent update was attempted.</p>
pub fn set_latest_update_attempt_at(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.latest_update_attempt_at = input;
self
}
/// Consumes the builder and constructs a [`ParallelDataProperties`](crate::model::ParallelDataProperties)
pub fn build(self) -> crate::model::ParallelDataProperties {
crate::model::ParallelDataProperties {
name: self.name,
arn: self.arn,
description: self.description,
status: self.status,
source_language_code: self.source_language_code,
target_language_codes: self.target_language_codes,
parallel_data_config: self.parallel_data_config,
message: self.message,
imported_data_size: self.imported_data_size,
imported_record_count: self.imported_record_count,
failed_record_count: self.failed_record_count,
skipped_record_count: self.skipped_record_count,
encryption_key: self.encryption_key,
created_at: self.created_at,
last_updated_at: self.last_updated_at,
latest_update_attempt_status: self.latest_update_attempt_status,
latest_update_attempt_at: self.latest_update_attempt_at,
}
}
}
}
impl ParallelDataProperties {
/// Creates a new builder-style object to manufacture [`ParallelDataProperties`](crate::model::ParallelDataProperties)
pub fn builder() -> crate::model::parallel_data_properties::Builder {
crate::model::parallel_data_properties::Builder::default()
}
}
/// <p>The location of the custom terminology data.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct TerminologyDataLocation {
/// <p>The repository type for the custom terminology data.</p>
pub repository_type: std::option::Option<std::string::String>,
/// <p>The Amazon S3 location of the most recent custom terminology input file that was successfully imported into Amazon Translate. The location is returned as a presigned URL that has a 30 minute expiration.</p> <important>
/// <p>Amazon Translate doesn't scan all input files for the risk of CSV injection attacks. </p>
/// <p>CSV injection occurs when a .csv or .tsv file is altered so that a record contains malicious code. The record begins with a special character, such as =, +, -, or @. When the file is opened in a spreadsheet program, the program might interpret the record as a formula and run the code within it.</p>
/// <p>Before you download an input file from Amazon S3, ensure that you recognize the file and trust its creator.</p>
/// </important>
pub location: std::option::Option<std::string::String>,
}
impl TerminologyDataLocation {
/// <p>The repository type for the custom terminology data.</p>
pub fn repository_type(&self) -> std::option::Option<&str> {
self.repository_type.as_deref()
}
/// <p>The Amazon S3 location of the most recent custom terminology input file that was successfully imported into Amazon Translate. The location is returned as a presigned URL that has a 30 minute expiration.</p> <important>
/// <p>Amazon Translate doesn't scan all input files for the risk of CSV injection attacks. </p>
/// <p>CSV injection occurs when a .csv or .tsv file is altered so that a record contains malicious code. The record begins with a special character, such as =, +, -, or @. When the file is opened in a spreadsheet program, the program might interpret the record as a formula and run the code within it.</p>
/// <p>Before you download an input file from Amazon S3, ensure that you recognize the file and trust its creator.</p>
/// </important>
pub fn location(&self) -> std::option::Option<&str> {
self.location.as_deref()
}
}
impl std::fmt::Debug for TerminologyDataLocation {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("TerminologyDataLocation");
formatter.field("repository_type", &self.repository_type);
formatter.field("location", &self.location);
formatter.finish()
}
}
/// See [`TerminologyDataLocation`](crate::model::TerminologyDataLocation)
pub mod terminology_data_location {
/// A builder for [`TerminologyDataLocation`](crate::model::TerminologyDataLocation)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) repository_type: std::option::Option<std::string::String>,
pub(crate) location: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The repository type for the custom terminology data.</p>
pub fn repository_type(mut self, input: impl Into<std::string::String>) -> Self {
self.repository_type = Some(input.into());
self
}
/// <p>The repository type for the custom terminology data.</p>
pub fn set_repository_type(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.repository_type = input;
self
}
/// <p>The Amazon S3 location of the most recent custom terminology input file that was successfully imported into Amazon Translate. The location is returned as a presigned URL that has a 30 minute expiration.</p> <important>
/// <p>Amazon Translate doesn't scan all input files for the risk of CSV injection attacks. </p>
/// <p>CSV injection occurs when a .csv or .tsv file is altered so that a record contains malicious code. The record begins with a special character, such as =, +, -, or @. When the file is opened in a spreadsheet program, the program might interpret the record as a formula and run the code within it.</p>
/// <p>Before you download an input file from Amazon S3, ensure that you recognize the file and trust its creator.</p>
/// </important>
pub fn location(mut self, input: impl Into<std::string::String>) -> Self {
self.location = Some(input.into());
self
}
/// <p>The Amazon S3 location of the most recent custom terminology input file that was successfully imported into Amazon Translate. The location is returned as a presigned URL that has a 30 minute expiration.</p> <important>
/// <p>Amazon Translate doesn't scan all input files for the risk of CSV injection attacks. </p>
/// <p>CSV injection occurs when a .csv or .tsv file is altered so that a record contains malicious code. The record begins with a special character, such as =, +, -, or @. When the file is opened in a spreadsheet program, the program might interpret the record as a formula and run the code within it.</p>
/// <p>Before you download an input file from Amazon S3, ensure that you recognize the file and trust its creator.</p>
/// </important>
pub fn set_location(mut self, input: std::option::Option<std::string::String>) -> Self {
self.location = input;
self
}
/// Consumes the builder and constructs a [`TerminologyDataLocation`](crate::model::TerminologyDataLocation)
pub fn build(self) -> crate::model::TerminologyDataLocation {
crate::model::TerminologyDataLocation {
repository_type: self.repository_type,
location: self.location,
}
}
}
}
impl TerminologyDataLocation {
/// Creates a new builder-style object to manufacture [`TerminologyDataLocation`](crate::model::TerminologyDataLocation)
pub fn builder() -> crate::model::terminology_data_location::Builder {
crate::model::terminology_data_location::Builder::default()
}
}
/// <p>The data associated with the custom terminology.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct TerminologyData {
/// <p>The file containing the custom terminology data. Your version of the AWS SDK performs a Base64-encoding on this field before sending a request to the AWS service. Users of the SDK should not perform Base64-encoding themselves.</p>
pub file: std::option::Option<aws_smithy_types::Blob>,
/// <p>The data format of the custom terminology.</p>
pub format: std::option::Option<crate::model::TerminologyDataFormat>,
/// <p>The directionality of your terminology resource indicates whether it has one source language (uni-directional) or multiple (multi-directional).</p>
/// <dl>
/// <dt>
/// UNI
/// </dt>
/// <dd>
/// <p>The terminology resource has one source language (for example, the first column in a CSV file), and all of its other languages are target languages. </p>
/// </dd>
/// <dt>
/// MULTI
/// </dt>
/// <dd>
/// <p>Any language in the terminology resource can be the source language or a target language. A single multi-directional terminology resource can be used for jobs that translate different language pairs. For example, if the terminology contains terms in English and Spanish, then it can be used for jobs that translate English to Spanish and jobs that translate Spanish to English.</p>
/// </dd>
/// </dl>
/// <p>When you create a custom terminology resource without specifying the directionality, it behaves as uni-directional terminology, although this parameter will have a null value.</p>
pub directionality: std::option::Option<crate::model::Directionality>,
}
impl TerminologyData {
/// <p>The file containing the custom terminology data. Your version of the AWS SDK performs a Base64-encoding on this field before sending a request to the AWS service. Users of the SDK should not perform Base64-encoding themselves.</p>
pub fn file(&self) -> std::option::Option<&aws_smithy_types::Blob> {
self.file.as_ref()
}
/// <p>The data format of the custom terminology.</p>
pub fn format(&self) -> std::option::Option<&crate::model::TerminologyDataFormat> {
self.format.as_ref()
}
/// <p>The directionality of your terminology resource indicates whether it has one source language (uni-directional) or multiple (multi-directional).</p>
/// <dl>
/// <dt>
/// UNI
/// </dt>
/// <dd>
/// <p>The terminology resource has one source language (for example, the first column in a CSV file), and all of its other languages are target languages. </p>
/// </dd>
/// <dt>
/// MULTI
/// </dt>
/// <dd>
/// <p>Any language in the terminology resource can be the source language or a target language. A single multi-directional terminology resource can be used for jobs that translate different language pairs. For example, if the terminology contains terms in English and Spanish, then it can be used for jobs that translate English to Spanish and jobs that translate Spanish to English.</p>
/// </dd>
/// </dl>
/// <p>When you create a custom terminology resource without specifying the directionality, it behaves as uni-directional terminology, although this parameter will have a null value.</p>
pub fn directionality(&self) -> std::option::Option<&crate::model::Directionality> {
self.directionality.as_ref()
}
}
impl std::fmt::Debug for TerminologyData {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("TerminologyData");
formatter.field("file", &"*** Sensitive Data Redacted ***");
formatter.field("format", &self.format);
formatter.field("directionality", &self.directionality);
formatter.finish()
}
}
/// See [`TerminologyData`](crate::model::TerminologyData)
pub mod terminology_data {
/// A builder for [`TerminologyData`](crate::model::TerminologyData)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) file: std::option::Option<aws_smithy_types::Blob>,
pub(crate) format: std::option::Option<crate::model::TerminologyDataFormat>,
pub(crate) directionality: std::option::Option<crate::model::Directionality>,
}
impl Builder {
/// <p>The file containing the custom terminology data. Your version of the AWS SDK performs a Base64-encoding on this field before sending a request to the AWS service. Users of the SDK should not perform Base64-encoding themselves.</p>
pub fn file(mut self, input: aws_smithy_types::Blob) -> Self {
self.file = Some(input);
self
}
/// <p>The file containing the custom terminology data. Your version of the AWS SDK performs a Base64-encoding on this field before sending a request to the AWS service. Users of the SDK should not perform Base64-encoding themselves.</p>
pub fn set_file(mut self, input: std::option::Option<aws_smithy_types::Blob>) -> Self {
self.file = input;
self
}
/// <p>The data format of the custom terminology.</p>
pub fn format(mut self, input: crate::model::TerminologyDataFormat) -> Self {
self.format = Some(input);
self
}
/// <p>The data format of the custom terminology.</p>
pub fn set_format(
mut self,
input: std::option::Option<crate::model::TerminologyDataFormat>,
) -> Self {
self.format = input;
self
}
/// <p>The directionality of your terminology resource indicates whether it has one source language (uni-directional) or multiple (multi-directional).</p>
/// <dl>
/// <dt>
/// UNI
/// </dt>
/// <dd>
/// <p>The terminology resource has one source language (for example, the first column in a CSV file), and all of its other languages are target languages. </p>
/// </dd>
/// <dt>
/// MULTI
/// </dt>
/// <dd>
/// <p>Any language in the terminology resource can be the source language or a target language. A single multi-directional terminology resource can be used for jobs that translate different language pairs. For example, if the terminology contains terms in English and Spanish, then it can be used for jobs that translate English to Spanish and jobs that translate Spanish to English.</p>
/// </dd>
/// </dl>
/// <p>When you create a custom terminology resource without specifying the directionality, it behaves as uni-directional terminology, although this parameter will have a null value.</p>
pub fn directionality(mut self, input: crate::model::Directionality) -> Self {
self.directionality = Some(input);
self
}
/// <p>The directionality of your terminology resource indicates whether it has one source language (uni-directional) or multiple (multi-directional).</p>
/// <dl>
/// <dt>
/// UNI
/// </dt>
/// <dd>
/// <p>The terminology resource has one source language (for example, the first column in a CSV file), and all of its other languages are target languages. </p>
/// </dd>
/// <dt>
/// MULTI
/// </dt>
/// <dd>
/// <p>Any language in the terminology resource can be the source language or a target language. A single multi-directional terminology resource can be used for jobs that translate different language pairs. For example, if the terminology contains terms in English and Spanish, then it can be used for jobs that translate English to Spanish and jobs that translate Spanish to English.</p>
/// </dd>
/// </dl>
/// <p>When you create a custom terminology resource without specifying the directionality, it behaves as uni-directional terminology, although this parameter will have a null value.</p>
pub fn set_directionality(
mut self,
input: std::option::Option<crate::model::Directionality>,
) -> Self {
self.directionality = input;
self
}
/// Consumes the builder and constructs a [`TerminologyData`](crate::model::TerminologyData)
pub fn build(self) -> crate::model::TerminologyData {
crate::model::TerminologyData {
file: self.file,
format: self.format,
directionality: self.directionality,
}
}
}
}
impl TerminologyData {
/// Creates a new builder-style object to manufacture [`TerminologyData`](crate::model::TerminologyData)
pub fn builder() -> crate::model::terminology_data::Builder {
crate::model::terminology_data::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 MergeStrategy {
#[allow(missing_docs)] // documentation missing in model
Overwrite,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for MergeStrategy {
fn from(s: &str) -> Self {
match s {
"OVERWRITE" => MergeStrategy::Overwrite,
other => MergeStrategy::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for MergeStrategy {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(MergeStrategy::from(s))
}
}
impl MergeStrategy {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
MergeStrategy::Overwrite => "OVERWRITE",
MergeStrategy::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&["OVERWRITE"]
}
}
impl AsRef<str> for MergeStrategy {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>The location of the most recent parallel data input file that was successfully imported into Amazon Translate.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ParallelDataDataLocation {
/// <p>Describes the repository that contains the parallel data input file.</p>
pub repository_type: std::option::Option<std::string::String>,
/// <p>The Amazon S3 location of the parallel data input file. The location is returned as a presigned URL to that has a 30 minute expiration.</p> <important>
/// <p>Amazon Translate doesn't scan all input files for the risk of CSV injection attacks. </p>
/// <p>CSV injection occurs when a .csv or .tsv file is altered so that a record contains malicious code. The record begins with a special character, such as =, +, -, or @. When the file is opened in a spreadsheet program, the program might interpret the record as a formula and run the code within it.</p>
/// <p>Before you download an input file from Amazon S3, ensure that you recognize the file and trust its creator.</p>
/// </important>
pub location: std::option::Option<std::string::String>,
}
impl ParallelDataDataLocation {
/// <p>Describes the repository that contains the parallel data input file.</p>
pub fn repository_type(&self) -> std::option::Option<&str> {
self.repository_type.as_deref()
}
/// <p>The Amazon S3 location of the parallel data input file. The location is returned as a presigned URL to that has a 30 minute expiration.</p> <important>
/// <p>Amazon Translate doesn't scan all input files for the risk of CSV injection attacks. </p>
/// <p>CSV injection occurs when a .csv or .tsv file is altered so that a record contains malicious code. The record begins with a special character, such as =, +, -, or @. When the file is opened in a spreadsheet program, the program might interpret the record as a formula and run the code within it.</p>
/// <p>Before you download an input file from Amazon S3, ensure that you recognize the file and trust its creator.</p>
/// </important>
pub fn location(&self) -> std::option::Option<&str> {
self.location.as_deref()
}
}
impl std::fmt::Debug for ParallelDataDataLocation {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ParallelDataDataLocation");
formatter.field("repository_type", &self.repository_type);
formatter.field("location", &self.location);
formatter.finish()
}
}
/// See [`ParallelDataDataLocation`](crate::model::ParallelDataDataLocation)
pub mod parallel_data_data_location {
/// A builder for [`ParallelDataDataLocation`](crate::model::ParallelDataDataLocation)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) repository_type: std::option::Option<std::string::String>,
pub(crate) location: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>Describes the repository that contains the parallel data input file.</p>
pub fn repository_type(mut self, input: impl Into<std::string::String>) -> Self {
self.repository_type = Some(input.into());
self
}
/// <p>Describes the repository that contains the parallel data input file.</p>
pub fn set_repository_type(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.repository_type = input;
self
}
/// <p>The Amazon S3 location of the parallel data input file. The location is returned as a presigned URL to that has a 30 minute expiration.</p> <important>
/// <p>Amazon Translate doesn't scan all input files for the risk of CSV injection attacks. </p>
/// <p>CSV injection occurs when a .csv or .tsv file is altered so that a record contains malicious code. The record begins with a special character, such as =, +, -, or @. When the file is opened in a spreadsheet program, the program might interpret the record as a formula and run the code within it.</p>
/// <p>Before you download an input file from Amazon S3, ensure that you recognize the file and trust its creator.</p>
/// </important>
pub fn location(mut self, input: impl Into<std::string::String>) -> Self {
self.location = Some(input.into());
self
}
/// <p>The Amazon S3 location of the parallel data input file. The location is returned as a presigned URL to that has a 30 minute expiration.</p> <important>
/// <p>Amazon Translate doesn't scan all input files for the risk of CSV injection attacks. </p>
/// <p>CSV injection occurs when a .csv or .tsv file is altered so that a record contains malicious code. The record begins with a special character, such as =, +, -, or @. When the file is opened in a spreadsheet program, the program might interpret the record as a formula and run the code within it.</p>
/// <p>Before you download an input file from Amazon S3, ensure that you recognize the file and trust its creator.</p>
/// </important>
pub fn set_location(mut self, input: std::option::Option<std::string::String>) -> Self {
self.location = input;
self
}
/// Consumes the builder and constructs a [`ParallelDataDataLocation`](crate::model::ParallelDataDataLocation)
pub fn build(self) -> crate::model::ParallelDataDataLocation {
crate::model::ParallelDataDataLocation {
repository_type: self.repository_type,
location: self.location,
}
}
}
}
impl ParallelDataDataLocation {
/// Creates a new builder-style object to manufacture [`ParallelDataDataLocation`](crate::model::ParallelDataDataLocation)
pub fn builder() -> crate::model::parallel_data_data_location::Builder {
crate::model::parallel_data_data_location::Builder::default()
}
}