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
// This file is @generated by prost-build.
/// A card interface displayed in a Google Chat message or Google Workspace
/// Add-on.
///
/// Cards support a defined layout, interactive UI elements like buttons, and
/// rich media like images. Use cards to present detailed information,
/// gather information from users, and guide users to take a next step.
///
/// [Card builder](<https://addons.gsuite.google.com/uikit/builder>)
///
/// To learn how
/// to build cards, see the following documentation:
///
/// * For Google Chat apps, see [Design the components of a card or
/// dialog](<https://developers.google.com/workspace/chat/design-components-card-dialog>).
/// * For Google Workspace Add-ons, see [Card-based
/// interfaces](<https://developers.google.com/apps-script/add-ons/concepts/cards>).
///
/// **Example: Card message for a Google Chat app**
///
/// ![Example contact
/// card](<https://developers.google.com/workspace/chat/images/card_api_reference.png>)
///
/// To create the sample card message in Google Chat, use the following JSON:
///
/// ```
/// {
/// "cardsV2": [
/// {
/// "cardId": "unique-card-id",
/// "card": {
/// "header": {
/// "title": "Sasha",
/// "subtitle": "Software Engineer",
/// "imageUrl":
/// "<https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png",>
/// "imageType": "CIRCLE",
/// "imageAltText": "Avatar for Sasha"
/// },
/// "sections": [
/// {
/// "header": "Contact Info",
/// "collapsible": true,
/// "uncollapsibleWidgetsCount": 1,
/// "widgets": [
/// {
/// "decoratedText": {
/// "startIcon": {
/// "knownIcon": "EMAIL"
/// },
/// "text": "sasha@example.com"
/// }
/// },
/// {
/// "decoratedText": {
/// "startIcon": {
/// "knownIcon": "PERSON"
/// },
/// "text": "<font color=\"#80e27e\">Online</font>"
/// }
/// },
/// {
/// "decoratedText": {
/// "startIcon": {
/// "knownIcon": "PHONE"
/// },
/// "text": "+1 (555) 555-1234"
/// }
/// },
/// {
/// "buttonList": {
/// "buttons": [
/// {
/// "text": "Share",
/// "onClick": {
/// "openLink": {
/// "url": "<https://example.com/share">
/// }
/// }
/// },
/// {
/// "text": "Edit",
/// "onClick": {
/// "action": {
/// "function": "goToView",
/// "parameters": [
/// {
/// "key": "viewType",
/// "value": "EDIT"
/// }
/// ]
/// }
/// }
/// }
/// ]
/// }
/// }
/// ]
/// }
/// ]
/// }
/// }
/// ]
/// }
/// ```
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Card {
/// The header of the card. A header usually contains a leading image and a
/// title. Headers always appear at the top of a card.
#[prost(message, optional, tag = "1")]
pub header: ::core::option::Option<card::CardHeader>,
/// Contains a collection of widgets. Each section has its own, optional
/// header. Sections are visually separated by a line divider. For an example
/// in Google Chat apps, see [Define a section of a
/// card](<https://developers.google.com/workspace/chat/design-components-card-dialog#define_a_section_of_a_card>).
#[prost(message, repeated, tag = "2")]
pub sections: ::prost::alloc::vec::Vec<card::Section>,
/// The divider style between sections.
#[prost(enumeration = "card::DividerStyle", tag = "9")]
pub section_divider_style: i32,
/// The card's actions. Actions are added to the card's toolbar menu.
///
/// [Google Workspace
/// Add-ons](<https://developers.google.com/workspace/add-ons>):
///
/// For example, the following JSON constructs a card action menu with
/// `Settings` and `Send Feedback` options:
///
/// ```
/// "card_actions": [
/// {
/// "actionLabel": "Settings",
/// "onClick": {
/// "action": {
/// "functionName": "goToView",
/// "parameters": [
/// {
/// "key": "viewType",
/// "value": "SETTING"
/// }
/// ],
/// "loadIndicator": "LoadIndicator.SPINNER"
/// }
/// }
/// },
/// {
/// "actionLabel": "Send Feedback",
/// "onClick": {
/// "openLink": {
/// "url": "<https://example.com/feedback">
/// }
/// }
/// }
/// ]
/// ```
#[prost(message, repeated, tag = "3")]
pub card_actions: ::prost::alloc::vec::Vec<card::CardAction>,
/// Name of the card. Used as a card identifier in card navigation.
///
/// [Google Workspace
/// Add-ons](<https://developers.google.com/workspace/add-ons>):
#[prost(string, tag = "4")]
pub name: ::prost::alloc::string::String,
/// The fixed footer shown at the bottom of this card.
///
/// Setting `fixedFooter` without specifying a `primaryButton` or a
/// `secondaryButton` causes an error. For Chat apps, you can use fixed footers
/// in
/// [dialogs](<https://developers.google.com/workspace/chat/dialogs>), but not
/// [card
/// messages](<https://developers.google.com/workspace/chat/create-messages#create>).
///
/// [Google Workspace Add-ons and Chat
/// apps](<https://developers.google.com/workspace/extend>):
#[prost(message, optional, boxed, tag = "5")]
pub fixed_footer: ::core::option::Option<
::prost::alloc::boxed::Box<card::CardFixedFooter>,
>,
/// In Google Workspace Add-ons, sets the display properties of the
/// `peekCardHeader`.
///
/// [Google Workspace
/// Add-ons](<https://developers.google.com/workspace/add-ons>):
#[prost(enumeration = "card::DisplayStyle", tag = "6")]
pub display_style: i32,
/// When displaying contextual content, the peek card header acts as a
/// placeholder so that the user can navigate forward between the homepage
/// cards and the contextual cards.
///
/// [Google Workspace
/// Add-ons](<https://developers.google.com/workspace/add-ons>):
#[prost(message, optional, tag = "7")]
pub peek_card_header: ::core::option::Option<card::CardHeader>,
}
/// Nested message and enum types in `Card`.
pub mod card {
/// Represents a card header. For an example in Google Chat apps, see [Add a
/// header](<https://developers.google.com/workspace/chat/design-components-card-dialog#add_a_header>).
///
/// [Google Workspace Add-ons and Chat
/// apps](<https://developers.google.com/workspace/extend>):
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CardHeader {
/// Required. The title of the card header.
/// The header has a fixed height: if both a
/// title and subtitle are specified, each takes up one line. If only the
/// title is specified, it takes up both lines.
#[prost(string, tag = "1")]
pub title: ::prost::alloc::string::String,
/// The subtitle of the card header. If specified, appears on its own line
/// below the `title`.
#[prost(string, tag = "2")]
pub subtitle: ::prost::alloc::string::String,
/// The shape used to crop the image.
///
/// [Google Workspace Add-ons and Chat
/// apps](<https://developers.google.com/workspace/extend>):
#[prost(enumeration = "super::widget::ImageType", tag = "3")]
pub image_type: i32,
/// The HTTPS URL of the image in the card header.
#[prost(string, tag = "4")]
pub image_url: ::prost::alloc::string::String,
/// The alternative text of this image that's used for accessibility.
#[prost(string, tag = "5")]
pub image_alt_text: ::prost::alloc::string::String,
}
/// A section contains a collection of widgets that are rendered
/// vertically in the order that they're specified.
///
/// [Google Workspace Add-ons and Chat
/// apps](<https://developers.google.com/workspace/extend>):
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Section {
/// Text that appears at the top of a section.
/// Supports simple HTML formatted text. For more information
/// about formatting text, see
/// [Formatting text in Google Chat
/// apps](<https://developers.google.com/workspace/chat/format-messages#card-formatting>)
/// and
/// [Formatting
/// text in Google Workspace
/// Add-ons](<https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting>).
#[prost(string, tag = "1")]
pub header: ::prost::alloc::string::String,
/// All the widgets in the section.
/// Must contain at least one widget.
#[prost(message, repeated, tag = "2")]
pub widgets: ::prost::alloc::vec::Vec<super::Widget>,
/// Indicates whether this section is collapsible.
///
/// Collapsible sections hide some or all widgets, but users can expand the
/// section to reveal the hidden widgets by clicking **Show more**. Users
/// can hide the widgets again by clicking **Show less**.
///
/// To determine which widgets are hidden, specify
/// `uncollapsibleWidgetsCount`.
#[prost(bool, tag = "5")]
pub collapsible: bool,
/// The number of uncollapsible widgets which remain visible even when a
/// section is collapsed.
///
/// For example, when a section
/// contains five widgets and the `uncollapsibleWidgetsCount` is set to `2`,
/// the first two widgets are always shown and the last three are collapsed
/// by default. The `uncollapsibleWidgetsCount` is taken into account only
/// when `collapsible` is `true`.
#[prost(int32, tag = "6")]
pub uncollapsible_widgets_count: i32,
}
/// A card action is the action associated with the card. For example,
/// an invoice card might include actions such as delete invoice, email
/// invoice, or open the invoice in a browser.
///
/// [Google Workspace
/// Add-ons](<https://developers.google.com/workspace/add-ons>):
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CardAction {
/// The label that displays as the action menu item.
#[prost(string, tag = "1")]
pub action_label: ::prost::alloc::string::String,
/// The `onClick` action for this action item.
#[prost(message, optional, tag = "2")]
pub on_click: ::core::option::Option<super::OnClick>,
}
/// A persistent (sticky) footer that that appears at the bottom of the card.
///
/// Setting `fixedFooter` without specifying a `primaryButton` or a
/// `secondaryButton` causes an error.
///
/// For Chat apps, you can use fixed footers in
/// [dialogs](<https://developers.google.com/workspace/chat/dialogs>), but not
/// [card
/// messages](<https://developers.google.com/workspace/chat/create-messages#create>).
/// For an example in Google Chat apps, see [Add a persistent
/// footer](<https://developers.google.com/workspace/chat/design-components-card-dialog#add_a_persistent_footer>).
///
/// [Google Workspace Add-ons and Chat
/// apps](<https://developers.google.com/workspace/extend>):
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CardFixedFooter {
/// The primary button of the fixed footer. The button must be a text button
/// with text and color set.
#[prost(message, optional, boxed, tag = "1")]
pub primary_button: ::core::option::Option<
::prost::alloc::boxed::Box<super::Button>,
>,
/// The secondary button of the fixed footer. The button must be a text
/// button with text and color set.
/// If `secondaryButton` is set, you must also set `primaryButton`.
#[prost(message, optional, boxed, tag = "2")]
pub secondary_button: ::core::option::Option<
::prost::alloc::boxed::Box<super::Button>,
>,
}
/// The divider style of a card. Currently only used for dividers betweens card
/// sections.
///
/// [Google Workspace Add-ons and Chat
/// apps](<https://developers.google.com/workspace/extend>):
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum DividerStyle {
/// Don't use. Unspecified.
Unspecified = 0,
/// Default option. Render a solid divider between sections.
SolidDivider = 1,
/// If set, no divider is rendered between sections.
NoDivider = 2,
}
impl DividerStyle {
/// 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 {
DividerStyle::Unspecified => "DIVIDER_STYLE_UNSPECIFIED",
DividerStyle::SolidDivider => "SOLID_DIVIDER",
DividerStyle::NoDivider => "NO_DIVIDER",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"DIVIDER_STYLE_UNSPECIFIED" => Some(Self::Unspecified),
"SOLID_DIVIDER" => Some(Self::SolidDivider),
"NO_DIVIDER" => Some(Self::NoDivider),
_ => None,
}
}
}
/// In Google Workspace Add-ons,
/// determines how a card is displayed.
///
/// [Google Workspace
/// Add-ons](<https://developers.google.com/workspace/add-ons>):
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum DisplayStyle {
/// Don't use. Unspecified.
Unspecified = 0,
/// The header of the card appears at the bottom of the
/// sidebar, partially covering the current top card of the stack. Clicking
/// the header pops the card into the card stack. If the card has no header,
/// a generated header is used instead.
Peek = 1,
/// Default value. The card is shown by replacing the view of the top card in
/// the card stack.
Replace = 2,
}
impl DisplayStyle {
/// 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 {
DisplayStyle::Unspecified => "DISPLAY_STYLE_UNSPECIFIED",
DisplayStyle::Peek => "PEEK",
DisplayStyle::Replace => "REPLACE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"DISPLAY_STYLE_UNSPECIFIED" => Some(Self::Unspecified),
"PEEK" => Some(Self::Peek),
"REPLACE" => Some(Self::Replace),
_ => None,
}
}
}
}
/// Each card is made up of widgets.
///
/// A widget is a composite object that can represent one of text, images,
/// buttons, and other object types.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Widget {
/// Specifies whether widgets align to the left, right, or center of a column.
#[prost(enumeration = "widget::HorizontalAlignment", tag = "8")]
pub horizontal_alignment: i32,
/// A widget can only have one of the following items. You can use multiple
/// widget fields to display more items.
#[prost(oneof = "widget::Data", tags = "1, 2, 3, 4, 5, 6, 7, 9, 10, 11")]
pub data: ::core::option::Option<widget::Data>,
}
/// Nested message and enum types in `Widget`.
pub mod widget {
/// The shape used to crop the image.
///
/// [Google Workspace Add-ons and Chat
/// apps](<https://developers.google.com/workspace/extend>):
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum ImageType {
/// Default value. Applies a square mask to the image. For example, a 4x3
/// image becomes 3x3.
Square = 0,
/// Applies a circular mask to the image. For example, a 4x3 image becomes a
/// circle with a diameter of 3.
Circle = 1,
}
impl ImageType {
/// 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 {
ImageType::Square => "SQUARE",
ImageType::Circle => "CIRCLE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SQUARE" => Some(Self::Square),
"CIRCLE" => Some(Self::Circle),
_ => None,
}
}
}
/// Specifies whether widgets align to the left, right, or center of a column.
///
/// [Google Chat apps](<https://developers.google.com/workspace/chat>):
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum HorizontalAlignment {
/// Don't use. Unspecified.
Unspecified = 0,
/// Default value. Aligns widgets to the start position of the column. For
/// left-to-right layouts, aligns to the left. For right-to-left layouts,
/// aligns to the right.
Start = 1,
/// Aligns widgets to the center of the column.
Center = 2,
/// Aligns widgets to the end position of the column. For left-to-right
/// layouts, aligns widgets to the right. For right-to-left layouts, aligns
/// widgets to the left.
End = 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::Start => "START",
HorizontalAlignment::Center => "CENTER",
HorizontalAlignment::End => "END",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"HORIZONTAL_ALIGNMENT_UNSPECIFIED" => Some(Self::Unspecified),
"START" => Some(Self::Start),
"CENTER" => Some(Self::Center),
"END" => Some(Self::End),
_ => None,
}
}
}
/// A widget can only have one of the following items. You can use multiple
/// widget fields to display more items.
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Data {
/// Displays a text paragraph. Supports simple HTML formatted text. For more
/// information about formatting text, see
/// [Formatting text in Google Chat
/// apps](<https://developers.google.com/workspace/chat/format-messages#card-formatting>)
/// and
/// [Formatting
/// text in Google Workspace
/// Add-ons](<https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting>).
///
/// For example, the following JSON creates a bolded text:
/// ```
/// "textParagraph": {
/// "text": " <b>bold text</b>"
/// }
/// ```
#[prost(message, tag = "1")]
TextParagraph(super::TextParagraph),
/// Displays an image.
///
/// For example, the following JSON creates an image with alternative text:
/// ```
/// "image": {
/// "imageUrl":
/// "<https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png",>
/// "altText": "Chat app avatar"
/// }
/// ```
#[prost(message, tag = "2")]
Image(super::Image),
/// Displays a decorated text item.
///
/// For example, the following JSON creates a decorated text widget showing
/// email address:
///
/// ```
/// "decoratedText": {
/// "icon": {
/// "knownIcon": "EMAIL"
/// },
/// "topLabel": "Email Address",
/// "text": "sasha@example.com",
/// "bottomLabel": "This is a new Email address!",
/// "switchControl": {
/// "name": "has_send_welcome_email_to_sasha",
/// "selected": false,
/// "controlType": "CHECKBOX"
/// }
/// }
/// ```
#[prost(message, tag = "3")]
DecoratedText(super::DecoratedText),
/// A list of buttons.
///
/// For example, the following JSON creates two buttons. The first
/// is a blue text button and the second is an image button that opens a
/// link:
/// ```
/// "buttonList": {
/// "buttons": [
/// {
/// "text": "Edit",
/// "color": {
/// "red": 0,
/// "green": 0,
/// "blue": 1,
/// "alpha": 1
/// },
/// "disabled": true,
/// },
/// {
/// "icon": {
/// "knownIcon": "INVITE",
/// "altText": "check calendar"
/// },
/// "onClick": {
/// "openLink": {
/// "url": "<https://example.com/calendar">
/// }
/// }
/// }
/// ]
/// }
/// ```
#[prost(message, tag = "4")]
ButtonList(super::ButtonList),
/// Displays a text box that users can type into.
///
/// For example, the following JSON creates a text input for an email
/// address:
///
/// ```
/// "textInput": {
/// "name": "mailing_address",
/// "label": "Mailing Address"
/// }
/// ```
///
/// As another example, the following JSON creates a text input for a
/// programming language with static suggestions:
/// ```
/// "textInput": {
/// "name": "preferred_programing_language",
/// "label": "Preferred Language",
/// "initialSuggestions": {
/// "items": [
/// {
/// "text": "C++"
/// },
/// {
/// "text": "Java"
/// },
/// {
/// "text": "JavaScript"
/// },
/// {
/// "text": "Python"
/// }
/// ]
/// }
/// }
/// ```
#[prost(message, tag = "5")]
TextInput(super::TextInput),
/// Displays a selection control that lets users select items. Selection
/// controls can be checkboxes, radio buttons, switches, or dropdown menus.
///
/// For example, the following JSON creates a dropdown menu that lets users
/// choose a size:
///
/// ```
/// "selectionInput": {
/// "name": "size",
/// "label": "Size"
/// "type": "DROPDOWN",
/// "items": [
/// {
/// "text": "S",
/// "value": "small",
/// "selected": false
/// },
/// {
/// "text": "M",
/// "value": "medium",
/// "selected": true
/// },
/// {
/// "text": "L",
/// "value": "large",
/// "selected": false
/// },
/// {
/// "text": "XL",
/// "value": "extra_large",
/// "selected": false
/// }
/// ]
/// }
/// ```
#[prost(message, tag = "6")]
SelectionInput(super::SelectionInput),
/// Displays a widget that lets users input a date, time, or date and time.
///
/// For example, the following JSON creates a date time picker to schedule an
/// appointment:
///
///
/// ```
/// "dateTimePicker": {
/// "name": "appointment_time",
/// "label": "Book your appointment at:",
/// "type": "DATE_AND_TIME",
/// "valueMsEpoch": "796435200000"
/// }
/// ```
#[prost(message, tag = "7")]
DateTimePicker(super::DateTimePicker),
/// Displays a horizontal line divider between widgets.
///
/// For example, the following JSON creates a divider:
/// ```
/// "divider": {
/// }
/// ```
#[prost(message, tag = "9")]
Divider(super::Divider),
/// Displays a grid with a collection of items.
///
/// A grid supports any number of columns and items. The number of rows is
/// determined by the upper bounds of the number items divided by the number
/// of columns. A grid with 10 items and 2 columns has 5 rows. A grid with 11
/// items and 2 columns has 6 rows.
///
/// [Google Workspace Add-ons and
/// Chat apps](<https://developers.google.com/workspace/extend>):
///
/// For example, the following JSON creates a 2 column grid with a single
/// item:
///
/// ```
/// "grid": {
/// "title": "A fine collection of items",
/// "columnCount": 2,
/// "borderStyle": {
/// "type": "STROKE",
/// "cornerRadius": 4
/// },
/// "items": [
/// {
/// "image": {
/// "imageUri": "<https://www.example.com/image.png",>
/// "cropStyle": {
/// "type": "SQUARE"
/// },
/// "borderStyle": {
/// "type": "STROKE"
/// }
/// },
/// "title": "An item",
/// "textAlignment": "CENTER"
/// }
/// ],
/// "onClick": {
/// "openLink": {
/// "url": "<https://www.example.com">
/// }
/// }
/// }
/// ```
#[prost(message, tag = "10")]
Grid(super::Grid),
/// Displays up to 2 columns.
///
/// To include more than 2 columns, or to use rows, use the `Grid` widget.
///
/// For example, the following JSON creates 2 columns that each contain
/// text paragraphs:
///
/// ```
/// "columns": {
/// "columnItems": [
/// {
/// "horizontalSizeStyle": "FILL_AVAILABLE_SPACE",
/// "horizontalAlignment": "CENTER",
/// "verticalAlignment": "CENTER",
/// "widgets": [
/// {
/// "textParagraph": {
/// "text": "First column text paragraph"
/// }
/// }
/// ]
/// },
/// {
/// "horizontalSizeStyle": "FILL_AVAILABLE_SPACE",
/// "horizontalAlignment": "CENTER",
/// "verticalAlignment": "CENTER",
/// "widgets": [
/// {
/// "textParagraph": {
/// "text": "Second column text paragraph"
/// }
/// }
/// ]
/// }
/// ]
/// }
/// ```
#[prost(message, tag = "11")]
Columns(super::Columns),
}
}
/// A paragraph of text that supports formatting. For an example in
/// Google Chat apps, see [Add a paragraph of formatted
/// text](<https://developers.google.com/workspace/chat/add-text-image-card-dialog#add_a_paragraph_of_formatted_text>).
/// For more information
/// about formatting text, see
/// [Formatting text in Google Chat
/// apps](<https://developers.google.com/workspace/chat/format-messages#card-formatting>)
/// and
/// [Formatting
/// text in Google Workspace
/// Add-ons](<https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting>).
///
/// [Google Workspace Add-ons and
/// Chat apps](<https://developers.google.com/workspace/extend>):
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TextParagraph {
/// The text that's shown in the widget.
#[prost(string, tag = "1")]
pub text: ::prost::alloc::string::String,
}
/// An image that is specified by a URL and can have an `onClick` action. For an
/// example, see [Add an
/// image](<https://developers.google.com/workspace/chat/add-text-image-card-dialog#add_an_image>).
///
/// [Google Workspace Add-ons and Chat
/// apps](<https://developers.google.com/workspace/extend>):
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Image {
/// The HTTPS URL that hosts the image.
///
/// For example:
///
/// ```
/// <https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png>
/// ```
#[prost(string, tag = "1")]
pub image_url: ::prost::alloc::string::String,
/// When a user clicks the image, the click triggers this action.
#[prost(message, optional, tag = "2")]
pub on_click: ::core::option::Option<OnClick>,
/// The alternative text of this image that's used for accessibility.
#[prost(string, tag = "3")]
pub alt_text: ::prost::alloc::string::String,
}
/// Displays a divider between widgets as a horizontal line. For an example in
/// Google Chat apps, see
/// [Add a horizontal divider between
/// widgets](<https://developers.google.com/workspace/chat/format-structure-card-dialog#add_a_horizontal_divider_between_widgets>).
///
/// [Google Workspace Add-ons and Chat
/// apps](<https://developers.google.com/workspace/extend>):
///
/// For example, the following JSON creates a divider:
///
/// ```
/// "divider": {}
/// ```
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Divider {}
/// A widget that displays text with optional decorations such as a label above
/// or below the text, an icon in front of the text, a selection widget, or a
/// button after the text. For an example in
/// Google Chat apps, see [Display text with decorative
/// text](<https://developers.google.com/workspace/chat/add-text-image-card-dialog#display_text_with_decorative_elements>).
///
/// [Google Workspace Add-ons and Chat
/// apps](<https://developers.google.com/workspace/extend>):
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DecoratedText {
/// Deprecated in favor of `startIcon`.
#[deprecated]
#[prost(message, optional, tag = "1")]
pub icon: ::core::option::Option<Icon>,
/// The icon displayed in front of the text.
#[prost(message, optional, tag = "12")]
pub start_icon: ::core::option::Option<Icon>,
/// The text that appears above `text`. Always truncates.
#[prost(string, tag = "3")]
pub top_label: ::prost::alloc::string::String,
/// Required. The primary text.
///
/// Supports simple formatting. For more information
/// about formatting text, see
/// [Formatting text in Google Chat
/// apps](<https://developers.google.com/workspace/chat/format-messages#card-formatting>)
/// and
/// [Formatting
/// text in Google Workspace
/// Add-ons](<https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting>).
#[prost(string, tag = "4")]
pub text: ::prost::alloc::string::String,
/// The wrap text setting. If `true`, the text wraps and displays on
/// multiple lines. Otherwise, the text is truncated.
///
/// Only applies to `text`, not `topLabel` and `bottomLabel`.
#[prost(bool, tag = "5")]
pub wrap_text: bool,
/// The text that appears below `text`. Always wraps.
#[prost(string, tag = "6")]
pub bottom_label: ::prost::alloc::string::String,
/// This action is triggered when users click `topLabel` or `bottomLabel`.
#[prost(message, optional, tag = "7")]
pub on_click: ::core::option::Option<OnClick>,
/// A button, switch, checkbox, or image that appears to the right-hand side
/// of text in the `decoratedText` widget.
#[prost(oneof = "decorated_text::Control", tags = "8, 9, 11")]
pub control: ::core::option::Option<decorated_text::Control>,
}
/// Nested message and enum types in `DecoratedText`.
pub mod decorated_text {
/// Either a toggle-style switch or a checkbox inside a `decoratedText` widget.
///
/// [Google Workspace Add-ons and Chat
/// apps](<https://developers.google.com/workspace/extend>):
///
/// Only supported in the `decoratedText` widget.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SwitchControl {
/// The name by which the switch widget is identified in a form input event.
///
/// For details about working with form inputs, see [Receive form
/// data](<https://developers.google.com/workspace/chat/read-form-data>).
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// The value entered by a user, returned as part of a form input event.
///
/// For details about working with form inputs, see [Receive form
/// data](<https://developers.google.com/workspace/chat/read-form-data>).
#[prost(string, tag = "2")]
pub value: ::prost::alloc::string::String,
/// When `true`, the switch is selected.
#[prost(bool, tag = "3")]
pub selected: bool,
/// The action to perform when the switch state is changed, such as what
/// function to run.
#[prost(message, optional, tag = "4")]
pub on_change_action: ::core::option::Option<super::Action>,
/// How the switch appears in the user interface.
///
/// [Google Workspace Add-ons
/// and Chat apps](<https://developers.google.com/workspace/extend>):
#[prost(enumeration = "switch_control::ControlType", tag = "5")]
pub control_type: i32,
}
/// Nested message and enum types in `SwitchControl`.
pub mod switch_control {
/// How the switch appears in the user interface.
///
/// [Google Workspace Add-ons
/// and Chat apps](<https://developers.google.com/workspace/extend>):
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum ControlType {
/// A toggle-style switch.
Switch = 0,
/// Deprecated in favor of `CHECK_BOX`.
Checkbox = 1,
/// A checkbox.
CheckBox = 2,
}
impl ControlType {
/// 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 {
ControlType::Switch => "SWITCH",
ControlType::Checkbox => "CHECKBOX",
ControlType::CheckBox => "CHECK_BOX",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SWITCH" => Some(Self::Switch),
"CHECKBOX" => Some(Self::Checkbox),
"CHECK_BOX" => Some(Self::CheckBox),
_ => None,
}
}
}
}
/// A button, switch, checkbox, or image that appears to the right-hand side
/// of text in the `decoratedText` widget.
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Control {
/// A button that a user can click to trigger an action.
#[prost(message, tag = "8")]
Button(super::Button),
/// A switch widget that a user can click to change its state and trigger an
/// action.
#[prost(message, tag = "9")]
SwitchControl(SwitchControl),
/// An icon displayed after the text.
///
/// Supports
/// [built-in](<https://developers.google.com/workspace/chat/format-messages#builtinicons>)
/// and
/// [custom](<https://developers.google.com/workspace/chat/format-messages#customicons>)
/// icons.
#[prost(message, tag = "11")]
EndIcon(super::Icon),
}
}
/// A field in which users can enter text. Supports suggestions and on-change
/// actions. For an example in Google Chat apps, see [Add a field in which a user
/// can enter
/// text](<https://developers.google.com/workspace/chat/design-interactive-card-dialog#add_a_field_in_which_a_user_can_enter_text>).
///
/// Chat apps receive and can process the value of entered text during form input
/// events. For details about working with form inputs, see [Receive form
/// data](<https://developers.google.com/workspace/chat/read-form-data>).
///
/// When you need to collect undefined or abstract data from users,
/// use a text input. To collect defined or enumerated data from users, use the
/// [SelectionInput][google.apps.card.v1.SelectionInput] widget.
///
/// [Google Workspace Add-ons and Chat
/// apps](<https://developers.google.com/workspace/extend>):
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TextInput {
/// The name by which the text input is identified in a form input event.
///
/// For details about working with form inputs, see [Receive form
/// data](<https://developers.google.com/workspace/chat/read-form-data>).
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// The text that appears above the text input field in the user interface.
///
/// Specify text that helps the user enter the information your app needs.
/// For example, if you are asking someone's name, but specifically need their
/// surname, write `surname` instead of `name`.
///
/// Required if `hintText` is unspecified. Otherwise, optional.
#[prost(string, tag = "2")]
pub label: ::prost::alloc::string::String,
/// Text that appears below the text input field meant to assist users by
/// prompting them to enter a certain value. This text is always visible.
///
/// Required if `label` is unspecified. Otherwise, optional.
#[prost(string, tag = "3")]
pub hint_text: ::prost::alloc::string::String,
/// The value entered by a user, returned as part of a form input event.
///
/// For details about working with form inputs, see [Receive form
/// data](<https://developers.google.com/workspace/chat/read-form-data>).
#[prost(string, tag = "4")]
pub value: ::prost::alloc::string::String,
/// How a text input field appears in the user interface.
/// For example, whether the field is single or multi-line.
#[prost(enumeration = "text_input::Type", tag = "5")]
pub r#type: i32,
/// What to do when a change occurs in the text input field. For example, a
/// user adding to the field or deleting text.
///
/// Examples of actions to take include running a custom function or opening
/// a [dialog](<https://developers.google.com/workspace/chat/dialogs>)
/// in Google Chat.
#[prost(message, optional, tag = "6")]
pub on_change_action: ::core::option::Option<Action>,
/// Suggested values that users can enter. These values appear when users click
/// inside the text input field. As users type, the suggested values
/// dynamically filter to match what the users have typed.
///
/// For example, a text input field for programming language might suggest
/// Java, JavaScript, Python, and C++. When users start typing `Jav`, the list
/// of suggestions filters to show just `Java` and `JavaScript`.
///
/// Suggested values help guide users to enter values that your app can make
/// sense of. When referring to JavaScript, some users might enter `javascript`
/// and others `java script`. Suggesting `JavaScript` can standardize how users
/// interact with your app.
///
/// When specified, `TextInput.type` is always `SINGLE_LINE`, even if it's set
/// to `MULTIPLE_LINE`.
///
/// [Google Workspace
/// Add-ons and Chat apps](<https://developers.google.com/workspace/extend>):
#[prost(message, optional, tag = "7")]
pub initial_suggestions: ::core::option::Option<Suggestions>,
/// Optional. Specify what action to take when the text input field provides
/// suggestions to users who interact with it.
///
/// If unspecified, the suggestions are set by `initialSuggestions` and
/// are processed by the client.
///
/// If specified, the app takes the action specified here, such as running
/// a custom function.
///
/// [Google Workspace
/// Add-ons](<https://developers.google.com/workspace/add-ons>):
#[prost(message, optional, tag = "8")]
pub auto_complete_action: ::core::option::Option<Action>,
/// Text that appears in the text input field when the field is empty.
/// Use this text to prompt users to enter a value. For example, `Enter a
/// number from 0 to 100`.
///
/// [Google Chat apps](<https://developers.google.com/workspace/chat>):
#[prost(string, tag = "12")]
pub placeholder_text: ::prost::alloc::string::String,
}
/// Nested message and enum types in `TextInput`.
pub mod text_input {
/// How a text input field appears in the user interface. For example,
/// whether it's a single line input field, or a multi-line input. If
/// `initialSuggestions` is specified, `type` is always `SINGLE_LINE`,
/// even if it's set to `MULTIPLE_LINE`.
///
/// [Google Workspace Add-ons and Chat
/// apps](<https://developers.google.com/workspace/extend>):
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Type {
/// The text input field has a fixed height of one line.
SingleLine = 0,
/// The text input field has a fixed height of multiple lines.
MultipleLine = 1,
}
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::SingleLine => "SINGLE_LINE",
Type::MultipleLine => "MULTIPLE_LINE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SINGLE_LINE" => Some(Self::SingleLine),
"MULTIPLE_LINE" => Some(Self::MultipleLine),
_ => None,
}
}
}
}
/// Suggested values that users can enter. These values appear when users click
/// inside the text input field. As users type, the suggested values
/// dynamically filter to match what the users have typed.
///
/// For example, a text input field for programming language might suggest
/// Java, JavaScript, Python, and C++. When users start typing `Jav`, the list
/// of suggestions filters to show `Java` and `JavaScript`.
///
/// Suggested values help guide users to enter values that your app can make
/// sense of. When referring to JavaScript, some users might enter `javascript`
/// and others `java script`. Suggesting `JavaScript` can standardize how users
/// interact with your app.
///
/// When specified, `TextInput.type` is always `SINGLE_LINE`, even if it's set
/// to `MULTIPLE_LINE`.
///
/// [Google Workspace
/// Add-ons and Chat apps](<https://developers.google.com/workspace/extend>):
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Suggestions {
/// A list of suggestions used for autocomplete recommendations in text input
/// fields.
#[prost(message, repeated, tag = "1")]
pub items: ::prost::alloc::vec::Vec<suggestions::SuggestionItem>,
}
/// Nested message and enum types in `Suggestions`.
pub mod suggestions {
/// One suggested value that users can enter in a text input field.
///
/// [Google Workspace Add-ons and Chat
/// apps](<https://developers.google.com/workspace/extend>):
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SuggestionItem {
#[prost(oneof = "suggestion_item::Content", tags = "1")]
pub content: ::core::option::Option<suggestion_item::Content>,
}
/// Nested message and enum types in `SuggestionItem`.
pub mod suggestion_item {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Content {
/// The value of a suggested input to a text input field. This is
/// equivalent to what users enter themselves.
#[prost(string, tag = "1")]
Text(::prost::alloc::string::String),
}
}
}
/// A list of buttons layed out horizontally. For an example in
/// Google Chat apps, see
/// [Add a
/// button](<https://developers.google.com/workspace/chat/design-interactive-card-dialog#add_a_button>).
///
/// [Google Workspace Add-ons and Chat
/// apps](<https://developers.google.com/workspace/extend>):
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ButtonList {
/// An array of buttons.
#[prost(message, repeated, tag = "1")]
pub buttons: ::prost::alloc::vec::Vec<Button>,
}
/// A widget that creates one or more UI items that users can select.
/// For example, a dropdown menu or checkboxes. You can use this widget to
/// collect data that can be predicted or enumerated. For an example in Google
/// Chat apps, see [Add selectable UI
/// elements](/workspace/chat/design-interactive-card-dialog#add_selectable_ui_elements).
///
/// Chat apps can process the value of items that users select or input. For
/// details about working with form inputs, see [Receive form
/// data](<https://developers.google.com/workspace/chat/read-form-data>).
///
/// To collect undefined or abstract data from users, use
/// the [TextInput][google.apps.card.v1.TextInput] widget.
///
/// [Google Workspace Add-ons
/// and Chat apps](<https://developers.google.com/workspace/extend>):
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SelectionInput {
/// The name that identifies the selection input in a form input event.
///
/// For details about working with form inputs, see [Receive form
/// data](<https://developers.google.com/workspace/chat/read-form-data>).
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// The text that appears above the selection input field in the user
/// interface.
///
/// Specify text that helps the user enter the information your app needs.
/// For example, if users are selecting the urgency of a work ticket from a
/// drop-down menu, the label might be "Urgency" or "Select urgency".
#[prost(string, tag = "2")]
pub label: ::prost::alloc::string::String,
/// The type of items that are displayed to users in a `SelectionInput` widget.
/// Selection types support different types of interactions. For example, users
/// can select one or more checkboxes, but they can only select one value from
/// a dropdown menu.
#[prost(enumeration = "selection_input::SelectionType", tag = "3")]
pub r#type: i32,
/// An array of selectable items. For example, an array of radio buttons or
/// checkboxes. Supports up to 100 items.
#[prost(message, repeated, tag = "4")]
pub items: ::prost::alloc::vec::Vec<selection_input::SelectionItem>,
/// If specified, the form is submitted when the selection changes. If not
/// specified, you must specify a separate button that submits the form.
///
/// For details about working with form inputs, see [Receive form
/// data](<https://developers.google.com/workspace/chat/read-form-data>).
#[prost(message, optional, tag = "5")]
pub on_change_action: ::core::option::Option<Action>,
/// For multiselect menus, the maximum number of items that a user can select.
/// Minimum value is 1 item. If unspecified, defaults to 3 items.
#[prost(int32, tag = "6")]
pub multi_select_max_selected_items: i32,
/// For multiselect menus, the number of text characters that a user inputs
/// before the app queries autocomplete and displays suggested items
/// in the menu.
///
/// If unspecified, defaults to 0 characters for static data sources and 3
/// characters for external data sources.
#[prost(int32, tag = "7")]
pub multi_select_min_query_length: i32,
/// For a multiselect menu, the data source that populates
/// selection items.
///
/// [Google Chat apps](<https://developers.google.com/workspace/chat>):
#[prost(oneof = "selection_input::MultiSelectDataSource", tags = "8, 9")]
pub multi_select_data_source: ::core::option::Option<
selection_input::MultiSelectDataSource,
>,
}
/// Nested message and enum types in `SelectionInput`.
pub mod selection_input {
/// An item that users can select in a selection input, such as a checkbox
/// or switch.
///
/// [Google Workspace Add-ons and Chat
/// apps](<https://developers.google.com/workspace/extend>):
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SelectionItem {
/// The text that identifies or describes the item to users.
#[prost(string, tag = "1")]
pub text: ::prost::alloc::string::String,
/// The value associated with this item. The client should use this as a form
/// input value.
///
/// For details about working with form inputs, see [Receive form
/// data](<https://developers.google.com/workspace/chat/read-form-data>).
#[prost(string, tag = "2")]
pub value: ::prost::alloc::string::String,
/// Whether the item is selected by default. If the selection input only
/// accepts one value (such as for radio buttons or a dropdown menu), only
/// set this field for one item.
#[prost(bool, tag = "3")]
pub selected: bool,
/// For multiselect menus, the URL for the icon displayed next to
/// the item's `text` field. Supports PNG and JPEG files. Must be an `HTTPS`
/// URL. For example,
/// `<https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png`.>
#[prost(string, tag = "4")]
pub start_icon_uri: ::prost::alloc::string::String,
/// For multiselect menus, a text description or label that's
/// displayed below the item's `text` field.
#[prost(string, tag = "5")]
pub bottom_text: ::prost::alloc::string::String,
}
/// For a
/// [`SelectionInput`][google.apps.card.v1.SelectionInput] widget that uses a
/// multiselect menu, a data source from Google Workspace. Used to populate
/// items in a multiselect menu.
///
/// [Google Chat apps](<https://developers.google.com/workspace/chat>):
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct PlatformDataSource {
/// The data source.
#[prost(oneof = "platform_data_source::DataSource", tags = "1")]
pub data_source: ::core::option::Option<platform_data_source::DataSource>,
}
/// Nested message and enum types in `PlatformDataSource`.
pub mod platform_data_source {
/// A data source shared by all [Google Workspace
/// applications]
/// (<https://developers.google.com/workspace/chat/api/reference/rest/v1/HostApp>).
///
/// [Google Chat apps](<https://developers.google.com/workspace/chat>):
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum CommonDataSource {
/// Default value. Don't use.
Unknown = 0,
/// Google Workspace users. The user can only view and select users from
/// their Google Workspace organization.
User = 1,
}
impl CommonDataSource {
/// 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 {
CommonDataSource::Unknown => "UNKNOWN",
CommonDataSource::User => "USER",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNKNOWN" => Some(Self::Unknown),
"USER" => Some(Self::User),
_ => None,
}
}
}
/// The data source.
#[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
pub enum DataSource {
/// A data source shared by all Google Workspace applications, such as
/// users in a Google Workspace organization.
#[prost(enumeration = "CommonDataSource", tag = "1")]
CommonDataSource(i32),
}
}
/// The format for the items that users can select. Different options support
/// different types of interactions. For example, users can select multiple
/// checkboxes, but can only select one item from a dropdown menu.
///
/// Each selection input supports one type of selection. Mixing checkboxes
/// and switches, for example, isn't supported.
///
/// [Google Workspace Add-ons and Chat
/// apps](<https://developers.google.com/workspace/extend>):
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum SelectionType {
/// A set of checkboxes. Users can select one or more checkboxes.
CheckBox = 0,
/// A set of radio buttons. Users can select one radio button.
RadioButton = 1,
/// A set of switches. Users can turn on one or more switches.
Switch = 2,
/// A dropdown menu. Users can select one item from the menu.
Dropdown = 3,
/// A multiselect menu for static or dynamic data. From the menu bar,
/// users select one or more items. Users can also input values to populate
/// dynamic data. For example, users can start typing the name of a Google
/// Chat space and the widget autosuggests the space.
///
/// To populate items for a multiselect menu, you can use one of the
/// following types of data sources:
///
/// * Static data: Items are specified as `SelectionItem` objects in the
/// widget. Up to 100 items.
/// * Google Workspace data: Items are populated using data from Google
/// Workspace, such as Google Workspace users or Google Chat spaces.
/// * External data: Items are populated from an external data
/// source outside of Google Workspace.
///
/// For examples of how to implement multiselect menus, see
/// [Add a multiselect
/// menu](<https://developers.google.com/workspace/chat/design-interactive-card-dialog#multiselect-menu>).
///
/// [Google Workspace Add-ons and Chat
/// apps](<https://developers.google.com/workspace/extend>):
/// Multiselect for Google Workspace Add-ons are in
/// Developer Preview.
MultiSelect = 4,
}
impl SelectionType {
/// 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 {
SelectionType::CheckBox => "CHECK_BOX",
SelectionType::RadioButton => "RADIO_BUTTON",
SelectionType::Switch => "SWITCH",
SelectionType::Dropdown => "DROPDOWN",
SelectionType::MultiSelect => "MULTI_SELECT",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"CHECK_BOX" => Some(Self::CheckBox),
"RADIO_BUTTON" => Some(Self::RadioButton),
"SWITCH" => Some(Self::Switch),
"DROPDOWN" => Some(Self::Dropdown),
"MULTI_SELECT" => Some(Self::MultiSelect),
_ => None,
}
}
}
/// For a multiselect menu, the data source that populates
/// selection items.
///
/// [Google Chat apps](<https://developers.google.com/workspace/chat>):
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum MultiSelectDataSource {
/// An external data source, such as a relational data base.
#[prost(message, tag = "8")]
ExternalDataSource(super::Action),
/// A data source from Google Workspace.
#[prost(message, tag = "9")]
PlatformDataSource(PlatformDataSource),
}
}
/// Lets users input a date, a time, or both a date and a time. For an example in
/// Google Chat apps, see [Let a user pick a date and
/// time](<https://developers.google.com/workspace/chat/design-interactive-card-dialog#let_a_user_pick_a_date_and_time>).
///
/// Users can input text or use the picker to select dates and times. If users
/// input an invalid date or time, the picker shows an error that prompts users
/// to input the information correctly.
///
/// [Google Workspace
/// Add-ons and Chat apps](<https://developers.google.com/workspace/extend>):
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DateTimePicker {
/// The name by which the `DateTimePicker` is identified in a form input event.
///
/// For details about working with form inputs, see [Receive form
/// data](<https://developers.google.com/workspace/chat/read-form-data>).
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// The text that prompts users to input a date, a time, or a date and time.
/// For example, if users are scheduling an appointment, use a label such as
/// `Appointment date` or `Appointment date and time`.
#[prost(string, tag = "2")]
pub label: ::prost::alloc::string::String,
/// Whether the widget supports inputting a date, a time, or the date and time.
#[prost(enumeration = "date_time_picker::DateTimePickerType", tag = "3")]
pub r#type: i32,
/// The default value displayed in the widget, in milliseconds since [Unix
/// epoch time](<https://en.wikipedia.org/wiki/Unix_time>).
///
/// Specify the value based on the type of picker (`DateTimePickerType`):
///
/// * `DATE_AND_TIME`: a calendar date and time in UTC. For example, to
/// represent January 1, 2023 at 12:00 PM UTC, use `1672574400000`.
/// * `DATE_ONLY`: a calendar date at 00:00:00 UTC. For example, to represent
/// January 1, 2023, use `1672531200000`.
/// * `TIME_ONLY`: a time in UTC. For example, to represent 12:00 PM, use
/// `43200000` (or `12 * 60 * 60 * 1000`).
#[prost(int64, tag = "4")]
pub value_ms_epoch: i64,
/// The number representing the time zone offset from UTC, in minutes.
/// If set, the `value_ms_epoch` is displayed in the specified time zone.
/// If unset, the value defaults to the user's time zone setting.
#[prost(int32, tag = "5")]
pub timezone_offset_date: i32,
/// Triggered when the user clicks **Save** or **Clear** from the
/// `DateTimePicker` interface.
#[prost(message, optional, tag = "6")]
pub on_change_action: ::core::option::Option<Action>,
}
/// Nested message and enum types in `DateTimePicker`.
pub mod date_time_picker {
/// The format for the date and time in the `DateTimePicker` widget.
/// Determines whether users can input a date, a time, or both a date and time.
///
/// [Google Workspace Add-ons and Chat
/// apps](<https://developers.google.com/workspace/extend>):
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum DateTimePickerType {
/// Users input a date and time.
DateAndTime = 0,
/// Users input a date.
DateOnly = 1,
/// Users input a time.
TimeOnly = 2,
}
impl DateTimePickerType {
/// 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 {
DateTimePickerType::DateAndTime => "DATE_AND_TIME",
DateTimePickerType::DateOnly => "DATE_ONLY",
DateTimePickerType::TimeOnly => "TIME_ONLY",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"DATE_AND_TIME" => Some(Self::DateAndTime),
"DATE_ONLY" => Some(Self::DateOnly),
"TIME_ONLY" => Some(Self::TimeOnly),
_ => None,
}
}
}
}
/// A text, icon, or text and icon button that users can click. For an example in
/// Google Chat apps, see
/// [Add a
/// button](<https://developers.google.com/workspace/chat/design-interactive-card-dialog#add_a_button>).
///
/// To make an image a clickable button, specify an
/// [`Image`][google.apps.card.v1.Image] (not an
/// [`ImageComponent`][google.apps.card.v1.ImageComponent]) and set an
/// `onClick` action.
///
/// [Google Workspace
/// Add-ons and Chat apps](<https://developers.google.com/workspace/extend>):
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Button {
/// The text displayed inside the button.
#[prost(string, tag = "1")]
pub text: ::prost::alloc::string::String,
/// The icon image. If both `icon` and `text` are set, then the icon appears
/// before the text.
#[prost(message, optional, tag = "2")]
pub icon: ::core::option::Option<Icon>,
/// If set, the button is filled with a solid background color and the font
/// color changes to maintain contrast with the background color. For example,
/// setting a blue background likely results in white text.
///
/// If unset, the image background is white and the font color is blue.
///
/// For red, green, and blue, the value of each field is a `float` number that
/// you can express in either of two ways: as a number between 0 and 255
/// divided by 255 (153/255), or as a value between 0 and 1 (0.6). 0 represents
/// the absence of a color and 1 or 255/255 represent the full presence of that
/// color on the RGB scale.
///
/// Optionally set `alpha`, which sets a level of transparency using this
/// equation:
///
/// ```
/// pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
/// ```
///
/// For `alpha`, a value of `1` corresponds with a solid color, and a value of
/// `0` corresponds with a completely transparent color.
///
/// For example, the following color represents a half transparent red:
///
/// ```
/// "color": {
/// "red": 1,
/// "green": 0,
/// "blue": 0,
/// "alpha": 0.5
/// }
/// ```
#[prost(message, optional, tag = "3")]
pub color: ::core::option::Option<super::super::super::r#type::Color>,
/// Required. The action to perform when a user clicks the button, such as
/// opening a hyperlink or running a custom function.
#[prost(message, optional, boxed, tag = "4")]
pub on_click: ::core::option::Option<::prost::alloc::boxed::Box<OnClick>>,
/// If `true`, the button is displayed in an inactive state and doesn't respond
/// to user actions.
#[prost(bool, tag = "5")]
pub disabled: bool,
/// The alternative text that's used for accessibility.
///
/// Set descriptive text that lets users know what the button does. For
/// example, if a button opens a hyperlink, you might write: "Opens a new
/// browser tab and navigates to the Google Chat developer documentation at
/// <https://developers.google.com/workspace/chat".>
#[prost(string, tag = "6")]
pub alt_text: ::prost::alloc::string::String,
}
/// An icon displayed in a widget on a card. For an example in Google Chat apps,
/// see [Add an
/// icon](<https://developers.google.com/workspace/chat/add-text-image-card-dialog#add_an_icon>).
///
/// Supports
/// [built-in](<https://developers.google.com/workspace/chat/format-messages#builtinicons>)
/// and
/// [custom](<https://developers.google.com/workspace/chat/format-messages#customicons>)
/// icons.
///
/// [Google Workspace Add-ons and Chat
/// apps](<https://developers.google.com/workspace/extend>):
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Icon {
/// Optional. A description of the icon used for accessibility.
/// If unspecified, the default value `Button` is provided. As a best practice,
/// you should set a helpful description for what the icon displays, and if
/// applicable, what it does. For example, `A user's account portrait`, or
/// `Opens a new browser tab and navigates to the Google Chat developer
/// documentation at <https://developers.google.com/workspace/chat`.>
///
/// If the icon is set in a [`Button`][google.apps.card.v1.Button], the
/// `altText` appears as helper text when the user hovers over the button.
/// However, if the button also sets `text`, the icon's `altText` is ignored.
#[prost(string, tag = "3")]
pub alt_text: ::prost::alloc::string::String,
/// The crop style applied to the image. In some cases, applying a
/// `CIRCLE` crop causes the image to be drawn larger than a built-in
/// icon.
#[prost(enumeration = "widget::ImageType", tag = "4")]
pub image_type: i32,
/// The icon displayed in the widget on the card.
#[prost(oneof = "icon::Icons", tags = "1, 2, 5")]
pub icons: ::core::option::Option<icon::Icons>,
}
/// Nested message and enum types in `Icon`.
pub mod icon {
/// The icon displayed in the widget on the card.
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Icons {
/// Display one of the built-in icons provided by Google Workspace.
///
/// For example, to display an airplane icon, specify `AIRPLANE`.
/// For a bus, specify `BUS`.
///
/// For a full list of supported icons, see [built-in
/// icons](<https://developers.google.com/workspace/chat/format-messages#builtinicons>).
#[prost(string, tag = "1")]
KnownIcon(::prost::alloc::string::String),
/// Display a custom icon hosted at an HTTPS URL.
///
/// For example:
///
/// ```
/// "iconUrl":
/// "<https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png">
/// ```
///
/// Supported file types include `.png` and `.jpg`.
#[prost(string, tag = "2")]
IconUrl(::prost::alloc::string::String),
/// Display one of the [Google Material
/// Icons](<https://fonts.google.com/icons>).
///
/// For example, to display a [checkbox
/// icon](<https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Acheck_box%3AFILL%400%3Bwght%40400%3BGRAD%400%3Bopsz%4048>),
/// use
/// ```
/// "material_icon": {
/// "name": "check_box"
/// }
/// ```
///
/// [Google Chat apps](<https://developers.google.com/workspace/chat>):
#[prost(message, tag = "5")]
MaterialIcon(super::MaterialIcon),
}
}
/// A [Google Material Icon](<https://fonts.google.com/icons>), which includes over
/// 2500+ options.
///
/// For example, to display a [checkbox
/// icon](<https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Acheck_box%3AFILL%400%3Bwght%40400%3BGRAD%400%3Bopsz%4048>)
/// with customized weight and grade, write the following:
///
/// ```
/// {
/// "name": "check_box",
/// "fill": true,
/// "weight": 300,
/// "grade": -25
/// }
/// ```
///
/// [Google Chat apps](<https://developers.google.com/workspace/chat>):
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MaterialIcon {
/// The icon name defined in the [Google Material
/// Icon](<https://fonts.google.com/icons>), for example, `check_box`. Any
/// invalid names are abandoned and replaced with empty string and
/// results in the icon failing to render.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Whether the icon renders as filled. Default value is false.
///
/// To preview different icon settings, go to
/// [Google Font Icons](<https://fonts.google.com/icons>) and adjust the
/// settings under **Customize**.
#[prost(bool, tag = "2")]
pub fill: bool,
/// The stroke weight of the icon. Choose from {100, 200, 300, 400,
/// 500, 600, 700}. If absent, default value is 400. If any other value is
/// specified, the default value is used.
///
/// To preview different icon settings, go to
/// [Google Font Icons](<https://fonts.google.com/icons>) and adjust the
/// settings under **Customize**.
#[prost(int32, tag = "3")]
pub weight: i32,
/// Weight and grade affect a symbol’s thickness. Adjustments to grade are more
/// granular than adjustments to weight and have a small impact on the size of
/// the symbol. Choose from {-25, 0, 200}. If absent, default value is 0. If
/// any other value is specified, the default value is used.
///
/// To preview different icon settings, go to
/// [Google Font Icons](<https://fonts.google.com/icons>) and adjust the
/// settings under **Customize**.
#[prost(int32, tag = "4")]
pub grade: i32,
}
/// Represents the crop style applied to an image.
///
/// [Google Workspace Add-ons and
/// Chat apps](<https://developers.google.com/workspace/extend>):
///
/// For example, here's how to apply a 16:9 aspect ratio:
///
/// ```
/// cropStyle {
/// "type": "RECTANGLE_CUSTOM",
/// "aspectRatio": 16/9
/// }
/// ```
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ImageCropStyle {
/// The crop type.
#[prost(enumeration = "image_crop_style::ImageCropType", tag = "1")]
pub r#type: i32,
/// The aspect ratio to use if the crop type is `RECTANGLE_CUSTOM`.
///
/// For example, here's how to apply a 16:9 aspect ratio:
///
/// ```
/// cropStyle {
/// "type": "RECTANGLE_CUSTOM",
/// "aspectRatio": 16/9
/// }
/// ```
#[prost(double, tag = "2")]
pub aspect_ratio: f64,
}
/// Nested message and enum types in `ImageCropStyle`.
pub mod image_crop_style {
/// Represents the crop style applied to an image.
///
/// [Google Workspace Add-ons
/// and Chat apps](<https://developers.google.com/workspace/extend>):
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum ImageCropType {
/// Don't use. Unspecified.
Unspecified = 0,
/// Default value. Applies a square crop.
Square = 1,
/// Applies a circular crop.
Circle = 2,
/// Applies a rectangular crop with a custom aspect ratio. Set the custom
/// aspect ratio with `aspectRatio`.
RectangleCustom = 3,
/// Applies a rectangular crop with a 4:3 aspect ratio.
Rectangle43 = 4,
}
impl ImageCropType {
/// 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 {
ImageCropType::Unspecified => "IMAGE_CROP_TYPE_UNSPECIFIED",
ImageCropType::Square => "SQUARE",
ImageCropType::Circle => "CIRCLE",
ImageCropType::RectangleCustom => "RECTANGLE_CUSTOM",
ImageCropType::Rectangle43 => "RECTANGLE_4_3",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"IMAGE_CROP_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"SQUARE" => Some(Self::Square),
"CIRCLE" => Some(Self::Circle),
"RECTANGLE_CUSTOM" => Some(Self::RectangleCustom),
"RECTANGLE_4_3" => Some(Self::Rectangle43),
_ => None,
}
}
}
}
/// The style options for the border of a card or widget, including the border
/// type and color.
///
/// [Google Workspace Add-ons and Chat
/// apps](<https://developers.google.com/workspace/extend>):
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct BorderStyle {
/// The border type.
#[prost(enumeration = "border_style::BorderType", tag = "1")]
pub r#type: i32,
/// The colors to use when the type is `BORDER_TYPE_STROKE`.
#[prost(message, optional, tag = "2")]
pub stroke_color: ::core::option::Option<super::super::super::r#type::Color>,
/// The corner radius for the border.
#[prost(int32, tag = "3")]
pub corner_radius: i32,
}
/// Nested message and enum types in `BorderStyle`.
pub mod border_style {
/// Represents the border types applied to widgets.
///
/// [Google Workspace Add-ons
/// and Chat apps](<https://developers.google.com/workspace/extend>):
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum BorderType {
/// Don't use. Unspecified.
Unspecified = 0,
/// Default value. No border.
NoBorder = 1,
/// Outline.
Stroke = 2,
}
impl BorderType {
/// 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 {
BorderType::Unspecified => "BORDER_TYPE_UNSPECIFIED",
BorderType::NoBorder => "NO_BORDER",
BorderType::Stroke => "STROKE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"BORDER_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"NO_BORDER" => Some(Self::NoBorder),
"STROKE" => Some(Self::Stroke),
_ => None,
}
}
}
}
/// Represents an image.
///
/// [Google Workspace Add-ons and Chat
/// apps](<https://developers.google.com/workspace/extend>):
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ImageComponent {
/// The image URL.
#[prost(string, tag = "1")]
pub image_uri: ::prost::alloc::string::String,
/// The accessibility label for the image.
#[prost(string, tag = "2")]
pub alt_text: ::prost::alloc::string::String,
/// The crop style to apply to the image.
#[prost(message, optional, tag = "3")]
pub crop_style: ::core::option::Option<ImageCropStyle>,
/// The border style to apply to the image.
#[prost(message, optional, tag = "4")]
pub border_style: ::core::option::Option<BorderStyle>,
}
/// Displays a grid with a collection of items. Items can only include text or
/// images. For responsive columns, or to include more than text or images, use
/// [`Columns`][google.apps.card.v1.Columns]. For an example in Google Chat apps,
/// see [Display a Grid with a collection of
/// items](<https://developers.google.com/workspace/chat/format-structure-card-dialog#display_a_grid_with_a_collection_of_items>).
///
/// A grid supports any number of columns and items. The number of rows is
/// determined by items divided by columns. A grid with
/// 10 items and 2 columns has 5 rows. A grid with 11 items and 2 columns
/// has 6 rows.
///
/// [Google Workspace Add-ons and Chat
/// apps](<https://developers.google.com/workspace/extend>):
///
/// For example, the following JSON creates a 2 column grid with a single
/// item:
///
/// ```
/// "grid": {
/// "title": "A fine collection of items",
/// "columnCount": 2,
/// "borderStyle": {
/// "type": "STROKE",
/// "cornerRadius": 4
/// },
/// "items": [
/// {
/// "image": {
/// "imageUri": "<https://www.example.com/image.png",>
/// "cropStyle": {
/// "type": "SQUARE"
/// },
/// "borderStyle": {
/// "type": "STROKE"
/// }
/// },
/// "title": "An item",
/// "textAlignment": "CENTER"
/// }
/// ],
/// "onClick": {
/// "openLink": {
/// "url": "<https://www.example.com">
/// }
/// }
/// }
/// ```
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Grid {
/// The text that displays in the grid header.
#[prost(string, tag = "1")]
pub title: ::prost::alloc::string::String,
/// The items to display in the grid.
#[prost(message, repeated, tag = "2")]
pub items: ::prost::alloc::vec::Vec<grid::GridItem>,
/// The border style to apply to each grid item.
#[prost(message, optional, tag = "3")]
pub border_style: ::core::option::Option<BorderStyle>,
/// The number of columns to display in the grid. A default value
/// is used if this field isn't specified, and that default value is
/// different depending on where the grid is shown (dialog versus companion).
#[prost(int32, tag = "4")]
pub column_count: i32,
/// This callback is reused by each individual grid item, but with the
/// item's identifier and index in the items list added to the callback's
/// parameters.
#[prost(message, optional, tag = "5")]
pub on_click: ::core::option::Option<OnClick>,
}
/// Nested message and enum types in `Grid`.
pub mod grid {
/// Represents an item in a grid layout. Items can contain text, an image, or
/// both text and an image.
///
/// [Google Workspace Add-ons and Chat
/// apps](<https://developers.google.com/workspace/extend>):
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GridItem {
/// A user-specified identifier for this grid item. This identifier is
/// returned in the parent grid's `onClick` callback parameters.
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
/// The image that displays in the grid item.
#[prost(message, optional, tag = "2")]
pub image: ::core::option::Option<super::ImageComponent>,
/// The grid item's title.
#[prost(string, tag = "3")]
pub title: ::prost::alloc::string::String,
/// The grid item's subtitle.
#[prost(string, tag = "4")]
pub subtitle: ::prost::alloc::string::String,
/// The layout to use for the grid item.
#[prost(enumeration = "grid_item::GridItemLayout", tag = "9")]
pub layout: i32,
}
/// Nested message and enum types in `GridItem`.
pub mod grid_item {
/// Represents the various layout options available for a grid item.
///
/// [Google Workspace Add-ons and Chat
/// apps](<https://developers.google.com/workspace/extend>):
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum GridItemLayout {
/// Don't use. Unspecified.
Unspecified = 0,
/// The title and subtitle are shown below the grid item's image.
TextBelow = 1,
/// The title and subtitle are shown above the grid item's image.
TextAbove = 2,
}
impl GridItemLayout {
/// 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 {
GridItemLayout::Unspecified => "GRID_ITEM_LAYOUT_UNSPECIFIED",
GridItemLayout::TextBelow => "TEXT_BELOW",
GridItemLayout::TextAbove => "TEXT_ABOVE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"GRID_ITEM_LAYOUT_UNSPECIFIED" => Some(Self::Unspecified),
"TEXT_BELOW" => Some(Self::TextBelow),
"TEXT_ABOVE" => Some(Self::TextAbove),
_ => None,
}
}
}
}
}
/// The `Columns` widget displays up to 2 columns in a card or dialog. You can
/// add widgets to each column; the widgets appear in the order that they are
/// specified. For an example in Google Chat apps, see
/// [Display cards and dialogs in
/// columns](<https://developers.google.com/workspace/chat/format-structure-card-dialog#display_cards_and_dialogs_in_columns>).
///
/// The height of each column is determined by the taller column. For example, if
/// the first column is taller than the second column, both columns have the
/// height of the first column. Because each column can contain a different
/// number of widgets, you can't define rows or align widgets between the
/// columns.
///
/// Columns are displayed side-by-side. You can customize the width of each
/// column using the `HorizontalSizeStyle` field. If the user's
/// screen width is too narrow, the second column wraps below the first:
///
/// * On web, the second column wraps if the screen width is less than or equal
/// to 480 pixels.
/// * On iOS devices, the second column wraps if the screen width is
/// less than or equal to 300 pt.
/// * On Android devices, the second column wraps if the screen width is
/// less than or equal to 320 dp.
///
/// To include more than 2 columns, or to use rows, use the
/// [`Grid`][google.apps.card.v1.Grid] widget.
///
/// [Google Workspace Add-ons and Chat
/// apps](<https://developers.google.com/workspace/extend>):
/// Columns for Google Workspace Add-ons are in
/// Developer Preview.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Columns {
/// An array of columns. You can include up to 2 columns in a card or dialog.
#[prost(message, repeated, tag = "2")]
pub column_items: ::prost::alloc::vec::Vec<columns::Column>,
}
/// Nested message and enum types in `Columns`.
pub mod columns {
/// A column.
///
/// [Google Workspace Add-ons and Chat
/// apps](<https://developers.google.com/workspace/extend>):
/// Columns for Google Workspace Add-ons are in
/// Developer Preview.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Column {
/// Specifies how a column fills the width of the card.
#[prost(enumeration = "column::HorizontalSizeStyle", tag = "1")]
pub horizontal_size_style: i32,
/// Specifies whether widgets align to the left, right, or center of a
/// column.
#[prost(enumeration = "super::widget::HorizontalAlignment", tag = "2")]
pub horizontal_alignment: i32,
/// Specifies whether widgets align to the top, bottom, or center of a
/// column.
#[prost(enumeration = "column::VerticalAlignment", tag = "3")]
pub vertical_alignment: i32,
/// An array of widgets included in a column. Widgets appear in the order
/// that they are specified.
#[prost(message, repeated, tag = "4")]
pub widgets: ::prost::alloc::vec::Vec<column::Widgets>,
}
/// Nested message and enum types in `Column`.
pub mod column {
/// The supported widgets that you can include in a column.
///
/// [Google Workspace Add-ons and Chat
/// apps](<https://developers.google.com/workspace/extend>):
/// Columns for Google Workspace Add-ons are in
/// Developer Preview.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Widgets {
#[prost(oneof = "widgets::Data", tags = "1, 2, 3, 4, 5, 6, 7")]
pub data: ::core::option::Option<widgets::Data>,
}
/// Nested message and enum types in `Widgets`.
pub mod widgets {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Data {
/// [TextParagraph][google.apps.card.v1.TextParagraph] widget.
#[prost(message, tag = "1")]
TextParagraph(super::super::super::TextParagraph),
/// [Image][google.apps.card.v1.Image] widget.
#[prost(message, tag = "2")]
Image(super::super::super::Image),
/// [DecoratedText][google.apps.card.v1.DecoratedText] widget.
#[prost(message, tag = "3")]
DecoratedText(super::super::super::DecoratedText),
/// [ButtonList][google.apps.card.v1.ButtonList] widget.
#[prost(message, tag = "4")]
ButtonList(super::super::super::ButtonList),
/// [TextInput][google.apps.card.v1.TextInput] widget.
#[prost(message, tag = "5")]
TextInput(super::super::super::TextInput),
/// [SelectionInput][google.apps.card.v1.SelectionInput] widget.
#[prost(message, tag = "6")]
SelectionInput(super::super::super::SelectionInput),
/// [DateTimePicker][google.apps.card.v1.DateTimePicker] widget.
#[prost(message, tag = "7")]
DateTimePicker(super::super::super::DateTimePicker),
}
}
/// Specifies how a column fills the width of the card. The width of each
/// column depends on both the `HorizontalSizeStyle` and the width of the
/// widgets within the column.
///
/// [Google Workspace Add-ons and Chat
/// apps](<https://developers.google.com/workspace/extend>):
/// Columns for Google Workspace Add-ons are in
/// Developer Preview.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum HorizontalSizeStyle {
/// Don't use. Unspecified.
Unspecified = 0,
/// Default value. Column fills the available space, up to 70% of the
/// card's width. If both columns are set to `FILL_AVAILABLE_SPACE`, each
/// column fills 50% of the space.
FillAvailableSpace = 1,
/// Column fills the least amount of space possible and no more than 30% of
/// the card's width.
FillMinimumSpace = 2,
}
impl HorizontalSizeStyle {
/// 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 {
HorizontalSizeStyle::Unspecified => {
"HORIZONTAL_SIZE_STYLE_UNSPECIFIED"
}
HorizontalSizeStyle::FillAvailableSpace => "FILL_AVAILABLE_SPACE",
HorizontalSizeStyle::FillMinimumSpace => "FILL_MINIMUM_SPACE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"HORIZONTAL_SIZE_STYLE_UNSPECIFIED" => Some(Self::Unspecified),
"FILL_AVAILABLE_SPACE" => Some(Self::FillAvailableSpace),
"FILL_MINIMUM_SPACE" => Some(Self::FillMinimumSpace),
_ => None,
}
}
}
/// Specifies whether widgets align to the top, bottom, or center of a
/// column.
///
/// [Google Workspace Add-ons and Chat
/// apps](<https://developers.google.com/workspace/extend>):
/// Columns for Google Workspace Add-ons are in
/// Developer Preview.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum VerticalAlignment {
/// Don't use. Unspecified.
Unspecified = 0,
/// Default value. Aligns widgets to the center of a column.
Center = 1,
/// Aligns widgets to the top of a column.
Top = 2,
/// Aligns widgets to the bottom of a column.
Bottom = 3,
}
impl VerticalAlignment {
/// 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 {
VerticalAlignment::Unspecified => "VERTICAL_ALIGNMENT_UNSPECIFIED",
VerticalAlignment::Center => "CENTER",
VerticalAlignment::Top => "TOP",
VerticalAlignment::Bottom => "BOTTOM",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"VERTICAL_ALIGNMENT_UNSPECIFIED" => Some(Self::Unspecified),
"CENTER" => Some(Self::Center),
"TOP" => Some(Self::Top),
"BOTTOM" => Some(Self::Bottom),
_ => None,
}
}
}
}
}
/// Represents how to respond when users click an interactive element on
/// a card, such as a button.
///
/// [Google Workspace Add-ons and Chat
/// apps](<https://developers.google.com/workspace/extend>):
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OnClick {
#[prost(oneof = "on_click::Data", tags = "1, 2, 3, 4")]
pub data: ::core::option::Option<on_click::Data>,
}
/// Nested message and enum types in `OnClick`.
pub mod on_click {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Data {
/// If specified, an action is triggered by this `onClick`.
#[prost(message, tag = "1")]
Action(super::Action),
/// If specified, this `onClick` triggers an open link action.
#[prost(message, tag = "2")]
OpenLink(super::OpenLink),
/// An add-on triggers this action when the action needs to open a
/// link. This differs from the `open_link` above in that this needs to talk
/// to server to get the link. Thus some preparation work is required for
/// web client to do before the open link action response comes back.
///
/// [Google Workspace
/// Add-ons](<https://developers.google.com/workspace/add-ons>):
#[prost(message, tag = "3")]
OpenDynamicLinkAction(super::Action),
/// A new card is pushed to the card stack after clicking if specified.
///
/// [Google Workspace
/// Add-ons](<https://developers.google.com/workspace/add-ons>):
#[prost(message, tag = "4")]
Card(::prost::alloc::boxed::Box<super::Card>),
}
}
/// Represents an `onClick` event that opens a hyperlink.
///
/// [Google Workspace Add-ons and Chat
/// apps](<https://developers.google.com/workspace/extend>):
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OpenLink {
/// The URL to open.
#[prost(string, tag = "1")]
pub url: ::prost::alloc::string::String,
/// How to open a link.
///
/// [Google Workspace
/// Add-ons](<https://developers.google.com/workspace/add-ons>):
#[prost(enumeration = "open_link::OpenAs", tag = "2")]
pub open_as: i32,
/// Whether the client forgets about a link after opening it, or observes it
/// until the window closes.
///
/// [Google Workspace
/// Add-ons](<https://developers.google.com/workspace/add-ons>):
#[prost(enumeration = "open_link::OnClose", tag = "3")]
pub on_close: i32,
}
/// Nested message and enum types in `OpenLink`.
pub mod open_link {
/// When an `OnClick` action opens a link, then the client can either open it
/// as a full-size window (if that's the frame used by the client), or an
/// overlay (such as a pop-up). The implementation depends on the client
/// platform capabilities, and the value selected might be ignored if the
/// client doesn't support it. `FULL_SIZE` is supported by all clients.
///
/// [Google Workspace
/// Add-ons](<https://developers.google.com/workspace/add-ons>):
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum OpenAs {
/// The link opens as a full-size window (if that's the frame used by the
/// client).
FullSize = 0,
/// The link opens as an overlay, such as a pop-up.
Overlay = 1,
}
impl OpenAs {
/// 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 {
OpenAs::FullSize => "FULL_SIZE",
OpenAs::Overlay => "OVERLAY",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"FULL_SIZE" => Some(Self::FullSize),
"OVERLAY" => Some(Self::Overlay),
_ => None,
}
}
}
/// What the client does when a link opened by an `OnClick` action is closed.
///
/// Implementation depends on client platform capabilities. For example, a web
/// browser might open a link in a pop-up window with an `OnClose` handler.
///
/// If both `OnOpen` and `OnClose` handlers are set, and the client platform
/// can't support both values, `OnClose` takes precedence.
///
/// [Google Workspace
/// Add-ons](<https://developers.google.com/workspace/add-ons>):
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum OnClose {
/// Default value. The card doesn't reload; nothing happens.
Nothing = 0,
/// Reloads the card after the child window closes.
///
/// If used in conjunction with
/// [`OpenAs.OVERLAY`](<https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#openas>),
/// the child window acts as a modal dialog and the parent card is blocked
/// until the child window closes.
Reload = 1,
}
impl OnClose {
/// 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 {
OnClose::Nothing => "NOTHING",
OnClose::Reload => "RELOAD",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"NOTHING" => Some(Self::Nothing),
"RELOAD" => Some(Self::Reload),
_ => None,
}
}
}
}
/// An action that describes the behavior when the form is submitted.
/// For example, you can invoke an Apps Script script to handle the form.
/// If the action is triggered, the form values are sent to the server.
///
/// [Google Workspace Add-ons and Chat
/// apps](<https://developers.google.com/workspace/extend>):
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Action {
/// A custom function to invoke when the containing element is
/// clicked or othrwise activated.
///
/// For example usage, see [Read form
/// data](<https://developers.google.com/workspace/chat/read-form-data>).
#[prost(string, tag = "1")]
pub function: ::prost::alloc::string::String,
/// List of action parameters.
#[prost(message, repeated, tag = "2")]
pub parameters: ::prost::alloc::vec::Vec<action::ActionParameter>,
/// Specifies the loading indicator that the action displays while
/// making the call to the action.
#[prost(enumeration = "action::LoadIndicator", tag = "3")]
pub load_indicator: i32,
/// Indicates whether form values persist after the action. The default value
/// is `false`.
///
/// If `true`, form values remain after the action is triggered. To let the
/// user make changes while the action is being processed, set
/// [`LoadIndicator`](<https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator>)
/// to `NONE`. For [card
/// messages](<https://developers.google.com/workspace/chat/api/guides/v1/messages/create#create>)
/// in Chat apps, you must also set the action's
/// [`ResponseType`](<https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#responsetype>)
/// to `UPDATE_MESSAGE` and use the same
/// [`card_id`](<https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#CardWithId>)
/// from the card that contained the action.
///
/// If `false`, the form values are cleared when the action is triggered.
/// To prevent the user from making changes while the action is being
/// processed, set
/// [`LoadIndicator`](<https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator>)
/// to `SPINNER`.
#[prost(bool, tag = "4")]
pub persist_values: bool,
/// Optional. Required when opening a
/// [dialog](<https://developers.google.com/workspace/chat/dialogs>).
///
/// What to do in response to an interaction with a user, such as a user
/// clicking a button in a card message.
///
/// If unspecified, the app responds by executing an `action`—like opening a
/// link or running a function—as normal.
///
/// By specifying an `interaction`, the app can respond in special interactive
/// ways. For example, by setting `interaction` to `OPEN_DIALOG`, the app can
/// open a [dialog](<https://developers.google.com/workspace/chat/dialogs>). When
/// specified, a loading indicator isn't shown. If specified for
/// an add-on, the entire card is stripped and nothing is shown in the client.
///
/// [Google Chat apps](<https://developers.google.com/workspace/chat>):
#[prost(enumeration = "action::Interaction", tag = "5")]
pub interaction: i32,
}
/// Nested message and enum types in `Action`.
pub mod action {
/// List of string parameters to supply when the action method is invoked.
/// For example, consider three snooze buttons: snooze now, snooze one day,
/// or snooze next week. You might use `action method = snooze()`, passing the
/// snooze type and snooze time in the list of string parameters.
///
/// To learn more, see
/// [`CommonEventObject`](<https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#commoneventobject>).
///
/// [Google Workspace Add-ons and Chat
/// apps](<https://developers.google.com/workspace/extend>):
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ActionParameter {
/// The name of the parameter for the action script.
#[prost(string, tag = "1")]
pub key: ::prost::alloc::string::String,
/// The value of the parameter.
#[prost(string, tag = "2")]
pub value: ::prost::alloc::string::String,
}
/// Specifies the loading indicator that the action displays while
/// making the call to the action.
///
/// [Google Workspace Add-ons and Chat
/// apps](<https://developers.google.com/workspace/extend>):
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum LoadIndicator {
/// Displays a spinner to indicate that content is loading.
Spinner = 0,
/// Nothing is displayed.
None = 1,
}
impl LoadIndicator {
/// 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 {
LoadIndicator::Spinner => "SPINNER",
LoadIndicator::None => "NONE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SPINNER" => Some(Self::Spinner),
"NONE" => Some(Self::None),
_ => None,
}
}
}
/// Optional. Required when opening a
/// [dialog](<https://developers.google.com/workspace/chat/dialogs>).
///
/// What to do in response to an interaction with a user, such as a user
/// clicking a button in a card message.
///
/// If unspecified, the app responds by executing an `action`—like opening a
/// link or running a function—as normal.
///
/// By specifying an `interaction`, the app can respond in special interactive
/// ways. For example, by setting `interaction` to `OPEN_DIALOG`, the app can
/// open a [dialog](<https://developers.google.com/workspace/chat/dialogs>).
///
/// When specified, a loading indicator isn't shown. If specified for
/// an add-on, the entire card is stripped and nothing is shown in the client.
///
/// [Google Chat apps](<https://developers.google.com/workspace/chat>):
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Interaction {
/// Default value. The `action` executes as normal.
Unspecified = 0,
/// Opens a [dialog](<https://developers.google.com/workspace/chat/dialogs>), a
/// windowed, card-based interface that Chat apps use to interact with users.
///
/// Only supported by Chat apps in response to button-clicks on card
/// messages. If specified for
/// an add-on, the entire card is stripped and nothing is shown in the
/// client.
///
/// [Google Chat apps](<https://developers.google.com/workspace/chat>):
OpenDialog = 1,
}
impl Interaction {
/// 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 {
Interaction::Unspecified => "INTERACTION_UNSPECIFIED",
Interaction::OpenDialog => "OPEN_DIALOG",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"INTERACTION_UNSPECIFIED" => Some(Self::Unspecified),
"OPEN_DIALOG" => Some(Self::OpenDialog),
_ => None,
}
}
}
}