Spaces:
Build error
Build error
File size: 90,384 Bytes
0827183 |
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 |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
from typing import List
from botbuilder.schema._connector_client_enums import ActivityTypes
from datetime import datetime
from enum import Enum
from msrest.serialization import Model
from msrest.exceptions import HttpOperationError
class ActivityEventNames(str, Enum):
continue_conversation = "ContinueConversation"
create_conversation = "CreateConversation"
class ConversationReference(Model):
"""An object relating to a particular point in a conversation.
:param activity_id: (Optional) ID of the activity to refer to
:type activity_id: str
:param user: (Optional) User participating in this conversation
:type user: ~botframework.connector.models.ChannelAccount
:param bot: Bot participating in this conversation
:type bot: ~botframework.connector.models.ChannelAccount
:param conversation: Conversation reference
:type conversation: ~botframework.connector.models.ConversationAccount
:param channel_id: Channel ID
:type channel_id: str
:param locale: A locale name for the contents of the text field.
The locale name is a combination of an ISO 639 two- or three-letter
culture code associated with a language and an ISO 3166 two-letter
subculture code associated with a country or region.
The locale name can also correspond to a valid BCP-47 language tag.
:type locale: str
:param service_url: Service endpoint where operations concerning the
referenced conversation may be performed
:type service_url: str
"""
_attribute_map = {
"activity_id": {"key": "activityId", "type": "str"},
"user": {"key": "user", "type": "ChannelAccount"},
"bot": {"key": "bot", "type": "ChannelAccount"},
"conversation": {"key": "conversation", "type": "ConversationAccount"},
"channel_id": {"key": "channelId", "type": "str"},
"locale": {"key": "locale", "type": "str"},
"service_url": {"key": "serviceUrl", "type": "str"},
}
def __init__(
self,
*,
activity_id: str = None,
user=None,
bot=None,
conversation=None,
channel_id: str = None,
locale: str = None,
service_url: str = None,
**kwargs
) -> None:
super(ConversationReference, self).__init__(**kwargs)
self.activity_id = activity_id
self.user = user
self.bot = bot
self.conversation = conversation
self.channel_id = channel_id
self.locale = locale
self.service_url = service_url
class Mention(Model):
"""Mention information (entity type: "mention").
:param mentioned: The mentioned user
:type mentioned: ~botframework.connector.models.ChannelAccount
:param text: Sub Text which represents the mention (can be null or empty)
:type text: str
:param type: Type of this entity (RFC 3987 IRI)
:type type: str
"""
_attribute_map = {
"mentioned": {"key": "mentioned", "type": "ChannelAccount"},
"text": {"key": "text", "type": "str"},
"type": {"key": "type", "type": "str"},
}
def __init__(
self, *, mentioned=None, text: str = None, type: str = None, **kwargs
) -> None:
super(Mention, self).__init__(**kwargs)
self.mentioned = mentioned
self.text = text
self.type = type
class ResourceResponse(Model):
"""A response containing a resource ID.
:param id: Id of the resource
:type id: str
"""
_attribute_map = {"id": {"key": "id", "type": "str"}}
def __init__(self, *, id: str = None, **kwargs) -> None:
super(ResourceResponse, self).__init__(**kwargs)
self.id = id
class Activity(Model):
"""An Activity is the basic communication type for the Bot Framework 3.0
protocol.
:param type: Contains the activity type. Possible values include:
'message', 'contactRelationUpdate', 'conversationUpdate', 'typing',
'endOfConversation', 'event', 'invoke', 'deleteUserData', 'messageUpdate',
'messageDelete', 'installationUpdate', 'messageReaction', 'suggestion',
'trace', 'handoff'
:type type: str or ~botframework.connector.models.ActivityTypes
:param id: Contains an ID that uniquely identifies the activity on the
channel.
:type id: str
:param timestamp: Contains the date and time that the message was sent, in
UTC, expressed in ISO-8601 format.
:type timestamp: datetime
:param local_timestamp: Contains the local date and time of the message
expressed in ISO-8601 format.
For example, 2016-09-23T13:07:49.4714686-07:00.
:type local_timestamp: datetime
:param local_timezone: Contains the name of the local timezone of the message,
expressed in IANA Time Zone database format.
For example, America/Los_Angeles.
:type local_timezone: str
:param service_url: Contains the URL that specifies the channel's service
endpoint. Set by the channel.
:type service_url: str
:param channel_id: Contains an ID that uniquely identifies the channel.
Set by the channel.
:type channel_id: str
:param from_property: Identifies the sender of the message.
:type from_property: ~botframework.connector.models.ChannelAccount
:param conversation: Identifies the conversation to which the activity
belongs.
:type conversation: ~botframework.connector.models.ConversationAccount
:param recipient: Identifies the recipient of the message.
:type recipient: ~botframework.connector.models.ChannelAccount
:param text_format: Format of text fields Default:markdown. Possible
values include: 'markdown', 'plain', 'xml'
:type text_format: str or ~botframework.connector.models.TextFormatTypes
:param attachment_layout: The layout hint for multiple attachments.
Default: list. Possible values include: 'list', 'carousel'
:type attachment_layout: str or
~botframework.connector.models.AttachmentLayoutTypes
:param members_added: The collection of members added to the conversation.
:type members_added: list[~botframework.connector.models.ChannelAccount]
:param members_removed: The collection of members removed from the
conversation.
:type members_removed: list[~botframework.connector.models.ChannelAccount]
:param reactions_added: The collection of reactions added to the
conversation.
:type reactions_added:
list[~botframework.connector.models.MessageReaction]
:param reactions_removed: The collection of reactions removed from the
conversation.
:type reactions_removed:
list[~botframework.connector.models.MessageReaction]
:param topic_name: The updated topic name of the conversation.
:type topic_name: str
:param history_disclosed: Indicates whether the prior history of the
channel is disclosed.
:type history_disclosed: bool
:param locale: A locale name for the contents of the text field.
The locale name is a combination of an ISO 639 two- or three-letter
culture code associated with a language
and an ISO 3166 two-letter subculture code associated with a country or
region.
The locale name can also correspond to a valid BCP-47 language tag.
:type locale: str
:param text: The text content of the message.
:type text: str
:param speak: The text to speak.
:type speak: str
:param input_hint: Indicates whether your bot is accepting,
expecting, or ignoring user input after the message is delivered to the
client. Possible values include: 'acceptingInput', 'ignoringInput',
'expectingInput'
:type input_hint: str or ~botframework.connector.models.InputHints
:param summary: The text to display if the channel cannot render cards.
:type summary: str
:param suggested_actions: The suggested actions for the activity.
:type suggested_actions: ~botframework.connector.models.SuggestedActions
:param attachments: Attachments
:type attachments: list[~botframework.connector.models.Attachment]
:param entities: Represents the entities that were mentioned in the
message.
:type entities: list[~botframework.connector.models.Entity]
:param channel_data: Contains channel-specific content.
:type channel_data: object
:param action: Indicates whether the recipient of a contactRelationUpdate
was added or removed from the sender's contact list.
:type action: str
:param reply_to_id: Contains the ID of the message to which this message
is a reply.
:type reply_to_id: str
:param label: A descriptive label for the activity.
:type label: str
:param value_type: The type of the activity's value object.
:type value_type: str
:param value: A value that is associated with the activity.
:type value: object
:param name: The name of the operation associated with an invoke or event
activity.
:type name: str
:param relates_to: A reference to another conversation or activity.
:type relates_to: ~botframework.connector.models.ConversationReference
:param code: The a code for endOfConversation activities that indicates
why the conversation ended. Possible values include: 'unknown',
'completedSuccessfully', 'userCancelled', 'botTimedOut',
'botIssuedInvalidMessage', 'channelFailed'
:type code: str or ~botframework.connector.models.EndOfConversationCodes
:param expiration: The time at which the activity should be considered to
be "expired" and should not be presented to the recipient.
:type expiration: datetime
:param importance: The importance of the activity. Possible values
include: 'low', 'normal', 'high'
:type importance: str or ~botframework.connector.models.ActivityImportance
:param delivery_mode: A delivery hint to signal to the recipient alternate
delivery paths for the activity.
The default delivery mode is "default". Possible values include: 'normal',
'notification', 'expectReplies', 'ephemeral'
:type delivery_mode: str or ~botframework.connector.models.DeliveryModes
:param listen_for: List of phrases and references that speech and language
priming systems should listen for
:type listen_for: list[str]
:param text_highlights: The collection of text fragments to highlight when
the activity contains a ReplyToId value.
:type text_highlights: list[~botframework.connector.models.TextHighlight]
:param semantic_action: An optional programmatic action accompanying this
request
:type semantic_action: ~botframework.connector.models.SemanticAction
:param caller_id: A string containing an IRI identifying the caller of a
bot. This field is not intended to be transmitted over the wire, but is
instead populated by bots and clients based on cryptographically
verifiable data that asserts the identity of the callers (e.g. tokens).
:type caller_id: str
"""
_attribute_map = {
"type": {"key": "type", "type": "str"},
"id": {"key": "id", "type": "str"},
"timestamp": {"key": "timestamp", "type": "iso-8601"},
"local_timestamp": {"key": "localTimestamp", "type": "iso-8601"},
"local_timezone": {"key": "localTimezone", "type": "str"},
"service_url": {"key": "serviceUrl", "type": "str"},
"channel_id": {"key": "channelId", "type": "str"},
"from_property": {"key": "from", "type": "ChannelAccount"},
"conversation": {"key": "conversation", "type": "ConversationAccount"},
"recipient": {"key": "recipient", "type": "ChannelAccount"},
"text_format": {"key": "textFormat", "type": "str"},
"attachment_layout": {"key": "attachmentLayout", "type": "str"},
"members_added": {"key": "membersAdded", "type": "[ChannelAccount]"},
"members_removed": {"key": "membersRemoved", "type": "[ChannelAccount]"},
"reactions_added": {"key": "reactionsAdded", "type": "[MessageReaction]"},
"reactions_removed": {"key": "reactionsRemoved", "type": "[MessageReaction]"},
"topic_name": {"key": "topicName", "type": "str"},
"history_disclosed": {"key": "historyDisclosed", "type": "bool"},
"locale": {"key": "locale", "type": "str"},
"text": {"key": "text", "type": "str"},
"speak": {"key": "speak", "type": "str"},
"input_hint": {"key": "inputHint", "type": "str"},
"summary": {"key": "summary", "type": "str"},
"suggested_actions": {"key": "suggestedActions", "type": "SuggestedActions"},
"attachments": {"key": "attachments", "type": "[Attachment]"},
"entities": {"key": "entities", "type": "[Entity]"},
"channel_data": {"key": "channelData", "type": "object"},
"action": {"key": "action", "type": "str"},
"reply_to_id": {"key": "replyToId", "type": "str"},
"label": {"key": "label", "type": "str"},
"value_type": {"key": "valueType", "type": "str"},
"value": {"key": "value", "type": "object"},
"name": {"key": "name", "type": "str"},
"relates_to": {"key": "relatesTo", "type": "ConversationReference"},
"code": {"key": "code", "type": "str"},
"expiration": {"key": "expiration", "type": "iso-8601"},
"importance": {"key": "importance", "type": "str"},
"delivery_mode": {"key": "deliveryMode", "type": "str"},
"listen_for": {"key": "listenFor", "type": "[str]"},
"text_highlights": {"key": "textHighlights", "type": "[TextHighlight]"},
"semantic_action": {"key": "semanticAction", "type": "SemanticAction"},
"caller_id": {"key": "callerId", "type": "str"},
}
def __init__(
self,
*,
type=None,
id: str = None,
timestamp=None,
local_timestamp=None,
local_timezone: str = None,
service_url: str = None,
channel_id: str = None,
from_property=None,
conversation=None,
recipient=None,
text_format=None,
attachment_layout=None,
members_added=None,
members_removed=None,
reactions_added=None,
reactions_removed=None,
topic_name: str = None,
history_disclosed: bool = None,
locale: str = None,
text: str = None,
speak: str = None,
input_hint=None,
summary: str = None,
suggested_actions=None,
attachments=None,
entities=None,
channel_data=None,
action: str = None,
reply_to_id: str = None,
label: str = None,
value_type: str = None,
value=None,
name: str = None,
relates_to=None,
code=None,
expiration=None,
importance=None,
delivery_mode=None,
listen_for=None,
text_highlights=None,
semantic_action=None,
caller_id: str = None,
**kwargs
) -> None:
super(Activity, self).__init__(**kwargs)
self.type = type
self.id = id
self.timestamp = timestamp
self.local_timestamp = local_timestamp
self.local_timezone = local_timezone
self.service_url = service_url
self.channel_id = channel_id
self.from_property = from_property
self.conversation = conversation
self.recipient = recipient
self.text_format = text_format
self.attachment_layout = attachment_layout
self.members_added = members_added
self.members_removed = members_removed
self.reactions_added = reactions_added
self.reactions_removed = reactions_removed
self.topic_name = topic_name
self.history_disclosed = history_disclosed
self.locale = locale
self.text = text
self.speak = speak
self.input_hint = input_hint
self.summary = summary
self.suggested_actions = suggested_actions
self.attachments = attachments
self.entities = entities
self.channel_data = channel_data
self.action = action
self.reply_to_id = reply_to_id
self.label = label
self.value_type = value_type
self.value = value
self.name = name
self.relates_to = relates_to
self.code = code
self.expiration = expiration
self.importance = importance
self.delivery_mode = delivery_mode
self.listen_for = listen_for
self.text_highlights = text_highlights
self.semantic_action = semantic_action
self.caller_id = caller_id
def apply_conversation_reference(
self, reference: ConversationReference, is_incoming: bool = False
):
"""
Updates this activity with the delivery information from an existing ConversationReference
:param reference: The existing conversation reference.
:param is_incoming: Optional, True to treat the activity as an
incoming activity, where the bot is the recipient; otherwise, False.
Default is False, and the activity will show the bot as the sender.
:returns: his activity, updated with the delivery information.
.. remarks::
Call GetConversationReference on an incoming
activity to get a conversation reference that you can then use to update an
outgoing activity with the correct delivery information.
"""
self.channel_id = reference.channel_id
self.service_url = reference.service_url
self.conversation = reference.conversation
if reference.locale is not None:
self.locale = reference.locale
if is_incoming:
self.from_property = reference.user
self.recipient = reference.bot
if reference.activity_id is not None:
self.id = reference.activity_id
else:
self.from_property = reference.bot
self.recipient = reference.user
if reference.activity_id is not None:
self.reply_to_id = reference.activity_id
return self
def as_contact_relation_update_activity(self):
"""
Returns this activity as a ContactRelationUpdateActivity object;
or None, if this is not that type of activity.
:returns: This activity as a message activity; or None.
"""
return (
self if self.__is_activity(ActivityTypes.contact_relation_update) else None
)
def as_conversation_update_activity(self):
"""
Returns this activity as a ConversationUpdateActivity object;
or None, if this is not that type of activity.
:returns: This activity as a conversation update activity; or None.
"""
return self if self.__is_activity(ActivityTypes.conversation_update) else None
def as_end_of_conversation_activity(self):
"""
Returns this activity as an EndOfConversationActivity object;
or None, if this is not that type of activity.
:returns: This activity as an end of conversation activity; or None.
"""
return self if self.__is_activity(ActivityTypes.end_of_conversation) else None
def as_event_activity(self):
"""
Returns this activity as an EventActivity object;
or None, if this is not that type of activity.
:returns: This activity as an event activity; or None.
"""
return self if self.__is_activity(ActivityTypes.event) else None
def as_handoff_activity(self):
"""
Returns this activity as a HandoffActivity object;
or None, if this is not that type of activity.
:returns: This activity as a handoff activity; or None.
"""
return self if self.__is_activity(ActivityTypes.handoff) else None
def as_installation_update_activity(self):
"""
Returns this activity as an InstallationUpdateActivity object;
or None, if this is not that type of activity.
:returns: This activity as an installation update activity; or None.
"""
return self if self.__is_activity(ActivityTypes.installation_update) else None
def as_invoke_activity(self):
"""
Returns this activity as an InvokeActivity object;
or None, if this is not that type of activity.
:returns: This activity as an invoke activity; or None.
"""
return self if self.__is_activity(ActivityTypes.invoke) else None
def as_message_activity(self):
"""
Returns this activity as a MessageActivity object;
or None, if this is not that type of activity.
:returns: This activity as a message activity; or None.
"""
return self if self.__is_activity(ActivityTypes.message) else None
def as_message_delete_activity(self):
"""
Returns this activity as a MessageDeleteActivity object;
or None, if this is not that type of activity.
:returns: This activity as a message delete request; or None.
"""
return self if self.__is_activity(ActivityTypes.message_delete) else None
def as_message_reaction_activity(self):
"""
Returns this activity as a MessageReactionActivity object;
or None, if this is not that type of activity.
:return: This activity as a message reaction activity; or None.
"""
return self if self.__is_activity(ActivityTypes.message_reaction) else None
def as_message_update_activity(self):
"""
Returns this activity as an MessageUpdateActivity object;
or None, if this is not that type of activity.
:returns: This activity as a message update request; or None.
"""
return self if self.__is_activity(ActivityTypes.message_update) else None
def as_suggestion_activity(self):
"""
Returns this activity as a SuggestionActivity object;
or None, if this is not that type of activity.
:returns: This activity as a suggestion activity; or None.
"""
return self if self.__is_activity(ActivityTypes.suggestion) else None
def as_trace_activity(self):
"""
Returns this activity as a TraceActivity object;
or None, if this is not that type of activity.
:returns: This activity as a trace activity; or None.
"""
return self if self.__is_activity(ActivityTypes.trace) else None
def as_typing_activity(self):
"""
Returns this activity as a TypingActivity object;
or null, if this is not that type of activity.
:returns: This activity as a typing activity; or null.
"""
return self if self.__is_activity(ActivityTypes.typing) else None
@staticmethod
def create_contact_relation_update_activity():
"""
Creates an instance of the :class:`Activity` class as aContactRelationUpdateActivity object.
:returns: The new contact relation update activity.
"""
return Activity(type=ActivityTypes.contact_relation_update)
@staticmethod
def create_conversation_update_activity():
"""
Creates an instance of the :class:`Activity` class as a ConversationUpdateActivity object.
:returns: The new conversation update activity.
"""
return Activity(type=ActivityTypes.conversation_update)
@staticmethod
def create_end_of_conversation_activity():
"""
Creates an instance of the :class:`Activity` class as an EndOfConversationActivity object.
:returns: The new end of conversation activity.
"""
return Activity(type=ActivityTypes.end_of_conversation)
@staticmethod
def create_event_activity():
"""
Creates an instance of the :class:`Activity` class as an EventActivity object.
:returns: The new event activity.
"""
return Activity(type=ActivityTypes.event)
@staticmethod
def create_handoff_activity():
"""
Creates an instance of the :class:`Activity` class as a HandoffActivity object.
:returns: The new handoff activity.
"""
return Activity(type=ActivityTypes.handoff)
@staticmethod
def create_invoke_activity():
"""
Creates an instance of the :class:`Activity` class as an InvokeActivity object.
:returns: The new invoke activity.
"""
return Activity(type=ActivityTypes.invoke)
@staticmethod
def create_message_activity():
"""
Creates an instance of the :class:`Activity` class as a MessageActivity object.
:returns: The new message activity.
"""
return Activity(type=ActivityTypes.message)
def create_reply(self, text: str = None, locale: str = None):
"""
Creates a new message activity as a response to this activity.
:param text: The text of the reply.
:param locale: The language code for the text.
:returns: The new message activity.
.. remarks::
The new activity sets up routing information based on this activity.
"""
return Activity(
type=ActivityTypes.message,
timestamp=datetime.utcnow(),
from_property=ChannelAccount(
id=self.recipient.id if self.recipient else None,
name=self.recipient.name if self.recipient else None,
),
recipient=ChannelAccount(
id=self.from_property.id if self.from_property else None,
name=self.from_property.name if self.from_property else None,
),
reply_to_id=self.id,
service_url=self.service_url,
channel_id=self.channel_id,
conversation=ConversationAccount(
is_group=self.conversation.is_group,
id=self.conversation.id,
name=self.conversation.name,
),
text=text if text else "",
locale=locale if locale else self.locale,
attachments=[],
entities=[],
)
def create_trace(
self, name: str, value: object = None, value_type: str = None, label: str = None
):
"""
Creates a new trace activity based on this activity.
:param name: The name of the trace operation to create.
:param value: Optional, the content for this trace operation.
:param value_type: Optional, identifier for the format of the value
Default is the name of type of the value.
:param label: Optional, a descriptive label for this trace operation.
:returns: The new trace activity.
"""
if not value_type and value:
value_type = type(value)
return Activity(
type=ActivityTypes.trace,
timestamp=datetime.utcnow(),
from_property=ChannelAccount(
id=self.recipient.id if self.recipient else None,
name=self.recipient.name if self.recipient else None,
),
recipient=ChannelAccount(
id=self.from_property.id if self.from_property else None,
name=self.from_property.name if self.from_property else None,
),
reply_to_id=self.id,
service_url=self.service_url,
channel_id=self.channel_id,
conversation=ConversationAccount(
is_group=self.conversation.is_group,
id=self.conversation.id,
name=self.conversation.name,
),
name=name,
label=label,
value_type=value_type,
value=value,
).as_trace_activity()
@staticmethod
def create_trace_activity(
name: str, value: object = None, value_type: str = None, label: str = None
):
"""
Creates an instance of the :class:`Activity` class as a TraceActivity object.
:param name: The name of the trace operation to create.
:param value: Optional, the content for this trace operation.
:param value_type: Optional, identifier for the format of the value.
Default is the name of type of the value.
:param label: Optional, a descriptive label for this trace operation.
:returns: The new trace activity.
"""
if not value_type and value:
value_type = type(value)
return Activity(
type=ActivityTypes.trace,
name=name,
label=label,
value_type=value_type,
value=value,
)
@staticmethod
def create_typing_activity():
"""
Creates an instance of the :class:`Activity` class as a TypingActivity object.
:returns: The new typing activity.
"""
return Activity(type=ActivityTypes.typing)
def get_conversation_reference(self):
"""
Creates a ConversationReference based on this activity.
:returns: A conversation reference for the conversation that contains this activity.
"""
return ConversationReference(
activity_id=self.id,
user=self.from_property,
bot=self.recipient,
conversation=self.conversation,
channel_id=self.channel_id,
locale=self.locale,
service_url=self.service_url,
)
def get_mentions(self) -> List[Mention]:
"""
Resolves the mentions from the entities of this activity.
:returns: The array of mentions; or an empty array, if none are found.
.. remarks::
This method is defined on the :class:`Activity` class, but is only intended
for use with a message activity, where the activity Activity.Type is set to
ActivityTypes.Message.
"""
_list = self.entities
return [x for x in _list if str(x.type).lower() == "mention"]
def get_reply_conversation_reference(
self, reply: ResourceResponse
) -> ConversationReference:
"""
Create a ConversationReference based on this Activity's Conversation info
and the ResourceResponse from sending an activity.
:param reply: ResourceResponse returned from send_activity.
:return: A ConversationReference that can be stored and used later to delete or update the activity.
"""
reference = self.get_conversation_reference()
reference.activity_id = reply.id
return reference
def has_content(self) -> bool:
"""
Indicates whether this activity has content.
:returns: True, if this activity has any content to send; otherwise, false.
.. remarks::
This method is defined on the :class:`Activity` class, but is only intended
for use with a message activity, where the activity Activity.Type is set to
ActivityTypes.Message.
"""
if self.text and self.text.strip():
return True
if self.summary and self.summary.strip():
return True
if self.attachments and len(self.attachments) > 0:
return True
if self.channel_data:
return True
return False
def is_from_streaming_connection(self) -> bool:
"""
Determine if the Activity was sent via an Http/Https connection or Streaming
This can be determined by looking at the service_url property:
(1) All channels that send messages via http/https are not streaming
(2) Channels that send messages via streaming have a ServiceUrl that does not begin with http/https.
:returns: True if the Activity originated from a streaming connection.
"""
if self.service_url:
return not self.service_url.lower().startswith("http")
return False
def __is_activity(self, activity_type: str) -> bool:
"""
Indicates whether this activity is of a specified activity type.
:param activity_type: The activity type to check for.
:return: True if this activity is of the specified activity type; otherwise, False.
"""
if self.type is None:
return False
type_attribute = str(self.type).lower()
activity_type = str(activity_type).lower()
result = type_attribute.startswith(activity_type)
if result:
result = len(type_attribute) == len(activity_type)
if not result:
result = (
len(type_attribute) > len(activity_type)
and type_attribute[len(activity_type)] == "/"
)
return result
class AnimationCard(Model):
"""An animation card (Ex: gif or short video clip).
:param title: Title of this card
:type title: str
:param subtitle: Subtitle of this card
:type subtitle: str
:param text: Text of this card
:type text: str
:param image: Thumbnail placeholder
:type image: ~botframework.connector.models.ThumbnailUrl
:param media: Media URLs for this card. When this field contains more than
one URL, each URL is an alternative format of the same content.
:type media: list[~botframework.connector.models.MediaUrl]
:param buttons: Actions on this card
:type buttons: list[~botframework.connector.models.CardAction]
:param shareable: This content may be shared with others (default:true)
:type shareable: bool
:param autoloop: Should the client loop playback at end of content
(default:true)
:type autoloop: bool
:param autostart: Should the client automatically start playback of media
in this card (default:true)
:type autostart: bool
:param aspect: Aspect ratio of thumbnail/media placeholder. Allowed values
are "16:9" and "4:3"
:type aspect: str
:param duration: Describes the length of the media content without
requiring a receiver to open the content. Formatted as an ISO 8601
Duration field.
:type duration: str
:param value: Supplementary parameter for this card
:type value: object
"""
_attribute_map = {
"title": {"key": "title", "type": "str"},
"subtitle": {"key": "subtitle", "type": "str"},
"text": {"key": "text", "type": "str"},
"image": {"key": "image", "type": "ThumbnailUrl"},
"media": {"key": "media", "type": "[MediaUrl]"},
"buttons": {"key": "buttons", "type": "[CardAction]"},
"shareable": {"key": "shareable", "type": "bool"},
"autoloop": {"key": "autoloop", "type": "bool"},
"autostart": {"key": "autostart", "type": "bool"},
"aspect": {"key": "aspect", "type": "str"},
"duration": {"key": "duration", "type": "str"},
"value": {"key": "value", "type": "object"},
}
def __init__(
self,
*,
title: str = None,
subtitle: str = None,
text: str = None,
image=None,
media=None,
buttons=None,
shareable: bool = None,
autoloop: bool = None,
autostart: bool = None,
aspect: str = None,
duration: str = None,
value=None,
**kwargs
) -> None:
super(AnimationCard, self).__init__(**kwargs)
self.title = title
self.subtitle = subtitle
self.text = text
self.image = image
self.media = media
self.buttons = buttons
self.shareable = shareable
self.autoloop = autoloop
self.autostart = autostart
self.aspect = aspect
self.duration = duration
self.value = value
class Attachment(Model):
"""An attachment within an activity.
:param content_type: mimetype/Contenttype for the file
:type content_type: str
:param content_url: Content Url
:type content_url: str
:param content: Embedded content
:type content: object
:param name: (OPTIONAL) The name of the attachment
:type name: str
:param thumbnail_url: (OPTIONAL) Thumbnail associated with attachment
:type thumbnail_url: str
"""
_attribute_map = {
"content_type": {"key": "contentType", "type": "str"},
"content_url": {"key": "contentUrl", "type": "str"},
"content": {"key": "content", "type": "object"},
"name": {"key": "name", "type": "str"},
"thumbnail_url": {"key": "thumbnailUrl", "type": "str"},
}
def __init__(
self,
*,
content_type: str = None,
content_url: str = None,
content=None,
name: str = None,
thumbnail_url: str = None,
**kwargs
) -> None:
super(Attachment, self).__init__(**kwargs)
self.content_type = content_type
self.content_url = content_url
self.content = content
self.name = name
self.thumbnail_url = thumbnail_url
class AttachmentData(Model):
"""Attachment data.
:param type: Content-Type of the attachment
:type type: str
:param name: Name of the attachment
:type name: str
:param original_base64: Attachment content
:type original_base64: bytearray
:param thumbnail_base64: Attachment thumbnail
:type thumbnail_base64: bytearray
"""
_attribute_map = {
"type": {"key": "type", "type": "str"},
"name": {"key": "name", "type": "str"},
"original_base64": {"key": "originalBase64", "type": "bytearray"},
"thumbnail_base64": {"key": "thumbnailBase64", "type": "bytearray"},
}
def __init__(
self,
*,
type: str = None,
name: str = None,
original_base64: bytearray = None,
thumbnail_base64: bytearray = None,
**kwargs
) -> None:
super(AttachmentData, self).__init__(**kwargs)
self.type = type
self.name = name
self.original_base64 = original_base64
self.thumbnail_base64 = thumbnail_base64
class AttachmentInfo(Model):
"""Metadata for an attachment.
:param name: Name of the attachment
:type name: str
:param type: ContentType of the attachment
:type type: str
:param views: attachment views
:type views: list[~botframework.connector.models.AttachmentView]
"""
_attribute_map = {
"name": {"key": "name", "type": "str"},
"type": {"key": "type", "type": "str"},
"views": {"key": "views", "type": "[AttachmentView]"},
}
def __init__(
self, *, name: str = None, type: str = None, views=None, **kwargs
) -> None:
super(AttachmentInfo, self).__init__(**kwargs)
self.name = name
self.type = type
self.views = views
class AttachmentView(Model):
"""Attachment View name and size.
:param view_id: Id of the attachment
:type view_id: str
:param size: Size of the attachment
:type size: int
"""
_attribute_map = {
"view_id": {"key": "viewId", "type": "str"},
"size": {"key": "size", "type": "int"},
}
def __init__(self, *, view_id: str = None, size: int = None, **kwargs) -> None:
super(AttachmentView, self).__init__(**kwargs)
self.view_id = view_id
self.size = size
class AudioCard(Model):
"""Audio card.
:param title: Title of this card
:type title: str
:param subtitle: Subtitle of this card
:type subtitle: str
:param text: Text of this card
:type text: str
:param image: Thumbnail placeholder
:type image: ~botframework.connector.models.ThumbnailUrl
:param media: Media URLs for this card. When this field contains more than
one URL, each URL is an alternative format of the same content.
:type media: list[~botframework.connector.models.MediaUrl]
:param buttons: Actions on this card
:type buttons: list[~botframework.connector.models.CardAction]
:param shareable: This content may be shared with others (default:true)
:type shareable: bool
:param autoloop: Should the client loop playback at end of content
(default:true)
:type autoloop: bool
:param autostart: Should the client automatically start playback of media
in this card (default:true)
:type autostart: bool
:param aspect: Aspect ratio of thumbnail/media placeholder. Allowed values
are "16:9" and "4:3"
:type aspect: str
:param duration: Describes the length of the media content without
requiring a receiver to open the content. Formatted as an ISO 8601
Duration field.
:type duration: str
:param value: Supplementary parameter for this card
:type value: object
"""
_attribute_map = {
"title": {"key": "title", "type": "str"},
"subtitle": {"key": "subtitle", "type": "str"},
"text": {"key": "text", "type": "str"},
"image": {"key": "image", "type": "ThumbnailUrl"},
"media": {"key": "media", "type": "[MediaUrl]"},
"buttons": {"key": "buttons", "type": "[CardAction]"},
"shareable": {"key": "shareable", "type": "bool"},
"autoloop": {"key": "autoloop", "type": "bool"},
"autostart": {"key": "autostart", "type": "bool"},
"aspect": {"key": "aspect", "type": "str"},
"duration": {"key": "duration", "type": "str"},
"value": {"key": "value", "type": "object"},
}
def __init__(
self,
*,
title: str = None,
subtitle: str = None,
text: str = None,
image=None,
media=None,
buttons=None,
shareable: bool = None,
autoloop: bool = None,
autostart: bool = None,
aspect: str = None,
duration: str = None,
value=None,
**kwargs
) -> None:
super(AudioCard, self).__init__(**kwargs)
self.title = title
self.subtitle = subtitle
self.text = text
self.image = image
self.media = media
self.buttons = buttons
self.shareable = shareable
self.autoloop = autoloop
self.autostart = autostart
self.aspect = aspect
self.duration = duration
self.value = value
class BasicCard(Model):
"""A basic card.
:param title: Title of the card
:type title: str
:param subtitle: Subtitle of the card
:type subtitle: str
:param text: Text for the card
:type text: str
:param images: Array of images for the card
:type images: list[~botframework.connector.models.CardImage]
:param buttons: Set of actions applicable to the current card
:type buttons: list[~botframework.connector.models.CardAction]
:param tap: This action will be activated when user taps on the card
itself
:type tap: ~botframework.connector.models.CardAction
"""
_attribute_map = {
"title": {"key": "title", "type": "str"},
"subtitle": {"key": "subtitle", "type": "str"},
"text": {"key": "text", "type": "str"},
"images": {"key": "images", "type": "[CardImage]"},
"buttons": {"key": "buttons", "type": "[CardAction]"},
"tap": {"key": "tap", "type": "CardAction"},
}
def __init__(
self,
*,
title: str = None,
subtitle: str = None,
text: str = None,
images=None,
buttons=None,
tap=None,
**kwargs
) -> None:
super(BasicCard, self).__init__(**kwargs)
self.title = title
self.subtitle = subtitle
self.text = text
self.images = images
self.buttons = buttons
self.tap = tap
class CardAction(Model):
"""A clickable action.
:param type: The type of action implemented by this button. Possible
values include: 'openUrl', 'imBack', 'postBack', 'playAudio', 'playVideo',
'showImage', 'downloadFile', 'signin', 'call', 'messageBack'
:type type: str or ~botframework.connector.models.ActionTypes
:param title: Text description which appears on the button
:type title: str
:param image: Image URL which will appear on the button, next to text
label
:type image: str
:param text: Text for this action
:type text: str
:param display_text: (Optional) text to display in the chat feed if the
button is clicked
:type display_text: str
:param value: Supplementary parameter for action. Content of this property
depends on the ActionType
:type value: object
:param channel_data: Channel-specific data associated with this action
:type channel_data: object
:param image_alt_text: Alternate image text to be used in place of the `image` field
:type image_alt_text: str
"""
_attribute_map = {
"type": {"key": "type", "type": "str"},
"title": {"key": "title", "type": "str"},
"image": {"key": "image", "type": "str"},
"text": {"key": "text", "type": "str"},
"display_text": {"key": "displayText", "type": "str"},
"value": {"key": "value", "type": "object"},
"channel_data": {"key": "channelData", "type": "object"},
"image_alt_text": {"key": "imageAltText", "type": "str"},
}
def __init__(
self,
*,
type=None,
title: str = None,
image: str = None,
text: str = None,
display_text: str = None,
value=None,
channel_data=None,
image_alt_text: str = None,
**kwargs
) -> None:
super(CardAction, self).__init__(**kwargs)
self.type = type
self.title = title
self.image = image
self.text = text
self.display_text = display_text
self.value = value
self.channel_data = channel_data
self.image_alt_text = image_alt_text
class CardImage(Model):
"""An image on a card.
:param url: URL thumbnail image for major content property
:type url: str
:param alt: Image description intended for screen readers
:type alt: str
:param tap: Action assigned to specific Attachment
:type tap: ~botframework.connector.models.CardAction
"""
_attribute_map = {
"url": {"key": "url", "type": "str"},
"alt": {"key": "alt", "type": "str"},
"tap": {"key": "tap", "type": "CardAction"},
}
def __init__(self, *, url: str = None, alt: str = None, tap=None, **kwargs) -> None:
super(CardImage, self).__init__(**kwargs)
self.url = url
self.alt = alt
self.tap = tap
class ChannelAccount(Model):
"""Channel account information needed to route a message.
:param id: Channel id for the user or bot on this channel (Example:
joe@smith.com, or @joesmith or 123456)
:type id: str
:param name: Display friendly name
:type name: str
:param aad_object_id: This account's object ID within Azure Active
Directory (AAD)
:type aad_object_id: str
:param role: Role of the entity behind the account (Example: User, Bot,
etc.). Possible values include: 'user', 'bot'
:type role: str or ~botframework.connector.models.RoleTypes
"""
_attribute_map = {
"id": {"key": "id", "type": "str"},
"name": {"key": "name", "type": "str"},
"aad_object_id": {"key": "aadObjectId", "type": "str"},
"role": {"key": "role", "type": "str"},
"properties": {"key": "properties", "type": "object"},
}
def __init__(
self,
*,
id: str = None,
name: str = None,
aad_object_id: str = None,
role=None,
properties=None,
**kwargs
) -> None:
super(ChannelAccount, self).__init__(**kwargs)
self.id = id
self.name = name
self.aad_object_id = aad_object_id
self.role = role
self.properties = properties
class ConversationAccount(Model):
"""Conversation account represents the identity of the conversation within a channel.
:param is_group: Indicates whether the conversation contains more than two
participants at the time the activity was generated
:type is_group: bool
:param conversation_type: Indicates the type of the conversation in
channels that distinguish between conversation types
:type conversation_type: str
:param id: Channel id for the user or bot on this channel (Example:
joe@smith.com, or @joesmith or 123456)
:type id: str
:param name: Display friendly name
:type name: str
:param aad_object_id: This account's object ID within Azure Active
Directory (AAD)
:type aad_object_id: str
:param role: Role of the entity behind the account (Example: User, Bot, Skill
etc.). Possible values include: 'user', 'bot', 'skill'
:type role: str or ~botframework.connector.models.RoleTypes
:param tenant_id: This conversation's tenant ID
:type tenant_id: str
:param properties: This conversation's properties
:type properties: object
"""
_attribute_map = {
"is_group": {"key": "isGroup", "type": "bool"},
"conversation_type": {"key": "conversationType", "type": "str"},
"id": {"key": "id", "type": "str"},
"name": {"key": "name", "type": "str"},
"aad_object_id": {"key": "aadObjectId", "type": "str"},
"role": {"key": "role", "type": "str"},
"tenant_id": {"key": "tenantID", "type": "str"},
"properties": {"key": "properties", "type": "object"},
}
def __init__(
self,
*,
is_group: bool = None,
conversation_type: str = None,
id: str = None,
name: str = None,
aad_object_id: str = None,
role=None,
tenant_id=None,
properties=None,
**kwargs
) -> None:
super(ConversationAccount, self).__init__(**kwargs)
self.is_group = is_group
self.conversation_type = conversation_type
self.id = id
self.name = name
self.aad_object_id = aad_object_id
self.role = role
self.tenant_id = tenant_id
self.properties = properties
class ConversationMembers(Model):
"""Conversation and its members.
:param id: Conversation ID
:type id: str
:param members: List of members in this conversation
:type members: list[~botframework.connector.models.ChannelAccount]
"""
_attribute_map = {
"id": {"key": "id", "type": "str"},
"members": {"key": "members", "type": "[ChannelAccount]"},
}
def __init__(self, *, id: str = None, members=None, **kwargs) -> None:
super(ConversationMembers, self).__init__(**kwargs)
self.id = id
self.members = members
class ConversationParameters(Model):
"""Parameters for creating a new conversation.
:param is_group: IsGroup
:type is_group: bool
:param bot: The bot address for this conversation
:type bot: ~botframework.connector.models.ChannelAccount
:param members: Members to add to the conversation
:type members: list[~botframework.connector.models.ChannelAccount]
:param topic_name: (Optional) Topic of the conversation (if supported by
the channel)
:type topic_name: str
:param activity: (Optional) When creating a new conversation, use this
activity as the initial message to the conversation
:type activity: ~botframework.connector.models.Activity
:param channel_data: Channel specific payload for creating the
conversation
:type channel_data: object
:param tenant_id: (Optional) The tenant ID in which the conversation should be created
:type tenant_id: str
"""
_attribute_map = {
"is_group": {"key": "isGroup", "type": "bool"},
"bot": {"key": "bot", "type": "ChannelAccount"},
"members": {"key": "members", "type": "[ChannelAccount]"},
"topic_name": {"key": "topicName", "type": "str"},
"activity": {"key": "activity", "type": "Activity"},
"channel_data": {"key": "channelData", "type": "object"},
"tenant_id": {"key": "tenantID", "type": "str"},
}
def __init__(
self,
*,
is_group: bool = None,
bot=None,
members=None,
topic_name: str = None,
activity=None,
channel_data=None,
tenant_id=None,
**kwargs
) -> None:
super(ConversationParameters, self).__init__(**kwargs)
self.is_group = is_group
self.bot = bot
self.members = members
self.topic_name = topic_name
self.activity = activity
self.channel_data = channel_data
self.tenant_id = tenant_id
class ConversationResourceResponse(Model):
"""A response containing a resource.
:param activity_id: ID of the Activity (if sent)
:type activity_id: str
:param service_url: Service endpoint where operations concerning the
conversation may be performed
:type service_url: str
:param id: Id of the resource
:type id: str
"""
_attribute_map = {
"activity_id": {"key": "activityId", "type": "str"},
"service_url": {"key": "serviceUrl", "type": "str"},
"id": {"key": "id", "type": "str"},
}
def __init__(
self,
*,
activity_id: str = None,
service_url: str = None,
id: str = None,
**kwargs
) -> None:
super(ConversationResourceResponse, self).__init__(**kwargs)
self.activity_id = activity_id
self.service_url = service_url
self.id = id
class ConversationsResult(Model):
"""Conversations result.
:param continuation_token: Paging token
:type continuation_token: str
:param conversations: List of conversations
:type conversations:
list[~botframework.connector.models.ConversationMembers]
"""
_attribute_map = {
"continuation_token": {"key": "continuationToken", "type": "str"},
"conversations": {"key": "conversations", "type": "[ConversationMembers]"},
}
def __init__(
self, *, continuation_token: str = None, conversations=None, **kwargs
) -> None:
super(ConversationsResult, self).__init__(**kwargs)
self.continuation_token = continuation_token
self.conversations = conversations
class ExpectedReplies(Model):
"""ExpectedReplies.
:param activities: A collection of Activities that conforms to the
ExpectedReplies schema.
:type activities: list[~botframework.connector.models.Activity]
"""
_attribute_map = {"activities": {"key": "activities", "type": "[Activity]"}}
def __init__(self, *, activities=None, **kwargs) -> None:
super(ExpectedReplies, self).__init__(**kwargs)
self.activities = activities
class Entity(Model):
"""Metadata object pertaining to an activity.
:param type: Type of this entity (RFC 3987 IRI)
:type type: str
"""
_attribute_map = {"type": {"key": "type", "type": "str"}}
def __init__(self, *, type: str = None, **kwargs) -> None:
super(Entity, self).__init__(**kwargs)
self.type = type
class Error(Model):
"""Object representing error information.
:param code: Error code
:type code: str
:param message: Error message
:type message: str
:param inner_http_error: Error from inner http call
:type inner_http_error: ~botframework.connector.models.InnerHttpError
"""
_attribute_map = {
"code": {"key": "code", "type": "str"},
"message": {"key": "message", "type": "str"},
"inner_http_error": {"key": "innerHttpError", "type": "InnerHttpError"},
}
def __init__(
self, *, code: str = None, message: str = None, inner_http_error=None, **kwargs
) -> None:
super(Error, self).__init__(**kwargs)
self.code = code
self.message = message
self.inner_http_error = inner_http_error
class ErrorResponse(Model):
"""An HTTP API response.
:param error: Error message
:type error: ~botframework.connector.models.Error
"""
_attribute_map = {"error": {"key": "error", "type": "Error"}}
def __init__(self, *, error=None, **kwargs) -> None:
super(ErrorResponse, self).__init__(**kwargs)
self.error = error
class ErrorResponseException(HttpOperationError):
"""Server responsed with exception of type: 'ErrorResponse'.
:param deserialize: A deserializer
:param response: Server response to be deserialized.
"""
def __init__(self, deserialize, response, *args):
super(ErrorResponseException, self).__init__(
deserialize, response, "ErrorResponse", *args
)
class Fact(Model):
"""Set of key-value pairs. Advantage of this section is that key and value
properties will be
rendered with default style information with some delimiter between them.
So there is no need for developer to specify style information.
:param key: The key for this Fact
:type key: str
:param value: The value for this Fact
:type value: str
"""
_attribute_map = {
"key": {"key": "key", "type": "str"},
"value": {"key": "value", "type": "str"},
}
def __init__(self, *, key: str = None, value: str = None, **kwargs) -> None:
super(Fact, self).__init__(**kwargs)
self.key = key
self.value = value
class GeoCoordinates(Model):
"""GeoCoordinates (entity type: "https://schema.org/GeoCoordinates").
:param elevation: Elevation of the location [WGS
84](https://en.wikipedia.org/wiki/World_Geodetic_System)
:type elevation: float
:param latitude: Latitude of the location [WGS
84](https://en.wikipedia.org/wiki/World_Geodetic_System)
:type latitude: float
:param longitude: Longitude of the location [WGS
84](https://en.wikipedia.org/wiki/World_Geodetic_System)
:type longitude: float
:param type: The type of the thing
:type type: str
:param name: The name of the thing
:type name: str
"""
_attribute_map = {
"elevation": {"key": "elevation", "type": "float"},
"latitude": {"key": "latitude", "type": "float"},
"longitude": {"key": "longitude", "type": "float"},
"type": {"key": "type", "type": "str"},
"name": {"key": "name", "type": "str"},
}
def __init__(
self,
*,
elevation: float = None,
latitude: float = None,
longitude: float = None,
type: str = None,
name: str = None,
**kwargs
) -> None:
super(GeoCoordinates, self).__init__(**kwargs)
self.elevation = elevation
self.latitude = latitude
self.longitude = longitude
self.type = type
self.name = name
class HeroCard(Model):
"""A Hero card (card with a single, large image).
:param title: Title of the card
:type title: str
:param subtitle: Subtitle of the card
:type subtitle: str
:param text: Text for the card
:type text: str
:param images: Array of images for the card
:type images: list[~botframework.connector.models.CardImage]
:param buttons: Set of actions applicable to the current card
:type buttons: list[~botframework.connector.models.CardAction]
:param tap: This action will be activated when user taps on the card
itself
:type tap: ~botframework.connector.models.CardAction
"""
_attribute_map = {
"title": {"key": "title", "type": "str"},
"subtitle": {"key": "subtitle", "type": "str"},
"text": {"key": "text", "type": "str"},
"images": {"key": "images", "type": "[CardImage]"},
"buttons": {"key": "buttons", "type": "[CardAction]"},
"tap": {"key": "tap", "type": "CardAction"},
}
def __init__(
self,
*,
title: str = None,
subtitle: str = None,
text: str = None,
images=None,
buttons=None,
tap=None,
**kwargs
) -> None:
super(HeroCard, self).__init__(**kwargs)
self.title = title
self.subtitle = subtitle
self.text = text
self.images = images
self.buttons = buttons
self.tap = tap
class InnerHttpError(Model):
"""Object representing inner http error.
:param status_code: HttpStatusCode from failed request
:type status_code: int
:param body: Body from failed request
:type body: object
"""
_attribute_map = {
"status_code": {"key": "statusCode", "type": "int"},
"body": {"key": "body", "type": "object"},
}
def __init__(self, *, status_code: int = None, body=None, **kwargs) -> None:
super(InnerHttpError, self).__init__(**kwargs)
self.status_code = status_code
self.body = body
class InvokeResponse(Model):
"""
Tuple class containing an HTTP Status Code and a JSON serializable
object. The HTTP Status code is, in the invoke activity scenario, what will
be set in the resulting POST. The Body of the resulting POST will be
JSON serialized content.
The body content is defined by the producer. The caller must know what
the content is and deserialize as needed.
"""
_attribute_map = {
"status": {"key": "status", "type": "int"},
"body": {"key": "body", "type": "object"},
}
def __init__(self, *, status: int = None, body: object = None, **kwargs):
"""
Gets or sets the HTTP status and/or body code for the response
:param status: The HTTP status code.
:param body: The JSON serializable body content for the response. This object
must be serializable by the core Python json routines. The caller is responsible
for serializing more complex/nested objects into native classes (lists and
dictionaries of strings are acceptable).
"""
super().__init__(**kwargs)
self.status = status
self.body = body
def is_successful_status_code(self) -> bool:
"""
Gets a value indicating whether the invoke response was successful.
:return: A value that indicates if the HTTP response was successful. true if status is in
the Successful range (200-299); otherwise false.
"""
return 200 <= self.status <= 299
class MediaCard(Model):
"""Media card.
:param title: Title of this card
:type title: str
:param subtitle: Subtitle of this card
:type subtitle: str
:param text: Text of this card
:type text: str
:param image: Thumbnail placeholder
:type image: ~botframework.connector.models.ThumbnailUrl
:param media: Media URLs for this card. When this field contains more than
one URL, each URL is an alternative format of the same content.
:type media: list[~botframework.connector.models.MediaUrl]
:param buttons: Actions on this card
:type buttons: list[~botframework.connector.models.CardAction]
:param shareable: This content may be shared with others (default:true)
:type shareable: bool
:param autoloop: Should the client loop playback at end of content
(default:true)
:type autoloop: bool
:param autostart: Should the client automatically start playback of media
in this card (default:true)
:type autostart: bool
:param aspect: Aspect ratio of thumbnail/media placeholder. Allowed values
are "16:9" and "4:3"
:type aspect: str
:param duration: Describes the length of the media content without
requiring a receiver to open the content. Formatted as an ISO 8601
Duration field.
:type duration: str
:param value: Supplementary parameter for this card
:type value: object
"""
_attribute_map = {
"title": {"key": "title", "type": "str"},
"subtitle": {"key": "subtitle", "type": "str"},
"text": {"key": "text", "type": "str"},
"image": {"key": "image", "type": "ThumbnailUrl"},
"media": {"key": "media", "type": "[MediaUrl]"},
"buttons": {"key": "buttons", "type": "[CardAction]"},
"shareable": {"key": "shareable", "type": "bool"},
"autoloop": {"key": "autoloop", "type": "bool"},
"autostart": {"key": "autostart", "type": "bool"},
"aspect": {"key": "aspect", "type": "str"},
"duration": {"key": "duration", "type": "str"},
"value": {"key": "value", "type": "object"},
}
def __init__(
self,
*,
title: str = None,
subtitle: str = None,
text: str = None,
image=None,
media=None,
buttons=None,
shareable: bool = None,
autoloop: bool = None,
autostart: bool = None,
aspect: str = None,
duration: str = None,
value=None,
**kwargs
) -> None:
super(MediaCard, self).__init__(**kwargs)
self.title = title
self.subtitle = subtitle
self.text = text
self.image = image
self.media = media
self.buttons = buttons
self.shareable = shareable
self.autoloop = autoloop
self.autostart = autostart
self.aspect = aspect
self.duration = duration
self.value = value
class MediaEventValue(Model):
"""Supplementary parameter for media events.
:param card_value: Callback parameter specified in the Value field of the
MediaCard that originated this event
:type card_value: object
"""
_attribute_map = {"card_value": {"key": "cardValue", "type": "object"}}
def __init__(self, *, card_value=None, **kwargs) -> None:
super(MediaEventValue, self).__init__(**kwargs)
self.card_value = card_value
class MediaUrl(Model):
"""Media URL.
:param url: Url for the media
:type url: str
:param profile: Optional profile hint to the client to differentiate
multiple MediaUrl objects from each other
:type profile: str
"""
_attribute_map = {
"url": {"key": "url", "type": "str"},
"profile": {"key": "profile", "type": "str"},
}
def __init__(self, *, url: str = None, profile: str = None, **kwargs) -> None:
super(MediaUrl, self).__init__(**kwargs)
self.url = url
self.profile = profile
class MessageReaction(Model):
"""Message reaction object.
:param type: Message reaction type. Possible values include: 'like',
'plusOne'
:type type: str or ~botframework.connector.models.MessageReactionTypes
"""
_attribute_map = {"type": {"key": "type", "type": "str"}}
def __init__(self, *, type=None, **kwargs) -> None:
super(MessageReaction, self).__init__(**kwargs)
self.type = type
class OAuthCard(Model):
"""A card representing a request to perform a sign in via OAuth.
:param text: Text for signin request
:type text: str
:param connection_name: The name of the registered connection
:type connection_name: str
:param buttons: Action to use to perform signin
:type buttons: list[~botframework.connector.models.CardAction]
"""
_attribute_map = {
"text": {"key": "text", "type": "str"},
"connection_name": {"key": "connectionName", "type": "str"},
"buttons": {"key": "buttons", "type": "[CardAction]"},
"token_exchange_resource": {"key": "tokenExchangeResource", "type": "object"},
}
def __init__(
self,
*,
text: str = None,
connection_name: str = None,
buttons=None,
token_exchange_resource=None,
**kwargs
) -> None:
super(OAuthCard, self).__init__(**kwargs)
self.text = text
self.connection_name = connection_name
self.buttons = buttons
self.token_exchange_resource = token_exchange_resource
class PagedMembersResult(Model):
"""Page of members.
:param continuation_token: Paging token
:type continuation_token: str
:param members: The Channel Accounts.
:type members: list[~botframework.connector.models.ChannelAccount]
"""
_attribute_map = {
"continuation_token": {"key": "continuationToken", "type": "str"},
"members": {"key": "members", "type": "[ChannelAccount]"},
}
def __init__(
self, *, continuation_token: str = None, members=None, **kwargs
) -> None:
super(PagedMembersResult, self).__init__(**kwargs)
self.continuation_token = continuation_token
self.members = members
class Place(Model):
"""Place (entity type: "https://schema.org/Place").
:param address: Address of the place (may be `string` or complex object of
type `PostalAddress`)
:type address: object
:param geo: Geo coordinates of the place (may be complex object of type
`GeoCoordinates` or `GeoShape`)
:type geo: object
:param has_map: Map to the place (may be `string` (URL) or complex object
of type `Map`)
:type has_map: object
:param type: The type of the thing
:type type: str
:param name: The name of the thing
:type name: str
"""
_attribute_map = {
"address": {"key": "address", "type": "object"},
"geo": {"key": "geo", "type": "object"},
"has_map": {"key": "hasMap", "type": "object"},
"type": {"key": "type", "type": "str"},
"name": {"key": "name", "type": "str"},
}
def __init__(
self,
*,
address=None,
geo=None,
has_map=None,
type: str = None,
name: str = None,
**kwargs
) -> None:
super(Place, self).__init__(**kwargs)
self.address = address
self.geo = geo
self.has_map = has_map
self.type = type
self.name = name
class ReceiptCard(Model):
"""A receipt card.
:param title: Title of the card
:type title: str
:param facts: Array of Fact objects
:type facts: list[~botframework.connector.models.Fact]
:param items: Array of Receipt Items
:type items: list[~botframework.connector.models.ReceiptItem]
:param tap: This action will be activated when user taps on the card
:type tap: ~botframework.connector.models.CardAction
:param total: Total amount of money paid (or to be paid)
:type total: str
:param tax: Total amount of tax paid (or to be paid)
:type tax: str
:param vat: Total amount of VAT paid (or to be paid)
:type vat: str
:param buttons: Set of actions applicable to the current card
:type buttons: list[~botframework.connector.models.CardAction]
"""
_attribute_map = {
"title": {"key": "title", "type": "str"},
"facts": {"key": "facts", "type": "[Fact]"},
"items": {"key": "items", "type": "[ReceiptItem]"},
"tap": {"key": "tap", "type": "CardAction"},
"total": {"key": "total", "type": "str"},
"tax": {"key": "tax", "type": "str"},
"vat": {"key": "vat", "type": "str"},
"buttons": {"key": "buttons", "type": "[CardAction]"},
}
def __init__(
self,
*,
title: str = None,
facts=None,
items=None,
tap=None,
total: str = None,
tax: str = None,
vat: str = None,
buttons=None,
**kwargs
) -> None:
super(ReceiptCard, self).__init__(**kwargs)
self.title = title
self.facts = facts
self.items = items
self.tap = tap
self.total = total
self.tax = tax
self.vat = vat
self.buttons = buttons
class ReceiptItem(Model):
"""An item on a receipt card.
:param title: Title of the Card
:type title: str
:param subtitle: Subtitle appears just below Title field, differs from
Title in font styling only
:type subtitle: str
:param text: Text field appears just below subtitle, differs from Subtitle
in font styling only
:type text: str
:param image: Image
:type image: ~botframework.connector.models.CardImage
:param price: Amount with currency
:type price: str
:param quantity: Number of items of given kind
:type quantity: str
:param tap: This action will be activated when user taps on the Item
bubble.
:type tap: ~botframework.connector.models.CardAction
"""
_attribute_map = {
"title": {"key": "title", "type": "str"},
"subtitle": {"key": "subtitle", "type": "str"},
"text": {"key": "text", "type": "str"},
"image": {"key": "image", "type": "CardImage"},
"price": {"key": "price", "type": "str"},
"quantity": {"key": "quantity", "type": "str"},
"tap": {"key": "tap", "type": "CardAction"},
}
def __init__(
self,
*,
title: str = None,
subtitle: str = None,
text: str = None,
image=None,
price: str = None,
quantity: str = None,
tap=None,
**kwargs
) -> None:
super(ReceiptItem, self).__init__(**kwargs)
self.title = title
self.subtitle = subtitle
self.text = text
self.image = image
self.price = price
self.quantity = quantity
self.tap = tap
class SemanticAction(Model):
"""Represents a reference to a programmatic action.
:param id: ID of this action
:type id: str
:param entities: Entities associated with this action
:type entities: dict[str, ~botframework.connector.models.Entity]
:param state: State of this action. Allowed values: `start`, `continue`, `done`
:type state: str or ~botframework.connector.models.SemanticActionStates
"""
_attribute_map = {
"id": {"key": "id", "type": "str"},
"entities": {"key": "entities", "type": "{Entity}"},
"state": {"key": "state", "type": "str"},
}
def __init__(self, *, id: str = None, entities=None, state=None, **kwargs) -> None:
super(SemanticAction, self).__init__(**kwargs)
self.id = id
self.entities = entities
self.state = state
class SigninCard(Model):
"""A card representing a request to sign in.
:param text: Text for signin request
:type text: str
:param buttons: Action to use to perform signin
:type buttons: list[~botframework.connector.models.CardAction]
"""
_attribute_map = {
"text": {"key": "text", "type": "str"},
"buttons": {"key": "buttons", "type": "[CardAction]"},
}
def __init__(self, *, text: str = None, buttons=None, **kwargs) -> None:
super(SigninCard, self).__init__(**kwargs)
self.text = text
self.buttons = buttons
class SuggestedActions(Model):
"""SuggestedActions that can be performed.
:param to: Ids of the recipients that the actions should be shown to.
These Ids are relative to the channelId and a subset of all recipients of
the activity
:type to: list[str]
:param actions: Actions that can be shown to the user
:type actions: list[~botframework.connector.models.CardAction]
"""
_attribute_map = {
"to": {"key": "to", "type": "[str]"},
"actions": {"key": "actions", "type": "[CardAction]"},
}
def __init__(self, *, to=None, actions=None, **kwargs) -> None:
super(SuggestedActions, self).__init__(**kwargs)
self.to = to
self.actions = actions
class TextHighlight(Model):
"""Refers to a substring of content within another field.
:param text: Defines the snippet of text to highlight
:type text: str
:param occurrence: Occurrence of the text field within the referenced
text, if multiple exist.
:type occurrence: int
"""
_attribute_map = {
"text": {"key": "text", "type": "str"},
"occurrence": {"key": "occurrence", "type": "int"},
}
def __init__(self, *, text: str = None, occurrence: int = None, **kwargs) -> None:
super(TextHighlight, self).__init__(**kwargs)
self.text = text
self.occurrence = occurrence
class Thing(Model):
"""Thing (entity type: "https://schema.org/Thing").
:param type: The type of the thing
:type type: str
:param name: The name of the thing
:type name: str
"""
_attribute_map = {
"type": {"key": "type", "type": "str"},
"name": {"key": "name", "type": "str"},
}
def __init__(self, *, type: str = None, name: str = None, **kwargs) -> None:
super(Thing, self).__init__(**kwargs)
self.type = type
self.name = name
class ThumbnailCard(Model):
"""A thumbnail card (card with a single, small thumbnail image).
:param title: Title of the card
:type title: str
:param subtitle: Subtitle of the card
:type subtitle: str
:param text: Text for the card
:type text: str
:param images: Array of images for the card
:type images: list[~botframework.connector.models.CardImage]
:param buttons: Set of actions applicable to the current card
:type buttons: list[~botframework.connector.models.CardAction]
:param tap: This action will be activated when user taps on the card
itself
:type tap: ~botframework.connector.models.CardAction
"""
_attribute_map = {
"title": {"key": "title", "type": "str"},
"subtitle": {"key": "subtitle", "type": "str"},
"text": {"key": "text", "type": "str"},
"images": {"key": "images", "type": "[CardImage]"},
"buttons": {"key": "buttons", "type": "[CardAction]"},
"tap": {"key": "tap", "type": "CardAction"},
}
def __init__(
self,
*,
title: str = None,
subtitle: str = None,
text: str = None,
images=None,
buttons=None,
tap=None,
**kwargs
) -> None:
super(ThumbnailCard, self).__init__(**kwargs)
self.title = title
self.subtitle = subtitle
self.text = text
self.images = images
self.buttons = buttons
self.tap = tap
class ThumbnailUrl(Model):
"""Thumbnail URL.
:param url: URL pointing to the thumbnail to use for media content
:type url: str
:param alt: HTML alt text to include on this thumbnail image
:type alt: str
"""
_attribute_map = {
"url": {"key": "url", "type": "str"},
"alt": {"key": "alt", "type": "str"},
}
def __init__(self, *, url: str = None, alt: str = None, **kwargs) -> None:
super(ThumbnailUrl, self).__init__(**kwargs)
self.url = url
self.alt = alt
class TokenExchangeInvokeRequest(Model):
"""TokenExchangeInvokeRequest.
:param id: The id from the OAuthCard.
:type id: str
:param connection_name: The connection name.
:type connection_name: str
:param token: The user token that can be exchanged.
:type token: str
:param properties: Extension data for overflow of properties.
:type properties: dict[str, object]
"""
_attribute_map = {
"id": {"key": "id", "type": "str"},
"connection_name": {"key": "connectionName", "type": "str"},
"token": {"key": "token", "type": "str"},
"properties": {"key": "properties", "type": "{object}"},
}
def __init__(
self,
*,
id: str = None,
connection_name: str = None,
token: str = None,
properties=None,
**kwargs
) -> None:
super(TokenExchangeInvokeRequest, self).__init__(**kwargs)
self.id = id
self.connection_name = connection_name
self.token = token
self.properties = properties
class TokenExchangeInvokeResponse(Model):
"""TokenExchangeInvokeResponse.
:param id: The id from the OAuthCard.
:type id: str
:param connection_name: The connection name.
:type connection_name: str
:param failure_detail: The details of why the token exchange failed.
:type failure_detail: str
:param properties: Extension data for overflow of properties.
:type properties: dict[str, object]
"""
_attribute_map = {
"id": {"key": "id", "type": "str"},
"connection_name": {"key": "connectionName", "type": "str"},
"failure_detail": {"key": "failureDetail", "type": "str"},
"properties": {"key": "properties", "type": "{object}"},
}
def __init__(
self,
*,
id: str = None,
connection_name: str = None,
failure_detail: str = None,
properties=None,
**kwargs
) -> None:
super(TokenExchangeInvokeResponse, self).__init__(**kwargs)
self.id = id
self.connection_name = connection_name
self.failure_detail = failure_detail
self.properties = properties
class TokenExchangeState(Model):
"""TokenExchangeState
:param connection_name: The connection name that was used.
:type connection_name: str
:param conversation: Gets or sets a reference to the conversation.
:type conversation: ~botframework.connector.models.ConversationReference
:param relates_to: Gets or sets a reference to a related parent conversation for this token exchange.
:type relates_to: ~botframework.connector.models.ConversationReference
:param bot_ur: The URL of the bot messaging endpoint.
:type bot_ur: str
:param ms_app_id: The bot's registered application ID.
:type ms_app_id: str
"""
_attribute_map = {
"connection_name": {"key": "connectionName", "type": "str"},
"conversation": {"key": "conversation", "type": "ConversationReference"},
"relates_to": {"key": "relatesTo", "type": "ConversationReference"},
"bot_url": {"key": "connectionName", "type": "str"},
"ms_app_id": {"key": "msAppId", "type": "str"},
}
def __init__(
self,
*,
connection_name: str = None,
conversation=None,
relates_to=None,
bot_url: str = None,
ms_app_id: str = None,
**kwargs
) -> None:
super(TokenExchangeState, self).__init__(**kwargs)
self.connection_name = connection_name
self.conversation = conversation
self.relates_to = relates_to
self.bot_url = bot_url
self.ms_app_id = ms_app_id
class TokenRequest(Model):
"""A request to receive a user token.
:param provider: The provider to request a user token from
:type provider: str
:param settings: A collection of settings for the specific provider for
this request
:type settings: dict[str, object]
"""
_attribute_map = {
"provider": {"key": "provider", "type": "str"},
"settings": {"key": "settings", "type": "{object}"},
}
def __init__(self, *, provider: str = None, settings=None, **kwargs) -> None:
super(TokenRequest, self).__init__(**kwargs)
self.provider = provider
self.settings = settings
class TokenResponse(Model):
"""A response that includes a user token.
:param connection_name: The connection name
:type connection_name: str
:param token: The user token
:type token: str
:param expiration: Expiration for the token, in ISO 8601 format (e.g.
"2007-04-05T14:30Z")
:type expiration: str
:param channel_id: The channelId of the TokenResponse
:type channel_id: str
"""
_attribute_map = {
"connection_name": {"key": "connectionName", "type": "str"},
"token": {"key": "token", "type": "str"},
"expiration": {"key": "expiration", "type": "str"},
"channel_id": {"key": "channelId", "type": "str"},
}
def __init__(
self,
*,
connection_name: str = None,
token: str = None,
expiration: str = None,
channel_id: str = None,
**kwargs
) -> None:
super(TokenResponse, self).__init__(**kwargs)
self.connection_name = connection_name
self.token = token
self.expiration = expiration
self.channel_id = channel_id
class Transcript(Model):
"""Transcript.
:param activities: A collection of Activities that conforms to the
Transcript schema.
:type activities: list[~botframework.connector.models.Activity]
"""
_attribute_map = {"activities": {"key": "activities", "type": "[Activity]"}}
def __init__(self, *, activities=None, **kwargs) -> None:
super(Transcript, self).__init__(**kwargs)
self.activities = activities
class VideoCard(Model):
"""Video card.
:param title: Title of this card
:type title: str
:param subtitle: Subtitle of this card
:type subtitle: str
:param text: Text of this card
:type text: str
:param image: Thumbnail placeholder
:type image: ~botframework.connector.models.ThumbnailUrl
:param media: Media URLs for this card. When this field contains more than
one URL, each URL is an alternative format of the same content.
:type media: list[~botframework.connector.models.MediaUrl]
:param buttons: Actions on this card
:type buttons: list[~botframework.connector.models.CardAction]
:param shareable: This content may be shared with others (default:true)
:type shareable: bool
:param autoloop: Should the client loop playback at end of content
(default:true)
:type autoloop: bool
:param autostart: Should the client automatically start playback of media
in this card (default:true)
:type autostart: bool
:param aspect: Aspect ratio of thumbnail/media placeholder. Allowed values
are "16:9" and "4:3"
:type aspect: str
:param duration: Describes the length of the media content without
requiring a receiver to open the content. Formatted as an ISO 8601
Duration field.
:type duration: str
:param value: Supplementary parameter for this card
:type value: object
"""
_attribute_map = {
"title": {"key": "title", "type": "str"},
"subtitle": {"key": "subtitle", "type": "str"},
"text": {"key": "text", "type": "str"},
"image": {"key": "image", "type": "ThumbnailUrl"},
"media": {"key": "media", "type": "[MediaUrl]"},
"buttons": {"key": "buttons", "type": "[CardAction]"},
"shareable": {"key": "shareable", "type": "bool"},
"autoloop": {"key": "autoloop", "type": "bool"},
"autostart": {"key": "autostart", "type": "bool"},
"aspect": {"key": "aspect", "type": "str"},
"duration": {"key": "duration", "type": "str"},
"value": {"key": "value", "type": "object"},
}
def __init__(
self,
*,
title: str = None,
subtitle: str = None,
text: str = None,
image=None,
media=None,
buttons=None,
shareable: bool = None,
autoloop: bool = None,
autostart: bool = None,
aspect: str = None,
duration: str = None,
value=None,
**kwargs
) -> None:
super(VideoCard, self).__init__(**kwargs)
self.title = title
self.subtitle = subtitle
self.text = text
self.image = image
self.media = media
self.buttons = buttons
self.shareable = shareable
self.autoloop = autoloop
self.autostart = autostart
self.aspect = aspect
self.duration = duration
self.value = value
class AdaptiveCardInvokeAction(Model):
"""AdaptiveCardInvokeAction.
Defines the structure that arrives in the Activity.Value.Action for Invoke activity with
name of 'adaptiveCard/action'.
:param type: The Type of this Adaptive Card Invoke Action.
:type type: str
:param id: The Id of this Adaptive Card Invoke Action.
:type id: str
:param verb: The Verb of this Adaptive Card Invoke Action.
:type verb: str
:param data: The data of this Adaptive Card Invoke Action.
:type data: dict[str, object]
"""
_attribute_map = {
"type": {"key": "type", "type": "str"},
"id": {"key": "id", "type": "str"},
"verb": {"key": "verb", "type": "str"},
"data": {"key": "data", "type": "{object}"},
}
def __init__(
self, *, type: str = None, id: str = None, verb: str = None, data=None, **kwargs
) -> None:
super(AdaptiveCardInvokeAction, self).__init__(**kwargs)
self.type = type
self.id = id
self.verb = verb
self.data = data
class AdaptiveCardInvokeResponse(Model):
"""AdaptiveCardInvokeResponse.
Defines the structure that is returned as the result of an Invoke activity with Name of 'adaptiveCard/action'.
:param status_code: The Card Action Response StatusCode.
:type status_code: int
:param type: The type of this Card Action Response.
:type type: str
:param value: The JSON response object.
:type value: dict[str, object]
"""
_attribute_map = {
"status_code": {"key": "statusCode", "type": "int"},
"type": {"key": "type", "type": "str"},
"value": {"key": "value", "type": "{object}"},
}
def __init__(
self, *, status_code: int = None, type: str = None, value=None, **kwargs
) -> None:
super(AdaptiveCardInvokeResponse, self).__init__(**kwargs)
self.status_code = status_code
self.type = type
self.value = value
class AdaptiveCardInvokeValue(Model):
"""AdaptiveCardInvokeResponse.
Defines the structure that arrives in the Activity.Value for Invoke activity with Name of 'adaptiveCard/action'.
:param action: The action of this adaptive card invoke action value.
:type action: :class:`botframework.schema.models.AdaptiveCardInvokeAction`
:param authentication: The TokenExchangeInvokeRequest for this adaptive card invoke action value.
:type authentication: :class:`botframework.schema.models.TokenExchangeInvokeRequest`
:param state: The 'state' or magic code for an OAuth flow.
:type state: str
"""
_attribute_map = {
"action": {"key": "action", "type": "{object}"},
"authentication": {"key": "authentication", "type": "{object}"},
"state": {"key": "state", "type": "str"},
}
def __init__(
self, *, action=None, authentication=None, state: str = None, **kwargs
) -> None:
super(AdaptiveCardInvokeValue, self).__init__(**kwargs)
self.action = action
self.authentication = authentication
self.state = state
|