1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770
/// Hints for the speech recognizer to help with recognition in a specific
/// conversation state.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SpeechContext {
/// Optional. A list of strings containing words and phrases that the speech
/// recognizer should recognize with higher likelihood.
///
/// This list can be used to:
///
/// * improve accuracy for words and phrases you expect the user to say,
/// e.g. typical commands for your Dialogflow agent
/// * add additional words to the speech recognizer vocabulary
/// * ...
///
/// See the [Cloud Speech
/// documentation](<https://cloud.google.com/speech-to-text/quotas>) for usage
/// limits.
#[prost(string, repeated, tag="1")]
pub phrases: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Optional. Boost for this context compared to other contexts:
///
/// * If the boost is positive, Dialogflow will increase the probability that
/// the phrases in this context are recognized over similar sounding phrases.
/// * If the boost is unspecified or non-positive, Dialogflow will not apply
/// any boost.
///
/// Dialogflow recommends that you use boosts in the range (0, 20] and that you
/// find a value that fits your use case with binary search.
#[prost(float, tag="2")]
pub boost: f32,
}
/// Information for a word recognized by the speech recognizer.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SpeechWordInfo {
/// The word this info is for.
#[prost(string, tag="3")]
pub word: ::prost::alloc::string::String,
/// Time offset relative to the beginning of the audio that corresponds to the
/// start of the spoken word. This is an experimental feature and the accuracy
/// of the time offset can vary.
#[prost(message, optional, tag="1")]
pub start_offset: ::core::option::Option<::prost_types::Duration>,
/// Time offset relative to the beginning of the audio that corresponds to the
/// end of the spoken word. This is an experimental feature and the accuracy of
/// the time offset can vary.
#[prost(message, optional, tag="2")]
pub end_offset: ::core::option::Option<::prost_types::Duration>,
/// The Speech confidence between 0.0 and 1.0 for this word. A higher number
/// indicates an estimated greater likelihood that the recognized word is
/// correct. The default of 0.0 is a sentinel value indicating that confidence
/// was not set.
///
/// This field is not guaranteed to be fully stable over time for the same
/// audio input. Users should also not rely on it to always be provided.
#[prost(float, tag="4")]
pub confidence: f32,
}
/// Instructs the speech recognizer how to process the audio content.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InputAudioConfig {
/// Required. Audio encoding of the audio content to process.
#[prost(enumeration="AudioEncoding", tag="1")]
pub audio_encoding: i32,
/// Required. Sample rate (in Hertz) of the audio content sent in the query.
/// Refer to
/// [Cloud Speech API
/// documentation](<https://cloud.google.com/speech-to-text/docs/basics>) for
/// more details.
#[prost(int32, tag="2")]
pub sample_rate_hertz: i32,
/// Required. The language of the supplied audio. Dialogflow does not do
/// translations. See [Language
/// Support](<https://cloud.google.com/dialogflow/docs/reference/language>)
/// for a list of the currently supported language codes. Note that queries in
/// the same session do not necessarily need to specify the same language.
#[prost(string, tag="3")]
pub language_code: ::prost::alloc::string::String,
/// If `true`, Dialogflow returns \[SpeechWordInfo][google.cloud.dialogflow.v2.SpeechWordInfo\] in
/// \[StreamingRecognitionResult][google.cloud.dialogflow.v2.StreamingRecognitionResult\] with information about the recognized speech
/// words, e.g. start and end time offsets. If false or unspecified, Speech
/// doesn't return any word-level information.
#[prost(bool, tag="13")]
pub enable_word_info: bool,
/// A list of strings containing words and phrases that the speech
/// recognizer should recognize with higher likelihood.
///
/// See [the Cloud Speech
/// documentation](<https://cloud.google.com/speech-to-text/docs/basics#phrase-hints>)
/// for more details.
///
/// This field is deprecated. Please use \[speech_contexts\]() instead. If you
/// specify both \[phrase_hints\]() and \[speech_contexts\](), Dialogflow will
/// treat the \[phrase_hints\]() as a single additional \[SpeechContext\]().
#[deprecated]
#[prost(string, repeated, tag="4")]
pub phrase_hints: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Context information to assist speech recognition.
///
/// See [the Cloud Speech
/// documentation](<https://cloud.google.com/speech-to-text/docs/basics#phrase-hints>)
/// for more details.
#[prost(message, repeated, tag="11")]
pub speech_contexts: ::prost::alloc::vec::Vec<SpeechContext>,
/// Which Speech model to select for the given request. Select the
/// model best suited to your domain to get best results. If a model is not
/// explicitly specified, then we auto-select a model based on the parameters
/// in the InputAudioConfig.
/// If enhanced speech model is enabled for the agent and an enhanced
/// version of the specified model for the language does not exist, then the
/// speech is recognized using the standard version of the specified model.
/// Refer to
/// [Cloud Speech API
/// documentation](<https://cloud.google.com/speech-to-text/docs/basics#select-model>)
/// for more details.
#[prost(string, tag="7")]
pub model: ::prost::alloc::string::String,
/// Which variant of the [Speech model]\[google.cloud.dialogflow.v2.InputAudioConfig.model\] to use.
#[prost(enumeration="SpeechModelVariant", tag="10")]
pub model_variant: i32,
/// If `false` (default), recognition does not cease until the
/// client closes the stream.
/// If `true`, the recognizer will detect a single spoken utterance in input
/// audio. Recognition ceases when it detects the audio's voice has
/// stopped or paused. In this case, once a detected intent is received, the
/// client should close the stream and start a new request with a new stream as
/// needed.
/// Note: This setting is relevant only for streaming methods.
/// Note: When specified, InputAudioConfig.single_utterance takes precedence
/// over StreamingDetectIntentRequest.single_utterance.
#[prost(bool, tag="8")]
pub single_utterance: bool,
/// Only used in \[Participants.AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent\] and
/// \[Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent\].
/// If `false` and recognition doesn't return any result, trigger
/// `NO_SPEECH_RECOGNIZED` event to Dialogflow agent.
#[prost(bool, tag="14")]
pub disable_no_speech_recognized_event: bool,
}
/// Description of which voice to use for speech synthesis.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VoiceSelectionParams {
/// Optional. The name of the voice. If not set, the service will choose a
/// voice based on the other parameters such as language_code and
/// \[ssml_gender][google.cloud.dialogflow.v2.VoiceSelectionParams.ssml_gender\].
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
/// Optional. The preferred gender of the voice. If not set, the service will
/// choose a voice based on the other parameters such as language_code and
/// \[name][google.cloud.dialogflow.v2.VoiceSelectionParams.name\]. Note that this is only a preference, not requirement. If a
/// voice of the appropriate gender is not available, the synthesizer should
/// substitute a voice with a different gender rather than failing the request.
#[prost(enumeration="SsmlVoiceGender", tag="2")]
pub ssml_gender: i32,
}
/// Configuration of how speech should be synthesized.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SynthesizeSpeechConfig {
/// Optional. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is the normal
/// native speed supported by the specific voice. 2.0 is twice as fast, and
/// 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 speed. Any
/// other values < 0.25 or > 4.0 will return an error.
#[prost(double, tag="1")]
pub speaking_rate: f64,
/// Optional. Speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20
/// semitones from the original pitch. -20 means decrease 20 semitones from the
/// original pitch.
#[prost(double, tag="2")]
pub pitch: f64,
/// Optional. Volume gain (in dB) of the normal native volume supported by the
/// specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of
/// 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB)
/// will play at approximately half the amplitude of the normal native signal
/// amplitude. A value of +6.0 (dB) will play at approximately twice the
/// amplitude of the normal native signal amplitude. We strongly recommend not
/// to exceed +10 (dB) as there's usually no effective increase in loudness for
/// any value greater than that.
#[prost(double, tag="3")]
pub volume_gain_db: f64,
/// Optional. An identifier which selects 'audio effects' profiles that are
/// applied on (post synthesized) text to speech. Effects are applied on top of
/// each other in the order they are given.
#[prost(string, repeated, tag="5")]
pub effects_profile_id: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Optional. The desired voice of the synthesized audio.
#[prost(message, optional, tag="4")]
pub voice: ::core::option::Option<VoiceSelectionParams>,
}
/// Instructs the speech synthesizer on how to generate the output audio content.
/// If this audio config is supplied in a request, it overrides all existing
/// text-to-speech settings applied to the agent.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OutputAudioConfig {
/// Required. Audio encoding of the synthesized audio content.
#[prost(enumeration="OutputAudioEncoding", tag="1")]
pub audio_encoding: i32,
/// The synthesis sample rate (in hertz) for this audio. If not
/// provided, then the synthesizer will use the default sample rate based on
/// the audio encoding. If this is different from the voice's natural sample
/// rate, then the synthesizer will honor this request by converting to the
/// desired sample rate (which might result in worse audio quality).
#[prost(int32, tag="2")]
pub sample_rate_hertz: i32,
/// Configuration of how speech should be synthesized.
#[prost(message, optional, tag="3")]
pub synthesize_speech_config: ::core::option::Option<SynthesizeSpeechConfig>,
}
/// Configures speech transcription for \[ConversationProfile][google.cloud.dialogflow.v2.ConversationProfile\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SpeechToTextConfig {
/// Optional. The speech model used in speech to text.
/// `SPEECH_MODEL_VARIANT_UNSPECIFIED`, `USE_BEST_AVAILABLE` will be treated as
/// `USE_ENHANCED`. It can be overridden in \[AnalyzeContentRequest][google.cloud.dialogflow.v2.AnalyzeContentRequest\] and
/// \[StreamingAnalyzeContentRequest][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest\] request.
#[prost(enumeration="SpeechModelVariant", tag="1")]
pub speech_model_variant: i32,
}
/// Audio encoding of the audio content sent in the conversational query request.
/// Refer to the
/// [Cloud Speech API
/// documentation](<https://cloud.google.com/speech-to-text/docs/basics>) for more
/// details.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum AudioEncoding {
/// Not specified.
Unspecified = 0,
/// Uncompressed 16-bit signed little-endian samples (Linear PCM).
Linear16 = 1,
/// \[`FLAC`\](<https://xiph.org/flac/documentation.html>) (Free Lossless Audio
/// Codec) is the recommended encoding because it is lossless (therefore
/// recognition is not compromised) and requires only about half the
/// bandwidth of `LINEAR16`. `FLAC` stream encoding supports 16-bit and
/// 24-bit samples, however, not all fields in `STREAMINFO` are supported.
Flac = 2,
/// 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.
Mulaw = 3,
/// Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000.
Amr = 4,
/// Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000.
AmrWb = 5,
/// Opus encoded audio frames in Ogg container
/// (\[OggOpus\](<https://wiki.xiph.org/OggOpus>)).
/// `sample_rate_hertz` must be 16000.
OggOpus = 6,
/// Although the use of lossy encodings is not recommended, if a very low
/// bitrate encoding is required, `OGG_OPUS` is highly preferred over
/// Speex encoding. The \[Speex\](<https://speex.org/>) encoding supported by
/// Dialogflow API has a header byte in each block, as in MIME type
/// `audio/x-speex-with-header-byte`.
/// It is a variant of the RTP Speex encoding defined in
/// [RFC 5574](<https://tools.ietf.org/html/rfc5574>).
/// The stream is a sequence of blocks, one block per RTP packet. Each block
/// starts with a byte containing the length of the block, in bytes, followed
/// by one or more frames of Speex data, padded to an integral number of
/// bytes (octets) as specified in RFC 5574. In other words, each RTP header
/// is replaced with a single byte containing the block length. Only Speex
/// wideband is supported. `sample_rate_hertz` must be 16000.
SpeexWithHeaderByte = 7,
}
impl AudioEncoding {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
AudioEncoding::Unspecified => "AUDIO_ENCODING_UNSPECIFIED",
AudioEncoding::Linear16 => "AUDIO_ENCODING_LINEAR_16",
AudioEncoding::Flac => "AUDIO_ENCODING_FLAC",
AudioEncoding::Mulaw => "AUDIO_ENCODING_MULAW",
AudioEncoding::Amr => "AUDIO_ENCODING_AMR",
AudioEncoding::AmrWb => "AUDIO_ENCODING_AMR_WB",
AudioEncoding::OggOpus => "AUDIO_ENCODING_OGG_OPUS",
AudioEncoding::SpeexWithHeaderByte => "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE",
}
}
}
/// Variant of the specified [Speech model]\[google.cloud.dialogflow.v2.InputAudioConfig.model\] to use.
///
/// See the [Cloud Speech
/// documentation](<https://cloud.google.com/speech-to-text/docs/enhanced-models>)
/// for which models have different variants. For example, the "phone_call" model
/// has both a standard and an enhanced variant. When you use an enhanced model,
/// you will generally receive higher quality results than for a standard model.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SpeechModelVariant {
/// No model variant specified. In this case Dialogflow defaults to
/// USE_BEST_AVAILABLE.
Unspecified = 0,
/// Use the best available variant of the [Speech
/// model]\[InputAudioConfig.model\] that the caller is eligible for.
///
/// Please see the [Dialogflow
/// docs](<https://cloud.google.com/dialogflow/docs/data-logging>) for
/// how to make your project eligible for enhanced models.
UseBestAvailable = 1,
/// Use standard model variant even if an enhanced model is available. See the
/// [Cloud Speech
/// documentation](<https://cloud.google.com/speech-to-text/docs/enhanced-models>)
/// for details about enhanced models.
UseStandard = 2,
/// Use an enhanced model variant:
///
/// * If an enhanced variant does not exist for the given
/// \[model][google.cloud.dialogflow.v2.InputAudioConfig.model\] and request language, Dialogflow falls
/// back to the standard variant.
///
/// The [Cloud Speech
/// documentation](<https://cloud.google.com/speech-to-text/docs/enhanced-models>)
/// describes which models have enhanced variants.
///
/// * If the API caller isn't eligible for enhanced models, Dialogflow returns
/// an error. Please see the [Dialogflow
/// docs](<https://cloud.google.com/dialogflow/docs/data-logging>)
/// for how to make your project eligible.
UseEnhanced = 3,
}
impl SpeechModelVariant {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
SpeechModelVariant::Unspecified => "SPEECH_MODEL_VARIANT_UNSPECIFIED",
SpeechModelVariant::UseBestAvailable => "USE_BEST_AVAILABLE",
SpeechModelVariant::UseStandard => "USE_STANDARD",
SpeechModelVariant::UseEnhanced => "USE_ENHANCED",
}
}
}
/// Gender of the voice as described in
/// [SSML voice element](<https://www.w3.org/TR/speech-synthesis11/#edef_voice>).
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SsmlVoiceGender {
/// An unspecified gender, which means that the client doesn't care which
/// gender the selected voice will have.
Unspecified = 0,
/// A male voice.
Male = 1,
/// A female voice.
Female = 2,
/// A gender-neutral voice.
Neutral = 3,
}
impl SsmlVoiceGender {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
SsmlVoiceGender::Unspecified => "SSML_VOICE_GENDER_UNSPECIFIED",
SsmlVoiceGender::Male => "SSML_VOICE_GENDER_MALE",
SsmlVoiceGender::Female => "SSML_VOICE_GENDER_FEMALE",
SsmlVoiceGender::Neutral => "SSML_VOICE_GENDER_NEUTRAL",
}
}
}
/// Audio encoding of the output audio format in Text-To-Speech.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum OutputAudioEncoding {
/// Not specified.
Unspecified = 0,
/// Uncompressed 16-bit signed little-endian samples (Linear PCM).
/// Audio content returned as LINEAR16 also contains a WAV header.
Linear16 = 1,
/// MP3 audio at 32kbps.
Mp3 = 2,
/// MP3 audio at 64kbps.
Mp364Kbps = 4,
/// Opus encoded audio wrapped in an ogg container. The result will be a
/// file which can be played natively on Android, and in browsers (at least
/// Chrome and Firefox). The quality of the encoding is considerably higher
/// than MP3 while using approximately the same bitrate.
OggOpus = 3,
/// 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.
Mulaw = 5,
}
impl OutputAudioEncoding {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
OutputAudioEncoding::Unspecified => "OUTPUT_AUDIO_ENCODING_UNSPECIFIED",
OutputAudioEncoding::Linear16 => "OUTPUT_AUDIO_ENCODING_LINEAR_16",
OutputAudioEncoding::Mp3 => "OUTPUT_AUDIO_ENCODING_MP3",
OutputAudioEncoding::Mp364Kbps => "OUTPUT_AUDIO_ENCODING_MP3_64_KBPS",
OutputAudioEncoding::OggOpus => "OUTPUT_AUDIO_ENCODING_OGG_OPUS",
OutputAudioEncoding::Mulaw => "OUTPUT_AUDIO_ENCODING_MULAW",
}
}
}
/// Dialogflow contexts are similar to natural language context. If a person says
/// to you "they are orange", you need context in order to understand what "they"
/// is referring to. Similarly, for Dialogflow to handle an end-user expression
/// like that, it needs to be provided with context in order to correctly match
/// an intent.
///
/// Using contexts, you can control the flow of a conversation. You can configure
/// contexts for an intent by setting input and output contexts, which are
/// identified by string names. When an intent is matched, any configured output
/// contexts for that intent become active. While any contexts are active,
/// Dialogflow is more likely to match intents that are configured with input
/// contexts that correspond to the currently active contexts.
///
/// For more information about context, see the
/// [Contexts guide](<https://cloud.google.com/dialogflow/docs/contexts-overview>).
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Context {
/// Required. The unique identifier of the context. Format:
/// `projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context ID>`,
/// or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User
/// ID>/sessions/<Session ID>/contexts/<Context ID>`.
///
/// The `Context ID` is always converted to lowercase, may only contain
/// characters in a-zA-Z0-9_-% and may be at most 250 bytes long.
///
/// If `Environment ID` is not specified, we assume default 'draft'
/// environment. If `User ID` is not specified, we assume default '-' user.
///
/// The following context names are reserved for internal use by Dialogflow.
/// You should not use these contexts or create contexts with these names:
///
/// * `__system_counters__`
/// * `*_id_dialog_context`
/// * `*_dialog_params_size`
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
/// Optional. The number of conversational query requests after which the
/// context expires. The default is `0`. If set to `0`, the context expires
/// immediately. Contexts expire automatically after 20 minutes if there
/// are no matching queries.
#[prost(int32, tag="2")]
pub lifespan_count: i32,
/// Optional. The collection of parameters associated with this context.
///
/// Depending on your protocol or client library language, this is a
/// map, associative array, symbol table, dictionary, or JSON object
/// composed of a collection of (MapKey, MapValue) pairs:
///
/// - MapKey type: string
/// - MapKey value: parameter name
/// - MapValue type:
/// - If parameter's entity type is a composite entity: map
/// - Else: depending on parameter value type, could be one of string,
/// number, boolean, null, list or map
/// - MapValue value:
/// - If parameter's entity type is a composite entity:
/// map from composite entity property names to property values
/// - Else: parameter value
#[prost(message, optional, tag="3")]
pub parameters: ::core::option::Option<::prost_types::Struct>,
}
/// The request message for \[Contexts.ListContexts][google.cloud.dialogflow.v2.Contexts.ListContexts\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListContextsRequest {
/// Required. The session to list all contexts from.
/// Format: `projects/<Project ID>/agent/sessions/<Session ID>` or
/// `projects/<Project ID>/agent/environments/<Environment ID>/users/<User
/// ID>/sessions/<Session ID>`.
/// If `Environment ID` is not specified, we assume default 'draft'
/// environment. If `User ID` is not specified, we assume default '-' user.
#[prost(string, tag="1")]
pub parent: ::prost::alloc::string::String,
/// Optional. The maximum number of items to return in a single page. By
/// default 100 and at most 1000.
#[prost(int32, tag="2")]
pub page_size: i32,
/// Optional. The next_page_token value returned from a previous list request.
#[prost(string, tag="3")]
pub page_token: ::prost::alloc::string::String,
}
/// The response message for \[Contexts.ListContexts][google.cloud.dialogflow.v2.Contexts.ListContexts\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListContextsResponse {
/// The list of contexts. There will be a maximum number of items
/// returned based on the page_size field in the request.
#[prost(message, repeated, tag="1")]
pub contexts: ::prost::alloc::vec::Vec<Context>,
/// Token to retrieve the next page of results, or empty if there are no
/// more results in the list.
#[prost(string, tag="2")]
pub next_page_token: ::prost::alloc::string::String,
}
/// The request message for \[Contexts.GetContext][google.cloud.dialogflow.v2.Contexts.GetContext\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetContextRequest {
/// Required. The name of the context. Format:
/// `projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context ID>`
/// or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User
/// ID>/sessions/<Session ID>/contexts/<Context ID>`.
/// If `Environment ID` is not specified, we assume default 'draft'
/// environment. If `User ID` is not specified, we assume default '-' user.
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
}
/// The request message for \[Contexts.CreateContext][google.cloud.dialogflow.v2.Contexts.CreateContext\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateContextRequest {
/// Required. The session to create a context for.
/// Format: `projects/<Project ID>/agent/sessions/<Session ID>` or
/// `projects/<Project ID>/agent/environments/<Environment ID>/users/<User
/// ID>/sessions/<Session ID>`.
/// If `Environment ID` is not specified, we assume default 'draft'
/// environment. If `User ID` is not specified, we assume default '-' user.
#[prost(string, tag="1")]
pub parent: ::prost::alloc::string::String,
/// Required. The context to create.
#[prost(message, optional, tag="2")]
pub context: ::core::option::Option<Context>,
}
/// The request message for \[Contexts.UpdateContext][google.cloud.dialogflow.v2.Contexts.UpdateContext\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateContextRequest {
/// Required. The context to update.
#[prost(message, optional, tag="1")]
pub context: ::core::option::Option<Context>,
/// Optional. The mask to control which fields get updated.
#[prost(message, optional, tag="2")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
/// The request message for \[Contexts.DeleteContext][google.cloud.dialogflow.v2.Contexts.DeleteContext\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteContextRequest {
/// Required. The name of the context to delete. Format:
/// `projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context ID>`
/// or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User
/// ID>/sessions/<Session ID>/contexts/<Context ID>`.
/// If `Environment ID` is not specified, we assume default 'draft'
/// environment. If `User ID` is not specified, we assume default '-' user.
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
}
/// The request message for \[Contexts.DeleteAllContexts][google.cloud.dialogflow.v2.Contexts.DeleteAllContexts\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteAllContextsRequest {
/// Required. The name of the session to delete all contexts from. Format:
/// `projects/<Project ID>/agent/sessions/<Session ID>` or `projects/<Project
/// ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session
/// ID>`.
/// If `Environment ID` is not specified we assume default 'draft' environment.
/// If `User ID` is not specified, we assume default '-' user.
#[prost(string, tag="1")]
pub parent: ::prost::alloc::string::String,
}
/// Generated client implementations.
pub mod contexts_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
/// Service for managing [Contexts][google.cloud.dialogflow.v2.Context].
#[derive(Debug, Clone)]
pub struct ContextsClient<T> {
inner: tonic::client::Grpc<T>,
}
impl ContextsClient<tonic::transport::Channel> {
/// Attempt to create a new client by connecting to a given endpoint.
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> ContextsClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> ContextsClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
{
ContextsClient::new(InterceptedService::new(inner, interceptor))
}
/// Compress requests with the given encoding.
///
/// This requires the server to support it otherwise it might respond with an
/// error.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
/// Enable decompressing responses.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
/// Returns the list of all contexts in the specified session.
pub async fn list_contexts(
&mut self,
request: impl tonic::IntoRequest<super::ListContextsRequest>,
) -> Result<tonic::Response<super::ListContextsResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.v2.Contexts/ListContexts",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Retrieves the specified context.
pub async fn get_context(
&mut self,
request: impl tonic::IntoRequest<super::GetContextRequest>,
) -> Result<tonic::Response<super::Context>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.v2.Contexts/GetContext",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Creates a context.
///
/// If the specified context already exists, overrides the context.
pub async fn create_context(
&mut self,
request: impl tonic::IntoRequest<super::CreateContextRequest>,
) -> Result<tonic::Response<super::Context>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.v2.Contexts/CreateContext",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Updates the specified context.
pub async fn update_context(
&mut self,
request: impl tonic::IntoRequest<super::UpdateContextRequest>,
) -> Result<tonic::Response<super::Context>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.v2.Contexts/UpdateContext",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Deletes the specified context.
pub async fn delete_context(
&mut self,
request: impl tonic::IntoRequest<super::DeleteContextRequest>,
) -> Result<tonic::Response<()>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.v2.Contexts/DeleteContext",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Deletes all active contexts in the specified session.
pub async fn delete_all_contexts(
&mut self,
request: impl tonic::IntoRequest<super::DeleteAllContextsRequest>,
) -> Result<tonic::Response<()>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.v2.Contexts/DeleteAllContexts",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}
/// An intent categorizes an end-user's intention for one conversation turn. For
/// each agent, you define many intents, where your combined intents can handle a
/// complete conversation. When an end-user writes or says something, referred to
/// as an end-user expression or end-user input, Dialogflow matches the end-user
/// input to the best intent in your agent. Matching an intent is also known as
/// intent classification.
///
/// For more information, see the [intent
/// guide](<https://cloud.google.com/dialogflow/docs/intents-overview>).
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Intent {
/// Optional. The unique identifier of this intent.
/// Required for \[Intents.UpdateIntent][google.cloud.dialogflow.v2.Intents.UpdateIntent\] and \[Intents.BatchUpdateIntents][google.cloud.dialogflow.v2.Intents.BatchUpdateIntents\]
/// methods.
/// Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
/// Required. The name of this intent.
#[prost(string, tag="2")]
pub display_name: ::prost::alloc::string::String,
/// Optional. Indicates whether webhooks are enabled for the intent.
#[prost(enumeration="intent::WebhookState", tag="6")]
pub webhook_state: i32,
/// Optional. The priority of this intent. Higher numbers represent higher
/// priorities.
///
/// - If the supplied value is unspecified or 0, the service
/// translates the value to 500,000, which corresponds to the
/// `Normal` priority in the console.
/// - If the supplied value is negative, the intent is ignored
/// in runtime detect intent requests.
#[prost(int32, tag="3")]
pub priority: i32,
/// Optional. Indicates whether this is a fallback intent.
#[prost(bool, tag="4")]
pub is_fallback: bool,
/// Optional. Indicates whether Machine Learning is disabled for the intent.
/// Note: If `ml_disabled` setting is set to true, then this intent is not
/// taken into account during inference in `ML ONLY` match mode. Also,
/// auto-markup in the UI is turned off.
#[prost(bool, tag="19")]
pub ml_disabled: bool,
/// Optional. Indicates that a live agent should be brought in to handle the
/// interaction with the user. In most cases, when you set this flag to true,
/// you would also want to set end_interaction to true as well. Default is
/// false.
#[prost(bool, tag="20")]
pub live_agent_handoff: bool,
/// Optional. Indicates that this intent ends an interaction. Some integrations
/// (e.g., Actions on Google or Dialogflow phone gateway) use this information
/// to close interaction with an end user. Default is false.
#[prost(bool, tag="21")]
pub end_interaction: bool,
/// Optional. The list of context names required for this intent to be
/// triggered.
/// Format: `projects/<Project ID>/agent/sessions/-/contexts/<Context ID>`.
#[prost(string, repeated, tag="7")]
pub input_context_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Optional. The collection of event names that trigger the intent.
/// If the collection of input contexts is not empty, all of the contexts must
/// be present in the active user session for an event to trigger this intent.
/// Event names are limited to 150 characters.
#[prost(string, repeated, tag="8")]
pub events: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Optional. The collection of examples that the agent is
/// trained on.
#[prost(message, repeated, tag="9")]
pub training_phrases: ::prost::alloc::vec::Vec<intent::TrainingPhrase>,
/// Optional. The name of the action associated with the intent.
/// Note: The action name must not contain whitespaces.
#[prost(string, tag="10")]
pub action: ::prost::alloc::string::String,
/// Optional. The collection of contexts that are activated when the intent
/// is matched. Context messages in this collection should not set the
/// parameters field. Setting the `lifespan_count` to 0 will reset the context
/// when the intent is matched.
/// Format: `projects/<Project ID>/agent/sessions/-/contexts/<Context ID>`.
#[prost(message, repeated, tag="11")]
pub output_contexts: ::prost::alloc::vec::Vec<Context>,
/// Optional. Indicates whether to delete all contexts in the current
/// session when this intent is matched.
#[prost(bool, tag="12")]
pub reset_contexts: bool,
/// Optional. The collection of parameters associated with the intent.
#[prost(message, repeated, tag="13")]
pub parameters: ::prost::alloc::vec::Vec<intent::Parameter>,
/// Optional. The collection of rich messages corresponding to the
/// `Response` field in the Dialogflow console.
#[prost(message, repeated, tag="14")]
pub messages: ::prost::alloc::vec::Vec<intent::Message>,
/// Optional. The list of platforms for which the first responses will be
/// copied from the messages in PLATFORM_UNSPECIFIED (i.e. default platform).
#[prost(enumeration="intent::message::Platform", repeated, packed="false", tag="15")]
pub default_response_platforms: ::prost::alloc::vec::Vec<i32>,
/// Read-only. The unique identifier of the root intent in the chain of
/// followup intents. It identifies the correct followup intents chain for
/// this intent. We populate this field only in the output.
///
/// Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
#[prost(string, tag="16")]
pub root_followup_intent_name: ::prost::alloc::string::String,
/// Read-only after creation. The unique identifier of the parent intent in the
/// chain of followup intents. You can set this field when creating an intent,
/// for example with \[CreateIntent][google.cloud.dialogflow.v2.Intents.CreateIntent\] or
/// \[BatchUpdateIntents][google.cloud.dialogflow.v2.Intents.BatchUpdateIntents\], in order to make this
/// intent a followup intent.
///
/// It identifies the parent followup intent.
/// Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
#[prost(string, tag="17")]
pub parent_followup_intent_name: ::prost::alloc::string::String,
/// Read-only. Information about all followup intents that have this intent as
/// a direct or indirect parent. We populate this field only in the output.
#[prost(message, repeated, tag="18")]
pub followup_intent_info: ::prost::alloc::vec::Vec<intent::FollowupIntentInfo>,
}
/// Nested message and enum types in `Intent`.
pub mod intent {
/// Represents an example that the agent is trained on.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TrainingPhrase {
/// Output only. The unique identifier of this training phrase.
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
/// Required. The type of the training phrase.
#[prost(enumeration="training_phrase::Type", tag="2")]
pub r#type: i32,
/// Required. The ordered list of training phrase parts.
/// The parts are concatenated in order to form the training phrase.
///
/// Note: The API does not automatically annotate training phrases like the
/// Dialogflow Console does.
///
/// Note: Do not forget to include whitespace at part boundaries,
/// so the training phrase is well formatted when the parts are concatenated.
///
/// If the training phrase does not need to be annotated with parameters,
/// you just need a single part with only the \[Part.text][google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part.text\] field set.
///
/// If you want to annotate the training phrase, you must create multiple
/// parts, where the fields of each part are populated in one of two ways:
///
/// - `Part.text` is set to a part of the phrase that has no parameters.
/// - `Part.text` is set to a part of the phrase that you want to annotate,
/// and the `entity_type`, `alias`, and `user_defined` fields are all
/// set.
#[prost(message, repeated, tag="3")]
pub parts: ::prost::alloc::vec::Vec<training_phrase::Part>,
/// Optional. Indicates how many times this example was added to
/// the intent. Each time a developer adds an existing sample by editing an
/// intent or training, this counter is increased.
#[prost(int32, tag="4")]
pub times_added_count: i32,
}
/// Nested message and enum types in `TrainingPhrase`.
pub mod training_phrase {
/// Represents a part of a training phrase.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Part {
/// Required. The text for this part.
#[prost(string, tag="1")]
pub text: ::prost::alloc::string::String,
/// Optional. The entity type name prefixed with `@`.
/// This field is required for annotated parts of the training phrase.
#[prost(string, tag="2")]
pub entity_type: ::prost::alloc::string::String,
/// Optional. The parameter name for the value extracted from the
/// annotated part of the example.
/// This field is required for annotated parts of the training phrase.
#[prost(string, tag="3")]
pub alias: ::prost::alloc::string::String,
/// Optional. Indicates whether the text was manually annotated.
/// This field is set to true when the Dialogflow Console is used to
/// manually annotate the part. When creating an annotated part with the
/// API, you must set this to true.
#[prost(bool, tag="4")]
pub user_defined: bool,
}
/// Represents different types of training phrases.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Type {
/// Not specified. This value should never be used.
Unspecified = 0,
/// Examples do not contain @-prefixed entity type names, but example parts
/// can be annotated with entity types.
Example = 1,
/// Templates are not annotated with entity types, but they can contain
/// @-prefixed entity type names as substrings.
/// Template mode has been deprecated. Example mode is the only supported
/// way to create new training phrases. If you have existing training
/// phrases that you've created in template mode, those will continue to
/// work.
Template = 2,
}
impl Type {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Type::Unspecified => "TYPE_UNSPECIFIED",
Type::Example => "EXAMPLE",
Type::Template => "TEMPLATE",
}
}
}
}
/// Represents intent parameters.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Parameter {
/// The unique identifier of this parameter.
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
/// Required. The name of the parameter.
#[prost(string, tag="2")]
pub display_name: ::prost::alloc::string::String,
/// Optional. The definition of the parameter value. It can be:
///
/// - a constant string,
/// - a parameter value defined as `$parameter_name`,
/// - an original parameter value defined as `$parameter_name.original`,
/// - a parameter value from some context defined as
/// `#context_name.parameter_name`.
#[prost(string, tag="3")]
pub value: ::prost::alloc::string::String,
/// Optional. The default value to use when the `value` yields an empty
/// result.
/// Default values can be extracted from contexts by using the following
/// syntax: `#context_name.parameter_name`.
#[prost(string, tag="4")]
pub default_value: ::prost::alloc::string::String,
/// Optional. The name of the entity type, prefixed with `@`, that
/// describes values of the parameter. If the parameter is
/// required, this must be provided.
#[prost(string, tag="5")]
pub entity_type_display_name: ::prost::alloc::string::String,
/// Optional. Indicates whether the parameter is required. That is,
/// whether the intent cannot be completed without collecting the parameter
/// value.
#[prost(bool, tag="6")]
pub mandatory: bool,
/// Optional. The collection of prompts that the agent can present to the
/// user in order to collect a value for the parameter.
#[prost(string, repeated, tag="7")]
pub prompts: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Optional. Indicates whether the parameter represents a list of values.
#[prost(bool, tag="8")]
pub is_list: bool,
}
/// A rich response message.
/// Corresponds to the intent `Response` field in the Dialogflow console.
/// For more information, see
/// [Rich response
/// messages](<https://cloud.google.com/dialogflow/docs/intents-rich-messages>).
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Message {
/// Optional. The platform that this message is intended for.
#[prost(enumeration="message::Platform", tag="6")]
pub platform: i32,
/// Required. The rich response message.
#[prost(oneof="message::Message", tags="1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 22, 23, 24")]
pub message: ::core::option::Option<message::Message>,
}
/// Nested message and enum types in `Message`.
pub mod message {
/// The text response message.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Text {
/// Optional. The collection of the agent's responses.
#[prost(string, repeated, tag="1")]
pub text: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// The image response message.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Image {
/// Optional. The public URI to an image file.
#[prost(string, tag="1")]
pub image_uri: ::prost::alloc::string::String,
/// Optional. A text description of the image to be used for accessibility,
/// e.g., screen readers.
#[prost(string, tag="2")]
pub accessibility_text: ::prost::alloc::string::String,
}
/// The quick replies response message.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QuickReplies {
/// Optional. The title of the collection of quick replies.
#[prost(string, tag="1")]
pub title: ::prost::alloc::string::String,
/// Optional. The collection of quick replies.
#[prost(string, repeated, tag="2")]
pub quick_replies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// The card response message.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Card {
/// Optional. The title of the card.
#[prost(string, tag="1")]
pub title: ::prost::alloc::string::String,
/// Optional. The subtitle of the card.
#[prost(string, tag="2")]
pub subtitle: ::prost::alloc::string::String,
/// Optional. The public URI to an image file for the card.
#[prost(string, tag="3")]
pub image_uri: ::prost::alloc::string::String,
/// Optional. The collection of card buttons.
#[prost(message, repeated, tag="4")]
pub buttons: ::prost::alloc::vec::Vec<card::Button>,
}
/// Nested message and enum types in `Card`.
pub mod card {
/// Contains information about a button.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Button {
/// Optional. The text to show on the button.
#[prost(string, tag="1")]
pub text: ::prost::alloc::string::String,
/// Optional. The text to send back to the Dialogflow API or a URI to
/// open.
#[prost(string, tag="2")]
pub postback: ::prost::alloc::string::String,
}
}
/// The simple response message containing speech or text.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SimpleResponse {
/// One of text_to_speech or ssml must be provided. The plain text of the
/// speech output. Mutually exclusive with ssml.
#[prost(string, tag="1")]
pub text_to_speech: ::prost::alloc::string::String,
/// One of text_to_speech or ssml must be provided. Structured spoken
/// response to the user in the SSML format. Mutually exclusive with
/// text_to_speech.
#[prost(string, tag="2")]
pub ssml: ::prost::alloc::string::String,
/// Optional. The text to display.
#[prost(string, tag="3")]
pub display_text: ::prost::alloc::string::String,
}
/// The collection of simple response candidates.
/// This message in `QueryResult.fulfillment_messages` and
/// `WebhookResponse.fulfillment_messages` should contain only one
/// `SimpleResponse`.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SimpleResponses {
/// Required. The list of simple responses.
#[prost(message, repeated, tag="1")]
pub simple_responses: ::prost::alloc::vec::Vec<SimpleResponse>,
}
/// The basic card message. Useful for displaying information.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BasicCard {
/// Optional. The title of the card.
#[prost(string, tag="1")]
pub title: ::prost::alloc::string::String,
/// Optional. The subtitle of the card.
#[prost(string, tag="2")]
pub subtitle: ::prost::alloc::string::String,
/// Required, unless image is present. The body text of the card.
#[prost(string, tag="3")]
pub formatted_text: ::prost::alloc::string::String,
/// Optional. The image for the card.
#[prost(message, optional, tag="4")]
pub image: ::core::option::Option<Image>,
/// Optional. The collection of card buttons.
#[prost(message, repeated, tag="5")]
pub buttons: ::prost::alloc::vec::Vec<basic_card::Button>,
}
/// Nested message and enum types in `BasicCard`.
pub mod basic_card {
/// The button object that appears at the bottom of a card.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Button {
/// Required. The title of the button.
#[prost(string, tag="1")]
pub title: ::prost::alloc::string::String,
/// Required. Action to take when a user taps on the button.
#[prost(message, optional, tag="2")]
pub open_uri_action: ::core::option::Option<button::OpenUriAction>,
}
/// Nested message and enum types in `Button`.
pub mod button {
/// Opens the given URI.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OpenUriAction {
/// Required. The HTTP or HTTPS scheme URI.
#[prost(string, tag="1")]
pub uri: ::prost::alloc::string::String,
}
}
}
/// The suggestion chip message that the user can tap to quickly post a reply
/// to the conversation.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Suggestion {
/// Required. The text shown the in the suggestion chip.
#[prost(string, tag="1")]
pub title: ::prost::alloc::string::String,
}
/// The collection of suggestions.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Suggestions {
/// Required. The list of suggested replies.
#[prost(message, repeated, tag="1")]
pub suggestions: ::prost::alloc::vec::Vec<Suggestion>,
}
/// The suggestion chip message that allows the user to jump out to the app
/// or website associated with this agent.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LinkOutSuggestion {
/// Required. The name of the app or site this chip is linking to.
#[prost(string, tag="1")]
pub destination_name: ::prost::alloc::string::String,
/// Required. The URI of the app or site to open when the user taps the
/// suggestion chip.
#[prost(string, tag="2")]
pub uri: ::prost::alloc::string::String,
}
/// The card for presenting a list of options to select from.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListSelect {
/// Optional. The overall title of the list.
#[prost(string, tag="1")]
pub title: ::prost::alloc::string::String,
/// Required. List items.
#[prost(message, repeated, tag="2")]
pub items: ::prost::alloc::vec::Vec<list_select::Item>,
/// Optional. Subtitle of the list.
#[prost(string, tag="3")]
pub subtitle: ::prost::alloc::string::String,
}
/// Nested message and enum types in `ListSelect`.
pub mod list_select {
/// An item in the list.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Item {
/// Required. Additional information about this option.
#[prost(message, optional, tag="1")]
pub info: ::core::option::Option<super::SelectItemInfo>,
/// Required. The title of the list item.
#[prost(string, tag="2")]
pub title: ::prost::alloc::string::String,
/// Optional. The main text describing the item.
#[prost(string, tag="3")]
pub description: ::prost::alloc::string::String,
/// Optional. The image to display.
#[prost(message, optional, tag="4")]
pub image: ::core::option::Option<super::Image>,
}
}
/// The card for presenting a carousel of options to select from.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CarouselSelect {
/// Required. Carousel items.
#[prost(message, repeated, tag="1")]
pub items: ::prost::alloc::vec::Vec<carousel_select::Item>,
}
/// Nested message and enum types in `CarouselSelect`.
pub mod carousel_select {
/// An item in the carousel.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Item {
/// Required. Additional info about the option item.
#[prost(message, optional, tag="1")]
pub info: ::core::option::Option<super::SelectItemInfo>,
/// Required. Title of the carousel item.
#[prost(string, tag="2")]
pub title: ::prost::alloc::string::String,
/// Optional. The body text of the card.
#[prost(string, tag="3")]
pub description: ::prost::alloc::string::String,
/// Optional. The image to display.
#[prost(message, optional, tag="4")]
pub image: ::core::option::Option<super::Image>,
}
}
/// Additional info about the select item for when it is triggered in a
/// dialog.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SelectItemInfo {
/// Required. A unique key that will be sent back to the agent if this
/// response is given.
#[prost(string, tag="1")]
pub key: ::prost::alloc::string::String,
/// Optional. A list of synonyms that can also be used to trigger this
/// item in dialog.
#[prost(string, repeated, tag="2")]
pub synonyms: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// The media content card for Actions on Google.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MediaContent {
/// Optional. What type of media is the content (ie "audio").
#[prost(enumeration="media_content::ResponseMediaType", tag="1")]
pub media_type: i32,
/// Required. List of media objects.
#[prost(message, repeated, tag="2")]
pub media_objects: ::prost::alloc::vec::Vec<media_content::ResponseMediaObject>,
}
/// Nested message and enum types in `MediaContent`.
pub mod media_content {
/// Response media object for media content card.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResponseMediaObject {
/// Required. Name of media card.
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
/// Optional. Description of media card.
#[prost(string, tag="2")]
pub description: ::prost::alloc::string::String,
/// Required. Url where the media is stored.
#[prost(string, tag="5")]
pub content_url: ::prost::alloc::string::String,
/// Image to show with the media card.
#[prost(oneof="response_media_object::Image", tags="3, 4")]
pub image: ::core::option::Option<response_media_object::Image>,
}
/// Nested message and enum types in `ResponseMediaObject`.
pub mod response_media_object {
/// Image to show with the media card.
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Image {
/// Optional. Image to display above media content.
#[prost(message, tag="3")]
LargeImage(super::super::Image),
/// Optional. Icon to display above media content.
#[prost(message, tag="4")]
Icon(super::super::Image),
}
}
/// Format of response media type.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ResponseMediaType {
/// Unspecified.
Unspecified = 0,
/// Response media type is audio.
Audio = 1,
}
impl ResponseMediaType {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
ResponseMediaType::Unspecified => "RESPONSE_MEDIA_TYPE_UNSPECIFIED",
ResponseMediaType::Audio => "AUDIO",
}
}
}
}
/// Browse Carousel Card for Actions on Google.
/// <https://developers.google.com/actions/assistant/responses#browsing_carousel>
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BrowseCarouselCard {
/// Required. List of items in the Browse Carousel Card. Minimum of two
/// items, maximum of ten.
#[prost(message, repeated, tag="1")]
pub items: ::prost::alloc::vec::Vec<browse_carousel_card::BrowseCarouselCardItem>,
/// Optional. Settings for displaying the image. Applies to every image in
/// \[items][google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.items\].
#[prost(enumeration="browse_carousel_card::ImageDisplayOptions", tag="2")]
pub image_display_options: i32,
}
/// Nested message and enum types in `BrowseCarouselCard`.
pub mod browse_carousel_card {
/// Browsing carousel tile
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BrowseCarouselCardItem {
/// Required. Action to present to the user.
#[prost(message, optional, tag="1")]
pub open_uri_action: ::core::option::Option<browse_carousel_card_item::OpenUrlAction>,
/// Required. Title of the carousel item. Maximum of two lines of text.
#[prost(string, tag="2")]
pub title: ::prost::alloc::string::String,
/// Optional. Description of the carousel item. Maximum of four lines of
/// text.
#[prost(string, tag="3")]
pub description: ::prost::alloc::string::String,
/// Optional. Hero image for the carousel item.
#[prost(message, optional, tag="4")]
pub image: ::core::option::Option<super::Image>,
/// Optional. Text that appears at the bottom of the Browse Carousel
/// Card. Maximum of one line of text.
#[prost(string, tag="5")]
pub footer: ::prost::alloc::string::String,
}
/// Nested message and enum types in `BrowseCarouselCardItem`.
pub mod browse_carousel_card_item {
/// Actions on Google action to open a given url.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OpenUrlAction {
/// Required. URL
#[prost(string, tag="1")]
pub url: ::prost::alloc::string::String,
/// Optional. Specifies the type of viewer that is used when opening
/// the URL. Defaults to opening via web browser.
#[prost(enumeration="open_url_action::UrlTypeHint", tag="3")]
pub url_type_hint: i32,
}
/// Nested message and enum types in `OpenUrlAction`.
pub mod open_url_action {
/// Type of the URI.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum UrlTypeHint {
/// Unspecified
Unspecified = 0,
/// Url would be an amp action
AmpAction = 1,
/// URL that points directly to AMP content, or to a canonical URL
/// which refers to AMP content via <link rel="amphtml">.
AmpContent = 2,
}
impl UrlTypeHint {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
UrlTypeHint::Unspecified => "URL_TYPE_HINT_UNSPECIFIED",
UrlTypeHint::AmpAction => "AMP_ACTION",
UrlTypeHint::AmpContent => "AMP_CONTENT",
}
}
}
}
}
/// Image display options for Actions on Google. This should be used for
/// when the image's aspect ratio does not match the image container's
/// aspect ratio.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ImageDisplayOptions {
/// Fill the gaps between the image and the image container with gray
/// bars.
Unspecified = 0,
/// Fill the gaps between the image and the image container with gray
/// bars.
Gray = 1,
/// Fill the gaps between the image and the image container with white
/// bars.
White = 2,
/// Image is scaled such that the image width and height match or exceed
/// the container dimensions. This may crop the top and bottom of the
/// image if the scaled image height is greater than the container
/// height, or crop the left and right of the image if the scaled image
/// width is greater than the container width. This is similar to "Zoom
/// Mode" on a widescreen TV when playing a 4:3 video.
Cropped = 3,
/// Pad the gaps between image and image frame with a blurred copy of the
/// same image.
BlurredBackground = 4,
}
impl ImageDisplayOptions {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
ImageDisplayOptions::Unspecified => "IMAGE_DISPLAY_OPTIONS_UNSPECIFIED",
ImageDisplayOptions::Gray => "GRAY",
ImageDisplayOptions::White => "WHITE",
ImageDisplayOptions::Cropped => "CROPPED",
ImageDisplayOptions::BlurredBackground => "BLURRED_BACKGROUND",
}
}
}
}
/// Table card for Actions on Google.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TableCard {
/// Required. Title of the card.
#[prost(string, tag="1")]
pub title: ::prost::alloc::string::String,
/// Optional. Subtitle to the title.
#[prost(string, tag="2")]
pub subtitle: ::prost::alloc::string::String,
/// Optional. Image which should be displayed on the card.
#[prost(message, optional, tag="3")]
pub image: ::core::option::Option<Image>,
/// Optional. Display properties for the columns in this table.
#[prost(message, repeated, tag="4")]
pub column_properties: ::prost::alloc::vec::Vec<ColumnProperties>,
/// Optional. Rows in this table of data.
#[prost(message, repeated, tag="5")]
pub rows: ::prost::alloc::vec::Vec<TableCardRow>,
/// Optional. List of buttons for the card.
#[prost(message, repeated, tag="6")]
pub buttons: ::prost::alloc::vec::Vec<basic_card::Button>,
}
/// Column properties for \[TableCard][google.cloud.dialogflow.v2.Intent.Message.TableCard\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ColumnProperties {
/// Required. Column heading.
#[prost(string, tag="1")]
pub header: ::prost::alloc::string::String,
/// Optional. Defines text alignment for all cells in this column.
#[prost(enumeration="column_properties::HorizontalAlignment", tag="2")]
pub horizontal_alignment: i32,
}
/// Nested message and enum types in `ColumnProperties`.
pub mod column_properties {
/// Text alignments within a cell.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum HorizontalAlignment {
/// Text is aligned to the leading edge of the column.
Unspecified = 0,
/// Text is aligned to the leading edge of the column.
Leading = 1,
/// Text is centered in the column.
Center = 2,
/// Text is aligned to the trailing edge of the column.
Trailing = 3,
}
impl HorizontalAlignment {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
HorizontalAlignment::Unspecified => "HORIZONTAL_ALIGNMENT_UNSPECIFIED",
HorizontalAlignment::Leading => "LEADING",
HorizontalAlignment::Center => "CENTER",
HorizontalAlignment::Trailing => "TRAILING",
}
}
}
}
/// Row of \[TableCard][google.cloud.dialogflow.v2.Intent.Message.TableCard\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TableCardRow {
/// Optional. List of cells that make up this row.
#[prost(message, repeated, tag="1")]
pub cells: ::prost::alloc::vec::Vec<TableCardCell>,
/// Optional. Whether to add a visual divider after this row.
#[prost(bool, tag="2")]
pub divider_after: bool,
}
/// Cell of \[TableCardRow][google.cloud.dialogflow.v2.Intent.Message.TableCardRow\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TableCardCell {
/// Required. Text in this cell.
#[prost(string, tag="1")]
pub text: ::prost::alloc::string::String,
}
/// The rich response message integration platform. See
/// \[Integrations\](<https://cloud.google.com/dialogflow/docs/integrations>).
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Platform {
/// Default platform.
Unspecified = 0,
/// Facebook.
Facebook = 1,
/// Slack.
Slack = 2,
/// Telegram.
Telegram = 3,
/// Kik.
Kik = 4,
/// Skype.
Skype = 5,
/// Line.
Line = 6,
/// Viber.
Viber = 7,
/// Google Assistant
/// See [Dialogflow webhook
/// format](<https://developers.google.com/assistant/actions/build/json/dialogflow-webhook-json>)
ActionsOnGoogle = 8,
/// Google Hangouts.
GoogleHangouts = 11,
}
impl Platform {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Platform::Unspecified => "PLATFORM_UNSPECIFIED",
Platform::Facebook => "FACEBOOK",
Platform::Slack => "SLACK",
Platform::Telegram => "TELEGRAM",
Platform::Kik => "KIK",
Platform::Skype => "SKYPE",
Platform::Line => "LINE",
Platform::Viber => "VIBER",
Platform::ActionsOnGoogle => "ACTIONS_ON_GOOGLE",
Platform::GoogleHangouts => "GOOGLE_HANGOUTS",
}
}
}
/// Required. The rich response message.
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Message {
/// The text response.
#[prost(message, tag="1")]
Text(Text),
/// The image response.
#[prost(message, tag="2")]
Image(Image),
/// The quick replies response.
#[prost(message, tag="3")]
QuickReplies(QuickReplies),
/// The card response.
#[prost(message, tag="4")]
Card(Card),
/// A custom platform-specific response.
#[prost(message, tag="5")]
Payload(::prost_types::Struct),
/// The voice and text-only responses for Actions on Google.
#[prost(message, tag="7")]
SimpleResponses(SimpleResponses),
/// The basic card response for Actions on Google.
#[prost(message, tag="8")]
BasicCard(BasicCard),
/// The suggestion chips for Actions on Google.
#[prost(message, tag="9")]
Suggestions(Suggestions),
/// The link out suggestion chip for Actions on Google.
#[prost(message, tag="10")]
LinkOutSuggestion(LinkOutSuggestion),
/// The list card response for Actions on Google.
#[prost(message, tag="11")]
ListSelect(ListSelect),
/// The carousel card response for Actions on Google.
#[prost(message, tag="12")]
CarouselSelect(CarouselSelect),
/// Browse carousel card for Actions on Google.
#[prost(message, tag="22")]
BrowseCarouselCard(BrowseCarouselCard),
/// Table card for Actions on Google.
#[prost(message, tag="23")]
TableCard(TableCard),
/// The media content card for Actions on Google.
#[prost(message, tag="24")]
MediaContent(MediaContent),
}
}
/// Represents a single followup intent in the chain.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FollowupIntentInfo {
/// The unique identifier of the followup intent.
/// Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
#[prost(string, tag="1")]
pub followup_intent_name: ::prost::alloc::string::String,
/// The unique identifier of the followup intent's parent.
/// Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
#[prost(string, tag="2")]
pub parent_followup_intent_name: ::prost::alloc::string::String,
}
/// Represents the different states that webhooks can be in.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum WebhookState {
/// Webhook is disabled in the agent and in the intent.
Unspecified = 0,
/// Webhook is enabled in the agent and in the intent.
Enabled = 1,
/// Webhook is enabled in the agent and in the intent. Also, each slot
/// filling prompt is forwarded to the webhook.
EnabledForSlotFilling = 2,
}
impl WebhookState {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
WebhookState::Unspecified => "WEBHOOK_STATE_UNSPECIFIED",
WebhookState::Enabled => "WEBHOOK_STATE_ENABLED",
WebhookState::EnabledForSlotFilling => "WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING",
}
}
}
}
/// The request message for \[Intents.ListIntents][google.cloud.dialogflow.v2.Intents.ListIntents\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListIntentsRequest {
/// Required. The agent to list all intents from.
/// Format: `projects/<Project ID>/agent`.
#[prost(string, tag="1")]
pub parent: ::prost::alloc::string::String,
/// Optional. The language used to access language-specific data.
/// If not specified, the agent's default language is used.
/// For more information, see
/// [Multilingual intent and entity
/// data](<https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity>).
#[prost(string, tag="2")]
pub language_code: ::prost::alloc::string::String,
/// Optional. The resource view to apply to the returned intent.
#[prost(enumeration="IntentView", tag="3")]
pub intent_view: i32,
/// Optional. The maximum number of items to return in a single page. By
/// default 100 and at most 1000.
#[prost(int32, tag="4")]
pub page_size: i32,
/// Optional. The next_page_token value returned from a previous list request.
#[prost(string, tag="5")]
pub page_token: ::prost::alloc::string::String,
}
/// The response message for \[Intents.ListIntents][google.cloud.dialogflow.v2.Intents.ListIntents\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListIntentsResponse {
/// The list of agent intents. There will be a maximum number of items
/// returned based on the page_size field in the request.
#[prost(message, repeated, tag="1")]
pub intents: ::prost::alloc::vec::Vec<Intent>,
/// Token to retrieve the next page of results, or empty if there are no
/// more results in the list.
#[prost(string, tag="2")]
pub next_page_token: ::prost::alloc::string::String,
}
/// The request message for \[Intents.GetIntent][google.cloud.dialogflow.v2.Intents.GetIntent\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetIntentRequest {
/// Required. The name of the intent.
/// Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
/// Optional. The language used to access language-specific data.
/// If not specified, the agent's default language is used.
/// For more information, see
/// [Multilingual intent and entity
/// data](<https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity>).
#[prost(string, tag="2")]
pub language_code: ::prost::alloc::string::String,
/// Optional. The resource view to apply to the returned intent.
#[prost(enumeration="IntentView", tag="3")]
pub intent_view: i32,
}
/// The request message for \[Intents.CreateIntent][google.cloud.dialogflow.v2.Intents.CreateIntent\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateIntentRequest {
/// Required. The agent to create a intent for.
/// Format: `projects/<Project ID>/agent`.
#[prost(string, tag="1")]
pub parent: ::prost::alloc::string::String,
/// Required. The intent to create.
#[prost(message, optional, tag="2")]
pub intent: ::core::option::Option<Intent>,
/// Optional. The language used to access language-specific data.
/// If not specified, the agent's default language is used.
/// For more information, see
/// [Multilingual intent and entity
/// data](<https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity>).
#[prost(string, tag="3")]
pub language_code: ::prost::alloc::string::String,
/// Optional. The resource view to apply to the returned intent.
#[prost(enumeration="IntentView", tag="4")]
pub intent_view: i32,
}
/// The request message for \[Intents.UpdateIntent][google.cloud.dialogflow.v2.Intents.UpdateIntent\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateIntentRequest {
/// Required. The intent to update.
#[prost(message, optional, tag="1")]
pub intent: ::core::option::Option<Intent>,
/// Optional. The language used to access language-specific data.
/// If not specified, the agent's default language is used.
/// For more information, see
/// [Multilingual intent and entity
/// data](<https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity>).
#[prost(string, tag="2")]
pub language_code: ::prost::alloc::string::String,
/// Optional. The mask to control which fields get updated.
#[prost(message, optional, tag="3")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
/// Optional. The resource view to apply to the returned intent.
#[prost(enumeration="IntentView", tag="4")]
pub intent_view: i32,
}
/// The request message for \[Intents.DeleteIntent][google.cloud.dialogflow.v2.Intents.DeleteIntent\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteIntentRequest {
/// Required. The name of the intent to delete. If this intent has direct or
/// indirect followup intents, we also delete them.
/// Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchUpdateIntentsRequest {
/// Required. The name of the agent to update or create intents in.
/// Format: `projects/<Project ID>/agent`.
#[prost(string, tag="1")]
pub parent: ::prost::alloc::string::String,
/// Optional. The language used to access language-specific data.
/// If not specified, the agent's default language is used.
/// For more information, see
/// [Multilingual intent and entity
/// data](<https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity>).
#[prost(string, tag="4")]
pub language_code: ::prost::alloc::string::String,
/// Optional. The mask to control which fields get updated.
#[prost(message, optional, tag="5")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
/// Optional. The resource view to apply to the returned intent.
#[prost(enumeration="IntentView", tag="6")]
pub intent_view: i32,
/// The source of the intent batch.
#[prost(oneof="batch_update_intents_request::IntentBatch", tags="2, 3")]
pub intent_batch: ::core::option::Option<batch_update_intents_request::IntentBatch>,
}
/// Nested message and enum types in `BatchUpdateIntentsRequest`.
pub mod batch_update_intents_request {
/// The source of the intent batch.
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum IntentBatch {
/// The URI to a Google Cloud Storage file containing intents to update or
/// create. The file format can either be a serialized proto (of IntentBatch
/// type) or JSON object. Note: The URI must start with "gs://".
#[prost(string, tag="2")]
IntentBatchUri(::prost::alloc::string::String),
/// The collection of intents to update or create.
#[prost(message, tag="3")]
IntentBatchInline(super::IntentBatch),
}
}
/// The response message for \[Intents.BatchUpdateIntents][google.cloud.dialogflow.v2.Intents.BatchUpdateIntents\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchUpdateIntentsResponse {
/// The collection of updated or created intents.
#[prost(message, repeated, tag="1")]
pub intents: ::prost::alloc::vec::Vec<Intent>,
}
/// The request message for \[Intents.BatchDeleteIntents][google.cloud.dialogflow.v2.Intents.BatchDeleteIntents\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchDeleteIntentsRequest {
/// Required. The name of the agent to delete all entities types for. Format:
/// `projects/<Project ID>/agent`.
#[prost(string, tag="1")]
pub parent: ::prost::alloc::string::String,
/// Required. The collection of intents to delete. Only intent `name` must be
/// filled in.
#[prost(message, repeated, tag="2")]
pub intents: ::prost::alloc::vec::Vec<Intent>,
}
/// This message is a wrapper around a collection of intents.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IntentBatch {
/// A collection of intents.
#[prost(message, repeated, tag="1")]
pub intents: ::prost::alloc::vec::Vec<Intent>,
}
/// Represents the options for views of an intent.
/// An intent can be a sizable object. Therefore, we provide a resource view that
/// does not return training phrases in the response by default.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum IntentView {
/// Training phrases field is not populated in the response.
Unspecified = 0,
/// All fields are populated.
Full = 1,
}
impl IntentView {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
IntentView::Unspecified => "INTENT_VIEW_UNSPECIFIED",
IntentView::Full => "INTENT_VIEW_FULL",
}
}
}
/// Generated client implementations.
pub mod intents_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
/// Service for managing [Intents][google.cloud.dialogflow.v2.Intent].
#[derive(Debug, Clone)]
pub struct IntentsClient<T> {
inner: tonic::client::Grpc<T>,
}
impl IntentsClient<tonic::transport::Channel> {
/// Attempt to create a new client by connecting to a given endpoint.
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> IntentsClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> IntentsClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
{
IntentsClient::new(InterceptedService::new(inner, interceptor))
}
/// Compress requests with the given encoding.
///
/// This requires the server to support it otherwise it might respond with an
/// error.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
/// Enable decompressing responses.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
/// Returns the list of all intents in the specified agent.
pub async fn list_intents(
&mut self,
request: impl tonic::IntoRequest<super::ListIntentsRequest>,
) -> Result<tonic::Response<super::ListIntentsResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.v2.Intents/ListIntents",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Retrieves the specified intent.
pub async fn get_intent(
&mut self,
request: impl tonic::IntoRequest<super::GetIntentRequest>,
) -> Result<tonic::Response<super::Intent>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.v2.Intents/GetIntent",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Creates an intent in the specified agent.
pub async fn create_intent(
&mut self,
request: impl tonic::IntoRequest<super::CreateIntentRequest>,
) -> Result<tonic::Response<super::Intent>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.v2.Intents/CreateIntent",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Updates the specified intent.
pub async fn update_intent(
&mut self,
request: impl tonic::IntoRequest<super::UpdateIntentRequest>,
) -> Result<tonic::Response<super::Intent>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.v2.Intents/UpdateIntent",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Deletes the specified intent and its direct or indirect followup intents.
pub async fn delete_intent(
&mut self,
request: impl tonic::IntoRequest<super::DeleteIntentRequest>,
) -> Result<tonic::Response<()>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.v2.Intents/DeleteIntent",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Updates/Creates multiple intents in the specified agent.
///
/// Operation <response: [BatchUpdateIntentsResponse][google.cloud.dialogflow.v2.BatchUpdateIntentsResponse]>
pub async fn batch_update_intents(
&mut self,
request: impl tonic::IntoRequest<super::BatchUpdateIntentsRequest>,
) -> Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.v2.Intents/BatchUpdateIntents",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Deletes intents in the specified agent.
///
/// Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
pub async fn batch_delete_intents(
&mut self,
request: impl tonic::IntoRequest<super::BatchDeleteIntentsRequest>,
) -> Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.v2.Intents/BatchDeleteIntents",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}
/// Each intent parameter has a type, called the entity type, which dictates
/// exactly how data from an end-user expression is extracted.
///
/// Dialogflow provides predefined system entities that can match many common
/// types of data. For example, there are system entities for matching dates,
/// times, colors, email addresses, and so on. You can also create your own
/// custom entities for matching custom data. For example, you could define a
/// vegetable entity that can match the types of vegetables available for
/// purchase with a grocery store agent.
///
/// For more information, see the
/// [Entity guide](<https://cloud.google.com/dialogflow/docs/entities-overview>).
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EntityType {
/// The unique identifier of the entity type.
/// Required for \[EntityTypes.UpdateEntityType][google.cloud.dialogflow.v2.EntityTypes.UpdateEntityType\] and
/// \[EntityTypes.BatchUpdateEntityTypes][google.cloud.dialogflow.v2.EntityTypes.BatchUpdateEntityTypes\] methods.
/// Format: `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
/// Required. The name of the entity type.
#[prost(string, tag="2")]
pub display_name: ::prost::alloc::string::String,
/// Required. Indicates the kind of entity type.
#[prost(enumeration="entity_type::Kind", tag="3")]
pub kind: i32,
/// Optional. Indicates whether the entity type can be automatically
/// expanded.
#[prost(enumeration="entity_type::AutoExpansionMode", tag="4")]
pub auto_expansion_mode: i32,
/// Optional. The collection of entity entries associated with the entity type.
#[prost(message, repeated, tag="6")]
pub entities: ::prost::alloc::vec::Vec<entity_type::Entity>,
/// Optional. Enables fuzzy entity extraction during classification.
#[prost(bool, tag="7")]
pub enable_fuzzy_extraction: bool,
}
/// Nested message and enum types in `EntityType`.
pub mod entity_type {
/// An **entity entry** for an associated entity type.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Entity {
/// Required. The primary value associated with this entity entry.
/// For example, if the entity type is *vegetable*, the value could be
/// *scallions*.
///
/// For `KIND_MAP` entity types:
///
/// * A reference value to be used in place of synonyms.
///
/// For `KIND_LIST` entity types:
///
/// * A string that can contain references to other entity types (with or
/// without aliases).
#[prost(string, tag="1")]
pub value: ::prost::alloc::string::String,
/// Required. A collection of value synonyms. For example, if the entity type
/// is *vegetable*, and `value` is *scallions*, a synonym could be *green
/// onions*.
///
/// For `KIND_LIST` entity types:
///
/// * This collection must contain exactly one synonym equal to `value`.
#[prost(string, repeated, tag="2")]
pub synonyms: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Represents kinds of entities.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Kind {
/// Not specified. This value should be never used.
Unspecified = 0,
/// Map entity types allow mapping of a group of synonyms to a reference
/// value.
Map = 1,
/// List entity types contain a set of entries that do not map to reference
/// values. However, list entity types can contain references to other entity
/// types (with or without aliases).
List = 2,
/// Regexp entity types allow to specify regular expressions in entries
/// values.
Regexp = 3,
}
impl Kind {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Kind::Unspecified => "KIND_UNSPECIFIED",
Kind::Map => "KIND_MAP",
Kind::List => "KIND_LIST",
Kind::Regexp => "KIND_REGEXP",
}
}
}
/// Represents different entity type expansion modes. Automated expansion
/// allows an agent to recognize values that have not been explicitly listed in
/// the entity (for example, new kinds of shopping list items).
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum AutoExpansionMode {
/// Auto expansion disabled for the entity.
Unspecified = 0,
/// Allows an agent to recognize values that have not been explicitly
/// listed in the entity.
Default = 1,
}
impl AutoExpansionMode {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
AutoExpansionMode::Unspecified => "AUTO_EXPANSION_MODE_UNSPECIFIED",
AutoExpansionMode::Default => "AUTO_EXPANSION_MODE_DEFAULT",
}
}
}
}
/// The request message for \[EntityTypes.ListEntityTypes][google.cloud.dialogflow.v2.EntityTypes.ListEntityTypes\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListEntityTypesRequest {
/// Required. The agent to list all entity types from.
/// Format: `projects/<Project ID>/agent`.
#[prost(string, tag="1")]
pub parent: ::prost::alloc::string::String,
/// Optional. The language used to access language-specific data.
/// If not specified, the agent's default language is used.
/// For more information, see
/// [Multilingual intent and entity
/// data](<https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity>).
#[prost(string, tag="2")]
pub language_code: ::prost::alloc::string::String,
/// Optional. The maximum number of items to return in a single page. By
/// default 100 and at most 1000.
#[prost(int32, tag="3")]
pub page_size: i32,
/// Optional. The next_page_token value returned from a previous list request.
#[prost(string, tag="4")]
pub page_token: ::prost::alloc::string::String,
}
/// The response message for \[EntityTypes.ListEntityTypes][google.cloud.dialogflow.v2.EntityTypes.ListEntityTypes\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListEntityTypesResponse {
/// The list of agent entity types. There will be a maximum number of items
/// returned based on the page_size field in the request.
#[prost(message, repeated, tag="1")]
pub entity_types: ::prost::alloc::vec::Vec<EntityType>,
/// Token to retrieve the next page of results, or empty if there are no
/// more results in the list.
#[prost(string, tag="2")]
pub next_page_token: ::prost::alloc::string::String,
}
/// The request message for \[EntityTypes.GetEntityType][google.cloud.dialogflow.v2.EntityTypes.GetEntityType\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetEntityTypeRequest {
/// Required. The name of the entity type.
/// Format: `projects/<Project ID>/agent/entityTypes/<EntityType ID>`.
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
/// Optional. The language used to access language-specific data.
/// If not specified, the agent's default language is used.
/// For more information, see
/// [Multilingual intent and entity
/// data](<https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity>).
#[prost(string, tag="2")]
pub language_code: ::prost::alloc::string::String,
}
/// The request message for \[EntityTypes.CreateEntityType][google.cloud.dialogflow.v2.EntityTypes.CreateEntityType\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateEntityTypeRequest {
/// Required. The agent to create a entity type for.
/// Format: `projects/<Project ID>/agent`.
#[prost(string, tag="1")]
pub parent: ::prost::alloc::string::String,
/// Required. The entity type to create.
#[prost(message, optional, tag="2")]
pub entity_type: ::core::option::Option<EntityType>,
/// Optional. The language used to access language-specific data.
/// If not specified, the agent's default language is used.
/// For more information, see
/// [Multilingual intent and entity
/// data](<https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity>).
#[prost(string, tag="3")]
pub language_code: ::prost::alloc::string::String,
}
/// The request message for \[EntityTypes.UpdateEntityType][google.cloud.dialogflow.v2.EntityTypes.UpdateEntityType\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateEntityTypeRequest {
/// Required. The entity type to update.
#[prost(message, optional, tag="1")]
pub entity_type: ::core::option::Option<EntityType>,
/// Optional. The language used to access language-specific data.
/// If not specified, the agent's default language is used.
/// For more information, see
/// [Multilingual intent and entity
/// data](<https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity>).
#[prost(string, tag="2")]
pub language_code: ::prost::alloc::string::String,
/// Optional. The mask to control which fields get updated.
#[prost(message, optional, tag="3")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
/// The request message for \[EntityTypes.DeleteEntityType][google.cloud.dialogflow.v2.EntityTypes.DeleteEntityType\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteEntityTypeRequest {
/// Required. The name of the entity type to delete.
/// Format: `projects/<Project ID>/agent/entityTypes/<EntityType ID>`.
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
}
/// The request message for \[EntityTypes.BatchUpdateEntityTypes][google.cloud.dialogflow.v2.EntityTypes.BatchUpdateEntityTypes\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchUpdateEntityTypesRequest {
/// Required. The name of the agent to update or create entity types in.
/// Format: `projects/<Project ID>/agent`.
#[prost(string, tag="1")]
pub parent: ::prost::alloc::string::String,
/// Optional. The language used to access language-specific data.
/// If not specified, the agent's default language is used.
/// For more information, see
/// [Multilingual intent and entity
/// data](<https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity>).
#[prost(string, tag="4")]
pub language_code: ::prost::alloc::string::String,
/// Optional. The mask to control which fields get updated.
#[prost(message, optional, tag="5")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
/// The source of the entity type batch.
///
/// For each entity type in the batch:
///
/// * If `name` is specified, we update an existing entity type.
/// * If `name` is not specified, we create a new entity type.
#[prost(oneof="batch_update_entity_types_request::EntityTypeBatch", tags="2, 3")]
pub entity_type_batch: ::core::option::Option<batch_update_entity_types_request::EntityTypeBatch>,
}
/// Nested message and enum types in `BatchUpdateEntityTypesRequest`.
pub mod batch_update_entity_types_request {
/// The source of the entity type batch.
///
/// For each entity type in the batch:
///
/// * If `name` is specified, we update an existing entity type.
/// * If `name` is not specified, we create a new entity type.
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum EntityTypeBatch {
/// The URI to a Google Cloud Storage file containing entity types to update
/// or create. The file format can either be a serialized proto (of
/// EntityBatch type) or a JSON object. Note: The URI must start with
/// "gs://".
#[prost(string, tag="2")]
EntityTypeBatchUri(::prost::alloc::string::String),
/// The collection of entity types to update or create.
#[prost(message, tag="3")]
EntityTypeBatchInline(super::EntityTypeBatch),
}
}
/// The response message for \[EntityTypes.BatchUpdateEntityTypes][google.cloud.dialogflow.v2.EntityTypes.BatchUpdateEntityTypes\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchUpdateEntityTypesResponse {
/// The collection of updated or created entity types.
#[prost(message, repeated, tag="1")]
pub entity_types: ::prost::alloc::vec::Vec<EntityType>,
}
/// The request message for \[EntityTypes.BatchDeleteEntityTypes][google.cloud.dialogflow.v2.EntityTypes.BatchDeleteEntityTypes\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchDeleteEntityTypesRequest {
/// Required. The name of the agent to delete all entities types for. Format:
/// `projects/<Project ID>/agent`.
#[prost(string, tag="1")]
pub parent: ::prost::alloc::string::String,
/// Required. The names entity types to delete. All names must point to the
/// same agent as `parent`.
#[prost(string, repeated, tag="2")]
pub entity_type_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// The request message for \[EntityTypes.BatchCreateEntities][google.cloud.dialogflow.v2.EntityTypes.BatchCreateEntities\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchCreateEntitiesRequest {
/// Required. The name of the entity type to create entities in. Format:
/// `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.
#[prost(string, tag="1")]
pub parent: ::prost::alloc::string::String,
/// Required. The entities to create.
#[prost(message, repeated, tag="2")]
pub entities: ::prost::alloc::vec::Vec<entity_type::Entity>,
/// Optional. The language used to access language-specific data.
/// If not specified, the agent's default language is used.
/// For more information, see
/// [Multilingual intent and entity
/// data](<https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity>).
#[prost(string, tag="3")]
pub language_code: ::prost::alloc::string::String,
}
/// The request message for \[EntityTypes.BatchUpdateEntities][google.cloud.dialogflow.v2.EntityTypes.BatchUpdateEntities\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchUpdateEntitiesRequest {
/// Required. The name of the entity type to update or create entities in.
/// Format: `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.
#[prost(string, tag="1")]
pub parent: ::prost::alloc::string::String,
/// Required. The entities to update or create.
#[prost(message, repeated, tag="2")]
pub entities: ::prost::alloc::vec::Vec<entity_type::Entity>,
/// Optional. The language used to access language-specific data.
/// If not specified, the agent's default language is used.
/// For more information, see
/// [Multilingual intent and entity
/// data](<https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity>).
#[prost(string, tag="3")]
pub language_code: ::prost::alloc::string::String,
/// Optional. The mask to control which fields get updated.
#[prost(message, optional, tag="4")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
/// The request message for \[EntityTypes.BatchDeleteEntities][google.cloud.dialogflow.v2.EntityTypes.BatchDeleteEntities\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchDeleteEntitiesRequest {
/// Required. The name of the entity type to delete entries for. Format:
/// `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.
#[prost(string, tag="1")]
pub parent: ::prost::alloc::string::String,
/// Required. The reference `values` of the entities to delete. Note that
/// these are not fully-qualified names, i.e. they don't start with
/// `projects/<Project ID>`.
#[prost(string, repeated, tag="2")]
pub entity_values: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Optional. The language used to access language-specific data.
/// If not specified, the agent's default language is used.
/// For more information, see
/// [Multilingual intent and entity
/// data](<https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity>).
#[prost(string, tag="3")]
pub language_code: ::prost::alloc::string::String,
}
/// This message is a wrapper around a collection of entity types.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EntityTypeBatch {
/// A collection of entity types.
#[prost(message, repeated, tag="1")]
pub entity_types: ::prost::alloc::vec::Vec<EntityType>,
}
/// Generated client implementations.
pub mod entity_types_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
/// Service for managing [EntityTypes][google.cloud.dialogflow.v2.EntityType].
#[derive(Debug, Clone)]
pub struct EntityTypesClient<T> {
inner: tonic::client::Grpc<T>,
}
impl EntityTypesClient<tonic::transport::Channel> {
/// Attempt to create a new client by connecting to a given endpoint.
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> EntityTypesClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> EntityTypesClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
{
EntityTypesClient::new(InterceptedService::new(inner, interceptor))
}
/// Compress requests with the given encoding.
///
/// This requires the server to support it otherwise it might respond with an
/// error.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
/// Enable decompressing responses.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
/// Returns the list of all entity types in the specified agent.
pub async fn list_entity_types(
&mut self,
request: impl tonic::IntoRequest<super::ListEntityTypesRequest>,
) -> Result<tonic::Response<super::ListEntityTypesResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.v2.EntityTypes/ListEntityTypes",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Retrieves the specified entity type.
pub async fn get_entity_type(
&mut self,
request: impl tonic::IntoRequest<super::GetEntityTypeRequest>,
) -> Result<tonic::Response<super::EntityType>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.v2.EntityTypes/GetEntityType",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Creates an entity type in the specified agent.
pub async fn create_entity_type(
&mut self,
request: impl tonic::IntoRequest<super::CreateEntityTypeRequest>,
) -> Result<tonic::Response<super::EntityType>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.v2.EntityTypes/CreateEntityType",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Updates the specified entity type.
pub async fn update_entity_type(
&mut self,
request: impl tonic::IntoRequest<super::UpdateEntityTypeRequest>,
) -> Result<tonic::Response<super::EntityType>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.v2.EntityTypes/UpdateEntityType",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Deletes the specified entity type.
pub async fn delete_entity_type(
&mut self,
request: impl tonic::IntoRequest<super::DeleteEntityTypeRequest>,
) -> Result<tonic::Response<()>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.v2.EntityTypes/DeleteEntityType",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Updates/Creates multiple entity types in the specified agent.
///
/// Operation <response: [BatchUpdateEntityTypesResponse][google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse]>
pub async fn batch_update_entity_types(
&mut self,
request: impl tonic::IntoRequest<super::BatchUpdateEntityTypesRequest>,
) -> Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.v2.EntityTypes/BatchUpdateEntityTypes",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Deletes entity types in the specified agent.
///
/// Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
pub async fn batch_delete_entity_types(
&mut self,
request: impl tonic::IntoRequest<super::BatchDeleteEntityTypesRequest>,
) -> Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.v2.EntityTypes/BatchDeleteEntityTypes",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Creates multiple new entities in the specified entity type.
///
/// Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
pub async fn batch_create_entities(
&mut self,
request: impl tonic::IntoRequest<super::BatchCreateEntitiesRequest>,
) -> Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.v2.EntityTypes/BatchCreateEntities",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Updates or creates multiple entities in the specified entity type. This
/// method does not affect entities in the entity type that aren't explicitly
/// specified in the request.
///
///
/// Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
pub async fn batch_update_entities(
&mut self,
request: impl tonic::IntoRequest<super::BatchUpdateEntitiesRequest>,
) -> Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.v2.EntityTypes/BatchUpdateEntities",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Deletes entities in the specified entity type.
///
///
/// Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
pub async fn batch_delete_entities(
&mut self,
request: impl tonic::IntoRequest<super::BatchDeleteEntitiesRequest>,
) -> Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.v2.EntityTypes/BatchDeleteEntities",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}
/// A session represents a conversation between a Dialogflow agent and an
/// end-user. You can create special entities, called session entities, during a
/// session. Session entities can extend or replace custom entity types and only
/// exist during the session that they were created for. All session data,
/// including session entities, is stored by Dialogflow for 20 minutes.
///
/// For more information, see the [session entity
/// guide](<https://cloud.google.com/dialogflow/docs/entities-session>).
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SessionEntityType {
/// Required. The unique identifier of this session entity type. Format:
/// `projects/<Project ID>/agent/sessions/<Session ID>/entityTypes/<Entity Type
/// Display Name>`, or `projects/<Project ID>/agent/environments/<Environment
/// ID>/users/<User ID>/sessions/<Session ID>/entityTypes/<Entity Type Display
/// Name>`.
/// If `Environment ID` is not specified, we assume default 'draft'
/// environment. If `User ID` is not specified, we assume default '-' user.
///
/// `<Entity Type Display Name>` must be the display name of an existing entity
/// type in the same agent that will be overridden or supplemented.
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
/// Required. Indicates whether the additional data should override or
/// supplement the custom entity type definition.
#[prost(enumeration="session_entity_type::EntityOverrideMode", tag="2")]
pub entity_override_mode: i32,
/// Required. The collection of entities associated with this session entity
/// type.
#[prost(message, repeated, tag="3")]
pub entities: ::prost::alloc::vec::Vec<entity_type::Entity>,
}
/// Nested message and enum types in `SessionEntityType`.
pub mod session_entity_type {
/// The types of modifications for a session entity type.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum EntityOverrideMode {
/// Not specified. This value should be never used.
Unspecified = 0,
/// The collection of session entities overrides the collection of entities
/// in the corresponding custom entity type.
Override = 1,
/// The collection of session entities extends the collection of entities in
/// the corresponding custom entity type.
///
/// Note: Even in this override mode calls to `ListSessionEntityTypes`,
/// `GetSessionEntityType`, `CreateSessionEntityType` and
/// `UpdateSessionEntityType` only return the additional entities added in
/// this session entity type. If you want to get the supplemented list,
/// please call \[EntityTypes.GetEntityType][google.cloud.dialogflow.v2.EntityTypes.GetEntityType\] on the custom entity type
/// and merge.
Supplement = 2,
}
impl EntityOverrideMode {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
EntityOverrideMode::Unspecified => "ENTITY_OVERRIDE_MODE_UNSPECIFIED",
EntityOverrideMode::Override => "ENTITY_OVERRIDE_MODE_OVERRIDE",
EntityOverrideMode::Supplement => "ENTITY_OVERRIDE_MODE_SUPPLEMENT",
}
}
}
}
/// The request message for \[SessionEntityTypes.ListSessionEntityTypes][google.cloud.dialogflow.v2.SessionEntityTypes.ListSessionEntityTypes\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListSessionEntityTypesRequest {
/// Required. The session to list all session entity types from.
/// Format: `projects/<Project ID>/agent/sessions/<Session ID>` or
/// `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/
/// sessions/<Session ID>`.
/// If `Environment ID` is not specified, we assume default 'draft'
/// environment. If `User ID` is not specified, we assume default '-' user.
#[prost(string, tag="1")]
pub parent: ::prost::alloc::string::String,
/// Optional. The maximum number of items to return in a single page. By
/// default 100 and at most 1000.
#[prost(int32, tag="2")]
pub page_size: i32,
/// Optional. The next_page_token value returned from a previous list request.
#[prost(string, tag="3")]
pub page_token: ::prost::alloc::string::String,
}
/// The response message for \[SessionEntityTypes.ListSessionEntityTypes][google.cloud.dialogflow.v2.SessionEntityTypes.ListSessionEntityTypes\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListSessionEntityTypesResponse {
/// The list of session entity types. There will be a maximum number of items
/// returned based on the page_size field in the request.
#[prost(message, repeated, tag="1")]
pub session_entity_types: ::prost::alloc::vec::Vec<SessionEntityType>,
/// Token to retrieve the next page of results, or empty if there are no
/// more results in the list.
#[prost(string, tag="2")]
pub next_page_token: ::prost::alloc::string::String,
}
/// The request message for \[SessionEntityTypes.GetSessionEntityType][google.cloud.dialogflow.v2.SessionEntityTypes.GetSessionEntityType\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetSessionEntityTypeRequest {
/// Required. The name of the session entity type. Format:
/// `projects/<Project ID>/agent/sessions/<Session ID>/entityTypes/<Entity Type
/// Display Name>` or `projects/<Project ID>/agent/environments/<Environment
/// ID>/users/<User ID>/sessions/<Session ID>/entityTypes/<Entity Type Display
/// Name>`.
/// If `Environment ID` is not specified, we assume default 'draft'
/// environment. If `User ID` is not specified, we assume default '-' user.
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
}
/// The request message for \[SessionEntityTypes.CreateSessionEntityType][google.cloud.dialogflow.v2.SessionEntityTypes.CreateSessionEntityType\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateSessionEntityTypeRequest {
/// Required. The session to create a session entity type for.
/// Format: `projects/<Project ID>/agent/sessions/<Session ID>` or
/// `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/
/// sessions/<Session ID>`.
/// If `Environment ID` is not specified, we assume default 'draft'
/// environment. If `User ID` is not specified, we assume default '-' user.
#[prost(string, tag="1")]
pub parent: ::prost::alloc::string::String,
/// Required. The session entity type to create.
#[prost(message, optional, tag="2")]
pub session_entity_type: ::core::option::Option<SessionEntityType>,
}
/// The request message for \[SessionEntityTypes.UpdateSessionEntityType][google.cloud.dialogflow.v2.SessionEntityTypes.UpdateSessionEntityType\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateSessionEntityTypeRequest {
/// Required. The session entity type to update.
#[prost(message, optional, tag="1")]
pub session_entity_type: ::core::option::Option<SessionEntityType>,
/// Optional. The mask to control which fields get updated.
#[prost(message, optional, tag="2")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
/// The request message for \[SessionEntityTypes.DeleteSessionEntityType][google.cloud.dialogflow.v2.SessionEntityTypes.DeleteSessionEntityType\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteSessionEntityTypeRequest {
/// Required. The name of the entity type to delete. Format:
/// `projects/<Project ID>/agent/sessions/<Session ID>/entityTypes/<Entity Type
/// Display Name>` or `projects/<Project ID>/agent/environments/<Environment
/// ID>/users/<User ID>/sessions/<Session ID>/entityTypes/<Entity Type Display
/// Name>`.
/// If `Environment ID` is not specified, we assume default 'draft'
/// environment. If `User ID` is not specified, we assume default '-' user.
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
}
/// Generated client implementations.
pub mod session_entity_types_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
/// Service for managing [SessionEntityTypes][google.cloud.dialogflow.v2.SessionEntityType].
#[derive(Debug, Clone)]
pub struct SessionEntityTypesClient<T> {
inner: tonic::client::Grpc<T>,
}
impl SessionEntityTypesClient<tonic::transport::Channel> {
/// Attempt to create a new client by connecting to a given endpoint.
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> SessionEntityTypesClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> SessionEntityTypesClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
{
SessionEntityTypesClient::new(InterceptedService::new(inner, interceptor))
}
/// Compress requests with the given encoding.
///
/// This requires the server to support it otherwise it might respond with an
/// error.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
/// Enable decompressing responses.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
/// Returns the list of all session entity types in the specified session.
///
/// This method doesn't work with Google Assistant integration.
/// Contact Dialogflow support if you need to use session entities
/// with Google Assistant integration.
pub async fn list_session_entity_types(
&mut self,
request: impl tonic::IntoRequest<super::ListSessionEntityTypesRequest>,
) -> Result<
tonic::Response<super::ListSessionEntityTypesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.v2.SessionEntityTypes/ListSessionEntityTypes",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Retrieves the specified session entity type.
///
/// This method doesn't work with Google Assistant integration.
/// Contact Dialogflow support if you need to use session entities
/// with Google Assistant integration.
pub async fn get_session_entity_type(
&mut self,
request: impl tonic::IntoRequest<super::GetSessionEntityTypeRequest>,
) -> Result<tonic::Response<super::SessionEntityType>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.v2.SessionEntityTypes/GetSessionEntityType",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Creates a session entity type.
///
/// If the specified session entity type already exists, overrides the session
/// entity type.
///
/// This method doesn't work with Google Assistant integration.
/// Contact Dialogflow support if you need to use session entities
/// with Google Assistant integration.
pub async fn create_session_entity_type(
&mut self,
request: impl tonic::IntoRequest<super::CreateSessionEntityTypeRequest>,
) -> Result<tonic::Response<super::SessionEntityType>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.v2.SessionEntityTypes/CreateSessionEntityType",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Updates the specified session entity type.
///
/// This method doesn't work with Google Assistant integration.
/// Contact Dialogflow support if you need to use session entities
/// with Google Assistant integration.
pub async fn update_session_entity_type(
&mut self,
request: impl tonic::IntoRequest<super::UpdateSessionEntityTypeRequest>,
) -> Result<tonic::Response<super::SessionEntityType>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.v2.SessionEntityTypes/UpdateSessionEntityType",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Deletes the specified session entity type.
///
/// This method doesn't work with Google Assistant integration.
/// Contact Dialogflow support if you need to use session entities
/// with Google Assistant integration.
pub async fn delete_session_entity_type(
&mut self,
request: impl tonic::IntoRequest<super::DeleteSessionEntityTypeRequest>,
) -> Result<tonic::Response<()>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.v2.SessionEntityTypes/DeleteSessionEntityType",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}
/// The request to detect user's intent.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DetectIntentRequest {
/// Required. The name of the session this query is sent to. Format:
/// `projects/<Project ID>/agent/sessions/<Session ID>`, or
/// `projects/<Project ID>/agent/environments/<Environment ID>/users/<User
/// ID>/sessions/<Session ID>`. If `Environment ID` is not specified, we assume
/// default 'draft' environment (`Environment ID` might be referred to as
/// environment name at some places). If `User ID` is not specified, we are
/// using "-". It's up to the API caller to choose an appropriate `Session ID`
/// and `User Id`. They can be a random number or some type of user and session
/// identifiers (preferably hashed). The length of the `Session ID` and
/// `User ID` must not exceed 36 characters.
///
/// For more information, see the [API interactions
/// guide](<https://cloud.google.com/dialogflow/docs/api-overview>).
///
/// Note: Always use agent versions for production traffic.
/// See [Versions and
/// environments](<https://cloud.google.com/dialogflow/es/docs/agents-versions>).
#[prost(string, tag="1")]
pub session: ::prost::alloc::string::String,
/// The parameters of this query.
#[prost(message, optional, tag="2")]
pub query_params: ::core::option::Option<QueryParameters>,
/// Required. The input specification. It can be set to:
///
/// 1. an audio config
/// which instructs the speech recognizer how to process the speech audio,
///
/// 2. a conversational query in the form of text, or
///
/// 3. an event that specifies which intent to trigger.
#[prost(message, optional, tag="3")]
pub query_input: ::core::option::Option<QueryInput>,
/// Instructs the speech synthesizer how to generate the output
/// audio. If this field is not set and agent-level speech synthesizer is not
/// configured, no output audio is generated.
#[prost(message, optional, tag="4")]
pub output_audio_config: ::core::option::Option<OutputAudioConfig>,
/// Mask for \[output_audio_config][google.cloud.dialogflow.v2.DetectIntentRequest.output_audio_config\] indicating which settings in this
/// request-level config should override speech synthesizer settings defined at
/// agent-level.
///
/// If unspecified or empty, \[output_audio_config][google.cloud.dialogflow.v2.DetectIntentRequest.output_audio_config\] replaces the agent-level
/// config in its entirety.
#[prost(message, optional, tag="7")]
pub output_audio_config_mask: ::core::option::Option<::prost_types::FieldMask>,
/// The natural language speech audio to be processed. This field
/// should be populated iff `query_input` is set to an input audio config.
/// A single request can contain up to 1 minute of speech audio data.
#[prost(bytes="vec", tag="5")]
pub input_audio: ::prost::alloc::vec::Vec<u8>,
}
/// The message returned from the DetectIntent method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DetectIntentResponse {
/// The unique identifier of the response. It can be used to
/// locate a response in the training example set or for reporting issues.
#[prost(string, tag="1")]
pub response_id: ::prost::alloc::string::String,
/// The selected results of the conversational query or event processing.
/// See `alternative_query_results` for additional potential results.
#[prost(message, optional, tag="2")]
pub query_result: ::core::option::Option<QueryResult>,
/// Specifies the status of the webhook request.
#[prost(message, optional, tag="3")]
pub webhook_status: ::core::option::Option<super::super::super::rpc::Status>,
/// The audio data bytes encoded as specified in the request.
/// Note: The output audio is generated based on the values of default platform
/// text responses found in the `query_result.fulfillment_messages` field. If
/// multiple default text responses exist, they will be concatenated when
/// generating audio. If no default platform text responses exist, the
/// generated audio content will be empty.
///
/// In some scenarios, multiple output audio fields may be present in the
/// response structure. In these cases, only the top-most-level audio output
/// has content.
#[prost(bytes="vec", tag="4")]
pub output_audio: ::prost::alloc::vec::Vec<u8>,
/// The config used by the speech synthesizer to generate the output audio.
#[prost(message, optional, tag="6")]
pub output_audio_config: ::core::option::Option<OutputAudioConfig>,
}
/// Represents the parameters of the conversational query.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryParameters {
/// The time zone of this conversational query from the
/// [time zone database](<https://www.iana.org/time-zones>), e.g.,
/// America/New_York, Europe/Paris. If not provided, the time zone specified in
/// agent settings is used.
#[prost(string, tag="1")]
pub time_zone: ::prost::alloc::string::String,
/// The geo location of this conversational query.
#[prost(message, optional, tag="2")]
pub geo_location: ::core::option::Option<super::super::super::r#type::LatLng>,
/// The collection of contexts to be activated before this query is
/// executed.
#[prost(message, repeated, tag="3")]
pub contexts: ::prost::alloc::vec::Vec<Context>,
/// Specifies whether to delete all contexts in the current session
/// before the new ones are activated.
#[prost(bool, tag="4")]
pub reset_contexts: bool,
/// Additional session entity types to replace or extend developer
/// entity types with. The entity synonyms apply to all languages and persist
/// for the session of this query.
#[prost(message, repeated, tag="5")]
pub session_entity_types: ::prost::alloc::vec::Vec<SessionEntityType>,
/// This field can be used to pass custom data to your webhook.
/// Arbitrary JSON objects are supported.
/// If supplied, the value is used to populate the
/// `WebhookRequest.original_detect_intent_request.payload`
/// field sent to your webhook.
#[prost(message, optional, tag="6")]
pub payload: ::core::option::Option<::prost_types::Struct>,
/// Configures the type of sentiment analysis to perform. If not
/// provided, sentiment analysis is not performed.
#[prost(message, optional, tag="10")]
pub sentiment_analysis_request_config: ::core::option::Option<SentimentAnalysisRequestConfig>,
/// This field can be used to pass HTTP headers for a webhook
/// call. These headers will be sent to webhook along with the headers that
/// have been configured through the Dialogflow web console. The headers
/// defined within this field will overwrite the headers configured through the
/// Dialogflow console if there is a conflict. Header names are
/// case-insensitive. Google's specified headers are not allowed. Including:
/// "Host", "Content-Length", "Connection", "From", "User-Agent",
/// "Accept-Encoding", "If-Modified-Since", "If-None-Match", "X-Forwarded-For",
/// etc.
#[prost(map="string, string", tag="14")]
pub webhook_headers: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
}
/// Represents the query input. It can contain either:
///
/// 1. An audio config which
/// instructs the speech recognizer how to process the speech audio.
///
/// 2. A conversational query in the form of text,.
///
/// 3. An event that specifies which intent to trigger.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryInput {
/// Required. The input specification.
#[prost(oneof="query_input::Input", tags="1, 2, 3")]
pub input: ::core::option::Option<query_input::Input>,
}
/// Nested message and enum types in `QueryInput`.
pub mod query_input {
/// Required. The input specification.
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Input {
/// Instructs the speech recognizer how to process the speech audio.
#[prost(message, tag="1")]
AudioConfig(super::InputAudioConfig),
/// The natural language text to be processed.
#[prost(message, tag="2")]
Text(super::TextInput),
/// The event to be processed.
#[prost(message, tag="3")]
Event(super::EventInput),
}
}
/// Represents the result of conversational query or event processing.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryResult {
/// The original conversational query text:
///
/// - If natural language text was provided as input, `query_text` contains
/// a copy of the input.
/// - If natural language speech audio was provided as input, `query_text`
/// contains the speech recognition result. If speech recognizer produced
/// multiple alternatives, a particular one is picked.
/// - If automatic spell correction is enabled, `query_text` will contain the
/// corrected user input.
#[prost(string, tag="1")]
pub query_text: ::prost::alloc::string::String,
/// The language that was triggered during intent detection.
/// See [Language
/// Support](<https://cloud.google.com/dialogflow/docs/reference/language>)
/// for a list of the currently supported language codes.
#[prost(string, tag="15")]
pub language_code: ::prost::alloc::string::String,
/// The Speech recognition confidence between 0.0 and 1.0. A higher number
/// indicates an estimated greater likelihood that the recognized words are
/// correct. The default of 0.0 is a sentinel value indicating that confidence
/// was not set.
///
/// This field is not guaranteed to be accurate or set. In particular this
/// field isn't set for StreamingDetectIntent since the streaming endpoint has
/// separate confidence estimates per portion of the audio in
/// StreamingRecognitionResult.
#[prost(float, tag="2")]
pub speech_recognition_confidence: f32,
/// The action name from the matched intent.
#[prost(string, tag="3")]
pub action: ::prost::alloc::string::String,
/// The collection of extracted parameters.
///
/// Depending on your protocol or client library language, this is a
/// map, associative array, symbol table, dictionary, or JSON object
/// composed of a collection of (MapKey, MapValue) pairs:
///
/// - MapKey type: string
/// - MapKey value: parameter name
/// - MapValue type:
/// - If parameter's entity type is a composite entity: map
/// - Else: depending on parameter value type, could be one of string,
/// number, boolean, null, list or map
/// - MapValue value:
/// - If parameter's entity type is a composite entity:
/// map from composite entity property names to property values
/// - Else: parameter value
#[prost(message, optional, tag="4")]
pub parameters: ::core::option::Option<::prost_types::Struct>,
/// This field is set to:
///
/// - `false` if the matched intent has required parameters and not all of
/// the required parameter values have been collected.
/// - `true` if all required parameter values have been collected, or if the
/// matched intent doesn't contain any required parameters.
#[prost(bool, tag="5")]
pub all_required_params_present: bool,
/// The text to be pronounced to the user or shown on the screen.
/// Note: This is a legacy field, `fulfillment_messages` should be preferred.
#[prost(string, tag="6")]
pub fulfillment_text: ::prost::alloc::string::String,
/// The collection of rich messages to present to the user.
#[prost(message, repeated, tag="7")]
pub fulfillment_messages: ::prost::alloc::vec::Vec<intent::Message>,
/// If the query was fulfilled by a webhook call, this field is set to the
/// value of the `source` field returned in the webhook response.
#[prost(string, tag="8")]
pub webhook_source: ::prost::alloc::string::String,
/// If the query was fulfilled by a webhook call, this field is set to the
/// value of the `payload` field returned in the webhook response.
#[prost(message, optional, tag="9")]
pub webhook_payload: ::core::option::Option<::prost_types::Struct>,
/// The collection of output contexts. If applicable,
/// `output_contexts.parameters` contains entries with name
/// `<parameter name>.original` containing the original parameter values
/// before the query.
#[prost(message, repeated, tag="10")]
pub output_contexts: ::prost::alloc::vec::Vec<Context>,
/// The intent that matched the conversational query. Some, not
/// all fields are filled in this message, including but not limited to:
/// `name`, `display_name`, `end_interaction` and `is_fallback`.
#[prost(message, optional, tag="11")]
pub intent: ::core::option::Option<Intent>,
/// The intent detection confidence. Values range from 0.0
/// (completely uncertain) to 1.0 (completely certain).
/// This value is for informational purpose only and is only used to
/// help match the best intent within the classification threshold.
/// This value may change for the same end-user expression at any time due to a
/// model retraining or change in implementation.
/// If there are `multiple knowledge_answers` messages, this value is set to
/// the greatest `knowledgeAnswers.match_confidence` value in the list.
#[prost(float, tag="12")]
pub intent_detection_confidence: f32,
/// Free-form diagnostic information for the associated detect intent request.
/// The fields of this data can change without notice, so you should not write
/// code that depends on its structure.
/// The data may contain:
///
/// - webhook call latency
/// - webhook errors
#[prost(message, optional, tag="14")]
pub diagnostic_info: ::core::option::Option<::prost_types::Struct>,
/// The sentiment analysis result, which depends on the
/// `sentiment_analysis_request_config` specified in the request.
#[prost(message, optional, tag="17")]
pub sentiment_analysis_result: ::core::option::Option<SentimentAnalysisResult>,
}
/// The top-level message sent by the client to the
/// \[Sessions.StreamingDetectIntent][google.cloud.dialogflow.v2.Sessions.StreamingDetectIntent\] method.
///
/// Multiple request messages should be sent in order:
///
/// 1. The first message must contain
/// \[session][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.session\],
/// \[query_input][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.query_input\] plus optionally
/// \[query_params][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.query_params\]. If the client
/// wants to receive an audio response, it should also contain
/// \[output_audio_config][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.output_audio_config\].
/// The message must not contain
/// \[input_audio][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.input_audio\].
/// 2. If \[query_input][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.query_input\] was set to
/// \[query_input.audio_config][google.cloud.dialogflow.v2.InputAudioConfig\], all subsequent
/// messages must contain
/// \[input_audio][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.input_audio\] to continue with
/// Speech recognition.
/// If you decide to rather detect an intent from text input after you
/// already started Speech recognition, please send a message with
/// \[query_input.text][google.cloud.dialogflow.v2.QueryInput.text\].
///
/// However, note that:
///
/// * Dialogflow will bill you for the audio duration so far.
/// * Dialogflow discards all Speech recognition results in favor of the
/// input text.
/// * Dialogflow will use the language code from the first message.
///
/// After you sent all input, you must half-close or abort the request stream.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamingDetectIntentRequest {
/// Required. The name of the session the query is sent to.
/// Format of the session name:
/// `projects/<Project ID>/agent/sessions/<Session ID>`, or
/// `projects/<Project ID>/agent/environments/<Environment ID>/users/<User
/// ID>/sessions/<Session ID>`. If `Environment ID` is not specified, we assume
/// default 'draft' environment. If `User ID` is not specified, we are using
/// "-". It's up to the API caller to choose an appropriate `Session ID` and
/// `User Id`. They can be a random number or some type of user and session
/// identifiers (preferably hashed). The length of the `Session ID` and
/// `User ID` must not exceed 36 characters.
///
/// For more information, see the [API interactions
/// guide](<https://cloud.google.com/dialogflow/docs/api-overview>).
///
/// Note: Always use agent versions for production traffic.
/// See [Versions and
/// environments](<https://cloud.google.com/dialogflow/es/docs/agents-versions>).
#[prost(string, tag="1")]
pub session: ::prost::alloc::string::String,
/// The parameters of this query.
#[prost(message, optional, tag="2")]
pub query_params: ::core::option::Option<QueryParameters>,
/// Required. The input specification. It can be set to:
///
/// 1. an audio config which instructs the speech recognizer how to process
/// the speech audio,
///
/// 2. a conversational query in the form of text, or
///
/// 3. an event that specifies which intent to trigger.
#[prost(message, optional, tag="3")]
pub query_input: ::core::option::Option<QueryInput>,
/// Please use \[InputAudioConfig.single_utterance][google.cloud.dialogflow.v2.InputAudioConfig.single_utterance\] instead.
/// If `false` (default), recognition does not cease until
/// the client closes the stream. If `true`, the recognizer will detect a
/// single spoken utterance in input audio. Recognition ceases when it detects
/// the audio's voice has stopped or paused. In this case, once a detected
/// intent is received, the client should close the stream and start a new
/// request with a new stream as needed.
/// This setting is ignored when `query_input` is a piece of text or an event.
#[deprecated]
#[prost(bool, tag="4")]
pub single_utterance: bool,
/// Instructs the speech synthesizer how to generate the output
/// audio. If this field is not set and agent-level speech synthesizer is not
/// configured, no output audio is generated.
#[prost(message, optional, tag="5")]
pub output_audio_config: ::core::option::Option<OutputAudioConfig>,
/// Mask for \[output_audio_config][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.output_audio_config\] indicating which settings in this
/// request-level config should override speech synthesizer settings defined at
/// agent-level.
///
/// If unspecified or empty, \[output_audio_config][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.output_audio_config\] replaces the agent-level
/// config in its entirety.
#[prost(message, optional, tag="7")]
pub output_audio_config_mask: ::core::option::Option<::prost_types::FieldMask>,
/// The input audio content to be recognized. Must be sent if
/// `query_input` was set to a streaming input audio config. The complete audio
/// over all streaming messages must not exceed 1 minute.
#[prost(bytes="vec", tag="6")]
pub input_audio: ::prost::alloc::vec::Vec<u8>,
}
/// The top-level message returned from the
/// `StreamingDetectIntent` method.
///
/// Multiple response messages can be returned in order:
///
/// 1. If the input was set to streaming audio, the first one or more messages
/// contain `recognition_result`. Each `recognition_result` represents a more
/// complete transcript of what the user said. The last `recognition_result`
/// has `is_final` set to `true`.
///
/// 2. The next message contains `response_id`, `query_result`
/// and optionally `webhook_status` if a WebHook was called.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamingDetectIntentResponse {
/// The unique identifier of the response. It can be used to
/// locate a response in the training example set or for reporting issues.
#[prost(string, tag="1")]
pub response_id: ::prost::alloc::string::String,
/// The result of speech recognition.
#[prost(message, optional, tag="2")]
pub recognition_result: ::core::option::Option<StreamingRecognitionResult>,
/// The result of the conversational query or event processing.
#[prost(message, optional, tag="3")]
pub query_result: ::core::option::Option<QueryResult>,
/// Specifies the status of the webhook request.
#[prost(message, optional, tag="4")]
pub webhook_status: ::core::option::Option<super::super::super::rpc::Status>,
/// The audio data bytes encoded as specified in the request.
/// Note: The output audio is generated based on the values of default platform
/// text responses found in the `query_result.fulfillment_messages` field. If
/// multiple default text responses exist, they will be concatenated when
/// generating audio. If no default platform text responses exist, the
/// generated audio content will be empty.
///
/// In some scenarios, multiple output audio fields may be present in the
/// response structure. In these cases, only the top-most-level audio output
/// has content.
#[prost(bytes="vec", tag="5")]
pub output_audio: ::prost::alloc::vec::Vec<u8>,
/// The config used by the speech synthesizer to generate the output audio.
#[prost(message, optional, tag="6")]
pub output_audio_config: ::core::option::Option<OutputAudioConfig>,
}
/// Contains a speech recognition result corresponding to a portion of the audio
/// that is currently being processed or an indication that this is the end
/// of the single requested utterance.
///
/// Example:
///
/// 1. transcript: "tube"
///
/// 2. transcript: "to be a"
///
/// 3. transcript: "to be"
///
/// 4. transcript: "to be or not to be"
/// is_final: true
///
/// 5. transcript: " that's"
///
/// 6. transcript: " that is"
///
/// 7. message_type: `END_OF_SINGLE_UTTERANCE`
///
/// 8. transcript: " that is the question"
/// is_final: true
///
/// Only two of the responses contain final results (#4 and #8 indicated by
/// `is_final: true`). Concatenating these generates the full transcript: "to be
/// or not to be that is the question".
///
/// In each response we populate:
///
/// * for `TRANSCRIPT`: `transcript` and possibly `is_final`.
///
/// * for `END_OF_SINGLE_UTTERANCE`: only `message_type`.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamingRecognitionResult {
/// Type of the result message.
#[prost(enumeration="streaming_recognition_result::MessageType", tag="1")]
pub message_type: i32,
/// Transcript text representing the words that the user spoke.
/// Populated if and only if `message_type` = `TRANSCRIPT`.
#[prost(string, tag="2")]
pub transcript: ::prost::alloc::string::String,
/// If `false`, the `StreamingRecognitionResult` represents an
/// interim result that may change. If `true`, the recognizer will not return
/// any further hypotheses about this piece of the audio. May only be populated
/// for `message_type` = `TRANSCRIPT`.
#[prost(bool, tag="3")]
pub is_final: bool,
/// The Speech confidence between 0.0 and 1.0 for the current portion of audio.
/// A higher number indicates an estimated greater likelihood that the
/// recognized words are correct. The default of 0.0 is a sentinel value
/// indicating that confidence was not set.
///
/// This field is typically only provided if `is_final` is true and you should
/// not rely on it being accurate or even set.
#[prost(float, tag="4")]
pub confidence: f32,
/// Word-specific information for the words recognized by Speech in
/// \[transcript][google.cloud.dialogflow.v2.StreamingRecognitionResult.transcript\]. Populated if and only if `message_type` = `TRANSCRIPT` and
/// \[InputAudioConfig.enable_word_info\] is set.
#[prost(message, repeated, tag="7")]
pub speech_word_info: ::prost::alloc::vec::Vec<SpeechWordInfo>,
/// Time offset of the end of this Speech recognition result relative to the
/// beginning of the audio. Only populated for `message_type` = `TRANSCRIPT`.
#[prost(message, optional, tag="8")]
pub speech_end_offset: ::core::option::Option<::prost_types::Duration>,
}
/// Nested message and enum types in `StreamingRecognitionResult`.
pub mod streaming_recognition_result {
/// Type of the response message.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum MessageType {
/// Not specified. Should never be used.
Unspecified = 0,
/// Message contains a (possibly partial) transcript.
Transcript = 1,
/// Event indicates that the server has detected the end of the user's speech
/// utterance and expects no additional inputs.
/// Therefore, the server will not process additional audio (although it may subsequently return additional results). The
/// client should stop sending additional audio data, half-close the gRPC
/// connection, and wait for any additional results until the server closes
/// the gRPC connection. This message is only sent if `single_utterance` was
/// set to `true`, and is not used otherwise.
EndOfSingleUtterance = 2,
}
impl MessageType {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
MessageType::Unspecified => "MESSAGE_TYPE_UNSPECIFIED",
MessageType::Transcript => "TRANSCRIPT",
MessageType::EndOfSingleUtterance => "END_OF_SINGLE_UTTERANCE",
}
}
}
}
/// Represents the natural language text to be processed.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TextInput {
/// Required. The UTF-8 encoded natural language text to be processed.
/// Text length must not exceed 256 characters.
#[prost(string, tag="1")]
pub text: ::prost::alloc::string::String,
/// Required. The language of this conversational query. See [Language
/// Support](<https://cloud.google.com/dialogflow/docs/reference/language>)
/// for a list of the currently supported language codes. Note that queries in
/// the same session do not necessarily need to specify the same language.
#[prost(string, tag="2")]
pub language_code: ::prost::alloc::string::String,
}
/// Events allow for matching intents by event name instead of the natural
/// language input. For instance, input `<event: { name: "welcome_event",
/// parameters: { name: "Sam" } }>` can trigger a personalized welcome response.
/// The parameter `name` may be used by the agent in the response:
/// `"Hello #welcome_event.name! What can I do for you today?"`.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventInput {
/// Required. The unique identifier of the event.
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
/// The collection of parameters associated with the event.
///
/// Depending on your protocol or client library language, this is a
/// map, associative array, symbol table, dictionary, or JSON object
/// composed of a collection of (MapKey, MapValue) pairs:
///
/// - MapKey type: string
/// - MapKey value: parameter name
/// - MapValue type:
/// - If parameter's entity type is a composite entity: map
/// - Else: depending on parameter value type, could be one of string,
/// number, boolean, null, list or map
/// - MapValue value:
/// - If parameter's entity type is a composite entity:
/// map from composite entity property names to property values
/// - Else: parameter value
#[prost(message, optional, tag="2")]
pub parameters: ::core::option::Option<::prost_types::Struct>,
/// Required. The language of this query. See [Language
/// Support](<https://cloud.google.com/dialogflow/docs/reference/language>)
/// for a list of the currently supported language codes. Note that queries in
/// the same session do not necessarily need to specify the same language.
#[prost(string, tag="3")]
pub language_code: ::prost::alloc::string::String,
}
/// Configures the types of sentiment analysis to perform.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SentimentAnalysisRequestConfig {
/// Instructs the service to perform sentiment analysis on
/// `query_text`. If not provided, sentiment analysis is not performed on
/// `query_text`.
#[prost(bool, tag="1")]
pub analyze_query_text_sentiment: bool,
}
/// The result of sentiment analysis. Sentiment analysis inspects user input
/// and identifies the prevailing subjective opinion, especially to determine a
/// user's attitude as positive, negative, or neutral.
/// For \[Participants.DetectIntent][\], it needs to be configured in
/// \[DetectIntentRequest.query_params][google.cloud.dialogflow.v2.DetectIntentRequest.query_params\]. For
/// \[Participants.StreamingDetectIntent][\], it needs to be configured in
/// \[StreamingDetectIntentRequest.query_params][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.query_params\].
/// And for \[Participants.AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent\] and
/// \[Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent\], it needs to be configured in
/// \[ConversationProfile.human_agent_assistant_config][google.cloud.dialogflow.v2.ConversationProfile.human_agent_assistant_config\]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SentimentAnalysisResult {
/// The sentiment analysis result for `query_text`.
#[prost(message, optional, tag="1")]
pub query_text_sentiment: ::core::option::Option<Sentiment>,
}
/// The sentiment, such as positive/negative feeling or association, for a unit
/// of analysis, such as the query text.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Sentiment {
/// Sentiment score between -1.0 (negative sentiment) and 1.0 (positive
/// sentiment).
#[prost(float, tag="1")]
pub score: f32,
/// A non-negative number in the [0, +inf) range, which represents the absolute
/// magnitude of sentiment, regardless of score (positive or negative).
#[prost(float, tag="2")]
pub magnitude: f32,
}
/// Generated client implementations.
pub mod sessions_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
/// A service used for session interactions.
///
/// For more information, see the [API interactions
/// guide](https://cloud.google.com/dialogflow/docs/api-overview).
#[derive(Debug, Clone)]
pub struct SessionsClient<T> {
inner: tonic::client::Grpc<T>,
}
impl SessionsClient<tonic::transport::Channel> {
/// Attempt to create a new client by connecting to a given endpoint.
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> SessionsClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> SessionsClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
{
SessionsClient::new(InterceptedService::new(inner, interceptor))
}
/// Compress requests with the given encoding.
///
/// This requires the server to support it otherwise it might respond with an
/// error.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
/// Enable decompressing responses.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
/// Processes a natural language query and returns structured, actionable data
/// as a result. This method is not idempotent, because it may cause contexts
/// and session entity types to be updated, which in turn might affect
/// results of future queries.
///
/// Note: Always use agent versions for production traffic.
/// See [Versions and
/// environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
pub async fn detect_intent(
&mut self,
request: impl tonic::IntoRequest<super::DetectIntentRequest>,
) -> Result<tonic::Response<super::DetectIntentResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.v2.Sessions/DetectIntent",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Processes a natural language query in audio format in a streaming fashion
/// and returns structured, actionable data as a result. This method is only
/// available via the gRPC API (not REST).
///
/// Note: Always use agent versions for production traffic.
/// See [Versions and
/// environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
pub async fn streaming_detect_intent(
&mut self,
request: impl tonic::IntoStreamingRequest<
Message = super::StreamingDetectIntentRequest,
>,
) -> Result<
tonic::Response<
tonic::codec::Streaming<super::StreamingDetectIntentResponse>,
>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.v2.Sessions/StreamingDetectIntent",
);
self.inner.streaming(request.into_streaming_request(), path, codec).await
}
}
}