dropbox-sdk 0.20.3

Rust bindings to the Dropbox API, generated by Stone from the official spec.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
namespace team

import account
import async
import common
import file_properties
import files
import secondary_emails
import team_common
import team_policies
import users
import users_common

union_closed TeamMembershipType
    full
        "User uses a license and has full access to team resources like the shared quota."
    limited
        @common.Deprecated
        "User does not have access to the shared quota and team admins have restricted administrative control."

struct RemovedStatus
    is_recoverable Boolean
        "True if the removed team member is recoverable."
    is_disconnected Boolean
        "True if the team member's account was converted to individual account."

    example default
        is_recoverable = false
        is_disconnected = false

union_closed TeamMemberStatus
    "The user's status as a member of a specific team."
    active
        "User has successfully joined the team."
    invited
        "User has been invited to a team, but has not joined the team yet."
    suspended
        "User is no longer a member of the team, but the account can be un-suspended,
        re-establishing the user as a team member."
    removed RemovedStatus
        "User is no longer a member of the team.
        Removed users are only listed when include_removed is true in members/list."

struct MemberProfile
    "Basic member profile."
    team_member_id team_common.TeamMemberId
        "ID of user as a member of a team."
    external_id String?
        "External ID that a team can attach to the user.
        An application using the API may find it easier to use their
        own IDs instead of Dropbox IDs like account_id or team_member_id."
    account_id users_common.AccountId?
        "A user's account identifier."
    email String
        "Email address of user."
    email_verified Boolean
        "Is true if the user's email is verified to be owned by the user."
    secondary_emails List(secondary_emails.SecondaryEmail)?
        "Secondary emails of a user."
    status TeamMemberStatus
        "The user's status as a member of a specific team."
    name users.Name
        "Representations for a person's name."
    membership_type TeamMembershipType
        "The user's membership type: full (normal team member) vs limited (does not use a license; no access to the team's shared quota)."
    invited_on common.DropboxTimestamp?
        "The date and time the user was invited to the team (contains value only when the member's status matches :field:`TeamMemberStatus.invited`)."
    joined_on common.DropboxTimestamp?
        "The date and time the user joined as a member of a specific team."
    suspended_on common.DropboxTimestamp?
        "The date and time the user was suspended from the team (contains value only when the member's status matches :field:`TeamMemberStatus.suspended`)."
    persistent_id String?
        "Persistent ID that a team can attach to the user.
        The persistent ID is unique ID to be used for SAML authentication."
    is_directory_restricted Boolean?
        "Whether the user is a directory restricted user."
    profile_photo_url String?
        "URL for the photo representing the user, if one is set."

    example default
        team_member_id = "dbmid:1234567"
        account_id = "dbid:AAH4f99T0taONIb-OurWxbNQ6ywGRopQngc"
        email = "mary@lamb.com"
        email_verified = true
        secondary_emails = [default, second_sec_email, third_sec_email]
        status = active
        name = default
        membership_type = full
        joined_on = "2015-05-12T15:50:38Z"
        profile_photo_url = "https://dl-web.dropbox.com/account_photo/get/dbaphid%3AAAHWGmIXV3sUuOmBfTz0wPsiqHUpBWvv3ZA?vers=1556069330102&size=128x128"

struct TeamMemberProfile extends MemberProfile
    "Profile of a user as a member of a team."
    groups List(team_common.GroupId)
        "List of group IDs of groups that the user belongs to."
    member_folder_id common.NamespaceId
        "The namespace id of the user's member folder."
    root_folder_id common.NamespaceId
        "The namespace id of the user's root folder."

    example default
        team_member_id = "dbmid:FDFSVF-DFSDF"
        account_id = "dbid:AAH4f99T0taONIb-OurWxbNQ6ywGRopQngc"
        external_id = "244423"
        email = "tami@seagull.com"
        email_verified = false
        secondary_emails = [third_sec_email, default]
        status = active
        name = default
        groups = ["g:e2db7665347abcd600000000001a2b3c"]
        membership_type = full
        joined_on = "2015-05-12T15:50:38Z"
        member_folder_id = "20"
        root_folder_id = "30"
        profile_photo_url = "https://dl-web.dropbox.com/account_photo/get/dbaphid%3AAAHWGmIXV3sUuOmBfTz0wPsiqHUpBWvv3ZA?vers=1556069330102&size=128x128"


union DesktopPlatform
    windows
        "Official Windows Dropbox desktop client."
    mac
        "Official Mac Dropbox desktop client."
    linux
        "Official Linux Dropbox desktop client."

union MobileClientPlatform
    iphone
        "Official Dropbox iPhone client."
    ipad
        "Official Dropbox iPad client."
    android
        "Official Dropbox Android client."
    windows_phone
        "Official Dropbox Windows phone client."
    blackberry
        "Official Dropbox Blackberry client."

union ListMemberDevicesError
    member_not_found
        "Member not found."

union ListMembersDevicesError
    reset
        "Indicates that the cursor has been invalidated. Call
        :route:`devices/list_members_devices` again with an empty cursor to obtain a new cursor."

union_closed RevokeDeviceSessionArg
    web_session DeviceSessionArg
        "End an active session."
    desktop_client RevokeDesktopClientArg
        "Unlink a linked desktop device."
    mobile_client DeviceSessionArg
        "Unlink a linked mobile device."

    example default
        web_session = default

union RevokeDeviceSessionError
    device_session_not_found
        "Device session not found."
    member_not_found
        "Member not found."

union RevokeDeviceSessionBatchError
    ""

union ListTeamDevicesError
    reset
        "Indicates that the cursor has been invalidated. Call
        :route:`devices/list_team_devices` again with an empty cursor to obtain a new cursor."

struct DeviceSessionArg
    session_id String
        "The session id."
    team_member_id String
        "The unique id of the member owning the device."

    example default
        session_id = "1234faaf0678bcde"
        team_member_id = "dbmid:AAHhy7WsR0x-u4ZCqiDl5Fz5zvuL3kmspwU"

struct RevokeDesktopClientArg extends DeviceSessionArg
    delete_on_unlink Boolean = false
        "Whether to delete all files of the account (this is possible only if supported by
        the desktop client and  will be made the next time the client access the account)."

    example default
        session_id = "1234faaf0678bcde"
        team_member_id = "dbmid:AAHhy7WsR0x-u4ZCqiDl5Fz5zvuL3kmspwU"

struct ListMemberDevicesArg
    team_member_id String
        "The team's member id."
    include_web_sessions Boolean = true
        "Whether to list web sessions of the team's member."
    include_desktop_clients Boolean = true
        "Whether to list linked desktop devices of the team's member."
    include_mobile_clients Boolean = true
        "Whether to list linked mobile devices of the team's member."

    example default
        team_member_id = "dbmid:AAFdgehTzw7WlXhZJsbGCLePe8RvQGYDr-I"

struct DeviceSession
    session_id String
        "The session id."
    ip_address String?
        "The IP address of the last activity from this session."
    country String?
        "The country from which the last activity from this session was made."
    created common.DropboxTimestamp?
        "The time this session was created."
    updated common.DropboxTimestamp?
        "The time of the last activity from this session."

struct ActiveWebSession extends DeviceSession
    "Information on active web sessions."
    user_agent String
        "Information on the hosting device."
    os String
        "Information on the hosting operating system."
    browser String
        "Information on the browser used for this web session."
    expires common.DropboxTimestamp?
        "The time this session expires."

    example default
        session_id = "dbwsid:AAFdgehTzw7WlXhZJsbGCLePe8RvQGYDr-I"
        ip_address = "3.3.3.3"
        country = "United States"
        created = "2015-05-12T15:50:38Z"
        updated = "2015-05-12T15:51:22Z"
        user_agent = "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.815.0 Safari/535.1"
        os = "Windows"
        browser = "Chrome"
        expires = "2015-05-13T15:51:22Z"

struct DesktopClientSession extends DeviceSession
    "Information about linked Dropbox desktop client sessions."
    host_name String
        "Name of the hosting desktop."
    client_type DesktopPlatform
        "The Dropbox desktop client type."
    client_version String
        "The Dropbox client version."
    platform String
        "Information on the hosting platform."
    is_delete_on_unlink_supported Boolean
        "Whether it's possible to delete all of the account files upon unlinking."

    example default
        session_id = "dbdsid:AAFdgehTzw7WlXhZJsbGCLePe8RvQGYDr-I"
        ip_address = "3.3.3.3"
        country = "United States"
        created = "2015-05-12T15:50:38Z"
        updated = "2015-05-12T15:51:22Z"
        host_name = "Home_desktop"
        client_type = mac
        client_version = "3.9.19"
        platform = "Mac OS X 10.10.3"
        is_delete_on_unlink_supported = true

struct MobileClientSession extends DeviceSession
    "Information about linked Dropbox mobile client sessions."
    device_name String
        "The device name."
    client_type MobileClientPlatform
        "The mobile application type."
    client_version String?
        "The dropbox client version."
    os_version String?
        "The hosting OS version."
    last_carrier String?
        "last carrier used by the device."

    example default
        session_id = "dbmsid:AAFdgehTzw7WlXhZJsbGCLePe8RvQGYDr-I"
        ip_address = "3.3.3.3"
        country = "United States"
        created = "2015-05-12T15:50:38Z"
        updated = "2015-05-12T15:51:22Z"
        device_name = "Iphone 6"
        client_type = iphone
        client_version = "3.9.5"
        os_version = "8.4"
        last_carrier = "Verizon"

struct ListMemberDevicesResult
    active_web_sessions List(ActiveWebSession)?
        "List of web sessions made by this team member."
    desktop_client_sessions List(DesktopClientSession)?
        "List of desktop clients used by this team member."
    mobile_client_sessions List(MobileClientSession)?
        "List of mobile client used by this team member."

struct ListMembersDevicesArg
    cursor String?
        "At the first call to the :route:`devices/list_members_devices` the cursor shouldn't be passed.
        Then, if the result of the call includes a cursor, the following requests should include the
        received cursors in order to receive the next sub list of team devices."
    include_web_sessions Boolean = true
        "Whether to list web sessions of the team members."
    include_desktop_clients Boolean = true
        "Whether to list desktop clients of the team members."
    include_mobile_clients Boolean = true
        "Whether to list mobile clients of the team members."

struct MemberDevices
    "Information on devices of a team's member."
    team_member_id String
        "The member unique Id."
    web_sessions List(ActiveWebSession)?
        "List of web sessions made by this team member."
    desktop_clients List(DesktopClientSession)?
        "List of desktop clients by this team member."
    mobile_clients List(MobileClientSession)?
        "List of mobile clients by this team member."

    example default
        team_member_id = "dbmid:AAHhy7WsR0x-u4ZCqiDl5Fz5zvuL3kmspwU"

struct ListMembersDevicesResult
    devices List(MemberDevices)
        "The devices of each member of the team."
    has_more Boolean
        "If true, then there are more devices available. Pass the
        cursor to :route:`devices/list_members_devices` to retrieve the rest."
    cursor String?
        "Pass the cursor into :route:`devices/list_members_devices` to receive the next
        sub list of team's devices."

struct RevokeDeviceSessionBatchArg
    revoke_devices List(RevokeDeviceSessionArg)

    example default
        revoke_devices = [default]

struct RevokeDeviceSessionStatus
    success Boolean
        "Result of the revoking request."
    error_type RevokeDeviceSessionError?
        "The error cause in case of a failure."

struct RevokeDeviceSessionBatchResult
    revoke_devices_status List(RevokeDeviceSessionStatus)

struct ListTeamDevicesArg
    cursor String?
        "At the first call to the :route:`devices/list_team_devices` the cursor shouldn't be passed.
        Then, if the result of the call includes a cursor, the following requests should include the
        received cursors in order to receive the next sub list of team devices."
    include_web_sessions Boolean = true
        "Whether to list web sessions of the team members."
    include_desktop_clients Boolean = true
        "Whether to list desktop clients of the team members."
    include_mobile_clients Boolean = true
        "Whether to list mobile clients of the team members."

    example default
        cursor = "ZtkX9_EHj3x7PMkVuFIhwKYXEpwpLwyxp9vMKomUhllil9q7eWiAu"

struct ListTeamDevicesResult
    devices List(MemberDevices)
        "The devices of each member of the team."
    has_more Boolean
        "If true, then there are more devices available. Pass the
        cursor to :route:`devices/list_team_devices` to retrieve the rest."
    cursor String?
        "Pass the cursor into :route:`devices/list_team_devices` to receive the next
        sub list of team's devices."

    example default
        devices = [default]
        has_more = false

route devices/list_member_devices (ListMemberDevicesArg, ListMemberDevicesResult, ListMemberDevicesError)
    "List all device sessions of a team's member."

    attrs
        auth = "team"
        scope = "sessions.list"

route devices/list_members_devices (ListMembersDevicesArg, ListMembersDevicesResult, ListMembersDevicesError)
    "List all device sessions of a team.
    Permission : Team member file access."

    attrs
        auth = "team"
        scope = "sessions.list"

route devices/revoke_device_session (RevokeDeviceSessionArg, Void, RevokeDeviceSessionError)
    "Revoke a device session of a team's member."

    attrs
        auth = "team"
        scope = "sessions.modify"

route devices/revoke_device_session_batch (RevokeDeviceSessionBatchArg, RevokeDeviceSessionBatchResult, RevokeDeviceSessionBatchError)
    "Revoke a list of device sessions of team members."

    attrs
        auth = "team"
        scope = "sessions.modify"

route devices/list_team_devices (ListTeamDevicesArg, ListTeamDevicesResult, ListTeamDevicesError) deprecated
    "List all device sessions of a team.
    Permission : Team member file access."

    attrs
        auth = "team"
        scope = "sessions.list"


union TeamFolderStatus
    active
        "The team folder and sub-folders are available to all members."
    archived
        "The team folder is archived and is not accessible outside of the team folder manager."
    archive_in_progress
        "The team folder is in the process of being archived and is not accessible outside of the team folder manager."
    inactive
        "The team folder is unmounted and can be restored."

struct TeamFolderIdArg
    team_folder_id common.SharedFolderId
        "The ID of the team folder."

    example default
        team_folder_id = "123456789"

struct TeamFolderIdListArg
    team_folder_ids List(common.SharedFolderId, min_items=1)
        "The list of team folder IDs."

    example default
        team_folder_ids = ["947182", "5819424", "852307532"]

struct TeamFolderMetadata
    "Properties of a team folder."
    team_folder_id common.SharedFolderId
        "The ID of the team folder."
    name String
        "The name of the team folder."
    status TeamFolderStatus
        "The status of the team folder."
    is_team_shared_dropbox Boolean
        "True if this team folder is a shared team root."
    sync_setting files.SyncSetting
        "The sync setting applied to this team folder."
    content_sync_settings List(files.ContentSyncSetting)
        "Sync settings applied to contents of this team folder."
    quota_limit Int64 = 0
        "The quota limit in bytes for this team folder namespace tree."

    example default
        name = "Marketing"
        team_folder_id = "123456789"
        status = active
        is_team_shared_dropbox = false
        sync_setting = default
        content_sync_settings = [default]
        quota_limit = 123456789

union TeamFolderAccessError
    invalid_team_folder_id
        "The team folder ID is invalid."
    no_access
        "The authenticated app does not have permission to manage that team folder."

union TeamFolderInvalidStatusError
    active
        "The folder is active and the operation did not succeed."
    archived
        "The folder is archived and the operation did not succeed."
    archive_in_progress
        "The folder is being archived and the operation did not succeed."

union TeamFolderTeamSharedDropboxError
    disallowed
        "This action is not allowed for a shared team root."

union BaseTeamFolderError
    "Base error that all errors for existing team folders should extend."
    access_error TeamFolderAccessError
    status_error TeamFolderInvalidStatusError
    team_shared_dropbox_error TeamFolderTeamSharedDropboxError

struct TeamFolderCreateArg
    name String
        "Name for the new team folder."
    sync_setting files.SyncSettingArg?
        "The sync setting to apply to this team folder. Only permitted if the team has team selective sync enabled."

    example default
        name = "Marketing"
        sync_setting = not_synced

union TeamFolderCreateError
    invalid_folder_name
        "The provided name cannot be used."
    folder_name_already_used
        "There is already a team folder with the provided name."
    folder_name_reserved
        "The provided name cannot be used because it is reserved."
    sync_settings_error files.SyncSettingsError
        "An error occurred setting the sync settings."
    folder_count_limit_exceeded
        "The team has reached the maximum number of team folders allowed by its plan."

struct TeamFolderRenameArg extends TeamFolderIdArg
    name String
        "New team folder name."

    example default
        team_folder_id = "123456789"
        name = "Sales"

union TeamFolderRenameError extends BaseTeamFolderError
    invalid_folder_name
        "The provided folder name cannot be used."
    folder_name_already_used
        "There is already a team folder with the same name."
    folder_name_reserved
        "The provided name cannot be used because it is reserved."

struct TeamFolderListArg
    limit UInt32(max_value=1000, min_value=1) = 1000
        "The maximum number of results to return per request."

    example default
        limit = 100

struct TeamFolderListResult
    "Result for :route:`team_folder/list` and :route:`team_folder/list/continue`."
    team_folders List(TeamFolderMetadata)
        "List of all team folders in the authenticated team."
    cursor String
        "Pass the cursor into :route:`team_folder/list/continue` to obtain additional team folders."
    has_more Boolean
        "Is true if there are additional team folders that have not been returned
        yet. An additional call to :route:`team_folder/list/continue` can retrieve them."

    example default
        team_folders = [default]
        cursor = "ZtkX9_EHj3x7PMkVuFIhwKYXEpwpLwyxp9vMKomUhllil9q7eWiAu"
        has_more = false

struct TeamFolderListError
    access_error TeamFolderAccessError

struct TeamFolderListContinueArg
    cursor String
        "Indicates from what point to get the next set of team folders."

    example default
        cursor = "ZtkX9_EHj3x7PMkVuFIhwKYXEpwpLwyxp9vMKomUhllil9q7eWiAu"

union TeamFolderListContinueError
    invalid_cursor
        "The cursor is invalid."

union_closed TeamFolderGetInfoItem
    id_not_found String = ""
        "An ID that was provided as a parameter to :route:`team_folder/get_info` did not
        match any of the team's team folders."
    team_folder_metadata TeamFolderMetadata
        "Properties of a team folder."

union TeamFolderActivateError extends BaseTeamFolderError
    folder_count_limit_exceeded
        "The team has reached the maximum number of team folders allowed by its plan."

union TeamFolderRestoreError extends BaseTeamFolderError
    folder_count_limit_exceeded
        "The team has reached the maximum number of team folders allowed by its plan."

struct TeamFolderArchiveArg extends TeamFolderIdArg
    force_async_off Boolean = false
        "Whether to force the archive to happen synchronously."

    example default
        team_folder_id = "123456789"
        force_async_off = false

union_closed TeamFolderArchiveLaunch extends async.LaunchResultBase
    complete TeamFolderMetadata

    example default
        complete = default

    example async_job_id
        async_job_id = "34g93hh34h04y384084"

union TeamFolderArchiveError extends BaseTeamFolderError
    ""

union_closed TeamFolderArchiveJobStatus extends async.PollResultBase
    complete TeamFolderMetadata
        "The archive job has finished. The value is the metadata for the resulting team folder."
    failed TeamFolderArchiveError
        "Error occurred while performing an asynchronous job from :route:`team_folder/archive`."

    example default
        complete = default

union TeamFolderPermanentlyDeleteError extends BaseTeamFolderError
    ""

struct TeamFolderUpdateSyncSettingsArg extends TeamFolderIdArg
    sync_setting files.SyncSettingArg?
        "Sync setting to apply to the team folder itself. Only meaningful if the team folder is not a shared team root."
    content_sync_settings List(files.ContentSyncSettingArg)?
        "Sync settings to apply to contents of this team folder."

    example default
        team_folder_id = "123456789"
        sync_setting = default
        content_sync_settings = [default]

union TeamFolderUpdateSyncSettingsError extends BaseTeamFolderError
    sync_settings_error files.SyncSettingsError
        "An error occurred setting the sync settings."

route team_folder/create (TeamFolderCreateArg, TeamFolderMetadata, TeamFolderCreateError)
    "Creates a new, active, team folder with no members. This endpoint can only be used for teams
    that do not already have a shared team space.
    Permission : Team member file access."

    attrs
        auth = "team"
        scope = "team_data.content.write"

route team_folder/rename (TeamFolderRenameArg, TeamFolderMetadata, TeamFolderRenameError)
    "Changes an active team folder's name.
    Permission : Team member file access."

    attrs
        auth = "team"
        scope = "team_data.content.write"

route team_folder/list (TeamFolderListArg, TeamFolderListResult, TeamFolderListError)
    "Lists all team folders.
    Permission : Team member file access."

    attrs
        auth = "team"
        scope = "team_data.content.read"

route team_folder/list/continue (TeamFolderListContinueArg, TeamFolderListResult, TeamFolderListContinueError)
    "Once a cursor has been retrieved from :route:`team_folder/list`, use this to paginate
    through all team folders.
    Permission : Team member file access."

    attrs
        auth = "team"
        scope = "team_data.content.read"

route team_folder/get_info (TeamFolderIdListArg, List(TeamFolderGetInfoItem), Void)
    "Retrieves metadata for team folders.
    Permission : Team member file access."

    attrs
        auth = "team"
        scope = "team_data.content.read"

route team_folder/activate (TeamFolderIdArg, TeamFolderMetadata, TeamFolderActivateError)
    "Sets an archived team folder's status to active.
    Permission : Team member file access."

    attrs
        auth = "team"
        scope = "team_data.content.write"

route team_folder/restore (TeamFolderIdArg, TeamFolderMetadata, TeamFolderRestoreError)
    "Sets an inactive team folder's status to active.
    Permission: Team member file access."

    attrs
        auth = "team"
        is_preview = true
        scope = "team_data.content.write"

route team_folder/archive (TeamFolderArchiveArg, TeamFolderArchiveLaunch, TeamFolderArchiveError)
    "Sets an active team folder's status to archived and removes all folder and file members.
    This endpoint cannot be used for teams that have a shared team space. This route will
    either finish synchronously, or return a job ID and do the async archive job in
    background. Please use team_folder/archive/check to check the job status.
    Permission : Team member file access."

    attrs
        auth = "team"
        scope = "team_data.content.write"

route team_folder/archive/check (async.PollArg, TeamFolderArchiveJobStatus, async.PollError)
    "Returns the status of an asynchronous job for archiving a team folder.
    The job may show '.tag' as complete, but the team folder could still be in the process of archiving (indicated by
    :field:`TeamFolderMetadata.status` with 'archive_in_progress').
    To confirm that the team folder is fully archived, check the field :field:`TeamFolderMetadata.status` in the response
    for the value 'archived'.
    Permission : Team member file access."

    attrs
        auth = "team"
        scope = "team_data.content.write"

route team_folder/permanently_delete (TeamFolderIdArg, Void, TeamFolderPermanentlyDeleteError)
    "Permanently deletes an archived team folder. This endpoint cannot be used for teams
    that have a shared team space.
    Permission : Team member file access."

    attrs
        auth = "team"
        scope = "team_data.content.write"

route team_folder/update_sync_settings (TeamFolderUpdateSyncSettingsArg, TeamFolderMetadata, TeamFolderUpdateSyncSettingsError)
    "Updates the sync settings on a team folder or its contents.  Use of this endpoint requires that the team has team selective sync enabled."

    attrs
        auth = "team"
        scope = "team_data.content.write"


alias LegalHoldId = String(pattern="^pid_dbhid:.+")

alias LegalHoldPolicyName = String(max_length=140)

alias LegalHoldPolicyDescription = String(max_length=501)

alias Path = String(pattern="(/(.|[\\r\\n])*)?")

alias LegalHoldsPolicyCreateResult = LegalHoldPolicy

alias LegalHoldsGetPolicyResult = LegalHoldPolicy

alias ListHeldRevisionCursor = String(min_length=1)

alias LegalHoldsPolicyUpdateResult = LegalHoldPolicy

union LegalHoldStatus
    active
        "The legal hold policy is active."
    released
        "The legal hold policy was released."
    activating
        "The legal hold policy is activating."
    updating
        "The legal hold policy is updating."
    exporting
        "The legal hold policy is exporting."
    releasing
        "The legal hold policy is releasing."

union LegalHoldsError
    unknown_legal_hold_error
        "There has been an unknown legal hold error."
    insufficient_permissions
        "You don't have permissions to perform this action."

union LegalHoldsPolicyCreateError extends LegalHoldsError
    start_date_is_later_than_end_date
        "Start date must be earlier than end date."
    empty_members_list
        "The users list must have at least one user."
    invalid_members
        "Some members in the members list are not valid to be placed under legal hold."
    number_of_users_on_hold_is_greater_than_hold_limitation
        "You cannot add more than 5 users in a legal hold."
    transient_error
        "Temporary infrastructure failure, please retry."
    name_must_be_unique
        "The name provided is already in use by another legal hold."
    team_exceeded_legal_hold_quota
        "Team exceeded legal hold quota."
    invalid_date
        "The provided date is invalid."

union LegalHoldsGetPolicyError extends LegalHoldsError
    legal_hold_policy_not_found
        "Legal hold policy does not exist for :field:`LegalHoldsGetPolicyArg.id`."

union LegalHoldsListPoliciesError extends LegalHoldsError
    transient_error
        "Temporary infrastructure failure, please retry."

union LegalHoldsListHeldRevisionsError extends LegalHoldsError
    transient_error
        "Temporary infrastructure failure, please retry."
    legal_hold_still_empty
        "The legal hold is not holding any revisions yet."
    inactive_legal_hold
        "Trying to list revisions for an inactive legal hold."

union LegalHoldsListHeldRevisionsContinueError
    unknown_legal_hold_error
        "There has been an unknown legal hold error."
    transient_error
        "Temporary infrastructure failure, please retry."
    reset
        "Indicates that the cursor has been invalidated. Call
        :route:`legal_holds/list_held_revisions_continue` again with an empty cursor to obtain a new cursor."

union LegalHoldsPolicyUpdateError extends LegalHoldsError
    transient_error
        "Temporary infrastructure failure, please retry."
    inactive_legal_hold
        "Trying to release an inactive legal hold."
    legal_hold_performing_another_operation
        "Legal hold is currently performing another operation."
    invalid_members
        "Some members in the members list are not valid to be placed under legal hold."
    number_of_users_on_hold_is_greater_than_hold_limitation
        "You cannot add more than 5 users in a legal hold."
    empty_members_list
        "The users list must have at least one user."
    name_must_be_unique
        "The name provided is already in use by another legal hold."
    legal_hold_policy_not_found
        "Legal hold policy does not exist for :field:`LegalHoldsPolicyUpdateArg.id`."

union LegalHoldsPolicyReleaseError extends LegalHoldsError
    legal_hold_performing_another_operation
        "Legal hold is currently performing another operation."
    legal_hold_already_releasing
        "Legal hold is currently performing a release or is already released."
    legal_hold_policy_not_found
        "Legal hold policy does not exist for :field:`LegalHoldsPolicyReleaseArg.id`."

struct MembersInfo
    team_member_ids List(team_common.TeamMemberId)
        "Team member IDs of the users under this hold."
    permanently_deleted_users UInt64
        "The number of permanently deleted users that were under this hold."

    example default
        team_member_ids = ["dbmid:efgh5678"]
        permanently_deleted_users = 2

struct LegalHoldPolicy
    id LegalHoldId
        "The legal hold id."
    name LegalHoldPolicyName
        "Policy name."
    description LegalHoldPolicyDescription?
        "A description of the legal hold policy."
    activation_time common.DropboxTimestamp?
        "The time at which the legal hold was activated."
    members MembersInfo
        "Team members IDs and number of permanently deleted members under hold."
    status LegalHoldStatus
        "The current state of the hold."
    start_date common.DropboxTimestamp
        "Start date of the legal hold policy."
    end_date common.DropboxTimestamp?
        "End date of the legal hold policy."

    example default
        id = "pid_dbhid:abcd1234"
        name = "acme cfo policy"
        activation_time = "2016-01-20T00:00:10Z"
        members = default
        status = active
        start_date = "2016-01-01T00:00:00Z"
        end_date = "2017-12-31T00:00:00Z"

struct LegalHoldsPolicyCreateArg
    name LegalHoldPolicyName
        "Policy name."
    description LegalHoldPolicyDescription?
        "A description of the legal hold policy."
    members List(team_common.TeamMemberId)
        "List of team member IDs added to the hold."
    start_date common.DropboxTimestamp?
        "start date of the legal hold policy."
    end_date common.DropboxTimestamp?
        "end date of the legal hold policy."

    example default
        name = "acme cfo policy"
        members = ["dbmid:FDFSVF-DFSDF"]
        start_date = "2016-01-01T00:00:00Z"
        end_date = "2017-12-31T00:00:00Z"

struct LegalHoldsGetPolicyArg
    id LegalHoldId
        "The legal hold Id."

    example default
        id = "pid_dbhid:abcd1234"

struct LegalHoldsListPoliciesArg
    include_released Boolean = false
        "Whether to return holds that were released."

    example default
        include_released = false

struct LegalHoldsListPoliciesResult
    policies List(LegalHoldPolicy)

    example default
        policies = [default]

struct LegalHoldsListHeldRevisionsArg
    id LegalHoldId
        "The legal hold Id."

    example default
        id = "pid_dbhid:abcd1234"

struct LegalHoldHeldRevisionMetadata
    new_filename String
        "The held revision filename."
    original_revision_id files.Rev
        "The id of the held revision."
    original_file_path Path
        "The original path of the held revision."
    server_modified common.DropboxTimestamp
        "The last time the file was modified on Dropbox."
    author_member_id team_common.TeamMemberId
        "The member id of the revision's author."
    author_member_status TeamMemberStatus
        "The member status of the revision's author."
    author_email common.EmailAddress
        "The email address of the held revision author."
    file_type String
        "The type of the held revision's file."
    size UInt64
        "The file size in bytes."
    content_hash files.Sha256HexHash
        "A hash of the file content. This field can be used to verify data integrity. For more
        information see our :link:`Content hash https://www.dropbox.com/developers/reference/content-hash` page."

    example default
        new_filename = "111_222.pdf"
        original_revision_id = "ab2rij4i5ojgfd"
        original_file_path = "/a.pdf"
        server_modified = "2019-08-12T12:08:52Z"
        author_member_id = "dbmid:abcd1234abcd1234abcd1234abcd1234a23"
        author_member_status = active
        author_email = "a@a.com"
        file_type = "Document"
        size = 3
        content_hash = "abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234"

struct LegalHoldsListHeldRevisionResult
    entries List(LegalHoldHeldRevisionMetadata)
        "List of file entries that under the hold."
    cursor ListHeldRevisionCursor?
        "The cursor idicates where to continue reading file metadata entries for the next API call. When there are no more entries, the cursor will return none.
        Pass the cursor into
        /2/team/legal_holds/list_held_revisions/continue."
    has_more Boolean
        "True if there are more file entries that haven't been returned. You can retrieve them with a call to /legal_holds/list_held_revisions_continue."

    example default
        entries = [default]
        has_more = false

struct LegalHoldsListHeldRevisionsContinueArg
    id LegalHoldId
        "The legal hold Id."
    cursor ListHeldRevisionCursor?
        "The cursor idicates where to continue reading file metadata entries for the next API call. When there are no more entries, the cursor will return none."

    example default
        id = "pid_dbhid:abcd1234"

struct LegalHoldsPolicyUpdateArg
    id LegalHoldId
        "The legal hold Id."
    name LegalHoldPolicyName?
        "Policy new name."
    description LegalHoldPolicyDescription?
        "Policy new description."
    members List(team_common.TeamMemberId)?
        "List of team member IDs to apply the policy on."

    example default
        id = "pid_dbhid:abcd1234"
        members = ["dbmid:FDFSVF-DFSDF"]

struct LegalHoldsPolicyReleaseArg
    id LegalHoldId
        "The legal hold Id."

    example default
        id = "pid_dbhid:abcd1234"

route legal_holds/create_policy (LegalHoldsPolicyCreateArg, LegalHoldsPolicyCreateResult, LegalHoldsPolicyCreateError)
    "Creates new legal hold policy.
    Note: Legal Holds is a paid add-on. Not all teams have the feature.
    Permission : Team member file access."

    attrs
        auth = "team"
        scope = "team_data.governance.write"

route legal_holds/get_policy (LegalHoldsGetPolicyArg, LegalHoldsGetPolicyResult, LegalHoldsGetPolicyError)
    "Gets a legal hold by Id.
    Note: Legal Holds is a paid add-on. Not all teams have the feature.
    Permission : Team member file access."

    attrs
        auth = "team"
        scope = "team_data.governance.write"

route legal_holds/list_policies (LegalHoldsListPoliciesArg, LegalHoldsListPoliciesResult, LegalHoldsListPoliciesError)
    "Lists legal holds on a team.
    Note: Legal Holds is a paid add-on. Not all teams have the feature.
    Permission : Team member file access."

    attrs
        auth = "team"
        scope = "team_data.governance.write"

route legal_holds/list_held_revisions (LegalHoldsListHeldRevisionsArg, LegalHoldsListHeldRevisionResult, LegalHoldsListHeldRevisionsError)
    "List the file metadata that's under the hold.
    Note: Legal Holds is a paid add-on. Not all teams have the feature.
    Permission : Team member file access."

    attrs
        auth = "team"
        scope = "team_data.governance.write"

route legal_holds/list_held_revisions_continue (LegalHoldsListHeldRevisionsContinueArg, LegalHoldsListHeldRevisionResult, LegalHoldsListHeldRevisionsError)
    "Continue listing the file metadata that's under the hold.
    Note: Legal Holds is a paid add-on. Not all teams have the feature.
    Permission : Team member file access."

    attrs
        auth = "team"
        scope = "team_data.governance.write"

route legal_holds/update_policy (LegalHoldsPolicyUpdateArg, LegalHoldsPolicyUpdateResult, LegalHoldsPolicyUpdateError)
    "Updates a legal hold.
    Note: Legal Holds is a paid add-on. Not all teams have the feature.
    Permission : Team member file access."

    attrs
        auth = "team"
        scope = "team_data.governance.write"

route legal_holds/release_policy (LegalHoldsPolicyReleaseArg, Void, LegalHoldsPolicyReleaseError)
    "Releases a legal hold by Id.
    Note: Legal Holds is a paid add-on. Not all teams have the feature.
    Permission : Team member file access."

    attrs
        auth = "team"
        scope = "team_data.governance.write"


route members/delete_former_member_files (MembersFormerMemberArg, Void, MembersDeleteFormerMemberFilesError)
    "Permanently delete the files of a user who has been removed from the team. After permanent
    deletion, those files will not be available to be transferred to another team member.
    Permission : Team member management
    Exactly one of team_member_id, email, or external_id must be provided to identify the user account."

    attrs
        auth = "team"
        scope = "members.write"

route members/get_available_team_member_roles (Void, MembersGetAvailableTeamMemberRolesResult, Void)
    "Get available TeamMemberRoles for the connected team. To be used with :route:`members/set_admin_permissions:2`.
    Permission : Team member management."

    attrs
        auth = "team"
        scope = "members.read"

route members/get_info (MembersGetInfoArgs, MembersGetInfoResult, MembersGetInfoError)
    "Returns information about multiple team members.
    Permission : Team information
    This endpoint will return :field:`MembersGetInfoItem.id_not_found`,
    for IDs (or emails) that cannot be matched to a valid team member."

    attrs
        auth = "team"
        scope = "members.read"

route members/get_info:2 (MembersGetInfoV2Arg, MembersGetInfoV2Result, MembersGetInfoError)
    "Returns information about multiple team members.
    Permission : Team information
    This endpoint will return :field:`MembersGetInfoItem.id_not_found`,
    for IDs (or emails) that cannot be matched to a valid team member."

    attrs
        auth = "team"
        scope = "members.read"

route members/list (MembersListArg, MembersListResult, MembersListError)
    "Lists members of a team.
    Permission : Team information."

    attrs
        auth = "team"
        scope = "members.read"

route members/list/continue (MembersListContinueArg, MembersListResult, MembersListContinueError)
    "Once a cursor has been retrieved from :route:`members/list`, use this to paginate
    through all team members.
    Permission : Team information."

    attrs
        auth = "team"
        scope = "members.read"

route members/list/continue:2 (MembersListContinueArg, MembersListV2Result, MembersListContinueError)
    "Once a cursor has been retrieved from :route:`members/list:2`, use this to paginate
    through all team members.
    Permission : Team information."

    attrs
        auth = "team"
        scope = "members.read"

route members/list:2 (MembersListArg, MembersListV2Result, MembersListError)
    "Lists members of a team.
    Permission : Team information."

    attrs
        auth = "team"
        scope = "members.read"

route members/move_former_member_files (MembersDataTransferArg, async.LaunchEmptyResult, MembersTransferFormerMembersFilesError)
    "Moves removed member's files to a different member. This endpoint initiates an asynchronous job. To obtain the final result
    of the job, the client should periodically poll :route:`members/move_former_member_files/job_status/check`.
    Permission : Team member management."

    attrs
        auth = "team"
        scope = "members.write"

route members/move_former_member_files/job_status/check (async.PollArg, async.PollEmptyResult, async.PollError)
    "Once an async_job_id is returned from :route:`members/move_former_member_files` ,
    use this to poll the status of the asynchronous request.
    Permission : Team member management."

    attrs
        auth = "team"
        scope = "members.write"

route members/remove (MembersRemoveArg, async.LaunchEmptyResult, MembersRemoveError)
    "Removes a member from a team.
    Permission : Team member management
    Exactly one of team_member_id, email, or external_id must be provided to identify the user account.
    Accounts can be recovered via :route:`members/recover` for a 7 day period
    or until the account has been permanently deleted or transferred to another account
    (whichever comes first). Calling :route:`members/add` while a user is still recoverable
    on your team will return with :field:`MemberAddResult.user_already_on_team`.
    Accounts can have their files transferred via the admin console for a limited time, based on the version history
    length associated with the team (180 days for most teams).
    Accounts can have their stacks transferred through the admin console. This only transfers stacks that they have created.
    This endpoint may initiate an asynchronous job. To obtain the final result
    of the job, the client should periodically poll :route:`members/remove/job_status/get`."

    attrs
        auth = "team"
        scope = "members.delete"

route members/remove/job_status/get (async.PollArg, async.PollEmptyResult, async.PollError)
    "Once an async_job_id is returned from :route:`members/remove` ,
    use this to poll the status of the asynchronous request.
    Permission : Team member management."

    attrs
        auth = "team"
        scope = "members.delete"

route members/set_admin_permissions (MembersSetPermissionsArg, MembersSetPermissionsResult, MembersSetPermissionsError)
    "Updates a team member's permissions.
    Permission : Team member management."

    attrs
        auth = "team"
        scope = "members.write"

route members/set_admin_permissions:2 (MembersSetPermissions2Arg, MembersSetPermissions2Result, MembersSetPermissions2Error)
    "Updates a team member's permissions.
    Permission : Team member management."

    attrs
        auth = "team"
        scope = "members.write"

route members/suspend (MembersDeactivateArg, Void, MembersSuspendError)
    "Suspend a member from a team.
    Permission : Team member management
    Exactly one of team_member_id, email, or external_id must be provided to identify the user account."

    attrs
        auth = "team"
        scope = "members.write"

route members/unsuspend (MembersUnsuspendArg, Void, MembersUnsuspendError)
    "Unsuspend a member from a team.
    Permission : Team member management
    Exactly one of team_member_id, email, or external_id must be provided to identify the user account."

    attrs
        auth = "team"
        scope = "members.write"


route members/delete_profile_photo (MembersDeleteProfilePhotoArg, TeamMemberInfo, MembersDeleteProfilePhotoError)
    "Deletes a team member's profile photo.
    Permission : Team member management."

    attrs
        auth = "team"
        scope = "members.write"

route members/delete_profile_photo:2 (MembersDeleteProfilePhotoArg, TeamMemberInfoV2Result, MembersDeleteProfilePhotoError)
    "Deletes a team member's profile photo.
    Permission : Team member management."

    attrs
        auth = "team"
        scope = "members.write"

route members/set_profile (MembersSetProfileArg, TeamMemberInfo, MembersSetProfileError)
    "Updates a team member's profile.
    Permission : Team member management."

    attrs
        auth = "team"
        scope = "members.write"

route members/set_profile:2 (MembersSetProfileArg, TeamMemberInfoV2Result, MembersSetProfileError)
    "Updates a team member's profile.
    Permission : Team member management."

    attrs
        auth = "team"
        scope = "members.write"

route members/set_profile_photo (MembersSetProfilePhotoArg, TeamMemberInfo, MembersSetProfilePhotoError)
    "Updates a team member's profile photo.
    Permission : Team member management."

    attrs
        auth = "team"
        scope = "members.write"

route members/set_profile_photo:2 (MembersSetProfilePhotoArg, TeamMemberInfoV2Result, MembersSetProfilePhotoError)
    "Updates a team member's profile photo.
    Permission : Team member management."

    attrs
        auth = "team"
        scope = "members.write"


route members/recover (MembersRecoverArg, Void, MembersRecoverError)
    "Recover a deleted member.
    Permission : Team member management
    Exactly one of team_member_id, email, or external_id must be provided to identify the user account."

    attrs
        auth = "team"
        scope = "members.delete"


route members/add (MembersAddArg, MembersAddLaunch, Void)
    "Adds members to a team.
    Permission : Team member management
    A maximum of 20 members can be specified in a single call.
    If no Dropbox account exists with the email address specified, a new Dropbox account will
    be created with the given email address, and that account will be invited to the team.
    If a personal Dropbox account exists with the email address specified in the call,
    this call will create a placeholder Dropbox account for the user on the team and send an
    email inviting the user to migrate their existing personal account onto the team.
    Team member management apps are required to set an initial given_name and surname for a
    user to use in the team invitation and for 'Perform as team member' actions taken on
    the user before they become 'active'."

    attrs
        auth = "team"
        scope = "members.write"

route members/add/job_status/get (async.PollArg, MembersAddJobStatus, async.PollError)
    "Once an async_job_id is returned from :route:`members/add` ,
    use this to poll the status of the asynchronous request.
    Permission : Team member management."

    attrs
        auth = "team"
        scope = "members.write"

route members/add/job_status/get:2 (async.PollArg, MembersAddJobStatusV2Result, async.PollError)
    "Once an async_job_id is returned from :route:`members/add:2` ,
    use this to poll the status of the asynchronous request.
    Permission : Team member management."

    attrs
        auth = "team"
        scope = "members.write"

route members/add:2 (MembersAddV2Arg, MembersAddLaunchV2Result, Void)
    "Adds members to a team.
    Permission : Team member management
    A maximum of 20 members can be specified in a single call.
    If no Dropbox account exists with the email address specified, a new Dropbox account will
    be created with the given email address, and that account will be invited to the team.
    If a personal Dropbox account exists with the email address specified in the call,
    this call will create a placeholder Dropbox account for the user on the team and send an
    email inviting the user to migrate their existing personal account onto the team."

    attrs
        auth = "team"
        scope = "members.write"

route members/send_welcome_email (UserSelectorArg, Void, MembersSendWelcomeError)
    "Sends welcome email to pending team member.
    Permission : Team member management
    Exactly one of team_member_id, email, or external_id must be provided to identify the user account.
    No-op if team member is not pending."

    attrs
        auth = "team"
        scope = "members.write"


alias MembersGetInfoResult = List(MembersGetInfoItem)

alias TeamMemberRoleId = String(max_length=128, pattern="pid_dbtmr:.*")

union_closed AdminTier
    "Describes which team-related admin permissions a user has."
    team_admin
        "User is an administrator of the team - has all permissions."
    user_management_admin
        "User can do most user provisioning, de-provisioning and management."
    support_admin
        "User can do a limited set of common support tasks for existing users. Note: Dropbox is adding new types of admin roles; these may display as support_admin."
    member_only
        "User is not an admin of the team."

    example default
        member_only = null

union_closed MemberAddResult extends MemberAddResultBase
    "Describes the result of attempting to add a single user to the team.
    'success' is the only value indicating that a user was indeed added to the team -
    the other values explain the type of failure that occurred, and include the email
    of the user for which the operation has failed."
    success TeamMemberInfo
        "Describes a user that was successfully added to the team."

    example default
        success = default

union_closed MemberAddResultBase
    team_license_limit common.EmailAddress
        "Team is already full. The organization has no available licenses."
    free_team_member_limit_reached common.EmailAddress
        "Team is already full. The free team member limit has been reached."
    user_already_on_team common.EmailAddress
        "User is already on this team. The provided email address is associated
        with a user who is already a member of (including in recoverable state) or invited to the team."
    user_on_another_team common.EmailAddress
        "User is already on another team. The provided email address is associated
        with a user that is already a member or invited to another team."
    user_already_paired common.EmailAddress
        "User is already paired."
    user_migration_failed common.EmailAddress
        "User migration has failed."
    duplicate_external_member_id common.EmailAddress
        "A user with the given external member ID already exists on the team (including in recoverable state)."
    duplicate_member_persistent_id common.EmailAddress
        "A user with the given persistent ID already exists on the team (including in recoverable state)."
    persistent_id_disabled common.EmailAddress
        "Persistent ID is only available to teams with persistent ID SAML configuration. Please contact Dropbox for more information."
    user_creation_failed common.EmailAddress
        "User creation has failed."

    example default
        team_license_limit = "apple@orange.com"

union MemberAddV2Result extends MemberAddResultBase
    "Describes the result of attempting to add a single user to the team.
    'success' is the only value indicating that a user was indeed added to the team -
    the other values explain the type of failure that occurred, and include the email
    of the user for which the operation has failed."
    success TeamMemberInfoV2
        "Describes a user that was successfully added to the team."

    example default
        success = default

union_closed MemberSelectorError extends UserSelectorError
    user_not_in_team
        "The user is not a member of the team."

union_closed MembersAddJobStatus extends async.PollResultBase
    complete List(MemberAddResult)
        "The asynchronous job has finished. For each member that was specified in the
        parameter :type:`MembersAddArg` that was provided to :route:`members/add`, a
        corresponding item is returned in this list."
    failed String = ""
        "The asynchronous job returned an error. The string contains an error message."

    example default
        complete = [default]

union MembersAddJobStatusV2Result extends async.PollResultBase
    complete List(MemberAddV2Result)
        "The asynchronous job has finished. For each member that was specified in the
        parameter :type:`MembersAddArg` that was provided to :route:`members/add:2`, a
        corresponding item is returned in this list."
    failed String = ""
        "The asynchronous job returned an error. The string contains an error message."

    example default
        complete = [default]

union_closed MembersAddLaunch extends async.LaunchResultBase
    complete List(MemberAddResult)

    example default
        complete = [default]

union MembersAddLaunchV2Result extends async.LaunchResultBase
    complete List(MemberAddV2Result)

    example default
        complete = [default]

union MembersDeactivateError extends UserSelectorError
    user_not_in_team
        "The user is not a member of the team."

union MembersDeleteFormerMemberFilesError extends MembersPermanentlyDeleteFilesError
    user_not_removed
        "User has not been removed from the team."

union MembersDeleteProfilePhotoError extends MemberSelectorError
    set_profile_disallowed
        "Modifying deleted users is not allowed."

union MembersGetInfoError
    ""

union_closed MembersGetInfoItem extends MembersGetInfoItemBase
    "Describes a result obtained for a single user whose id was specified in the
    parameter of :route:`members/get_info`."
    member_info TeamMemberInfo
        "Info about a team member."

    example default
        member_info = default

union_closed MembersGetInfoItemBase
    id_not_found String = ""
        "An ID that was provided as a parameter to :route:`members/get_info` or :route:`members/get_info:2`,
        and did not match a corresponding user. This might be a team_member_id, an
        email, or an external ID, depending on how the method was called."

union MembersGetInfoItemV2 extends MembersGetInfoItemBase
    "Describes a result obtained for a single user whose id was specified in the
    parameter of :route:`members/get_info:2`."
    member_info TeamMemberInfoV2
        "Info about a team member."

    example default
        member_info = default

union MembersListContinueError
    invalid_cursor
        "The cursor is invalid."

union MembersListError
    ""

union MembersPermanentlyDeleteFilesError extends MembersDeactivateError
    transfer_in_progress
        "Cannot permanently delete files while it's being transferred."
    already_transferred
        "Cannot permanently delete files that have already been transferred."
    already_transferred_or_deleted
        "Cannot permanently delete files that have already been transferred or deleted."

union MembersRecoverError extends UserSelectorError
    user_unrecoverable
        "The user is not recoverable."
    user_not_in_team
        "The user is not a member of the team."
    team_license_limit
        "Team is full. The organization has no available licenses."

union MembersRemoveError extends MembersTransferFilesError
    remove_last_admin
        "The user is the last admin of the team, so it cannot be removed from it."
    cannot_keep_account_and_transfer
        "Cannot keep account and transfer the data to another user at the same time."
    cannot_keep_account_and_delete_data
        "Cannot keep account and delete the data at the same time. To keep the account the argument wipe_data should be set to :val:`false`."
    cannot_keep_account_and_permanently_delete
        "Cannot keep account and permanently delete the data at the same time. To keep the account the argument permanently_delete_files should be set to :val:`false`."
    email_address_too_long_to_be_disabled
        "The email address of the user is too long to be disabled."
    cannot_keep_invited_user_account
        "Cannot keep account of an invited user."
    cannot_retain_shares_when_data_wiped
        "Cannot retain team shares when the user's data is marked for deletion on their linked devices. The argument wipe_data should be set to :val:`false`."
    cannot_retain_shares_when_no_account_kept
        "The user's account must be kept in order to retain team shares. The argument keep_account should be set to :val:`true`."
    cannot_retain_shares_when_team_external_sharing_off
        "Externally sharing files, folders, and links must be enabled in team settings in order to retain team shares for the user."
    cannot_keep_account
        "Only a team admin, can convert this account to a Basic account."
    cannot_keep_account_under_legal_hold
        "This user content is currently being held. To convert this member's account to a Basic account, you'll first need to remove them from the hold."
    cannot_keep_account_required_to_sign_tos
        "To convert this member to a Basic account, they'll first need to sign in to Dropbox and agree to the terms of service."
    cannot_permanently_delete_and_transfer
        "Cannot permanently delete files and transfer the data to another user at the same time."
    member_is_transfer_destination
        "This user is the active destination of an in-progress file transfer. Wait for the transfer to complete before removing this member."

union MembersSendWelcomeError extends MemberSelectorError
    ""

union MembersSetPermissions2Error extends UserSelectorError
    last_admin
        "Cannot remove the admin setting of the last admin."
    user_not_in_team
        "The user is not a member of the team."
    cannot_set_permissions
        "Cannot remove/grant permissions. This can happen if the team member is suspended."
    role_not_found
        "No matching role found. At least one of the provided new_roles does not exist on this team."

union MembersSetPermissionsError extends UserSelectorError
    last_admin
        "Cannot remove the admin setting of the last admin."
    user_not_in_team
        "The user is not a member of the team."
    cannot_set_permissions
        "Cannot remove/grant permissions."
    team_license_limit
        "Team is full. The organization has no available licenses."

union MembersSetProfileError extends MemberSelectorError
    external_id_and_new_external_id_unsafe
        "It is unsafe to use both external_id and new_external_id."
    no_new_data_specified
        "None of new_email, new_given_name, new_surname, or new_external_id are specified."
    email_reserved_for_other_user
        "Email is already reserved for another user."
    external_id_used_by_other_user
        "The external ID is already in use by another team member."
    set_profile_disallowed
        "Modifying deleted users is not allowed."
    param_cannot_be_empty
        "Parameter new_email cannot be empty."
    persistent_id_disabled
        "Persistent ID is only available to teams with persistent ID SAML configuration. Please contact Dropbox for more information."
    persistent_id_used_by_other_user
        "The persistent ID is already in use by another team member."
    directory_restricted_off
        "Directory Restrictions option is not available."

union MembersSetProfilePhotoError extends MemberSelectorError
    set_profile_disallowed
        "Modifying deleted users is not allowed."
    photo_error account.SetProfilePhotoError

union MembersSuspendError extends MembersDeactivateError
    suspend_inactive_user
        "The user is not active, so it cannot be suspended."
    suspend_last_admin
        "The user is the last admin of the team, so it cannot be suspended."
    team_license_limit
        "Team is full. The organization has no available licenses."

union MembersTransferFilesError extends MembersPermanentlyDeleteFilesError
    removed_and_transfer_dest_should_differ
        "Expected removed user and transfer_dest user to be different."
    removed_and_transfer_admin_should_differ
        "Expected removed user and transfer_admin user to be different."
    transfer_dest_user_not_found
        "No matching user found for the argument transfer_dest_id."
    transfer_dest_user_not_in_team
        "The provided transfer_dest_id does not exist on this team."
    transfer_admin_user_not_in_team
        "The provided transfer_admin_id does not exist on this team."
    transfer_admin_user_not_found
        "No matching user found for the argument transfer_admin_id."
    unspecified_transfer_admin_id
        "The transfer_admin_id argument must be provided when file transfer is requested."
    transfer_admin_is_not_admin
        "Specified transfer_admin user is not a team admin."
    recipient_not_verified
        "The recipient user's email is not verified."

union MembersTransferFormerMembersFilesError extends MembersTransferFilesError
    user_data_is_being_transferred
        "The user's data is being transferred. Please wait some time before retrying."
    user_not_removed
        "No matching removed user found for the argument user."
    user_data_cannot_be_transferred
        "User files aren't transferable anymore."
    user_data_already_transferred
        "User's data has already been transferred to another user."

union MembersUnsuspendError extends MembersDeactivateError
    unsuspend_non_suspended_member
        "The user is unsuspended, so it cannot be unsuspended again."
    team_license_limit
        "Team is full. The organization has no available licenses."

struct MemberAddArg extends MemberAddArgBase
    role AdminTier = member_only

    example default
        member_email = "tom.s@company.com"
        member_given_name = "Tom"
        member_surname = "Silverstone"
        member_external_id = "company_id:342432"
        role = default

struct MemberAddArgBase
    member_email common.EmailAddress
    member_given_name common.OptionalNamePart?
        "Member's first name."
    member_surname common.OptionalNamePart?
        "Member's last name."
    member_external_id team_common.MemberExternalId?
        "External ID for member."
    member_persistent_id String?
        "Persistent ID for member. This field is only available to teams using persistent ID SAML configuration."
    send_welcome_email Boolean = true
        "Whether to send a welcome email to the member.
        If send_welcome_email is false, no email invitation will be sent to the user.
        This may be useful for apps using single sign-on (SSO) flows for onboarding that
        want to handle announcements themselves."
    is_directory_restricted Boolean?
        "Whether a user is directory restricted."

    example default
        member_email = "tom.s@company.com"
        member_given_name = "Tom"
        member_surname = "Silverstone"
        member_external_id = "company_id:342432"

struct MemberAddV2Arg extends MemberAddArgBase
    role_ids List(TeamMemberRoleId, max_items=1)?

    example default
        member_email = "tom.s@company.com"
        member_given_name = "Tom"
        member_surname = "Silverstone"
        member_external_id = "company_id:342432"
        role_ids = ["pid_dbtmr:2345"]

struct MembersAddArg extends MembersAddArgBase
    new_members List(MemberAddArg)
        "Details of new members to be added to the team."

    example default
        new_members = [default]

struct MembersAddArgBase
    force_async Boolean = false
        "Whether to force the add to happen asynchronously."

    example default
        force_async = true

struct MembersAddV2Arg extends MembersAddArgBase
    new_members List(MemberAddV2Arg)
        "Details of new members to be added to the team."

    example default
        new_members = [default]

struct MembersDataTransferArg extends MembersDeactivateBaseArg
    transfer_dest_id UserSelectorArg
        "Files from the deleted member account will be transferred to this user."
    transfer_admin_id UserSelectorArg
        "Errors during the transfer process will be sent via
        email to this user."

    example default
        user = default
        transfer_dest_id = default
        transfer_admin_id = default

struct MembersDeactivateArg extends MembersDeactivateBaseArg
    wipe_data Boolean = true
        "If provided, controls if the user's data will be deleted on their linked devices."

    example default
        user = default
        wipe_data = false

struct MembersDeactivateBaseArg
    "Exactly one of team_member_id, email, or external_id must be provided to identify the user account."
    user UserSelectorArg
        "Identity of user to remove/suspend/have their files moved."

struct MembersDeleteProfilePhotoArg
    user UserSelectorArg
        "Identity of the user whose profile photo will be deleted."

    example default
        user = default

struct MembersFormerMemberArg
    "Exactly one of team_member_id, email, or external_id must be provided to identify a former team member."
    user UserSelectorArg
        "Identity of user whose files will be permanently deleted."

struct MembersGetAvailableTeamMemberRolesResult
    "Available TeamMemberRole for the connected team. To be used with :route:`members/set_admin_permissions:2`."
    roles List(TeamMemberRole)
        "Available roles."

    example default
        roles = [team_member_role_super, team_member_role_billing, team_member_role_user_management, team_member_role_support]

struct MembersGetInfoArgs
    members List(UserSelectorArg)
        "List of team members."

    example default
        members = [default]

struct MembersGetInfoV2Arg
    members List(UserSelectorArg)
        "List of team members."

    example default
        members = [default]

struct MembersGetInfoV2Result
    members_info List(MembersGetInfoItemV2)
        "List of team members info."

    example default
        members_info = [default]

struct MembersListArg
    limit UInt32(max_value=1000, min_value=1) = 1000
        "Number of results to return per call."
    include_removed Boolean = false
        "Whether to return removed members."

    example default
        limit = 100
        include_removed = false

struct MembersListContinueArg
    cursor String
        "Indicates from what point to get the next set of members."

    example default
        cursor = "ZtkX9_EHj3x7PMkVuFIhwKYXEpwpLwyxp9vMKomUhllil9q7eWiAu"

struct MembersListResult
    members List(TeamMemberInfo)
        "List of team members."
    cursor String
        "Pass the cursor into :route:`members/list/continue` to obtain the additional members."
    has_more Boolean
        "Is true if there are additional team members that have not been returned
        yet. An additional call to :route:`members/list/continue` can retrieve them."

    example default
        members = [default]
        cursor = "ZtkX9_EHj3x7PMkVuFIhwKYXEpwpLwyxp9vMKomUhllil9q7eWiAu"
        has_more = true

struct MembersListV2Result
    members List(TeamMemberInfoV2)
        "List of team members."
    cursor String
        "Pass the cursor into :route:`members/list/continue:2` to obtain the additional members."
    has_more Boolean
        "Is true if there are additional team members that have not been returned
        yet. An additional call to :route:`members/list/continue:2` can retrieve them."

    example default
        members = [default]
        cursor = "ZtkX9_EHj3x7PMkVuFIhwKYXEpwpLwyxp9vMKomUhllil9q7eWiAu"
        has_more = true

struct MembersRecoverArg
    "Exactly one of team_member_id, email, or external_id must be provided to identify the user account."
    user UserSelectorArg
        "Identity of user to recover."

    example default
        user = default

struct MembersRemoveArg extends MembersDeactivateArg
    transfer_dest_id UserSelectorArg?
        "If provided, files from the deleted member account will be
        transferred to this user."
    transfer_admin_id UserSelectorArg?
        "If provided, errors during the transfer process will be sent via
        email to this user. If the transfer_dest_id argument was provided,
        then this argument must be provided as well."
    keep_account Boolean = false
        "Downgrade the member to a Basic account. The user will retain the email address associated with their Dropbox
        account and data in their account that is not restricted to team members. In order to keep the account the argument :field:`wipe_data` should be set to :val:`false`."
    retain_team_shares Boolean = false
        "If provided, allows removed users to keep access to Dropbox folders (not Dropbox Paper folders) already explicitly shared with them (not via a group) when they are downgraded to a Basic account.
        Users will not retain access to folders that do not allow external sharing. In order to keep the sharing relationships,
        the arguments :field:`wipe_data` should be set to :val:`false` and :field:`keep_account` should be set to :val:`true`."
    permanently_delete_files Boolean = false
        "Permanently delete the data in the deleted member's account. After permanent
        deletion, the data is no longer available to be transferred to a different user."

    example default
        user = default
        wipe_data = true
        transfer_dest_id = default
        transfer_admin_id = default
        keep_account = false
        retain_team_shares = false
        permanently_delete_files = false

struct MembersSetPermissions2Arg
    "Exactly one of team_member_id, email, or external_id must be provided to identify the user account."
    user UserSelectorArg
        "Identity of user whose role will be set."
    new_roles List(TeamMemberRoleId, max_items=1)?
        "The new roles for the member. Send empty list to make user member only. For now, only up to one role is allowed."

    example default
        user = default
        new_roles = ["pid_dbtmr:1234"]

struct MembersSetPermissions2Result
    team_member_id team_common.TeamMemberId
        "The member ID of the user to which the change was applied."
    roles List(TeamMemberRole)?
        "The roles after the change. Empty in case the user become a non-admin."

    example default
        team_member_id = "dbmid:9978889"
        roles = [team_member_role_user_management]

struct MembersSetPermissionsArg
    "Exactly one of team_member_id, email, or external_id must be provided to identify the user account."
    user UserSelectorArg
        "Identity of user whose role will be set."
    new_role AdminTier
        "The new role of the member."

    example default
        user = default
        new_role = default

struct MembersSetPermissionsResult
    team_member_id team_common.TeamMemberId
        "The member ID of the user to which the change was applied."
    role AdminTier
        "The role after the change."

    example default
        team_member_id = "dbmid:9978889"
        role = default

struct MembersSetProfileArg
    "Exactly one of team_member_id, email, or external_id must be provided to identify the user account.
    At least one of new_email, new_external_id, new_given_name, and/or new_surname must be provided."
    user UserSelectorArg
        "Identity of user whose profile will be set."
    new_email common.EmailAddress?
        "New email for member."
    new_external_id team_common.MemberExternalId?
        "New external ID for member."
    new_given_name common.OptionalNamePart?
        "New given name for member."
    new_surname common.OptionalNamePart?
        "New surname for member."
    new_persistent_id String?
        "New persistent ID. This field only available to teams using persistent ID SAML configuration."
    new_is_directory_restricted Boolean?
        "New value for whether the user is a directory restricted user."

    example default
        user = default
        new_email = "t.smith@domain.com"
        new_surname = "Smith"

struct MembersSetProfilePhotoArg
    user UserSelectorArg
        "Identity of the user whose profile photo will be set."
    photo account.PhotoSourceArg
        "Image to set as the member's new profile photo."

    example default
        user = default
        photo = default

struct MembersUnsuspendArg
    "Exactly one of team_member_id, email, or external_id must be provided to identify the user account."
    user UserSelectorArg
        "Identity of user to unsuspend."

    example default
        user = default

struct TeamMemberInfo
    "Information about a team member."
    profile TeamMemberProfile
        "Profile of a user as a member of a team."
    role AdminTier
        "The user's role in the team."

    example default
        profile = default
        role = member_only

struct TeamMemberInfoV2
    "Information about a team member."
    profile TeamMemberProfile
        "Profile of a user as a member of a team."
    roles List(TeamMemberRole)?
        "The user's roles in the team."

    example default
        profile = default
        roles = [team_member_role_user_management]

struct TeamMemberInfoV2Result
    "Information about a team member, after the change, like at :route:`members/set_profile:2`."
    member_info TeamMemberInfoV2
        "Member info, after the change."

    example default
        member_info = default

struct TeamMemberRole
    "A role which can be attached to a team member. This replaces AdminTier; each AdminTier corresponds to a new TeamMemberRole with a matching name."
    role_id TeamMemberRoleId
        "A string containing encoded role ID. For roles defined by Dropbox, this is the same across all teams."
    name String(max_length=32)
        "The role display name."
    description String(max_length=256)
        "Role description. Describes which permissions come with this role."

    example team_member_role_super
        role_id = "pid_dbtmr:2345"
        name = "Team admin"
        description = "User can do most user provisioning, de-provisioning and management."

    example team_member_role_user_management
        role_id = "pid_dbtmr:3456"
        name = "User management admin"
        description = "Add, remove, and manage member accounts."

    example team_member_role_support
        role_id = "pid_dbtmr:4567"
        name = "Support admin"
        description = "Help members with limited tasks, including password reset."

    example team_member_role_billing
        role_id = "pid_dbtmr:5678"
        name = "Billing admin"
        description = "Make payments and renew contracts."


union Feature
    "A set of features that a Dropbox Business account may support."
    upload_api_rate_limit
        "The number of upload API calls allowed per month."
    has_team_shared_dropbox
        "Does this team have a shared team root."
    has_team_file_events
        "Does this team have file events."
    has_team_selective_sync
        "Does this team have team selective sync enabled."
    has_distinct_member_homes
        "Does this team have team member folder."

union FeatureValue
    "The values correspond to entries in :type:`Feature`. You may get different value according
    to your Dropbox Business plan."
    upload_api_rate_limit UploadApiRateLimitValue
    has_team_shared_dropbox HasTeamSharedDropboxValue
    has_team_file_events HasTeamFileEventsValue
    has_team_selective_sync HasTeamSelectiveSyncValue
    has_distinct_member_homes HasDistinctMemberHomesValue

    example uploadRateLimited
        upload_api_rate_limit = limited

    example hasTeamSharedDropbox
        has_team_shared_dropbox = default

    example hasTeamFileEvents
        has_team_file_events = ex_no_file_events

    example HasTeamSelectiveSync
        has_team_selective_sync = default

    example hasDistinctMemberHomes
        has_distinct_member_homes = default

union FeaturesGetValuesBatchError
    empty_features_list
        "At least one :type:`Feature` must be included in the
        :type:`FeaturesGetValuesBatchArg`.features list."

union HasDistinctMemberHomesValue
    "The value for :field:`Feature.has_distinct_member_homes`."
    has_distinct_member_homes Boolean = false
        "Does this team have distinct team member homes."

    example default
        has_distinct_member_homes = true

union HasTeamFileEventsValue
    "The value for :field:`Feature.has_team_file_events`."
    enabled Boolean = false
        "Does this team have file events."

    example ex_no_file_events
        enabled = false

union HasTeamSelectiveSyncValue
    "The value for :field:`Feature.has_team_selective_sync`."
    has_team_selective_sync Boolean = false
        "Does this team have team selective sync enabled."

    example default
        has_team_selective_sync = true

union HasTeamSharedDropboxValue
    "The value for :field:`Feature.has_team_shared_dropbox`."
    has_team_shared_dropbox Boolean = false
        "Does this team have a shared team root."

    example default
        has_team_shared_dropbox = false

union TokenGetAuthenticatedAdminError
    "Error returned by :route:`token/get_authenticated_admin`."
    mapping_not_found
        "The current token is not associated with a team admin, because mappings were not
        recorded when the token was created. Consider re-authorizing a new access token
        to record its authenticating admin."
    admin_not_active
        "Either the team admin that authorized this token is no longer an active member of the
        team or no longer a team admin."

union UploadApiRateLimitValue
    "The value for :field:`Feature.upload_api_rate_limit`."
    unlimited
        "This team has unlimited upload API quota. So far both server version account and legacy
        account type have unlimited monthly upload api quota."
    limit UInt32 = 0
        "The number of upload API calls allowed per month."

    example limited
        limit = 25000

union_closed UserSelectorArg
    "Argument for selecting a single user, either by team_member_id, external_id or email."
    team_member_id team_common.TeamMemberId
    external_id team_common.MemberExternalId
    email common.EmailAddress

    example default
        team_member_id = "dbmid:efgh5678"

    example email
        email = "dan@hotmail.com"

union_closed UserSelectorError
    "Error that can be returned whenever a struct derived from :type:`UserSelectorArg` is used."
    user_not_found
        "No matching user found. The provided team_member_id, email, or external_id does not exist on this team."

union_closed UsersSelectorArg
    "Argument for selecting a list of users, either by team_member_ids, external_ids or emails."
    team_member_ids List(team_common.TeamMemberId)
        "List of member IDs."
    external_ids List(team_common.MemberExternalId)
        "List of external user IDs."
    emails List(common.EmailAddress)
        "List of email addresses."

struct FeaturesGetValuesBatchArg
    features List(Feature)
        "A list of features in :type:`Feature`. If the list is empty,
        this route will return :type:`FeaturesGetValuesBatchError`."

    example listOfValues
        features = [upload_api_rate_limit, has_team_shared_dropbox]

struct FeaturesGetValuesBatchResult
    values List(FeatureValue)

    example listOfResults
        values = [uploadRateLimited, hasTeamSharedDropbox]

struct TeamGetInfoResult
    name String
        "The name of the team."
    team_id String
        "The ID of the team."
    num_licensed_users UInt32
        "The number of licenses available to the team."
    num_provisioned_users UInt32
        "The number of accounts that have been invited or are already active members of the team."
    num_used_licenses UInt32 = 0
        "The number of licenses used on the team."
    policies team_policies.TeamMemberPolicies

    example default
        name = "Dropbox Inc."
        team_id = "dbtid:1234abcd"
        num_licensed_users = 5
        num_provisioned_users = 2
        num_used_licenses = 1
        policies = default

struct TokenGetAuthenticatedAdminResult
    "Results for :route:`token/get_authenticated_admin`."
    admin_profile TeamMemberProfile
        "The admin who authorized the token."

    example default
        admin_profile = default


route features/get_values (FeaturesGetValuesBatchArg, FeaturesGetValuesBatchResult, FeaturesGetValuesBatchError)
    "Get the values for one or more features. This route allows you to check your account's
    capability for what feature you can access or what value you have for certain features.
    Permission : Team information."

    attrs
        auth = "team"
        scope = "team_info.read"


route get_info (Void, TeamGetInfoResult, Void)
    "Retrieves information about a team."

    attrs
        auth = "team"
        scope = "team_info.read"


route token/get_authenticated_admin (Void, TokenGetAuthenticatedAdminResult, TokenGetAuthenticatedAdminError)
    "Returns the member profile of the admin who generated the team access token used to make the call."

    attrs
        auth = "team"
        scope = "team_info.read"


route properties/template/add (file_properties.AddTemplateArg, file_properties.AddTemplateResult, file_properties.ModifyTemplateError) deprecated
    "Permission : Team member file access."

    attrs
        auth = "team"
        scope = "files.team_metadata.write"

route properties/template/get (file_properties.GetTemplateArg, file_properties.GetTemplateResult, file_properties.TemplateError) deprecated
    "Permission : Team member file access. The scope for the route is files.team_metadata.write."

    attrs
        auth = "team"
        scope = "files.team_metadata.write"


alias GroupsGetInfoResult = List(GroupsGetInfoItem)

union_closed GroupAccessType
    "Role of a user in group."
    member
        "User is a member of the group, but has no special permissions."
    owner
        "User can rename the group, and add/remove members."

    example default
        member = null

union_closed GroupSelector
    "Argument for selecting a single group, either by group_id or by external group ID."
    group_id team_common.GroupId
        "Group ID."
    group_external_id team_common.GroupExternalId
        "External ID of the group."

    example default
        group_id = "g:e2db7665347abcd600000000001a2b3c"

union GroupSelectorError
    "Error that can be raised when :type:`GroupSelector` is used."
    group_not_found
        "No matching group found. No groups match the specified group ID."

union GroupSelectorWithTeamGroupError extends GroupSelectorError
    "Error that can be raised when :type:`GroupSelector` is used and team groups are disallowed from
    being used."
    system_managed_group_disallowed
        "This operation is not supported on system-managed groups."

union_closed GroupsSelector
    "Argument for selecting a list of groups, either by group_ids, or external group IDs."
    group_ids List(team_common.GroupId)
        "List of group IDs."
    group_external_ids List(String)
        "List of external IDs of groups."

    example default
        group_ids = ["g:e2db7665347abcd600000000001a2b3c", "g:111111147abcd6000000000222222c"]

union GroupMemberSelectorError extends GroupSelectorWithTeamGroupError
    "Error that can be raised when :type:`GroupMemberSelector` is used, and the user
    is required to be a member of the specified group."
    member_not_in_group
        "The specified user is not a member of this group."

union GroupMembersSelectorError extends GroupSelectorWithTeamGroupError
    "Error that can be raised when :type:`GroupMembersSelector` is used, and the users
    are required to be members of the specified group."
    member_not_in_group
        "At least one of the specified users is not a member of the group."

union GroupsListContinueError
    invalid_cursor
        "The cursor is invalid."

union_closed GroupsGetInfoItem
    id_not_found String = ""
        "An ID that was provided as a parameter to :route:`groups/get_info`, and
        did not match a corresponding group. The ID can be a group ID, or an external ID,
        depending on how the method was called."
    group_info GroupFullInfo
        "Info about a group."

    example default
        group_info = default

union GroupsGetInfoError
    group_not_on_team
        "The group is not on your team."

union GroupCreateError
    group_name_already_used
        "The requested group name is already being used by another group."
    group_name_invalid
        "Group name is empty or has invalid characters."
    external_id_already_in_use
        "The requested external ID is already being used by another group."
    system_managed_group_disallowed
        "System-managed group cannot be manually created."

union GroupDeleteError extends GroupSelectorWithTeamGroupError
    group_already_deleted
        "This group has already been deleted."

union GroupUpdateError extends GroupSelectorWithTeamGroupError
    group_name_already_used
        "The requested group name is already being used by another group."
    group_name_invalid
        "Group name is empty or has invalid characters."
    external_id_already_in_use
        "The requested external ID is already being used by another group."

union GroupMembersAddError extends GroupSelectorWithTeamGroupError
    duplicate_user
        "You cannot add duplicate users. One or more of the members
        you are trying to add is already a member of the group."
    group_not_in_team
        "Group is not in this team. You cannot add members to a
        group that is outside of your team."
    members_not_in_team List(String)
        "These members are not part of your team. Currently, you cannot add members
        to a group if they are not part of your team, though this
        may change in a subsequent version. To add new members to your Dropbox
        Business team, use the :route:`members/add` endpoint."
    users_not_found List(String)
        "These users were not found in Dropbox."
    user_must_be_active_to_be_owner
        "A suspended user cannot be added to a group as :field:`GroupAccessType.owner`."
    user_cannot_be_manager_of_company_managed_group List(String)
        "A company-managed group cannot be managed by a user."

union GroupMembersRemoveError extends GroupMembersSelectorError
    group_not_in_team
        "Group is not in this team. You cannot remove members from a group
        that is outside of your team."
    members_not_in_team List(String)
        "These members are not part of your team."
    users_not_found List(String)
        "These users were not found in Dropbox."

union GroupMemberSetAccessTypeError extends GroupMemberSelectorError
    user_cannot_be_manager_of_company_managed_group
        "A company managed group cannot be managed by a user."

union GroupsMembersListContinueError
    invalid_cursor
        "The cursor is invalid."

union GroupsPollError extends async.PollError
    access_denied
        "You are not allowed to poll this job."

struct GroupMemberSelector
    "Argument for selecting a group and a single user."
    group GroupSelector
        "Specify a group."
    user UserSelectorArg
        "Identity of a user that is a member of :field:`group`."

    example default
        group = default
        user = default

struct GroupMembersSelector
    "Argument for selecting a group and a list of users."
    group GroupSelector
        "Specify a group."
    users UsersSelectorArg
        "A list of users that are members of :field:`group`."

struct IncludeMembersArg
    return_members Boolean = true
        "Whether to return the list of members in the group.
        Note that the default value will cause all the group members
        to be returned in the response. This may take a long time for large groups."

struct GroupMemberInfo
    "Profile of group member, and role in group."
    profile MemberProfile
        "Profile of group member."
    access_type GroupAccessType
        "The role that the user has in the group."

    example default
        profile = default
        access_type = default

struct GroupFullInfo extends team_common.GroupSummary
    "Full description of a group."
    members List(GroupMemberInfo)?
        "List of group members."
    created UInt64
        "The group creation time as a UTC timestamp in milliseconds since the Unix epoch."

    example default
        group_name = "project launch"
        group_id = "g:e2db7665347abcd600000000001a2b3c"
        member_count = 5
        group_management_type = user_managed
        members = [default]
        created = 1447255518000

struct GroupsListArg
    limit UInt32(max_value=1000, min_value=1) = 1000
        "Number of results to return per call."

    example default
        limit = 100

struct GroupsListResult
    groups List(team_common.GroupSummary)
    cursor String
        "Pass the cursor into :route:`groups/list/continue` to obtain the additional groups."
    has_more Boolean
        "Is true if there are additional groups that have not been returned
        yet. An additional call to :route:`groups/list/continue` can retrieve them."

    example default
        groups = [default]
        cursor = "ZtkX9_EHj3x7PMkVuFIhwKYXEpwpLwyxp9vMKomUhllil9q7eWiAu"
        has_more = false

struct GroupsListContinueArg
    cursor String
        "Indicates from what point to get the next set of groups."

    example default
        cursor = "ZtkX9_EHj3x7PMkVuFIhwKYXEpwpLwyxp9vMKomUhllil9q7eWiAu"

struct GroupCreateArg
    group_name String
        "Group name."
    add_creator_as_owner Boolean = false
        "Automatically add the creator of the group."
    group_external_id team_common.GroupExternalId?
        "The creator of a team can associate an arbitrary external ID to the group."
    group_management_type team_common.GroupManagementType?
        "Whether the team can be managed by selected users, or only by team admins."

    example default
        group_name = "Europe sales"
        group_external_id = "group-134"

struct GroupUpdateArgs extends IncludeMembersArg
    group GroupSelector
        "Specify a group."
    new_group_name String?
        "Optional argument. Set group name to this if provided."
    new_group_external_id team_common.GroupExternalId?
        "Optional argument. New group external ID.
        If the argument is None, the group's external_id won't be updated.
        If the argument is empty string, the group's external id will be cleared."
    new_group_management_type team_common.GroupManagementType?
        "Set new group management type, if provided."

    example default
        group = default
        new_group_name = "Europe west sales"
        new_group_external_id = "sales-234"
        new_group_management_type = company_managed

struct GroupMembersChangeResult
    "Result returned by :route:`groups/members/add` and :route:`groups/members/remove`."
    group_info GroupFullInfo
        "The group info after member change operation has been performed."
    async_job_id async.AsyncJobId
        @common.Deprecated
        "For legacy purposes async_job_id will always return one space ' '. Formerly, it was an ID that was used to obtain the status of granting/revoking group-owned resources. It's no longer necessary because the async processing now happens automatically."

    example default
        group_info = default
        async_job_id = "99988877733388"

struct MemberAccess
    "Specify access type a member should have when joined to a group."
    user UserSelectorArg
        "Identity of a user."
    access_type GroupAccessType
        "Access type."

    example default
        user = default
        access_type = default

struct GroupMembersAddArg extends IncludeMembersArg
    group GroupSelector
        "Group to which users will be added."
    members List(MemberAccess)
        "List of users to be added to the group."

    example default
        group = default
        members = [default]

struct GroupMembersRemoveArg extends IncludeMembersArg
    group GroupSelector
        "Group from which users will be removed."
    users List(UserSelectorArg)
        "List of users to be removed from the group."

    example default
        group = default
        users = [default]

struct GroupMembersSetAccessTypeArg extends GroupMemberSelector
    access_type GroupAccessType
        "New group access type the user will have."
    return_members Boolean = true
        "Whether to return the list of members in the group.
        Note that the default value will cause all the group members
        to be returned in the response. This may take a long time for large groups."

    example default
        group = default
        user = default
        access_type = default

struct GroupsMembersListArg
    group GroupSelector
        "The group whose members are to be listed."
    limit UInt32(max_value=1000, min_value=1) = 1000
        "Number of results to return per call."

    example default
        group = default
        limit = 100

struct GroupsMembersListResult
    members List(GroupMemberInfo)
    cursor String
        "Pass the cursor into :route:`groups/members/list/continue` to obtain additional group members."
    has_more Boolean
        "Is true if there are additional group members that have not been returned
        yet. An additional call to :route:`groups/members/list/continue` can retrieve them."

    example default
        members = []
        cursor = "ZtkX9_EHj3x7PMkVuFIhwKYXEpwpLwyxp9vMKomUhllil9q7eWiAu"
        has_more = false

struct GroupsMembersListContinueArg
    cursor String
        "Indicates from what point to get the next set of groups."

    example default
        cursor = "ZtkX9_EHj3x7PMkVuFIhwKYXEpwpLwyxp9vMKomUhllil9q7eWiAu"

route groups/list (GroupsListArg, GroupsListResult, Void)
    "Lists groups on a team.
    Permission : Team Information."

    attrs
        auth = "team"
        scope = "groups.read"

route groups/list/continue (GroupsListContinueArg, GroupsListResult, GroupsListContinueError)
    "Once a cursor has been retrieved from :route:`groups/list`, use this to paginate
    through all groups.
    Permission : Team Information."

    attrs
        auth = "team"
        scope = "groups.read"

route groups/get_info (GroupsSelector, GroupsGetInfoResult, GroupsGetInfoError)
    "Retrieves information about one or more groups. Note that the optional field
    :field:`GroupFullInfo.members` is not returned for system-managed groups.
    Permission : Team Information."

    attrs
        auth = "team"
        scope = "groups.read"

route groups/create (GroupCreateArg, GroupFullInfo, GroupCreateError)
    "Creates a new, empty group, with a requested name.
    Permission : Team member management."

    attrs
        auth = "team"
        scope = "groups.write"

route groups/delete (GroupSelector, async.LaunchEmptyResult, GroupDeleteError)
    "Deletes a group.
    The group is deleted immediately. However the revoking of group-owned resources
    may take additional time.
    Use the :route:`groups/job_status/get` to determine whether this process has completed.
    Permission : Team member management."

    attrs
        auth = "team"
        scope = "groups.write"

route groups/update (GroupUpdateArgs, GroupFullInfo, GroupUpdateError)
    "Updates a group's name and/or external ID.
    Permission : Team member management."

    attrs
        auth = "team"
        scope = "groups.write"

route groups/members/add (GroupMembersAddArg, GroupMembersChangeResult, GroupMembersAddError)
    "Adds members to a group.
    The members are added immediately. However the granting of group-owned resources
    may take additional time.
    Use the :route:`groups/job_status/get` to determine whether this process has completed.
    Permission : Team member management."

    attrs
        auth = "team"
        scope = "groups.write"

route groups/members/remove (GroupMembersRemoveArg, GroupMembersChangeResult, GroupMembersRemoveError)
    "Removes members from a group.
    The members are removed immediately. However the revoking of group-owned resources
    may take additional time.
    Use the :route:`groups/job_status/get` to determine whether this process has completed.
    This method permits removing the only owner of a group, even in cases where this is not
    possible via the web client.
    Permission : Team member management."

    attrs
        auth = "team"
        scope = "groups.write"

route groups/members/set_access_type (GroupMembersSetAccessTypeArg, GroupsGetInfoResult, GroupMemberSetAccessTypeError)
    "Sets a member's access type in a group.
    Permission : Team member management."

    attrs
        auth = "team"
        scope = "groups.write"

route groups/members/list (GroupsMembersListArg, GroupsMembersListResult, GroupSelectorError)
    "Lists members of a group.
    Permission : Team Information."

    attrs
        auth = "team"
        scope = "groups.read"

route groups/members/list/continue (GroupsMembersListContinueArg, GroupsMembersListResult, GroupsMembersListContinueError)
    "Once a cursor has been retrieved from :route:`groups/members/list`, use this to paginate
    through all members of the group.
    Permission : Team information."

    attrs
        auth = "team"
        scope = "groups.read"

route groups/job_status/get (async.PollArg, async.PollEmptyResult, GroupsPollError)
    "Once an async_job_id is returned from :route:`groups/delete`,
    :route:`groups/members/add` , or :route:`groups/members/remove`
    use this method to poll the status of granting/revoking
    group members' access to group-owned resources.
    Permission : Team member management."

    attrs
        auth = "team"
        scope = "groups.write"


union ListMemberAppsError
    "Error returned by :route:`linked_apps/list_member_linked_apps`."
    member_not_found
        "Member not found."

union ListMembersAppsError
    "Error returned by :route:`linked_apps/list_members_linked_apps`."
    reset
        "Indicates that the cursor has been invalidated. Call
        :route:`linked_apps/list_members_linked_apps` again with an empty cursor to obtain a new cursor."

union RevokeLinkedAppError
    "Error returned by :route:`linked_apps/revoke_linked_app`."
    app_not_found
        "Application not found."
    member_not_found
        "Member not found."
    app_folder_removal_not_supported
        "App folder removal is not supported."

union RevokeLinkedAppBatchError
    "Error returned by :route:`linked_apps/revoke_linked_app_batch`."

union ListTeamAppsError
    "Error returned by :route:`linked_apps/list_team_linked_apps`."
    reset
        "Indicates that the cursor has been invalidated. Call
        :route:`linked_apps/list_team_linked_apps` again with an empty cursor to obtain a new cursor."

struct ListMemberAppsArg
    team_member_id String
        "The team member id."

    example default
        team_member_id = "dbmid:AAFdgehTzw7WlXhZJsbGCLePe8RvQGYDr-I"

struct ApiApp
    "Information on linked third party applications."
    app_id String
        "The application unique id."
    app_name String
        "The application name."
    publisher String?
        "The application publisher name."
    publisher_url String?
        "The publisher's URL."
    linked common.DropboxTimestamp?
        "The time this application was linked."
    is_app_folder Boolean
        "Whether the linked application uses a dedicated folder."

    example default
        app_id = "dbaid:AAFdgehTzw7WlXhZJsbGCLePe8RvQGYDr-I"
        app_name = "Notes"
        publisher = "Notes company"
        publisher_url = "http://company.com"
        linked = "2015-05-12T15:50:38Z"
        is_app_folder = true

struct ListMemberAppsResult
    linked_api_apps List(ApiApp)
        "List of third party applications linked by this team member."

    example default
        linked_api_apps = [default]

struct ListMembersAppsArg
    "Arguments for :route:`linked_apps/list_members_linked_apps`."
    cursor String?
        "At the first call to the :route:`linked_apps/list_members_linked_apps` the cursor shouldn't be
        passed. Then, if the result of the call includes a cursor, the following requests should
        include the received cursors in order to receive the next sub list of the team applications."

    example default
        cursor = "AADAQO8ZWKvBkSMXb1J9dAYVvwZ0wcvfyzIBo2e1H-_N-67pfrYKTb4oN_3LG9_ilWjblZXuiR8ubjjiQQkHq-MvDjbe_6bkcJgjnTpowrRaQA"

struct MemberLinkedApps
    "Information on linked applications of a team member."
    team_member_id String
        "The member unique Id."
    linked_api_apps List(ApiApp)
        "List of third party applications linked by this team member."

    example default
        team_member_id = "dbmid:AAFdgehTzw7WlXhZJsbGCLePe8RvQGYDr-I"
        linked_api_apps = [default]

struct ListMembersAppsResult
    "Information returned by :route:`linked_apps/list_members_linked_apps`."
    apps List(MemberLinkedApps)
        "The linked applications of each member of the team."
    has_more Boolean
        "If true, then there are more apps available. Pass the
        cursor to :route:`linked_apps/list_members_linked_apps` to retrieve the rest."
    cursor String?
        "Pass the cursor into :route:`linked_apps/list_members_linked_apps` to receive the next
        sub list of team's applications."

    example default
        apps = [default]
        has_more = true
        cursor = "AADAQO8ZWKvBkSMXb1J9dAYVvwZ0wcvfyzIBo2e1H-_N-67pfrYKTb4oN_3LG9_ilWjblZXuiR8ubjjiQQkHq-MvDjbe_6bkcJgjnTpowrRaQA"

struct RevokeLinkedApiAppArg
    app_id String
        "The application's unique id."
    team_member_id String
        "The unique id of the member owning the device."
    keep_app_folder Boolean = true
        @common.Deprecated
        "This flag is not longer supported, the application dedicated folder (in case the application uses
        one) will be kept."

    example default
        app_id = "dbaid:AAFdgehTzw7WlXhZJsbGCLePe8RvQGYDr-I"
        team_member_id = "dbmid:AAFdgehTzw7WlXhZJsbGCLePe8RvQGYDr-I"

struct RevokeLinkedApiAppBatchArg
    revoke_linked_app List(RevokeLinkedApiAppArg)

    example default
        revoke_linked_app = [default]

struct RevokeLinkedAppStatus
    success Boolean
        "Result of the revoking request."
    error_type RevokeLinkedAppError?
        "The error cause in case of a failure."

    example default
        success = false
        error_type = app_not_found

struct RevokeLinkedAppBatchResult
    revoke_linked_app_status List(RevokeLinkedAppStatus)

    example default
        revoke_linked_app_status = [default]

struct ListTeamAppsArg
    "Arguments for :route:`linked_apps/list_team_linked_apps`."
    cursor String?
        "At the first call to the :route:`linked_apps/list_team_linked_apps` the cursor shouldn't be
        passed. Then, if the result of the call includes a cursor, the following requests should
        include the received cursors in order to receive the next sub list of the team applications."

    example default
        cursor = "AADAQO8ZWKvBkSMXb1J9dAYVvwZ0wcvfyzIBo2e1H-_N-67pfrYKTb4oN_3LG9_ilWjblZXuiR8ubjjiQQkHq-MvDjbe_6bkcJgjnTpowrRaQA"

struct ListTeamAppsResult
    "Information returned by :route:`linked_apps/list_team_linked_apps`."
    apps List(MemberLinkedApps)
        "The linked applications of each member of the team."
    has_more Boolean
        "If true, then there are more apps available. Pass the
        cursor to :route:`linked_apps/list_team_linked_apps` to retrieve the rest."
    cursor String?
        "Pass the cursor into :route:`linked_apps/list_team_linked_apps` to receive the next
        sub list of team's applications."

    example default
        apps = [default]
        has_more = true
        cursor = "AADAQO8ZWKvBkSMXb1J9dAYVvwZ0wcvfyzIBo2e1H-_N-67pfrYKTb4oN_3LG9_ilWjblZXuiR8ubjjiQQkHq-MvDjbe_6bkcJgjnTpowrRaQA"

route linked_apps/list_member_linked_apps (ListMemberAppsArg, ListMemberAppsResult, ListMemberAppsError)
    "List all linked applications of the team member.
    Note, this endpoint does not list any team-linked applications."

    attrs
        auth = "team"
        scope = "sessions.list"

route linked_apps/list_members_linked_apps (ListMembersAppsArg, ListMembersAppsResult, ListMembersAppsError)
    "List all applications linked to the team members' accounts.
    Note, this endpoint does not list any team-linked applications."

    attrs
        auth = "team"
        scope = "sessions.list"

route linked_apps/revoke_linked_app (RevokeLinkedApiAppArg, Void, RevokeLinkedAppError)
    "Revoke a linked application of the team member."

    attrs
        auth = "team"
        scope = "sessions.modify"

route linked_apps/revoke_linked_app_batch (RevokeLinkedApiAppBatchArg, RevokeLinkedAppBatchResult, RevokeLinkedAppBatchError)
    "Revoke a list of linked applications of the team members."

    attrs
        auth = "team"
        scope = "sessions.modify"

route linked_apps/list_team_linked_apps (ListTeamAppsArg, ListTeamAppsResult, ListTeamAppsError) deprecated
    "List all applications linked to the team members' accounts.
    Note, this endpoint doesn't list any team-linked applications."

    attrs
        auth = "team"
        scope = "sessions.list"


alias UserQuota = UInt32(min_value=2)

struct UserCustomQuotaArg
    "User and their required custom quota in GB (1 TB = 1024 GB)."
    user UserSelectorArg
    quota_gb UserQuota

    example default
        user = default
        quota_gb = 30

struct UserCustomQuotaResult
    "User and their custom quota in GB (1 TB = 1024 GB).
    No quota returns if the user has no custom quota set."
    user UserSelectorArg
    quota_gb UserQuota?

struct SetCustomQuotaArg
    users_and_quotas List(UserCustomQuotaArg)
        "List of users and their custom quotas."

    example default
        users_and_quotas = [default]

union CustomQuotaError
    "Error returned when getting member custom quota."
    too_many_users
        "A maximum of 1000 users can be set for a single call."

union SetCustomQuotaError extends CustomQuotaError
    "Error returned when setting member custom quota."
    some_users_are_excluded
        "Some of the users are on the excluded users list and can't have custom quota set."

union CustomQuotaResult
    "User custom quota."
    success UserCustomQuotaResult
        "User's custom quota."
    invalid_user UserSelectorArg
        "Invalid user (not in team)."

struct CustomQuotaUsersArg
    users List(UserSelectorArg)
        "List of users."

    example default
        users = [default]

union RemoveCustomQuotaResult
    "User result for setting member custom quota."
    success UserSelectorArg
        "Successfully removed user."
    invalid_user UserSelectorArg
        "Invalid user (not in team)."

struct ExcludedUsersUpdateArg
    "Argument of excluded users update operation.
    Should include a list of users to add/remove (according to endpoint),
    Maximum size of the list is 1000 users."
    users List(UserSelectorArg)?
        "List of users to be added/removed."

    example default
        users = [default]

union ExcludedUsersUpdateError
    "Excluded users update error."
    users_not_in_team
        "At least one of the users is not part of your team."
    too_many_users
        "A maximum of 1000 users for each of addition/removal can be supplied."

struct ExcludedUsersListArg
    "Excluded users list argument."
    limit UInt32(max_value=1000, min_value=1) = 1000
        "Number of results to return per call."

    example default
        limit = 100

struct ExcludedUsersListContinueArg
    "Excluded users list continue argument."
    cursor String
        "Indicates from what point to get the next set of users."

    example default
        cursor = "ZtkX9_EHj3x7PMkVuFIhwKYXEpwpLwyxp9vMKomUhllil9q7eWiAu"

struct ExcludedUsersListResult
    "Excluded users list result."
    users List(MemberProfile)
    cursor String?
        "Pass the cursor into :route:`member_space_limits/excluded_users/list/continue` to obtain
        additional excluded users."
    has_more Boolean
        "Is true if there are additional excluded users that have not been returned
        yet. An additional call to :route:`member_space_limits/excluded_users/list/continue` can
        retrieve them."

    example default
        users = []
        cursor = "ZtkX9_EHj3x7PMkVuFIhwKYXEpwpLwyxp9vMKomUhllil9q7eWiAu"
        has_more = false

union ExcludedUsersUpdateStatus
    "Excluded users update operation status."
    success
        "Update successful."

struct ExcludedUsersUpdateResult
    "Excluded users update result."
    status ExcludedUsersUpdateStatus
        "Update status."

    example default
        status = success

union ExcludedUsersListError
    "Excluded users list error."
    list_error
        "An error occurred."

union ExcludedUsersListContinueError
    "Excluded users list continue error."
    invalid_cursor
        "The cursor is invalid."

route member_space_limits/set_custom_quota (SetCustomQuotaArg, List(CustomQuotaResult), SetCustomQuotaError)
    "Set users custom quota. Custom quota has to be at least 2GB.
    A maximum of 1000 members can be specified in a single call.
    Note: to apply a custom space limit, a team admin needs to set a member space limit for the team first.
    (the team admin can check the settings here: https://www.dropbox.com/team/admin/settings/space)."

    attrs
        auth = "team"
        scope = "members.read"

route member_space_limits/remove_custom_quota (CustomQuotaUsersArg, List(RemoveCustomQuotaResult), CustomQuotaError)
    "Remove users custom quota.
    A maximum of 1000 members can be specified in a single call.
    Note: to apply a custom space limit, a team admin needs to set a member space limit for the team first.
    (the team admin can check the settings here: https://www.dropbox.com/team/admin/settings/space)."

    attrs
        auth = "team"
        scope = "members.write"

route member_space_limits/get_custom_quota (CustomQuotaUsersArg, List(CustomQuotaResult), CustomQuotaError)
    "Get users custom quota.
    A maximum of 1000 members can be specified in a single call.
    Note: to apply a custom space limit, a team admin needs to set a member space limit for the team first.
    (the team admin can check the settings here: https://www.dropbox.com/team/admin/settings/space)."

    attrs
        auth = "team"
        scope = "members.read"

route member_space_limits/excluded_users/add (ExcludedUsersUpdateArg, ExcludedUsersUpdateResult, ExcludedUsersUpdateError)
    "Add users to member space limits excluded users list."

    attrs
        auth = "team"
        scope = "members.write"

route member_space_limits/excluded_users/remove (ExcludedUsersUpdateArg, ExcludedUsersUpdateResult, ExcludedUsersUpdateError)
    "Remove users from member space limits excluded users list."

    attrs
        auth = "team"
        scope = "members.write"

route member_space_limits/excluded_users/list (ExcludedUsersListArg, ExcludedUsersListResult, ExcludedUsersListError)
    "List member space limits excluded users."

    attrs
        auth = "team"
        scope = "members.read"

route member_space_limits/excluded_users/list/continue (ExcludedUsersListContinueArg, ExcludedUsersListResult, ExcludedUsersListContinueError)
    "Continue listing member space limits excluded users."

    attrs
        auth = "team"
        scope = "members.read"


union AddSecondaryEmailResult
    "Result of trying to add a secondary email to a user.
    'success' is the only value indicating that a secondary email was successfully added to a user.
    The other values explain the type of error that occurred, and include the email for which the error occurred."
    success secondary_emails.SecondaryEmail
        "Describes a secondary email that was successfully added to a user."
    unavailable common.EmailAddress
        "Secondary email is not available to be claimed by the user."
    already_pending common.EmailAddress
        "Secondary email is already a pending email for the user."
    already_owned_by_user common.EmailAddress
        "Secondary email is already a verified email for the user."
    reached_limit common.EmailAddress
        "User already has the maximum number of secondary emails allowed."
    transient_error common.EmailAddress
        @common.Deprecated
        "A transient error occurred. Please try again later."
    too_many_updates common.EmailAddress
        "An error occurred due to conflicting updates. Please try again later."
    unknown_error common.EmailAddress
        "An unknown error occurred."
    rate_limited common.EmailAddress
        "Too many emails are being sent to this email address. Please try again later."

    example default
        success = default

    example unavailable
        unavailable = "alice@example.com"

union UserAddResult
    "Result of trying to add secondary emails to a user.
    'success' is the only value indicating that a user was successfully retrieved for adding secondary emails.
    The other values explain the type of error that occurred, and include the user for which the error occurred."
    success UserSecondaryEmailsResult
        "Describes a user and the results for each attempt to add a secondary email."
    invalid_user UserSelectorArg
        "Specified user is not a valid target for adding secondary emails."
    unverified UserSelectorArg
        "Secondary emails can only be added to verified users."
    placeholder_user UserSelectorArg
        "Secondary emails cannot be added to placeholder users."

    example default
        success = default

    example invalid
        invalid_user = default

union AddSecondaryEmailsError
    "Error returned when adding secondary emails fails."
    secondary_emails_disabled
        "Secondary emails are disabled for the team."
    too_many_emails
        "A maximum of 20 secondary emails can be added in a single call."

union ResendSecondaryEmailResult
    "Result of trying to resend verification email to a secondary email address.
    'success' is the only value indicating that a verification email was successfully sent.
    The other values explain the type of error that occurred, and include the email for which the error occurred."
    success common.EmailAddress
        "A verification email was successfully sent to the secondary email address."
    not_pending common.EmailAddress
        "This secondary email address is not pending for the user."
    rate_limited common.EmailAddress
        "Too many emails are being sent to this email address. Please try again later."

    example default
        success = "alice@example.com"

union UserResendResult
    "Result of trying to resend verification emails to a user.
    'success' is the only value indicating that a user was successfully retrieved for sending verification emails.
    The other values explain the type of error that occurred, and include the user for which the error occurred."
    success UserResendEmailsResult
        "Describes a user and the results for each attempt to resend verification emails."
    invalid_user UserSelectorArg
        "Specified user is not a valid target for resending verification emails."

    example default
        success = default

    example invalid
        invalid_user = default

union DeleteSecondaryEmailResult
    "Result of trying to delete a secondary email address.
    'success' is the only value indicating that a secondary email was successfully deleted.
    The other values explain the type of error that occurred, and include the email for which the error occurred."
    success common.EmailAddress
        "The secondary email was successfully deleted."
    not_found common.EmailAddress
        "The email address was not found for the user."
    cannot_remove_primary common.EmailAddress
        "The email address is the primary email address of the user, and cannot be removed."

    example default
        success = "alice@example.com"

    example not_found
        not_found = "alic@example.com"

union UserDeleteResult
    "Result of trying to delete a user's secondary emails.
    'success' is the only value indicating that a user was successfully retrieved for deleting secondary emails.
    The other values explain the type of error that occurred, and include the user for which the error occurred."
    success UserDeleteEmailsResult
        "Describes a user and the results for each attempt to delete a secondary email."
    invalid_user UserSelectorArg
        "Specified user is not a valid target for deleting secondary emails."

    example default
        success = default

    example invalid_user
        invalid_user = default

struct UserSecondaryEmailsArg
    "User and a list of secondary emails."
    user UserSelectorArg
    secondary_emails List(common.EmailAddress)

    example default
        user = default
        secondary_emails = ["bob2@hotmail.com", "bob@inst.gov"]

struct UserSecondaryEmailsResult
    user UserSelectorArg
    results List(AddSecondaryEmailResult)

    example default
        user = default
        results = [default, unavailable]

struct AddSecondaryEmailsArg
    new_secondary_emails List(UserSecondaryEmailsArg)
        "List of users and secondary emails to add."

    example default
        new_secondary_emails = [default]

struct AddSecondaryEmailsResult
    results List(UserAddResult)
        "List of users and secondary email results."

    example default
        results = [default, invalid]

struct ResendVerificationEmailArg
    emails_to_resend List(UserSecondaryEmailsArg)
        "List of users and secondary emails to resend verification emails to."

    example default
        emails_to_resend = [default]

struct UserResendEmailsResult
    user UserSelectorArg
    results List(ResendSecondaryEmailResult)

    example default
        user = default
        results = [default]

struct ResendVerificationEmailResult
    "List of users and resend results."
    results List(UserResendResult)

    example default
        results = [default]

struct DeleteSecondaryEmailsArg
    emails_to_delete List(UserSecondaryEmailsArg)
        "List of users and their secondary emails to delete."

    example default
        emails_to_delete = [default]

struct UserDeleteEmailsResult
    user UserSelectorArg
    results List(DeleteSecondaryEmailResult)

    example default
        user = default
        results = [default, not_found]

struct DeleteSecondaryEmailsResult
    results List(UserDeleteResult)

    example default
        results = [default]

route members/secondary_emails/add (AddSecondaryEmailsArg, AddSecondaryEmailsResult, AddSecondaryEmailsError)
    "Add secondary emails to users.
    Permission : Team member management.
    Emails that are on verified domains will be verified automatically.
    For each email address not on a verified domain a verification email will be sent."

    attrs
        auth = "team"
        scope = "members.write"

route members/secondary_emails/resend_verification_emails (ResendVerificationEmailArg, ResendVerificationEmailResult, Void)
    "Resend secondary email verification emails.
    Permission : Team member management."

    attrs
        auth = "team"
        scope = "members.write"

route members/secondary_emails/delete (DeleteSecondaryEmailsArg, DeleteSecondaryEmailsResult, Void)
    "Delete secondary emails from users
    Permission : Team member management.
    Users will be notified of deletions of verified secondary emails at both the secondary email and their primary email."

    attrs
        auth = "team"
        scope = "members.write"


union SharingAllowlistAddError
    malformed_entry String = ""
        "One of provided values is not valid."
    no_entries_provided
        "Neither single domain nor email provided."
    too_many_entries_provided
        "Too many entries provided within one call."
    team_limit_reached
        "Team entries limit reached."
    unknown_error
        "Unknown error."
    entries_already_exist String = ""
        "Entries already exists."

union SharingAllowlistListContinueError
    invalid_cursor
        "Provided cursor is not valid."

union SharingAllowlistRemoveError
    malformed_entry String = ""
        "One of provided values is not valid."
    entries_do_not_exist String = ""
        "One or more provided values do not exist."
    no_entries_provided
        "Neither single domain nor email provided."
    too_many_entries_provided
        "Too many entries provided within one call."
    unknown_error
        "Unknown error."

struct SharingAllowlistAddArgs
    "Structure representing Approve List entries. Domain and emails are supported.
    At least one entry of any supported type is required."
    domains List(String)?
        "List of domains represented by valid string representation (RFC-1034/5)."
    emails List(String)?
        "List of emails represented by valid string representation (RFC-5322/822)."

    example default
        domains = ["test-domain.com", "subdomain.some.com"]
        emails = ["adam@test-domain.com", "john@some.com"]

struct SharingAllowlistAddResponse
    "This struct is empty. The comment here is intentionally emitted to avoid indentation issues with Stone."

struct SharingAllowlistListArg
    limit UInt32(max_value=1000, min_value=1) = 1000
        "The number of entries to fetch at one time."

    example default
        limit = 100

struct SharingAllowlistListContinueArg
    cursor String
        "The cursor returned from a previous call to :route:`sharing_allowlist/list` or :route:`sharing_allowlist/list/continue`."

    example default
        cursor = "dGVzdF9jdXJzb3IK"

struct SharingAllowlistListError
    "This struct is empty. The comment here is intentionally emitted to avoid indentation issues with Stone."

struct SharingAllowlistListResponse
    domains List(String)
        "List of domains represented by valid string representation (RFC-1034/5)."
    emails List(String)
        "List of emails represented by valid string representation (RFC-5322/822)."
    cursor String = ""
        "If this is nonempty, there are more entries that can be fetched with :route:`sharing_allowlist/list/continue`."
    has_more Boolean = false
        "if true indicates that more entries can be fetched with :route:`sharing_allowlist/list/continue`."

    example default
        domains = ["test-domain.com", "subdomain.some.com"]
        emails = ["adam@test-domain.com", "john@some.com"]
        cursor = "dGVzdF9jdXJzb3IK"
        has_more = true

struct SharingAllowlistRemoveArgs
    domains List(String)?
        "List of domains represented by valid string representation (RFC-1034/5)."
    emails List(String)?
        "List of emails represented by valid string representation (RFC-5322/822)."

    example default
        domains = ["test-domain.com", "subdomain.some.com"]
        emails = ["adam@test-domain.com", "john@some.com"]

struct SharingAllowlistRemoveResponse
    "This struct is empty. The comment here is intentionally emitted to avoid indentation issues with Stone."

route sharing_allowlist/add (SharingAllowlistAddArgs, SharingAllowlistAddResponse, SharingAllowlistAddError)
    "Endpoint adds Approve List entries. Changes are effective immediately.
    Changes are committed in transaction. In case of single validation error - all entries are rejected.
    Valid domains (RFC-1034/5) and emails (RFC-5322/822) are accepted.
    Added entries cannot overflow limit of 10000 entries per team.
    Maximum 100 entries per call is allowed."

    attrs
        auth = "team"
        is_preview = true
        scope = "team_info.write"

route sharing_allowlist/list (SharingAllowlistListArg, SharingAllowlistListResponse, SharingAllowlistListError)
    "Lists Approve List entries for given team, from newest to oldest, returning
    up to `limit` entries at a time. If there are more than `limit` entries
    associated with the current team, more can be fetched by passing the
    returned `cursor` to :route:`sharing_allowlist/list/continue`."

    attrs
        auth = "team"
        is_preview = true
        scope = "team_info.read"

route sharing_allowlist/list/continue (SharingAllowlistListContinueArg, SharingAllowlistListResponse, SharingAllowlistListContinueError)
    "Lists entries associated with given team, starting from a the cursor. See :route:`sharing_allowlist/list`."

    attrs
        auth = "team"
        is_preview = true
        scope = "team_info.read"

route sharing_allowlist/remove (SharingAllowlistRemoveArgs, SharingAllowlistRemoveResponse, SharingAllowlistRemoveError)
    "Endpoint removes Approve List entries. Changes are effective immediately.
    Changes are committed in transaction. In case of single validation error - all entries are rejected.
    Valid domains (RFC-1034/5) and emails (RFC-5322/822) are accepted.
    Entries being removed have to be present on the list.
    Maximum 1000 entries per call is allowed."

    attrs
        auth = "team"
        is_preview = true
        scope = "team_info.write"


union BulkSuspendReportDeliveryStatus
    bulk_suspend_report_delivery_status_unspecified
    bulk_suspend_report_delivery_status_pending
    bulk_suspend_report_delivery_status_delivered
    bulk_suspend_report_delivery_status_failed


struct BulkSuspendMemberTarget
    "One member selected for suspension. The opaque client item ID correlates the
    eventual report row with the caller's input without sending CSV data."
    client_item_id String
    suspend_arg MembersDeactivateArg

struct BulkSuspendArg
    "Launches one action-specific bulk suspend job."
    members List(BulkSuspendMemberTarget)
        "Must contain between 1 and 500 targets. The launch handler also rejects
        duplicate client item IDs and duplicate member selectors."

union BulkSuspendError
    "A typed launch rejection. Authorization failures continue to use the API v2
    authentication/permission error surface."
    invalid_request
    too_many_members
    duplicate_client_item_id
    duplicate_team_member_id
    acting_admin
    last_admin

union BulkSuspendRowFailure extends MembersSuspendError
    "Stable machine-readable reasons used by the terminal row report."
    protected_acting_admin
    permission_changed
    suspend_failed

union BulkSuspendRowOutcome
    "The terminal outcome for one requested member. Row outcomes are delivered in
    the report rather than embedded in the status response."
    suspended
    failed BulkSuspendRowFailure
    unknown

struct BulkSuspendComplete
    requested Int64
    suspended Int64
    failed Int64
    unknown Int64
    report_delivery BulkSuspendReportDeliveryStatus

union BulkSuspendTaskFailure
    unusable_result

union BulkSuspendJobStatus extends async.PollResultBase
    "Coarse job state. Live row progress and report contents are intentionally
    omitted; callers receive row details in the terminal email report."
    complete BulkSuspendComplete
    failed BulkSuspendTaskFailure

route members/bulk_suspend (BulkSuspendArg, async.LaunchResultBase, BulkSuspendError)
    "Launch a bulk suspend job. The server enforces a maximum of 500 members."

    attrs
        auth = "team"
        scope = "members.write"

route members/bulk_suspend/job_status/check (async.PollArg, BulkSuspendJobStatus, async.PollError)
    "Poll a previously launched bulk suspend job."

    attrs
        auth = "team"
        scope = "members.write"


union NamespaceType
    app_folder
        "App sandbox folder."
    shared_folder
        "Shared folder."
    team_folder
        "Top-level team-owned folder."
    team_member_folder
        "Team member's home folder."
    team_member_root
        "Team member's root folder."

union TeamNamespacesListContinueError extends TeamNamespacesListError
    invalid_cursor
        "The cursor is invalid."

union TeamNamespacesListError
    invalid_arg
        "Argument passed in is invalid."

struct NamespaceMetadata
    "Properties of a namespace."
    name String
        "The name of this namespace."
    namespace_id common.SharedFolderId
        "The ID of this namespace."
    namespace_type NamespaceType
        "The type of this namespace."
    team_member_id team_common.TeamMemberId?
        "If this is a team member or app folder, the ID of the owning team member.
        Otherwise, this field is not present."
    quota_limit Int64 = 0
        "The quota limit in bytes for this namespace tree. Only applicable to team folders."

    example shared_folder
        name = "Marketing"
        namespace_id = "123456789"
        namespace_type = shared_folder
        quota_limit = 0

    example team_member_folder
        name = "Franz Ferdinand"
        namespace_id = "123456789"
        namespace_type = team_member_folder
        team_member_id = "dbmid:1234567"
        quota_limit = 0

struct TeamNamespacesListResult
    "Result for :route:`namespaces/list`."
    namespaces List(NamespaceMetadata)
        "List of all namespaces the team can access."
    cursor String
        "Pass the cursor into :route:`namespaces/list/continue` to obtain
        additional namespaces. Note that duplicate namespaces may be returned."
    has_more Boolean
        "Is true if there are additional namespaces that have not been returned yet."

    example default
        namespaces = [shared_folder, team_member_folder]
        cursor = "ZtkX9_EHj3x7PMkVuFIhwKYXEpwpLwyxp9vMKomUhllil9q7eWiAu"
        has_more = false

struct TeamNamespacesListArg
    limit UInt32(max_value=1000, min_value=1) = 1000
        @common.Deprecated
        "Specifying a value here has no effect."

    example default
        limit = 1

    example with_filter
        limit = 1

struct TeamNamespacesListContinueArg
    cursor String
        "Indicates from what point to get the next set of team-accessible namespaces."

    example default
        cursor = "ZtkX9_EHj3x7PMkVuFIhwKYXEpwpLwyxp9vMKomUhllil9q7eWiAu"

    example with_filter
        cursor = "ZtkX9_EHj3x7PMkVuFIhwKYXEpwpLwyxp9vMKomUhllil9q7eWiAu"

route namespaces/list (TeamNamespacesListArg, TeamNamespacesListResult, TeamNamespacesListError)
    "Returns a list of all team-accessible namespaces. This list includes team folders,
    shared folders containing team members, team members' home namespaces, and team members'
    app folders. Home namespaces and app folders are always owned by this team or members of the
    team, but shared folders may be owned by other users or other teams. Duplicates may occur in the
    list."

    attrs
        auth = "team"
        scope = "team_data.member"

route namespaces/list/continue (TeamNamespacesListContinueArg, TeamNamespacesListResult, TeamNamespacesListContinueError)
    "Once a cursor has been retrieved from :route:`namespaces/list`, use this to paginate
    through all team-accessible namespaces. Duplicates may occur in the list."

    attrs
        auth = "team"
        scope = "team_data.member"


route reports/get_activity (DateRange, GetActivityReport, DateRangeError) deprecated
    "Retrieves reporting data about a team's user activity.
    Deprecated: Will be removed on July 1st 2021."

    attrs
        auth = "team"
        scope = "team_info.read"


route reports/get_storage (DateRange, GetStorageReport, DateRangeError) deprecated
    "Retrieves reporting data about a team's storage usage.
    Deprecated: Will be removed on July 1st 2021."

    attrs
        auth = "team"
        scope = "team_info.read"


route reports/get_devices (DateRange, GetDevicesReport, DateRangeError) deprecated
    "Retrieves reporting data about a team's linked devices.
    Deprecated: Will be removed on July 1st 2021."

    attrs
        auth = "team"
        scope = "team_info.read"


route reports/get_membership (DateRange, GetMembershipReport, DateRangeError) deprecated
    "Retrieves reporting data about a team's membership.
    Deprecated: Will be removed on July 1st 2021."

    attrs
        auth = "team"
        scope = "team_info.read"


alias NumberPerDay = List(UInt64?)

union TeamReportFailureReason
    temporary_error
        "We couldn't create the report, but we think this was a fluke. Everything should work if you try it again."
    many_reports_at_once
        "Too many other reports are being created right now. Try creating this report again once the others finish."
    too_much_data
        "We couldn't create the report. Try creating the report again with less data."

    example default
        many_reports_at_once = null

union DateRangeError
    "Errors that can originate from problems in input arguments to reports."

struct DateRange
    "Input arguments that can be provided for most reports."
    start_date common.Date?
        "Optional starting date (inclusive). If start_date is None or too long ago, this field will
        be set to 6 months ago."
    end_date common.Date?
        "Optional ending date (exclusive)."

struct StorageBucket
    "Describes the number of users in a specific storage bucket."
    bucket String
        "The name of the storage bucket.
        For example, '1G' is a bucket of users with storage size up to 1 Giga."
    users UInt64
        "The number of people whose storage is in the range of this storage bucket."

    example default
        bucket = "1G"
        users = 21

struct BaseDfbReport
    "Base report structure."
    start_date String
        "First date present in the results as 'YYYY-MM-DD' or None."

struct GetStorageReport extends BaseDfbReport
    "Storage Report Result.
    Each of the items in the storage report is an array of values, one value per day.
    If there is no data for a day, then the value will be None."
    total_usage NumberPerDay
        "Sum of the shared, unshared, and datastore usages, for each day."
    shared_usage NumberPerDay
        "Array of the combined size (bytes) of team members' shared folders, for each day."
    unshared_usage NumberPerDay
        "Array of the combined size (bytes) of team members' root namespaces, for each day."
    shared_folders NumberPerDay
        "Array of the number of shared folders owned by team members, for each day."
    member_storage_map List(List(StorageBucket))
        "Array of storage summaries of team members' account sizes.
        Each storage summary is an array of key, value pairs, where each pair describes
        a storage bucket.
        The key indicates the upper bound of the bucket and the value is the
        number of users in that bucket. There is one such summary per day.
        If there is no data for a day, the storage summary will be empty."

struct GetActivityReport extends BaseDfbReport
    "Activity Report Result.
    Each of the items in the storage report is an array of values, one value per day.
    If there is no data for a day, then the value will be None."
    adds NumberPerDay
        "Array of total number of adds by team members."
    edits NumberPerDay
        "Array of number of edits by team members.
        If the same user edits the same file multiple times this is counted as a single edit."
    deletes NumberPerDay
        "Array of total number of deletes by team members."
    active_users_28_day NumberPerDay
        "Array of the number of users who have been active in the last 28 days."
    active_users_7_day NumberPerDay
        "Array of the number of users who have been active in the last week."
    active_users_1_day NumberPerDay
        "Array of the number of users who have been active in the last day."
    active_shared_folders_28_day NumberPerDay
        "Array of the number of shared folders with some activity in the last 28 days."
    active_shared_folders_7_day NumberPerDay
        "Array of the number of shared folders with some activity in the last week."
    active_shared_folders_1_day NumberPerDay
        "Array of the number of shared folders with some activity in the last day."
    shared_links_created NumberPerDay
        "Array of the number of shared links created."
    shared_links_viewed_by_team NumberPerDay
        "Array of the number of views by team users to shared links created by the team."
    shared_links_viewed_by_outside_user NumberPerDay
        "Array of the number of views by users outside of the team to shared links created by the team."
    shared_links_viewed_by_not_logged_in NumberPerDay
        "Array of the number of views by non-logged-in users to shared links created by the team."
    shared_links_viewed_total NumberPerDay
        "Array of the total number of views to shared links created by the team."

struct GetMembershipReport extends BaseDfbReport
    "Membership Report Result.
    Each of the items in the storage report is an array of values, one value per day.
    If there is no data for a day, then the value will be None."
    team_size NumberPerDay
        "Team size, for each day."
    pending_invites NumberPerDay
        "The number of pending invites to the team, for each day."
    members_joined NumberPerDay
        "The number of members that joined the team, for each day."
    suspended_members NumberPerDay
        "The number of suspended team members, for each day."
    licenses NumberPerDay
        "The total number of licenses the team has, for each day."

struct DevicesActive
    "Each of the items is an array of values, one value per day.
    The value is the number of devices active within a time window, ending with that day.
    If there is no data for a day, then the value will be None."
    windows NumberPerDay
        "Array of number of linked windows (desktop) clients with activity."
    macos NumberPerDay
        "Array of number of linked mac (desktop) clients with activity."
    linux NumberPerDay
        "Array of number of linked linus (desktop) clients with activity."
    ios NumberPerDay
        "Array of number of linked ios devices with activity."
    android NumberPerDay
        "Array of number of linked android devices with activity."
    other NumberPerDay
        "Array of number of other linked devices (blackberry, windows phone, etc)
        with activity."
    total NumberPerDay
        "Array of total number of linked clients with activity."

struct GetDevicesReport extends BaseDfbReport
    "Devices Report Result. Contains subsections for different time ranges of activity.
    Each of the items in each subsection of the storage report is an array of values,
    one value per day.
    If there is no data for a day, then the value will be None."
    active_1_day DevicesActive
        "Report of the number of devices active in the last day."
    active_7_day DevicesActive
        "Report of the number of devices active in the last 7 days."
    active_28_day DevicesActive
        "Report of the number of devices active in the last 28 days."