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
|
# -*- coding: utf-8 -*-
# Auto-generated by Stone, do not modify.
# @generated
# flake8: noqa
# pylint: skip-file
"""
This namespace contains helpers for property and template metadata endpoints.
These endpoints enable you to tag arbitrary key/value data to Dropbox files.
The most basic unit in this namespace is the :class:`PropertyField`. These fields encapsulate the actual key/value data.
Fields are added to a Dropbox file using a :class:`PropertyGroup`. Property groups contain a reference to a Dropbox file and a :class:`PropertyGroupTemplate`. Property groups are uniquely identified by the combination of their associated Dropbox file and template.
The :class:`PropertyGroupTemplate` is a way of restricting the possible key names and value types of the data within a property group. The possible key names and value types are explicitly enumerated using :class:`PropertyFieldTemplate` objects.
You can think of a property group template as a class definition for a particular key/value metadata object, and the property groups themselves as the instantiations of these objects.
Templates are owned either by a user/app pair or team/app pair. Templates and their associated properties can't be accessed by any app other than the app that created them, and even then, only when the app is linked with the owner of the template (either a user or team).
User-owned templates are accessed via the user-auth file_properties/templates/*_for_user endpoints, while team-owned templates are accessed via the team-auth file_properties/templates/*_for_team endpoints. Properties associated with either type of template can be accessed via the user-auth properties/* endpoints.
Finally, properties can be accessed from a number of endpoints that return metadata, including `files/get_metadata`, and `files/list_folder`. Properties can also be added during upload, using `files/upload`.
"""
from __future__ import unicode_literals
from stone.backends.python_rsrc import stone_base as bb
from stone.backends.python_rsrc import stone_validators as bv
class AddPropertiesArg(bb.Struct):
"""
:ivar file_properties.AddPropertiesArg.path: A unique identifier for the
file or folder.
:ivar file_properties.AddPropertiesArg.property_groups: The property groups
which are to be added to a Dropbox file. No two groups in the input
should refer to the same template.
"""
__slots__ = [
'_path_value',
'_property_groups_value',
]
_has_required_fields = True
def __init__(self,
path=None,
property_groups=None):
self._path_value = bb.NOT_SET
self._property_groups_value = bb.NOT_SET
if path is not None:
self.path = path
if property_groups is not None:
self.property_groups = property_groups
# Instance attribute type: str (validator is set below)
path = bb.Attribute("path")
# Instance attribute type: list of [PropertyGroup] (validator is set below)
property_groups = bb.Attribute("property_groups")
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(AddPropertiesArg, self)._process_custom_annotations(annotation_type, field_path, processor)
AddPropertiesArg_validator = bv.Struct(AddPropertiesArg)
class TemplateError(bb.Union):
"""
This class acts as a tagged union. Only one of the ``is_*`` methods will
return true. To get the associated value of a tag (if one exists), use the
corresponding ``get_*`` method.
:ivar str file_properties.TemplateError.template_not_found: Template does
not exist for the given identifier.
:ivar file_properties.TemplateError.restricted_content: You do not have
permission to modify this template.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
restricted_content = None
# Attribute is overwritten below the class definition
other = None
@classmethod
def template_not_found(cls, val):
"""
Create an instance of this class set to the ``template_not_found`` tag
with value ``val``.
:param str val:
:rtype: TemplateError
"""
return cls('template_not_found', val)
def is_template_not_found(self):
"""
Check if the union tag is ``template_not_found``.
:rtype: bool
"""
return self._tag == 'template_not_found'
def is_restricted_content(self):
"""
Check if the union tag is ``restricted_content``.
:rtype: bool
"""
return self._tag == 'restricted_content'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def get_template_not_found(self):
"""
Template does not exist for the given identifier.
Only call this if :meth:`is_template_not_found` is true.
:rtype: str
"""
if not self.is_template_not_found():
raise AttributeError("tag 'template_not_found' not set")
return self._value
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(TemplateError, self)._process_custom_annotations(annotation_type, field_path, processor)
TemplateError_validator = bv.Union(TemplateError)
class PropertiesError(TemplateError):
"""
This class acts as a tagged union. Only one of the ``is_*`` methods will
return true. To get the associated value of a tag (if one exists), use the
corresponding ``get_*`` method.
:ivar file_properties.PropertiesError.unsupported_folder: This folder cannot
be tagged. Tagging folders is not supported for team-owned templates.
"""
# Attribute is overwritten below the class definition
unsupported_folder = None
@classmethod
def path(cls, val):
"""
Create an instance of this class set to the ``path`` tag with value
``val``.
:param LookupError val:
:rtype: PropertiesError
"""
return cls('path', val)
def is_path(self):
"""
Check if the union tag is ``path``.
:rtype: bool
"""
return self._tag == 'path'
def is_unsupported_folder(self):
"""
Check if the union tag is ``unsupported_folder``.
:rtype: bool
"""
return self._tag == 'unsupported_folder'
def get_path(self):
"""
Only call this if :meth:`is_path` is true.
:rtype: LookupError
"""
if not self.is_path():
raise AttributeError("tag 'path' not set")
return self._value
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(PropertiesError, self)._process_custom_annotations(annotation_type, field_path, processor)
PropertiesError_validator = bv.Union(PropertiesError)
class InvalidPropertyGroupError(PropertiesError):
"""
This class acts as a tagged union. Only one of the ``is_*`` methods will
return true. To get the associated value of a tag (if one exists), use the
corresponding ``get_*`` method.
:ivar file_properties.InvalidPropertyGroupError.property_field_too_large:
One or more of the supplied property field values is too large.
:ivar file_properties.InvalidPropertyGroupError.does_not_fit_template: One
or more of the supplied property fields does not conform to the template
specifications.
:ivar file_properties.InvalidPropertyGroupError.duplicate_property_groups:
There are 2 or more property groups referring to the same templates in
the input.
"""
# Attribute is overwritten below the class definition
property_field_too_large = None
# Attribute is overwritten below the class definition
does_not_fit_template = None
# Attribute is overwritten below the class definition
duplicate_property_groups = None
def is_property_field_too_large(self):
"""
Check if the union tag is ``property_field_too_large``.
:rtype: bool
"""
return self._tag == 'property_field_too_large'
def is_does_not_fit_template(self):
"""
Check if the union tag is ``does_not_fit_template``.
:rtype: bool
"""
return self._tag == 'does_not_fit_template'
def is_duplicate_property_groups(self):
"""
Check if the union tag is ``duplicate_property_groups``.
:rtype: bool
"""
return self._tag == 'duplicate_property_groups'
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(InvalidPropertyGroupError, self)._process_custom_annotations(annotation_type, field_path, processor)
InvalidPropertyGroupError_validator = bv.Union(InvalidPropertyGroupError)
class AddPropertiesError(InvalidPropertyGroupError):
"""
This class acts as a tagged union. Only one of the ``is_*`` methods will
return true. To get the associated value of a tag (if one exists), use the
corresponding ``get_*`` method.
:ivar file_properties.AddPropertiesError.property_group_already_exists: A
property group associated with this template and file already exists.
"""
# Attribute is overwritten below the class definition
property_group_already_exists = None
def is_property_group_already_exists(self):
"""
Check if the union tag is ``property_group_already_exists``.
:rtype: bool
"""
return self._tag == 'property_group_already_exists'
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(AddPropertiesError, self)._process_custom_annotations(annotation_type, field_path, processor)
AddPropertiesError_validator = bv.Union(AddPropertiesError)
class PropertyGroupTemplate(bb.Struct):
"""
Defines how a property group may be structured.
:ivar file_properties.PropertyGroupTemplate.name: Display name for the
template. Template names can be up to 256 bytes.
:ivar file_properties.PropertyGroupTemplate.description: Description for the
template. Template descriptions can be up to 1024 bytes.
:ivar file_properties.PropertyGroupTemplate.fields: Definitions of the
property fields associated with this template. There can be up to 32
properties in a single template.
"""
__slots__ = [
'_name_value',
'_description_value',
'_fields_value',
]
_has_required_fields = True
def __init__(self,
name=None,
description=None,
fields=None):
self._name_value = bb.NOT_SET
self._description_value = bb.NOT_SET
self._fields_value = bb.NOT_SET
if name is not None:
self.name = name
if description is not None:
self.description = description
if fields is not None:
self.fields = fields
# Instance attribute type: str (validator is set below)
name = bb.Attribute("name")
# Instance attribute type: str (validator is set below)
description = bb.Attribute("description")
# Instance attribute type: list of [PropertyFieldTemplate] (validator is set below)
fields = bb.Attribute("fields")
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(PropertyGroupTemplate, self)._process_custom_annotations(annotation_type, field_path, processor)
PropertyGroupTemplate_validator = bv.Struct(PropertyGroupTemplate)
class AddTemplateArg(PropertyGroupTemplate):
__slots__ = [
]
_has_required_fields = True
def __init__(self,
name=None,
description=None,
fields=None):
super(AddTemplateArg, self).__init__(name,
description,
fields)
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(AddTemplateArg, self)._process_custom_annotations(annotation_type, field_path, processor)
AddTemplateArg_validator = bv.Struct(AddTemplateArg)
class AddTemplateResult(bb.Struct):
"""
:ivar file_properties.AddTemplateResult.template_id: An identifier for
template added by See
:meth:`dropbox.dropbox_client.Dropbox.file_properties_templates_add_for_user`
or
:meth:`dropbox.dropbox_client.Dropbox.file_properties_templates_add_for_team`.
"""
__slots__ = [
'_template_id_value',
]
_has_required_fields = True
def __init__(self,
template_id=None):
self._template_id_value = bb.NOT_SET
if template_id is not None:
self.template_id = template_id
# Instance attribute type: str (validator is set below)
template_id = bb.Attribute("template_id")
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(AddTemplateResult, self)._process_custom_annotations(annotation_type, field_path, processor)
AddTemplateResult_validator = bv.Struct(AddTemplateResult)
class GetTemplateArg(bb.Struct):
"""
:ivar file_properties.GetTemplateArg.template_id: An identifier for template
added by route See
:meth:`dropbox.dropbox_client.Dropbox.file_properties_templates_add_for_user`
or
:meth:`dropbox.dropbox_client.Dropbox.file_properties_templates_add_for_team`.
"""
__slots__ = [
'_template_id_value',
]
_has_required_fields = True
def __init__(self,
template_id=None):
self._template_id_value = bb.NOT_SET
if template_id is not None:
self.template_id = template_id
# Instance attribute type: str (validator is set below)
template_id = bb.Attribute("template_id")
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(GetTemplateArg, self)._process_custom_annotations(annotation_type, field_path, processor)
GetTemplateArg_validator = bv.Struct(GetTemplateArg)
class GetTemplateResult(PropertyGroupTemplate):
__slots__ = [
]
_has_required_fields = True
def __init__(self,
name=None,
description=None,
fields=None):
super(GetTemplateResult, self).__init__(name,
description,
fields)
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(GetTemplateResult, self)._process_custom_annotations(annotation_type, field_path, processor)
GetTemplateResult_validator = bv.Struct(GetTemplateResult)
class ListTemplateResult(bb.Struct):
"""
:ivar file_properties.ListTemplateResult.template_ids: List of identifiers
for templates added by See
:meth:`dropbox.dropbox_client.Dropbox.file_properties_templates_add_for_user`
or
:meth:`dropbox.dropbox_client.Dropbox.file_properties_templates_add_for_team`.
"""
__slots__ = [
'_template_ids_value',
]
_has_required_fields = True
def __init__(self,
template_ids=None):
self._template_ids_value = bb.NOT_SET
if template_ids is not None:
self.template_ids = template_ids
# Instance attribute type: list of [str] (validator is set below)
template_ids = bb.Attribute("template_ids")
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(ListTemplateResult, self)._process_custom_annotations(annotation_type, field_path, processor)
ListTemplateResult_validator = bv.Struct(ListTemplateResult)
class LogicalOperator(bb.Union):
"""
Logical operator to join search queries together.
This class acts as a tagged union. Only one of the ``is_*`` methods will
return true. To get the associated value of a tag (if one exists), use the
corresponding ``get_*`` method.
:ivar file_properties.LogicalOperator.or_operator: Append a query with an
"or" operator.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
or_operator = None
# Attribute is overwritten below the class definition
other = None
def is_or_operator(self):
"""
Check if the union tag is ``or_operator``.
:rtype: bool
"""
return self._tag == 'or_operator'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(LogicalOperator, self)._process_custom_annotations(annotation_type, field_path, processor)
LogicalOperator_validator = bv.Union(LogicalOperator)
class LookUpPropertiesError(bb.Union):
"""
This class acts as a tagged union. Only one of the ``is_*`` methods will
return true. To get the associated value of a tag (if one exists), use the
corresponding ``get_*`` method.
:ivar file_properties.LookUpPropertiesError.property_group_not_found: No
property group was found.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
property_group_not_found = None
# Attribute is overwritten below the class definition
other = None
def is_property_group_not_found(self):
"""
Check if the union tag is ``property_group_not_found``.
:rtype: bool
"""
return self._tag == 'property_group_not_found'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(LookUpPropertiesError, self)._process_custom_annotations(annotation_type, field_path, processor)
LookUpPropertiesError_validator = bv.Union(LookUpPropertiesError)
class LookupError(bb.Union):
"""
This class acts as a tagged union. Only one of the ``is_*`` methods will
return true. To get the associated value of a tag (if one exists), use the
corresponding ``get_*`` method.
:ivar file_properties.LookupError.not_found: There is nothing at the given
path.
:ivar file_properties.LookupError.not_file: We were expecting a file, but
the given path refers to something that isn't a file.
:ivar file_properties.LookupError.not_folder: We were expecting a folder,
but the given path refers to something that isn't a folder.
:ivar file_properties.LookupError.restricted_content: The file cannot be
transferred because the content is restricted. For example, we might
restrict a file due to legal requirements.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
not_found = None
# Attribute is overwritten below the class definition
not_file = None
# Attribute is overwritten below the class definition
not_folder = None
# Attribute is overwritten below the class definition
restricted_content = None
# Attribute is overwritten below the class definition
other = None
@classmethod
def malformed_path(cls, val):
"""
Create an instance of this class set to the ``malformed_path`` tag with
value ``val``.
:param str val:
:rtype: LookupError
"""
return cls('malformed_path', val)
def is_malformed_path(self):
"""
Check if the union tag is ``malformed_path``.
:rtype: bool
"""
return self._tag == 'malformed_path'
def is_not_found(self):
"""
Check if the union tag is ``not_found``.
:rtype: bool
"""
return self._tag == 'not_found'
def is_not_file(self):
"""
Check if the union tag is ``not_file``.
:rtype: bool
"""
return self._tag == 'not_file'
def is_not_folder(self):
"""
Check if the union tag is ``not_folder``.
:rtype: bool
"""
return self._tag == 'not_folder'
def is_restricted_content(self):
"""
Check if the union tag is ``restricted_content``.
:rtype: bool
"""
return self._tag == 'restricted_content'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def get_malformed_path(self):
"""
Only call this if :meth:`is_malformed_path` is true.
:rtype: str
"""
if not self.is_malformed_path():
raise AttributeError("tag 'malformed_path' not set")
return self._value
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(LookupError, self)._process_custom_annotations(annotation_type, field_path, processor)
LookupError_validator = bv.Union(LookupError)
class ModifyTemplateError(TemplateError):
"""
This class acts as a tagged union. Only one of the ``is_*`` methods will
return true. To get the associated value of a tag (if one exists), use the
corresponding ``get_*`` method.
:ivar file_properties.ModifyTemplateError.conflicting_property_names: A
property field key with that name already exists in the template.
:ivar file_properties.ModifyTemplateError.too_many_properties: There are too
many properties in the changed template. The maximum number of
properties per template is 32.
:ivar file_properties.ModifyTemplateError.too_many_templates: There are too
many templates for the team.
:ivar file_properties.ModifyTemplateError.template_attribute_too_large: The
template name, description or one or more of the property field keys is
too large.
"""
# Attribute is overwritten below the class definition
conflicting_property_names = None
# Attribute is overwritten below the class definition
too_many_properties = None
# Attribute is overwritten below the class definition
too_many_templates = None
# Attribute is overwritten below the class definition
template_attribute_too_large = None
def is_conflicting_property_names(self):
"""
Check if the union tag is ``conflicting_property_names``.
:rtype: bool
"""
return self._tag == 'conflicting_property_names'
def is_too_many_properties(self):
"""
Check if the union tag is ``too_many_properties``.
:rtype: bool
"""
return self._tag == 'too_many_properties'
def is_too_many_templates(self):
"""
Check if the union tag is ``too_many_templates``.
:rtype: bool
"""
return self._tag == 'too_many_templates'
def is_template_attribute_too_large(self):
"""
Check if the union tag is ``template_attribute_too_large``.
:rtype: bool
"""
return self._tag == 'template_attribute_too_large'
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(ModifyTemplateError, self)._process_custom_annotations(annotation_type, field_path, processor)
ModifyTemplateError_validator = bv.Union(ModifyTemplateError)
class OverwritePropertyGroupArg(bb.Struct):
"""
:ivar file_properties.OverwritePropertyGroupArg.path: A unique identifier
for the file or folder.
:ivar file_properties.OverwritePropertyGroupArg.property_groups: The
property groups "snapshot" updates to force apply. No two groups in the
input should refer to the same template.
"""
__slots__ = [
'_path_value',
'_property_groups_value',
]
_has_required_fields = True
def __init__(self,
path=None,
property_groups=None):
self._path_value = bb.NOT_SET
self._property_groups_value = bb.NOT_SET
if path is not None:
self.path = path
if property_groups is not None:
self.property_groups = property_groups
# Instance attribute type: str (validator is set below)
path = bb.Attribute("path")
# Instance attribute type: list of [PropertyGroup] (validator is set below)
property_groups = bb.Attribute("property_groups")
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(OverwritePropertyGroupArg, self)._process_custom_annotations(annotation_type, field_path, processor)
OverwritePropertyGroupArg_validator = bv.Struct(OverwritePropertyGroupArg)
class PropertiesSearchArg(bb.Struct):
"""
:ivar file_properties.PropertiesSearchArg.queries: Queries to search.
:ivar file_properties.PropertiesSearchArg.template_filter: Filter results to
contain only properties associated with these template IDs.
"""
__slots__ = [
'_queries_value',
'_template_filter_value',
]
_has_required_fields = True
def __init__(self,
queries=None,
template_filter=None):
self._queries_value = bb.NOT_SET
self._template_filter_value = bb.NOT_SET
if queries is not None:
self.queries = queries
if template_filter is not None:
self.template_filter = template_filter
# Instance attribute type: list of [PropertiesSearchQuery] (validator is set below)
queries = bb.Attribute("queries")
# Instance attribute type: TemplateFilter (validator is set below)
template_filter = bb.Attribute("template_filter", user_defined=True)
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(PropertiesSearchArg, self)._process_custom_annotations(annotation_type, field_path, processor)
PropertiesSearchArg_validator = bv.Struct(PropertiesSearchArg)
class PropertiesSearchContinueArg(bb.Struct):
"""
:ivar file_properties.PropertiesSearchContinueArg.cursor: The cursor
returned by your last call to
:meth:`dropbox.dropbox_client.Dropbox.file_properties_properties_search`
or
:meth:`dropbox.dropbox_client.Dropbox.file_properties_properties_search_continue`.
"""
__slots__ = [
'_cursor_value',
]
_has_required_fields = True
def __init__(self,
cursor=None):
self._cursor_value = bb.NOT_SET
if cursor is not None:
self.cursor = cursor
# Instance attribute type: str (validator is set below)
cursor = bb.Attribute("cursor")
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(PropertiesSearchContinueArg, self)._process_custom_annotations(annotation_type, field_path, processor)
PropertiesSearchContinueArg_validator = bv.Struct(PropertiesSearchContinueArg)
class PropertiesSearchContinueError(bb.Union):
"""
This class acts as a tagged union. Only one of the ``is_*`` methods will
return true. To get the associated value of a tag (if one exists), use the
corresponding ``get_*`` method.
:ivar file_properties.PropertiesSearchContinueError.reset: Indicates that
the cursor has been invalidated. Call
:meth:`dropbox.dropbox_client.Dropbox.file_properties_properties_search`
to obtain a new cursor.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
reset = None
# Attribute is overwritten below the class definition
other = None
def is_reset(self):
"""
Check if the union tag is ``reset``.
:rtype: bool
"""
return self._tag == 'reset'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(PropertiesSearchContinueError, self)._process_custom_annotations(annotation_type, field_path, processor)
PropertiesSearchContinueError_validator = bv.Union(PropertiesSearchContinueError)
class PropertiesSearchError(bb.Union):
"""
This class acts as a tagged union. Only one of the ``is_*`` methods will
return true. To get the associated value of a tag (if one exists), use the
corresponding ``get_*`` method.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
other = None
@classmethod
def property_group_lookup(cls, val):
"""
Create an instance of this class set to the ``property_group_lookup``
tag with value ``val``.
:param LookUpPropertiesError val:
:rtype: PropertiesSearchError
"""
return cls('property_group_lookup', val)
def is_property_group_lookup(self):
"""
Check if the union tag is ``property_group_lookup``.
:rtype: bool
"""
return self._tag == 'property_group_lookup'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def get_property_group_lookup(self):
"""
Only call this if :meth:`is_property_group_lookup` is true.
:rtype: LookUpPropertiesError
"""
if not self.is_property_group_lookup():
raise AttributeError("tag 'property_group_lookup' not set")
return self._value
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(PropertiesSearchError, self)._process_custom_annotations(annotation_type, field_path, processor)
PropertiesSearchError_validator = bv.Union(PropertiesSearchError)
class PropertiesSearchMatch(bb.Struct):
"""
:ivar file_properties.PropertiesSearchMatch.id: The ID for the matched file
or folder.
:ivar file_properties.PropertiesSearchMatch.path: The path for the matched
file or folder.
:ivar file_properties.PropertiesSearchMatch.is_deleted: Whether the file or
folder is deleted.
:ivar file_properties.PropertiesSearchMatch.property_groups: List of custom
property groups associated with the file.
"""
__slots__ = [
'_id_value',
'_path_value',
'_is_deleted_value',
'_property_groups_value',
]
_has_required_fields = True
def __init__(self,
id=None,
path=None,
is_deleted=None,
property_groups=None):
self._id_value = bb.NOT_SET
self._path_value = bb.NOT_SET
self._is_deleted_value = bb.NOT_SET
self._property_groups_value = bb.NOT_SET
if id is not None:
self.id = id
if path is not None:
self.path = path
if is_deleted is not None:
self.is_deleted = is_deleted
if property_groups is not None:
self.property_groups = property_groups
# Instance attribute type: str (validator is set below)
id = bb.Attribute("id")
# Instance attribute type: str (validator is set below)
path = bb.Attribute("path")
# Instance attribute type: bool (validator is set below)
is_deleted = bb.Attribute("is_deleted")
# Instance attribute type: list of [PropertyGroup] (validator is set below)
property_groups = bb.Attribute("property_groups")
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(PropertiesSearchMatch, self)._process_custom_annotations(annotation_type, field_path, processor)
PropertiesSearchMatch_validator = bv.Struct(PropertiesSearchMatch)
class PropertiesSearchMode(bb.Union):
"""
This class acts as a tagged union. Only one of the ``is_*`` methods will
return true. To get the associated value of a tag (if one exists), use the
corresponding ``get_*`` method.
:ivar str file_properties.PropertiesSearchMode.field_name: Search for a
value associated with this field name.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
other = None
@classmethod
def field_name(cls, val):
"""
Create an instance of this class set to the ``field_name`` tag with
value ``val``.
:param str val:
:rtype: PropertiesSearchMode
"""
return cls('field_name', val)
def is_field_name(self):
"""
Check if the union tag is ``field_name``.
:rtype: bool
"""
return self._tag == 'field_name'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def get_field_name(self):
"""
Search for a value associated with this field name.
Only call this if :meth:`is_field_name` is true.
:rtype: str
"""
if not self.is_field_name():
raise AttributeError("tag 'field_name' not set")
return self._value
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(PropertiesSearchMode, self)._process_custom_annotations(annotation_type, field_path, processor)
PropertiesSearchMode_validator = bv.Union(PropertiesSearchMode)
class PropertiesSearchQuery(bb.Struct):
"""
:ivar file_properties.PropertiesSearchQuery.query: The property field value
for which to search across templates.
:ivar file_properties.PropertiesSearchQuery.mode: The mode with which to
perform the search.
:ivar file_properties.PropertiesSearchQuery.logical_operator: The logical
operator with which to append the query.
"""
__slots__ = [
'_query_value',
'_mode_value',
'_logical_operator_value',
]
_has_required_fields = True
def __init__(self,
query=None,
mode=None,
logical_operator=None):
self._query_value = bb.NOT_SET
self._mode_value = bb.NOT_SET
self._logical_operator_value = bb.NOT_SET
if query is not None:
self.query = query
if mode is not None:
self.mode = mode
if logical_operator is not None:
self.logical_operator = logical_operator
# Instance attribute type: str (validator is set below)
query = bb.Attribute("query")
# Instance attribute type: PropertiesSearchMode (validator is set below)
mode = bb.Attribute("mode", user_defined=True)
# Instance attribute type: LogicalOperator (validator is set below)
logical_operator = bb.Attribute("logical_operator", user_defined=True)
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(PropertiesSearchQuery, self)._process_custom_annotations(annotation_type, field_path, processor)
PropertiesSearchQuery_validator = bv.Struct(PropertiesSearchQuery)
class PropertiesSearchResult(bb.Struct):
"""
:ivar file_properties.PropertiesSearchResult.matches: A list (possibly
empty) of matches for the query.
:ivar file_properties.PropertiesSearchResult.cursor: Pass the cursor into
:meth:`dropbox.dropbox_client.Dropbox.file_properties_properties_search_continue`
to continue to receive search results. Cursor will be null when there
are no more results.
"""
__slots__ = [
'_matches_value',
'_cursor_value',
]
_has_required_fields = True
def __init__(self,
matches=None,
cursor=None):
self._matches_value = bb.NOT_SET
self._cursor_value = bb.NOT_SET
if matches is not None:
self.matches = matches
if cursor is not None:
self.cursor = cursor
# Instance attribute type: list of [PropertiesSearchMatch] (validator is set below)
matches = bb.Attribute("matches")
# Instance attribute type: str (validator is set below)
cursor = bb.Attribute("cursor", nullable=True)
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(PropertiesSearchResult, self)._process_custom_annotations(annotation_type, field_path, processor)
PropertiesSearchResult_validator = bv.Struct(PropertiesSearchResult)
class PropertyField(bb.Struct):
"""
Raw key/value data to be associated with a Dropbox file. Property fields are
added to Dropbox files as a :class:`PropertyGroup`.
:ivar file_properties.PropertyField.name: Key of the property field
associated with a file and template. Keys can be up to 256 bytes.
:ivar file_properties.PropertyField.value: Value of the property field
associated with a file and template. Values can be up to 1024 bytes.
"""
__slots__ = [
'_name_value',
'_value_value',
]
_has_required_fields = True
def __init__(self,
name=None,
value=None):
self._name_value = bb.NOT_SET
self._value_value = bb.NOT_SET
if name is not None:
self.name = name
if value is not None:
self.value = value
# Instance attribute type: str (validator is set below)
name = bb.Attribute("name")
# Instance attribute type: str (validator is set below)
value = bb.Attribute("value")
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(PropertyField, self)._process_custom_annotations(annotation_type, field_path, processor)
PropertyField_validator = bv.Struct(PropertyField)
class PropertyFieldTemplate(bb.Struct):
"""
Defines how a single property field may be structured. Used exclusively by
:class:`PropertyGroupTemplate`.
:ivar file_properties.PropertyFieldTemplate.name: Key of the property field
being described. Property field keys can be up to 256 bytes.
:ivar file_properties.PropertyFieldTemplate.description: Description of the
property field. Property field descriptions can be up to 1024 bytes.
:ivar file_properties.PropertyFieldTemplate.type: Data type of the value of
this property field. This type will be enforced upon property creation
and modifications.
"""
__slots__ = [
'_name_value',
'_description_value',
'_type_value',
]
_has_required_fields = True
def __init__(self,
name=None,
description=None,
type=None):
self._name_value = bb.NOT_SET
self._description_value = bb.NOT_SET
self._type_value = bb.NOT_SET
if name is not None:
self.name = name
if description is not None:
self.description = description
if type is not None:
self.type = type
# Instance attribute type: str (validator is set below)
name = bb.Attribute("name")
# Instance attribute type: str (validator is set below)
description = bb.Attribute("description")
# Instance attribute type: PropertyType (validator is set below)
type = bb.Attribute("type", user_defined=True)
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(PropertyFieldTemplate, self)._process_custom_annotations(annotation_type, field_path, processor)
PropertyFieldTemplate_validator = bv.Struct(PropertyFieldTemplate)
class PropertyGroup(bb.Struct):
"""
A subset of the property fields described by the corresponding
:class:`PropertyGroupTemplate`. Properties are always added to a Dropbox
file as a :class:`PropertyGroup`. The possible key names and value types in
this group are defined by the corresponding :class:`PropertyGroupTemplate`.
:ivar file_properties.PropertyGroup.template_id: A unique identifier for the
associated template.
:ivar file_properties.PropertyGroup.fields: The actual properties associated
with the template. There can be up to 32 property types per template.
"""
__slots__ = [
'_template_id_value',
'_fields_value',
]
_has_required_fields = True
def __init__(self,
template_id=None,
fields=None):
self._template_id_value = bb.NOT_SET
self._fields_value = bb.NOT_SET
if template_id is not None:
self.template_id = template_id
if fields is not None:
self.fields = fields
# Instance attribute type: str (validator is set below)
template_id = bb.Attribute("template_id")
# Instance attribute type: list of [PropertyField] (validator is set below)
fields = bb.Attribute("fields")
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(PropertyGroup, self)._process_custom_annotations(annotation_type, field_path, processor)
PropertyGroup_validator = bv.Struct(PropertyGroup)
class PropertyGroupUpdate(bb.Struct):
"""
:ivar file_properties.PropertyGroupUpdate.template_id: A unique identifier
for a property template.
:ivar file_properties.PropertyGroupUpdate.add_or_update_fields: Property
fields to update. If the property field already exists, it is updated.
If the property field doesn't exist, the property group is added.
:ivar file_properties.PropertyGroupUpdate.remove_fields: Property fields to
remove (by name), provided they exist.
"""
__slots__ = [
'_template_id_value',
'_add_or_update_fields_value',
'_remove_fields_value',
]
_has_required_fields = True
def __init__(self,
template_id=None,
add_or_update_fields=None,
remove_fields=None):
self._template_id_value = bb.NOT_SET
self._add_or_update_fields_value = bb.NOT_SET
self._remove_fields_value = bb.NOT_SET
if template_id is not None:
self.template_id = template_id
if add_or_update_fields is not None:
self.add_or_update_fields = add_or_update_fields
if remove_fields is not None:
self.remove_fields = remove_fields
# Instance attribute type: str (validator is set below)
template_id = bb.Attribute("template_id")
# Instance attribute type: list of [PropertyField] (validator is set below)
add_or_update_fields = bb.Attribute("add_or_update_fields", nullable=True)
# Instance attribute type: list of [str] (validator is set below)
remove_fields = bb.Attribute("remove_fields", nullable=True)
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(PropertyGroupUpdate, self)._process_custom_annotations(annotation_type, field_path, processor)
PropertyGroupUpdate_validator = bv.Struct(PropertyGroupUpdate)
class PropertyType(bb.Union):
"""
Data type of the given property field added.
This class acts as a tagged union. Only one of the ``is_*`` methods will
return true. To get the associated value of a tag (if one exists), use the
corresponding ``get_*`` method.
:ivar file_properties.PropertyType.string: The associated property field
will be of type string. Unicode is supported.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
string = None
# Attribute is overwritten below the class definition
other = None
def is_string(self):
"""
Check if the union tag is ``string``.
:rtype: bool
"""
return self._tag == 'string'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(PropertyType, self)._process_custom_annotations(annotation_type, field_path, processor)
PropertyType_validator = bv.Union(PropertyType)
class RemovePropertiesArg(bb.Struct):
"""
:ivar file_properties.RemovePropertiesArg.path: A unique identifier for the
file or folder.
:ivar file_properties.RemovePropertiesArg.property_template_ids: A list of
identifiers for a template created by
:meth:`dropbox.dropbox_client.Dropbox.file_properties_templates_add_for_user`
or
:meth:`dropbox.dropbox_client.Dropbox.file_properties_templates_add_for_team`.
"""
__slots__ = [
'_path_value',
'_property_template_ids_value',
]
_has_required_fields = True
def __init__(self,
path=None,
property_template_ids=None):
self._path_value = bb.NOT_SET
self._property_template_ids_value = bb.NOT_SET
if path is not None:
self.path = path
if property_template_ids is not None:
self.property_template_ids = property_template_ids
# Instance attribute type: str (validator is set below)
path = bb.Attribute("path")
# Instance attribute type: list of [str] (validator is set below)
property_template_ids = bb.Attribute("property_template_ids")
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(RemovePropertiesArg, self)._process_custom_annotations(annotation_type, field_path, processor)
RemovePropertiesArg_validator = bv.Struct(RemovePropertiesArg)
class RemovePropertiesError(PropertiesError):
"""
This class acts as a tagged union. Only one of the ``is_*`` methods will
return true. To get the associated value of a tag (if one exists), use the
corresponding ``get_*`` method.
"""
@classmethod
def property_group_lookup(cls, val):
"""
Create an instance of this class set to the ``property_group_lookup``
tag with value ``val``.
:param LookUpPropertiesError val:
:rtype: RemovePropertiesError
"""
return cls('property_group_lookup', val)
def is_property_group_lookup(self):
"""
Check if the union tag is ``property_group_lookup``.
:rtype: bool
"""
return self._tag == 'property_group_lookup'
def get_property_group_lookup(self):
"""
Only call this if :meth:`is_property_group_lookup` is true.
:rtype: LookUpPropertiesError
"""
if not self.is_property_group_lookup():
raise AttributeError("tag 'property_group_lookup' not set")
return self._value
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(RemovePropertiesError, self)._process_custom_annotations(annotation_type, field_path, processor)
RemovePropertiesError_validator = bv.Union(RemovePropertiesError)
class RemoveTemplateArg(bb.Struct):
"""
:ivar file_properties.RemoveTemplateArg.template_id: An identifier for a
template created by
:meth:`dropbox.dropbox_client.Dropbox.file_properties_templates_add_for_user`
or
:meth:`dropbox.dropbox_client.Dropbox.file_properties_templates_add_for_team`.
"""
__slots__ = [
'_template_id_value',
]
_has_required_fields = True
def __init__(self,
template_id=None):
self._template_id_value = bb.NOT_SET
if template_id is not None:
self.template_id = template_id
# Instance attribute type: str (validator is set below)
template_id = bb.Attribute("template_id")
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(RemoveTemplateArg, self)._process_custom_annotations(annotation_type, field_path, processor)
RemoveTemplateArg_validator = bv.Struct(RemoveTemplateArg)
class TemplateFilterBase(bb.Union):
"""
This class acts as a tagged union. Only one of the ``is_*`` methods will
return true. To get the associated value of a tag (if one exists), use the
corresponding ``get_*`` method.
:ivar list of [str] file_properties.TemplateFilterBase.filter_some: Only
templates with an ID in the supplied list will be returned (a subset of
templates will be returned).
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
other = None
@classmethod
def filter_some(cls, val):
"""
Create an instance of this class set to the ``filter_some`` tag with
value ``val``.
:param list of [str] val:
:rtype: TemplateFilterBase
"""
return cls('filter_some', val)
def is_filter_some(self):
"""
Check if the union tag is ``filter_some``.
:rtype: bool
"""
return self._tag == 'filter_some'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def get_filter_some(self):
"""
Only templates with an ID in the supplied list will be returned (a
subset of templates will be returned).
Only call this if :meth:`is_filter_some` is true.
:rtype: list of [str]
"""
if not self.is_filter_some():
raise AttributeError("tag 'filter_some' not set")
return self._value
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(TemplateFilterBase, self)._process_custom_annotations(annotation_type, field_path, processor)
TemplateFilterBase_validator = bv.Union(TemplateFilterBase)
class TemplateFilter(TemplateFilterBase):
"""
This class acts as a tagged union. Only one of the ``is_*`` methods will
return true. To get the associated value of a tag (if one exists), use the
corresponding ``get_*`` method.
:ivar file_properties.TemplateFilter.filter_none: No templates will be
filtered from the result (all templates will be returned).
"""
# Attribute is overwritten below the class definition
filter_none = None
def is_filter_none(self):
"""
Check if the union tag is ``filter_none``.
:rtype: bool
"""
return self._tag == 'filter_none'
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(TemplateFilter, self)._process_custom_annotations(annotation_type, field_path, processor)
TemplateFilter_validator = bv.Union(TemplateFilter)
class TemplateOwnerType(bb.Union):
"""
This class acts as a tagged union. Only one of the ``is_*`` methods will
return true. To get the associated value of a tag (if one exists), use the
corresponding ``get_*`` method.
:ivar file_properties.TemplateOwnerType.user: Template will be associated
with a user.
:ivar file_properties.TemplateOwnerType.team: Template will be associated
with a team.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
user = None
# Attribute is overwritten below the class definition
team = None
# Attribute is overwritten below the class definition
other = None
def is_user(self):
"""
Check if the union tag is ``user``.
:rtype: bool
"""
return self._tag == 'user'
def is_team(self):
"""
Check if the union tag is ``team``.
:rtype: bool
"""
return self._tag == 'team'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(TemplateOwnerType, self)._process_custom_annotations(annotation_type, field_path, processor)
TemplateOwnerType_validator = bv.Union(TemplateOwnerType)
class UpdatePropertiesArg(bb.Struct):
"""
:ivar file_properties.UpdatePropertiesArg.path: A unique identifier for the
file or folder.
:ivar file_properties.UpdatePropertiesArg.update_property_groups: The
property groups "delta" updates to apply.
"""
__slots__ = [
'_path_value',
'_update_property_groups_value',
]
_has_required_fields = True
def __init__(self,
path=None,
update_property_groups=None):
self._path_value = bb.NOT_SET
self._update_property_groups_value = bb.NOT_SET
if path is not None:
self.path = path
if update_property_groups is not None:
self.update_property_groups = update_property_groups
# Instance attribute type: str (validator is set below)
path = bb.Attribute("path")
# Instance attribute type: list of [PropertyGroupUpdate] (validator is set below)
update_property_groups = bb.Attribute("update_property_groups")
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(UpdatePropertiesArg, self)._process_custom_annotations(annotation_type, field_path, processor)
UpdatePropertiesArg_validator = bv.Struct(UpdatePropertiesArg)
class UpdatePropertiesError(InvalidPropertyGroupError):
"""
This class acts as a tagged union. Only one of the ``is_*`` methods will
return true. To get the associated value of a tag (if one exists), use the
corresponding ``get_*`` method.
"""
@classmethod
def property_group_lookup(cls, val):
"""
Create an instance of this class set to the ``property_group_lookup``
tag with value ``val``.
:param LookUpPropertiesError val:
:rtype: UpdatePropertiesError
"""
return cls('property_group_lookup', val)
def is_property_group_lookup(self):
"""
Check if the union tag is ``property_group_lookup``.
:rtype: bool
"""
return self._tag == 'property_group_lookup'
def get_property_group_lookup(self):
"""
Only call this if :meth:`is_property_group_lookup` is true.
:rtype: LookUpPropertiesError
"""
if not self.is_property_group_lookup():
raise AttributeError("tag 'property_group_lookup' not set")
return self._value
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(UpdatePropertiesError, self)._process_custom_annotations(annotation_type, field_path, processor)
UpdatePropertiesError_validator = bv.Union(UpdatePropertiesError)
class UpdateTemplateArg(bb.Struct):
"""
:ivar file_properties.UpdateTemplateArg.template_id: An identifier for
template added by See
:meth:`dropbox.dropbox_client.Dropbox.file_properties_templates_add_for_user`
or
:meth:`dropbox.dropbox_client.Dropbox.file_properties_templates_add_for_team`.
:ivar file_properties.UpdateTemplateArg.name: A display name for the
template. template names can be up to 256 bytes.
:ivar file_properties.UpdateTemplateArg.description: Description for the new
template. Template descriptions can be up to 1024 bytes.
:ivar file_properties.UpdateTemplateArg.add_fields: Property field templates
to be added to the group template. There can be up to 32 properties in a
single template.
"""
__slots__ = [
'_template_id_value',
'_name_value',
'_description_value',
'_add_fields_value',
]
_has_required_fields = True
def __init__(self,
template_id=None,
name=None,
description=None,
add_fields=None):
self._template_id_value = bb.NOT_SET
self._name_value = bb.NOT_SET
self._description_value = bb.NOT_SET
self._add_fields_value = bb.NOT_SET
if template_id is not None:
self.template_id = template_id
if name is not None:
self.name = name
if description is not None:
self.description = description
if add_fields is not None:
self.add_fields = add_fields
# Instance attribute type: str (validator is set below)
template_id = bb.Attribute("template_id")
# Instance attribute type: str (validator is set below)
name = bb.Attribute("name", nullable=True)
# Instance attribute type: str (validator is set below)
description = bb.Attribute("description", nullable=True)
# Instance attribute type: list of [PropertyFieldTemplate] (validator is set below)
add_fields = bb.Attribute("add_fields", nullable=True)
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(UpdateTemplateArg, self)._process_custom_annotations(annotation_type, field_path, processor)
UpdateTemplateArg_validator = bv.Struct(UpdateTemplateArg)
class UpdateTemplateResult(bb.Struct):
"""
:ivar file_properties.UpdateTemplateResult.template_id: An identifier for
template added by route See
:meth:`dropbox.dropbox_client.Dropbox.file_properties_templates_add_for_user`
or
:meth:`dropbox.dropbox_client.Dropbox.file_properties_templates_add_for_team`.
"""
__slots__ = [
'_template_id_value',
]
_has_required_fields = True
def __init__(self,
template_id=None):
self._template_id_value = bb.NOT_SET
if template_id is not None:
self.template_id = template_id
# Instance attribute type: str (validator is set below)
template_id = bb.Attribute("template_id")
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(UpdateTemplateResult, self)._process_custom_annotations(annotation_type, field_path, processor)
UpdateTemplateResult_validator = bv.Struct(UpdateTemplateResult)
Id_validator = bv.String(min_length=1)
PathOrId_validator = bv.String(pattern='/(.|[\\r\\n])*|id:.*|(ns:[0-9]+(/.*)?)')
PropertiesSearchCursor_validator = bv.String(min_length=1)
TemplateId_validator = bv.String(min_length=1, pattern='(/|ptid:).*')
AddPropertiesArg.path.validator = PathOrId_validator
AddPropertiesArg.property_groups.validator = bv.List(PropertyGroup_validator)
AddPropertiesArg._all_field_names_ = set([
'path',
'property_groups',
])
AddPropertiesArg._all_fields_ = [
('path', AddPropertiesArg.path.validator),
('property_groups', AddPropertiesArg.property_groups.validator),
]
TemplateError._template_not_found_validator = TemplateId_validator
TemplateError._restricted_content_validator = bv.Void()
TemplateError._other_validator = bv.Void()
TemplateError._tagmap = {
'template_not_found': TemplateError._template_not_found_validator,
'restricted_content': TemplateError._restricted_content_validator,
'other': TemplateError._other_validator,
}
TemplateError.restricted_content = TemplateError('restricted_content')
TemplateError.other = TemplateError('other')
PropertiesError._path_validator = LookupError_validator
PropertiesError._unsupported_folder_validator = bv.Void()
PropertiesError._tagmap = {
'path': PropertiesError._path_validator,
'unsupported_folder': PropertiesError._unsupported_folder_validator,
}
PropertiesError._tagmap.update(TemplateError._tagmap)
PropertiesError.unsupported_folder = PropertiesError('unsupported_folder')
InvalidPropertyGroupError._property_field_too_large_validator = bv.Void()
InvalidPropertyGroupError._does_not_fit_template_validator = bv.Void()
InvalidPropertyGroupError._duplicate_property_groups_validator = bv.Void()
InvalidPropertyGroupError._tagmap = {
'property_field_too_large': InvalidPropertyGroupError._property_field_too_large_validator,
'does_not_fit_template': InvalidPropertyGroupError._does_not_fit_template_validator,
'duplicate_property_groups': InvalidPropertyGroupError._duplicate_property_groups_validator,
}
InvalidPropertyGroupError._tagmap.update(PropertiesError._tagmap)
InvalidPropertyGroupError.property_field_too_large = InvalidPropertyGroupError('property_field_too_large')
InvalidPropertyGroupError.does_not_fit_template = InvalidPropertyGroupError('does_not_fit_template')
InvalidPropertyGroupError.duplicate_property_groups = InvalidPropertyGroupError('duplicate_property_groups')
AddPropertiesError._property_group_already_exists_validator = bv.Void()
AddPropertiesError._tagmap = {
'property_group_already_exists': AddPropertiesError._property_group_already_exists_validator,
}
AddPropertiesError._tagmap.update(InvalidPropertyGroupError._tagmap)
AddPropertiesError.property_group_already_exists = AddPropertiesError('property_group_already_exists')
PropertyGroupTemplate.name.validator = bv.String()
PropertyGroupTemplate.description.validator = bv.String()
PropertyGroupTemplate.fields.validator = bv.List(PropertyFieldTemplate_validator)
PropertyGroupTemplate._all_field_names_ = set([
'name',
'description',
'fields',
])
PropertyGroupTemplate._all_fields_ = [
('name', PropertyGroupTemplate.name.validator),
('description', PropertyGroupTemplate.description.validator),
('fields', PropertyGroupTemplate.fields.validator),
]
AddTemplateArg._all_field_names_ = PropertyGroupTemplate._all_field_names_.union(set([]))
AddTemplateArg._all_fields_ = PropertyGroupTemplate._all_fields_ + []
AddTemplateResult.template_id.validator = TemplateId_validator
AddTemplateResult._all_field_names_ = set(['template_id'])
AddTemplateResult._all_fields_ = [('template_id', AddTemplateResult.template_id.validator)]
GetTemplateArg.template_id.validator = TemplateId_validator
GetTemplateArg._all_field_names_ = set(['template_id'])
GetTemplateArg._all_fields_ = [('template_id', GetTemplateArg.template_id.validator)]
GetTemplateResult._all_field_names_ = PropertyGroupTemplate._all_field_names_.union(set([]))
GetTemplateResult._all_fields_ = PropertyGroupTemplate._all_fields_ + []
ListTemplateResult.template_ids.validator = bv.List(TemplateId_validator)
ListTemplateResult._all_field_names_ = set(['template_ids'])
ListTemplateResult._all_fields_ = [('template_ids', ListTemplateResult.template_ids.validator)]
LogicalOperator._or_operator_validator = bv.Void()
LogicalOperator._other_validator = bv.Void()
LogicalOperator._tagmap = {
'or_operator': LogicalOperator._or_operator_validator,
'other': LogicalOperator._other_validator,
}
LogicalOperator.or_operator = LogicalOperator('or_operator')
LogicalOperator.other = LogicalOperator('other')
LookUpPropertiesError._property_group_not_found_validator = bv.Void()
LookUpPropertiesError._other_validator = bv.Void()
LookUpPropertiesError._tagmap = {
'property_group_not_found': LookUpPropertiesError._property_group_not_found_validator,
'other': LookUpPropertiesError._other_validator,
}
LookUpPropertiesError.property_group_not_found = LookUpPropertiesError('property_group_not_found')
LookUpPropertiesError.other = LookUpPropertiesError('other')
LookupError._malformed_path_validator = bv.String()
LookupError._not_found_validator = bv.Void()
LookupError._not_file_validator = bv.Void()
LookupError._not_folder_validator = bv.Void()
LookupError._restricted_content_validator = bv.Void()
LookupError._other_validator = bv.Void()
LookupError._tagmap = {
'malformed_path': LookupError._malformed_path_validator,
'not_found': LookupError._not_found_validator,
'not_file': LookupError._not_file_validator,
'not_folder': LookupError._not_folder_validator,
'restricted_content': LookupError._restricted_content_validator,
'other': LookupError._other_validator,
}
LookupError.not_found = LookupError('not_found')
LookupError.not_file = LookupError('not_file')
LookupError.not_folder = LookupError('not_folder')
LookupError.restricted_content = LookupError('restricted_content')
LookupError.other = LookupError('other')
ModifyTemplateError._conflicting_property_names_validator = bv.Void()
ModifyTemplateError._too_many_properties_validator = bv.Void()
ModifyTemplateError._too_many_templates_validator = bv.Void()
ModifyTemplateError._template_attribute_too_large_validator = bv.Void()
ModifyTemplateError._tagmap = {
'conflicting_property_names': ModifyTemplateError._conflicting_property_names_validator,
'too_many_properties': ModifyTemplateError._too_many_properties_validator,
'too_many_templates': ModifyTemplateError._too_many_templates_validator,
'template_attribute_too_large': ModifyTemplateError._template_attribute_too_large_validator,
}
ModifyTemplateError._tagmap.update(TemplateError._tagmap)
ModifyTemplateError.conflicting_property_names = ModifyTemplateError('conflicting_property_names')
ModifyTemplateError.too_many_properties = ModifyTemplateError('too_many_properties')
ModifyTemplateError.too_many_templates = ModifyTemplateError('too_many_templates')
ModifyTemplateError.template_attribute_too_large = ModifyTemplateError('template_attribute_too_large')
OverwritePropertyGroupArg.path.validator = PathOrId_validator
OverwritePropertyGroupArg.property_groups.validator = bv.List(PropertyGroup_validator, min_items=1)
OverwritePropertyGroupArg._all_field_names_ = set([
'path',
'property_groups',
])
OverwritePropertyGroupArg._all_fields_ = [
('path', OverwritePropertyGroupArg.path.validator),
('property_groups', OverwritePropertyGroupArg.property_groups.validator),
]
PropertiesSearchArg.queries.validator = bv.List(PropertiesSearchQuery_validator, min_items=1)
PropertiesSearchArg.template_filter.validator = TemplateFilter_validator
PropertiesSearchArg._all_field_names_ = set([
'queries',
'template_filter',
])
PropertiesSearchArg._all_fields_ = [
('queries', PropertiesSearchArg.queries.validator),
('template_filter', PropertiesSearchArg.template_filter.validator),
]
PropertiesSearchContinueArg.cursor.validator = PropertiesSearchCursor_validator
PropertiesSearchContinueArg._all_field_names_ = set(['cursor'])
PropertiesSearchContinueArg._all_fields_ = [('cursor', PropertiesSearchContinueArg.cursor.validator)]
PropertiesSearchContinueError._reset_validator = bv.Void()
PropertiesSearchContinueError._other_validator = bv.Void()
PropertiesSearchContinueError._tagmap = {
'reset': PropertiesSearchContinueError._reset_validator,
'other': PropertiesSearchContinueError._other_validator,
}
PropertiesSearchContinueError.reset = PropertiesSearchContinueError('reset')
PropertiesSearchContinueError.other = PropertiesSearchContinueError('other')
PropertiesSearchError._property_group_lookup_validator = LookUpPropertiesError_validator
PropertiesSearchError._other_validator = bv.Void()
PropertiesSearchError._tagmap = {
'property_group_lookup': PropertiesSearchError._property_group_lookup_validator,
'other': PropertiesSearchError._other_validator,
}
PropertiesSearchError.other = PropertiesSearchError('other')
PropertiesSearchMatch.id.validator = Id_validator
PropertiesSearchMatch.path.validator = bv.String()
PropertiesSearchMatch.is_deleted.validator = bv.Boolean()
PropertiesSearchMatch.property_groups.validator = bv.List(PropertyGroup_validator)
PropertiesSearchMatch._all_field_names_ = set([
'id',
'path',
'is_deleted',
'property_groups',
])
PropertiesSearchMatch._all_fields_ = [
('id', PropertiesSearchMatch.id.validator),
('path', PropertiesSearchMatch.path.validator),
('is_deleted', PropertiesSearchMatch.is_deleted.validator),
('property_groups', PropertiesSearchMatch.property_groups.validator),
]
PropertiesSearchMode._field_name_validator = bv.String()
PropertiesSearchMode._other_validator = bv.Void()
PropertiesSearchMode._tagmap = {
'field_name': PropertiesSearchMode._field_name_validator,
'other': PropertiesSearchMode._other_validator,
}
PropertiesSearchMode.other = PropertiesSearchMode('other')
PropertiesSearchQuery.query.validator = bv.String()
PropertiesSearchQuery.mode.validator = PropertiesSearchMode_validator
PropertiesSearchQuery.logical_operator.validator = LogicalOperator_validator
PropertiesSearchQuery._all_field_names_ = set([
'query',
'mode',
'logical_operator',
])
PropertiesSearchQuery._all_fields_ = [
('query', PropertiesSearchQuery.query.validator),
('mode', PropertiesSearchQuery.mode.validator),
('logical_operator', PropertiesSearchQuery.logical_operator.validator),
]
PropertiesSearchResult.matches.validator = bv.List(PropertiesSearchMatch_validator)
PropertiesSearchResult.cursor.validator = bv.Nullable(PropertiesSearchCursor_validator)
PropertiesSearchResult._all_field_names_ = set([
'matches',
'cursor',
])
PropertiesSearchResult._all_fields_ = [
('matches', PropertiesSearchResult.matches.validator),
('cursor', PropertiesSearchResult.cursor.validator),
]
PropertyField.name.validator = bv.String()
PropertyField.value.validator = bv.String()
PropertyField._all_field_names_ = set([
'name',
'value',
])
PropertyField._all_fields_ = [
('name', PropertyField.name.validator),
('value', PropertyField.value.validator),
]
PropertyFieldTemplate.name.validator = bv.String()
PropertyFieldTemplate.description.validator = bv.String()
PropertyFieldTemplate.type.validator = PropertyType_validator
PropertyFieldTemplate._all_field_names_ = set([
'name',
'description',
'type',
])
PropertyFieldTemplate._all_fields_ = [
('name', PropertyFieldTemplate.name.validator),
('description', PropertyFieldTemplate.description.validator),
('type', PropertyFieldTemplate.type.validator),
]
PropertyGroup.template_id.validator = TemplateId_validator
PropertyGroup.fields.validator = bv.List(PropertyField_validator)
PropertyGroup._all_field_names_ = set([
'template_id',
'fields',
])
PropertyGroup._all_fields_ = [
('template_id', PropertyGroup.template_id.validator),
('fields', PropertyGroup.fields.validator),
]
PropertyGroupUpdate.template_id.validator = TemplateId_validator
PropertyGroupUpdate.add_or_update_fields.validator = bv.Nullable(bv.List(PropertyField_validator))
PropertyGroupUpdate.remove_fields.validator = bv.Nullable(bv.List(bv.String()))
PropertyGroupUpdate._all_field_names_ = set([
'template_id',
'add_or_update_fields',
'remove_fields',
])
PropertyGroupUpdate._all_fields_ = [
('template_id', PropertyGroupUpdate.template_id.validator),
('add_or_update_fields', PropertyGroupUpdate.add_or_update_fields.validator),
('remove_fields', PropertyGroupUpdate.remove_fields.validator),
]
PropertyType._string_validator = bv.Void()
PropertyType._other_validator = bv.Void()
PropertyType._tagmap = {
'string': PropertyType._string_validator,
'other': PropertyType._other_validator,
}
PropertyType.string = PropertyType('string')
PropertyType.other = PropertyType('other')
RemovePropertiesArg.path.validator = PathOrId_validator
RemovePropertiesArg.property_template_ids.validator = bv.List(TemplateId_validator)
RemovePropertiesArg._all_field_names_ = set([
'path',
'property_template_ids',
])
RemovePropertiesArg._all_fields_ = [
('path', RemovePropertiesArg.path.validator),
('property_template_ids', RemovePropertiesArg.property_template_ids.validator),
]
RemovePropertiesError._property_group_lookup_validator = LookUpPropertiesError_validator
RemovePropertiesError._tagmap = {
'property_group_lookup': RemovePropertiesError._property_group_lookup_validator,
}
RemovePropertiesError._tagmap.update(PropertiesError._tagmap)
RemoveTemplateArg.template_id.validator = TemplateId_validator
RemoveTemplateArg._all_field_names_ = set(['template_id'])
RemoveTemplateArg._all_fields_ = [('template_id', RemoveTemplateArg.template_id.validator)]
TemplateFilterBase._filter_some_validator = bv.List(TemplateId_validator, min_items=1)
TemplateFilterBase._other_validator = bv.Void()
TemplateFilterBase._tagmap = {
'filter_some': TemplateFilterBase._filter_some_validator,
'other': TemplateFilterBase._other_validator,
}
TemplateFilterBase.other = TemplateFilterBase('other')
TemplateFilter._filter_none_validator = bv.Void()
TemplateFilter._tagmap = {
'filter_none': TemplateFilter._filter_none_validator,
}
TemplateFilter._tagmap.update(TemplateFilterBase._tagmap)
TemplateFilter.filter_none = TemplateFilter('filter_none')
TemplateOwnerType._user_validator = bv.Void()
TemplateOwnerType._team_validator = bv.Void()
TemplateOwnerType._other_validator = bv.Void()
TemplateOwnerType._tagmap = {
'user': TemplateOwnerType._user_validator,
'team': TemplateOwnerType._team_validator,
'other': TemplateOwnerType._other_validator,
}
TemplateOwnerType.user = TemplateOwnerType('user')
TemplateOwnerType.team = TemplateOwnerType('team')
TemplateOwnerType.other = TemplateOwnerType('other')
UpdatePropertiesArg.path.validator = PathOrId_validator
UpdatePropertiesArg.update_property_groups.validator = bv.List(PropertyGroupUpdate_validator)
UpdatePropertiesArg._all_field_names_ = set([
'path',
'update_property_groups',
])
UpdatePropertiesArg._all_fields_ = [
('path', UpdatePropertiesArg.path.validator),
('update_property_groups', UpdatePropertiesArg.update_property_groups.validator),
]
UpdatePropertiesError._property_group_lookup_validator = LookUpPropertiesError_validator
UpdatePropertiesError._tagmap = {
'property_group_lookup': UpdatePropertiesError._property_group_lookup_validator,
}
UpdatePropertiesError._tagmap.update(InvalidPropertyGroupError._tagmap)
UpdateTemplateArg.template_id.validator = TemplateId_validator
UpdateTemplateArg.name.validator = bv.Nullable(bv.String())
UpdateTemplateArg.description.validator = bv.Nullable(bv.String())
UpdateTemplateArg.add_fields.validator = bv.Nullable(bv.List(PropertyFieldTemplate_validator))
UpdateTemplateArg._all_field_names_ = set([
'template_id',
'name',
'description',
'add_fields',
])
UpdateTemplateArg._all_fields_ = [
('template_id', UpdateTemplateArg.template_id.validator),
('name', UpdateTemplateArg.name.validator),
('description', UpdateTemplateArg.description.validator),
('add_fields', UpdateTemplateArg.add_fields.validator),
]
UpdateTemplateResult.template_id.validator = TemplateId_validator
UpdateTemplateResult._all_field_names_ = set(['template_id'])
UpdateTemplateResult._all_fields_ = [('template_id', UpdateTemplateResult.template_id.validator)]
PropertiesSearchArg.template_filter.default = TemplateFilter.filter_none
PropertiesSearchQuery.logical_operator.default = LogicalOperator.or_operator
properties_add = bb.Route(
'properties/add',
1,
False,
AddPropertiesArg_validator,
bv.Void(),
AddPropertiesError_validator,
{'auth': 'user',
'host': 'api',
'style': 'rpc'},
)
properties_overwrite = bb.Route(
'properties/overwrite',
1,
False,
OverwritePropertyGroupArg_validator,
bv.Void(),
InvalidPropertyGroupError_validator,
{'auth': 'user',
'host': 'api',
'style': 'rpc'},
)
properties_remove = bb.Route(
'properties/remove',
1,
False,
RemovePropertiesArg_validator,
bv.Void(),
RemovePropertiesError_validator,
{'auth': 'user',
'host': 'api',
'style': 'rpc'},
)
properties_search = bb.Route(
'properties/search',
1,
False,
PropertiesSearchArg_validator,
PropertiesSearchResult_validator,
PropertiesSearchError_validator,
{'auth': 'user',
'host': 'api',
'style': 'rpc'},
)
properties_search_continue = bb.Route(
'properties/search/continue',
1,
False,
PropertiesSearchContinueArg_validator,
PropertiesSearchResult_validator,
PropertiesSearchContinueError_validator,
{'auth': 'user',
'host': 'api',
'style': 'rpc'},
)
properties_update = bb.Route(
'properties/update',
1,
False,
UpdatePropertiesArg_validator,
bv.Void(),
UpdatePropertiesError_validator,
{'auth': 'user',
'host': 'api',
'style': 'rpc'},
)
templates_add_for_team = bb.Route(
'templates/add_for_team',
1,
False,
AddTemplateArg_validator,
AddTemplateResult_validator,
ModifyTemplateError_validator,
{'auth': 'team',
'host': 'api',
'style': 'rpc'},
)
templates_add_for_user = bb.Route(
'templates/add_for_user',
1,
False,
AddTemplateArg_validator,
AddTemplateResult_validator,
ModifyTemplateError_validator,
{'auth': 'user',
'host': 'api',
'style': 'rpc'},
)
templates_get_for_team = bb.Route(
'templates/get_for_team',
1,
False,
GetTemplateArg_validator,
GetTemplateResult_validator,
TemplateError_validator,
{'auth': 'team',
'host': 'api',
'style': 'rpc'},
)
templates_get_for_user = bb.Route(
'templates/get_for_user',
1,
False,
GetTemplateArg_validator,
GetTemplateResult_validator,
TemplateError_validator,
{'auth': 'user',
'host': 'api',
'style': 'rpc'},
)
templates_list_for_team = bb.Route(
'templates/list_for_team',
1,
False,
bv.Void(),
ListTemplateResult_validator,
TemplateError_validator,
{'auth': 'team',
'host': 'api',
'style': 'rpc'},
)
templates_list_for_user = bb.Route(
'templates/list_for_user',
1,
False,
bv.Void(),
ListTemplateResult_validator,
TemplateError_validator,
{'auth': 'user',
'host': 'api',
'style': 'rpc'},
)
templates_remove_for_team = bb.Route(
'templates/remove_for_team',
1,
False,
RemoveTemplateArg_validator,
bv.Void(),
TemplateError_validator,
{'auth': 'team',
'host': 'api',
'style': 'rpc'},
)
templates_remove_for_user = bb.Route(
'templates/remove_for_user',
1,
False,
RemoveTemplateArg_validator,
bv.Void(),
TemplateError_validator,
{'auth': 'user',
'host': 'api',
'style': 'rpc'},
)
templates_update_for_team = bb.Route(
'templates/update_for_team',
1,
False,
UpdateTemplateArg_validator,
UpdateTemplateResult_validator,
ModifyTemplateError_validator,
{'auth': 'team',
'host': 'api',
'style': 'rpc'},
)
templates_update_for_user = bb.Route(
'templates/update_for_user',
1,
False,
UpdateTemplateArg_validator,
UpdateTemplateResult_validator,
ModifyTemplateError_validator,
{'auth': 'user',
'host': 'api',
'style': 'rpc'},
)
ROUTES = {
'properties/add': properties_add,
'properties/overwrite': properties_overwrite,
'properties/remove': properties_remove,
'properties/search': properties_search,
'properties/search/continue': properties_search_continue,
'properties/update': properties_update,
'templates/add_for_team': templates_add_for_team,
'templates/add_for_user': templates_add_for_user,
'templates/get_for_team': templates_get_for_team,
'templates/get_for_user': templates_get_for_user,
'templates/list_for_team': templates_list_for_team,
'templates/list_for_user': templates_list_for_user,
'templates/remove_for_team': templates_remove_for_team,
'templates/remove_for_user': templates_remove_for_user,
'templates/update_for_team': templates_update_for_team,
'templates/update_for_user': templates_update_for_user,
}
|