-
Notifications
You must be signed in to change notification settings - Fork 325
/
Copy pathbase_team.py
3059 lines (2652 loc) · 108 KB
/
base_team.py
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
# -*- coding: utf-8 -*-
# Auto-generated by Stone, do not modify.
# flake8: noqa
# pylint: skip-file
from abc import ABCMeta, abstractmethod
import warnings
from dropbox import account
from dropbox import async_
from dropbox import auth
from dropbox import check
from dropbox import common
from dropbox import contacts
from dropbox import file_properties
from dropbox import file_requests
from dropbox import files
from dropbox import openid
from dropbox import paper
from dropbox import secondary_emails
from dropbox import seen_state
from dropbox import sharing
from dropbox import team
from dropbox import team_common
from dropbox import team_log
from dropbox import team_policies
from dropbox import users
from dropbox import users_common
class DropboxTeamBase(object):
__metaclass__ = ABCMeta
@abstractmethod
def request(self, route, namespace, arg, arg_binary=None):
pass
# ------------------------------------------
# Routes in account namespace
# ------------------------------------------
# Routes in auth namespace
# ------------------------------------------
# Routes in check namespace
# ------------------------------------------
# Routes in contacts namespace
# ------------------------------------------
# Routes in file_properties namespace
def file_properties_templates_add_for_team(self,
name,
description,
fields):
"""
Add a template associated with a team. See
:meth:`file_properties_properties_add` to add properties to a file or
folder. Note: this endpoint will create team-owned templates.
Route attributes:
scope: files.team_metadata.write
:rtype: :class:`dropbox.file_properties.AddTemplateResult`
:raises: :class:`.exceptions.ApiError`
If this raises, ApiError will contain:
:class:`dropbox.file_properties.ModifyTemplateError`
"""
arg = file_properties.AddTemplateArg(name,
description,
fields)
r = self.request(
file_properties.templates_add_for_team,
'file_properties',
arg,
None,
)
return r
def file_properties_templates_get_for_team(self,
template_id):
"""
Get the schema for a specified template.
Route attributes:
scope: files.team_metadata.write
:param str template_id: An identifier for template added by route See
:meth:`file_properties_templates_add_for_user` or
:meth:`file_properties_templates_add_for_team`.
:rtype: :class:`dropbox.file_properties.GetTemplateResult`
:raises: :class:`.exceptions.ApiError`
If this raises, ApiError will contain:
:class:`dropbox.file_properties.TemplateError`
"""
arg = file_properties.GetTemplateArg(template_id)
r = self.request(
file_properties.templates_get_for_team,
'file_properties',
arg,
None,
)
return r
def file_properties_templates_list_for_team(self):
"""
Get the template identifiers for a team. To get the schema of each
template use :meth:`file_properties_templates_get_for_team`.
Route attributes:
scope: files.team_metadata.write
:rtype: :class:`dropbox.file_properties.ListTemplateResult`
:raises: :class:`.exceptions.ApiError`
If this raises, ApiError will contain:
:class:`dropbox.file_properties.TemplateError`
"""
arg = None
r = self.request(
file_properties.templates_list_for_team,
'file_properties',
arg,
None,
)
return r
def file_properties_templates_remove_for_team(self,
template_id):
"""
Permanently removes the specified template created from
:meth:`file_properties_templates_add_for_user`. All properties
associated with the template will also be removed. This action cannot be
undone.
Route attributes:
scope: files.team_metadata.write
:param str template_id: An identifier for a template created by
:meth:`file_properties_templates_add_for_user` or
:meth:`file_properties_templates_add_for_team`.
:rtype: None
:raises: :class:`.exceptions.ApiError`
If this raises, ApiError will contain:
:class:`dropbox.file_properties.TemplateError`
"""
arg = file_properties.RemoveTemplateArg(template_id)
r = self.request(
file_properties.templates_remove_for_team,
'file_properties',
arg,
None,
)
return None
def file_properties_templates_update_for_team(self,
template_id,
name=None,
description=None,
add_fields=None):
"""
Update a template associated with a team. This route can update the
template name, the template description and add optional properties to
templates.
Route attributes:
scope: files.team_metadata.write
:param str template_id: An identifier for template added by See
:meth:`file_properties_templates_add_for_user` or
:meth:`file_properties_templates_add_for_team`.
:param Nullable[str] name: A display name for the template. template
names can be up to 256 bytes.
:param Nullable[str] description: Description for the new template.
Template descriptions can be up to 1024 bytes.
:param
Nullable[List[:class:`dropbox.file_properties.PropertyFieldTemplate`]]
add_fields: Property field templates to be added to the group
template. There can be up to 32 properties in a single template.
:rtype: :class:`dropbox.file_properties.UpdateTemplateResult`
:raises: :class:`.exceptions.ApiError`
If this raises, ApiError will contain:
:class:`dropbox.file_properties.ModifyTemplateError`
"""
arg = file_properties.UpdateTemplateArg(template_id,
name,
description,
add_fields)
r = self.request(
file_properties.templates_update_for_team,
'file_properties',
arg,
None,
)
return r
# ------------------------------------------
# Routes in file_requests namespace
# ------------------------------------------
# Routes in files namespace
# ------------------------------------------
# Routes in openid namespace
# ------------------------------------------
# Routes in paper namespace
# ------------------------------------------
# Routes in sharing namespace
# ------------------------------------------
# Routes in team namespace
def team_devices_list_member_devices(self,
team_member_id,
include_web_sessions=True,
include_desktop_clients=True,
include_mobile_clients=True):
"""
List all device sessions of a team's member.
Route attributes:
scope: sessions.list
:param str team_member_id: The team's member id.
:param bool include_web_sessions: Whether to list web sessions of the
team's member.
:param bool include_desktop_clients: Whether to list linked desktop
devices of the team's member.
:param bool include_mobile_clients: Whether to list linked mobile
devices of the team's member.
:rtype: :class:`dropbox.team.ListMemberDevicesResult`
:raises: :class:`.exceptions.ApiError`
If this raises, ApiError will contain:
:class:`dropbox.team.ListMemberDevicesError`
"""
arg = team.ListMemberDevicesArg(team_member_id,
include_web_sessions,
include_desktop_clients,
include_mobile_clients)
r = self.request(
team.devices_list_member_devices,
'team',
arg,
None,
)
return r
def team_devices_list_members_devices(self,
cursor=None,
include_web_sessions=True,
include_desktop_clients=True,
include_mobile_clients=True):
"""
List all device sessions of a team. Permission : Team member file
access.
Route attributes:
scope: sessions.list
:param Nullable[str] cursor: At the first call to the
:meth:`team_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.
:param bool include_web_sessions: Whether to list web sessions of the
team members.
:param bool include_desktop_clients: Whether to list desktop clients of
the team members.
:param bool include_mobile_clients: Whether to list mobile clients of
the team members.
:rtype: :class:`dropbox.team.ListMembersDevicesResult`
:raises: :class:`.exceptions.ApiError`
If this raises, ApiError will contain:
:class:`dropbox.team.ListMembersDevicesError`
"""
arg = team.ListMembersDevicesArg(cursor,
include_web_sessions,
include_desktop_clients,
include_mobile_clients)
r = self.request(
team.devices_list_members_devices,
'team',
arg,
None,
)
return r
def team_devices_list_team_devices(self,
cursor=None,
include_web_sessions=True,
include_desktop_clients=True,
include_mobile_clients=True):
"""
List all device sessions of a team. Permission : Team member file
access.
Route attributes:
scope: sessions.list
:param Nullable[str] cursor: At the first call to the
:meth:`team_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.
:param bool include_web_sessions: Whether to list web sessions of the
team members.
:param bool include_desktop_clients: Whether to list desktop clients of
the team members.
:param bool include_mobile_clients: Whether to list mobile clients of
the team members.
:rtype: :class:`dropbox.team.ListTeamDevicesResult`
:raises: :class:`.exceptions.ApiError`
If this raises, ApiError will contain:
:class:`dropbox.team.ListTeamDevicesError`
"""
warnings.warn(
'devices/list_team_devices is deprecated. Use devices/list_members_devices.',
DeprecationWarning,
)
arg = team.ListTeamDevicesArg(cursor,
include_web_sessions,
include_desktop_clients,
include_mobile_clients)
r = self.request(
team.devices_list_team_devices,
'team',
arg,
None,
)
return r
def team_devices_revoke_device_session(self,
arg):
"""
Revoke a device session of a team's member.
Route attributes:
scope: sessions.modify
:type arg: :class:`dropbox.team.RevokeDeviceSessionArg`
:rtype: None
:raises: :class:`.exceptions.ApiError`
If this raises, ApiError will contain:
:class:`dropbox.team.RevokeDeviceSessionError`
"""
r = self.request(
team.devices_revoke_device_session,
'team',
arg,
None,
)
return None
def team_devices_revoke_device_session_batch(self,
revoke_devices):
"""
Revoke a list of device sessions of team members.
Route attributes:
scope: sessions.modify
:type revoke_devices: List[:class:`dropbox.team.RevokeDeviceSessionArg`]
:rtype: :class:`dropbox.team.RevokeDeviceSessionBatchResult`
:raises: :class:`.exceptions.ApiError`
If this raises, ApiError will contain:
:class:`dropbox.team.RevokeDeviceSessionBatchError`
"""
arg = team.RevokeDeviceSessionBatchArg(revoke_devices)
r = self.request(
team.devices_revoke_device_session_batch,
'team',
arg,
None,
)
return r
def team_features_get_values(self,
features):
"""
Get the values for one or more featues. 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.
Route attributes:
scope: team_info.read
:param List[:class:`dropbox.team.Feature`] features: A list of features
in :class:`dropbox.team.Feature`. If the list is empty, this route
will return :class:`dropbox.team.FeaturesGetValuesBatchError`.
:rtype: :class:`dropbox.team.FeaturesGetValuesBatchResult`
:raises: :class:`.exceptions.ApiError`
If this raises, ApiError will contain:
:class:`dropbox.team.FeaturesGetValuesBatchError`
"""
arg = team.FeaturesGetValuesBatchArg(features)
r = self.request(
team.features_get_values,
'team',
arg,
None,
)
return r
def team_get_info(self):
"""
Retrieves information about a team.
Route attributes:
scope: team_info.read
:rtype: :class:`dropbox.team.TeamGetInfoResult`
"""
arg = None
r = self.request(
team.get_info,
'team',
arg,
None,
)
return r
def team_groups_create(self,
group_name,
add_creator_as_owner=False,
group_external_id=None,
group_management_type=None):
"""
Creates a new, empty group, with a requested name. Permission : Team
member management.
Route attributes:
scope: groups.write
:param str group_name: Group name.
:param bool add_creator_as_owner: Automatically add the creator of the
group.
:param Nullable[str] group_external_id: The creator of a team can
associate an arbitrary external ID to the group.
:param Nullable[:class:`dropbox.team.GroupManagementType`]
group_management_type: Whether the team can be managed by selected
users, or only by team admins.
:rtype: :class:`dropbox.team.GroupFullInfo`
:raises: :class:`.exceptions.ApiError`
If this raises, ApiError will contain:
:class:`dropbox.team.GroupCreateError`
"""
arg = team.GroupCreateArg(group_name,
add_creator_as_owner,
group_external_id,
group_management_type)
r = self.request(
team.groups_create,
'team',
arg,
None,
)
return r
def team_groups_delete(self,
arg):
"""
Deletes a group. The group is deleted immediately. However the revoking
of group-owned resources may take additional time. Use the
:meth:`team_groups_job_status_get` to determine whether this process has
completed. Permission : Team member management.
Route attributes:
scope: groups.write
:param arg: Argument for selecting a single group, either by group_id or
by external group ID.
:type arg: :class:`dropbox.team.GroupSelector`
:rtype: :class:`dropbox.team.LaunchEmptyResult`
:raises: :class:`.exceptions.ApiError`
If this raises, ApiError will contain:
:class:`dropbox.team.GroupDeleteError`
"""
r = self.request(
team.groups_delete,
'team',
arg,
None,
)
return r
def team_groups_get_info(self,
arg):
"""
Retrieves information about one or more groups. Note that the optional
field ``GroupFullInfo.members`` is not returned for system-managed
groups. Permission : Team Information.
Route attributes:
scope: groups.read
:param arg: Argument for selecting a list of groups, either by
group_ids, or external group IDs.
:type arg: :class:`dropbox.team.GroupsSelector`
:rtype: List[:class:`dropbox.team.GroupsGetInfoItem`]
:raises: :class:`.exceptions.ApiError`
If this raises, ApiError will contain:
:class:`dropbox.team.GroupsGetInfoError`
"""
r = self.request(
team.groups_get_info,
'team',
arg,
None,
)
return r
def team_groups_job_status_get(self,
async_job_id):
"""
Once an async_job_id is returned from :meth:`team_groups_delete`,
:meth:`team_groups_members_add` , or :meth:`team_groups_members_remove`
use this method to poll the status of granting/revoking group members'
access to group-owned resources. Permission : Team member management.
Route attributes:
scope: groups.write
:param str async_job_id: Id of the asynchronous job. This is the value
of a response returned from the method that launched the job.
:rtype: :class:`dropbox.team.PollEmptyResult`
:raises: :class:`.exceptions.ApiError`
If this raises, ApiError will contain:
:class:`dropbox.team.GroupsPollError`
"""
arg = async_.PollArg(async_job_id)
r = self.request(
team.groups_job_status_get,
'team',
arg,
None,
)
return r
def team_groups_list(self,
limit=1000):
"""
Lists groups on a team. Permission : Team Information.
Route attributes:
scope: groups.read
:param int limit: Number of results to return per call.
:rtype: :class:`dropbox.team.GroupsListResult`
"""
arg = team.GroupsListArg(limit)
r = self.request(
team.groups_list,
'team',
arg,
None,
)
return r
def team_groups_list_continue(self,
cursor):
"""
Once a cursor has been retrieved from :meth:`team_groups_list`, use this
to paginate through all groups. Permission : Team Information.
Route attributes:
scope: groups.read
:param str cursor: Indicates from what point to get the next set of
groups.
:rtype: :class:`dropbox.team.GroupsListResult`
:raises: :class:`.exceptions.ApiError`
If this raises, ApiError will contain:
:class:`dropbox.team.GroupsListContinueError`
"""
arg = team.GroupsListContinueArg(cursor)
r = self.request(
team.groups_list_continue,
'team',
arg,
None,
)
return r
def team_groups_members_add(self,
group,
members,
return_members=True):
"""
Adds members to a group. The members are added immediately. However the
granting of group-owned resources may take additional time. Use the
:meth:`team_groups_job_status_get` to determine whether this process has
completed. Permission : Team member management.
Route attributes:
scope: groups.write
:param group: Group to which users will be added.
:type group: :class:`dropbox.team.GroupSelector`
:param List[:class:`dropbox.team.MemberAccess`] members: List of users
to be added to the group.
:rtype: :class:`dropbox.team.GroupMembersChangeResult`
:raises: :class:`.exceptions.ApiError`
If this raises, ApiError will contain:
:class:`dropbox.team.GroupMembersAddError`
"""
arg = team.GroupMembersAddArg(group,
members,
return_members)
r = self.request(
team.groups_members_add,
'team',
arg,
None,
)
return r
def team_groups_members_list(self,
group,
limit=1000):
"""
Lists members of a group. Permission : Team Information.
Route attributes:
scope: groups.read
:param group: The group whose members are to be listed.
:type group: :class:`dropbox.team.GroupSelector`
:param int limit: Number of results to return per call.
:rtype: :class:`dropbox.team.GroupsMembersListResult`
:raises: :class:`.exceptions.ApiError`
If this raises, ApiError will contain:
:class:`dropbox.team.GroupSelectorError`
"""
arg = team.GroupsMembersListArg(group,
limit)
r = self.request(
team.groups_members_list,
'team',
arg,
None,
)
return r
def team_groups_members_list_continue(self,
cursor):
"""
Once a cursor has been retrieved from :meth:`team_groups_members_list`,
use this to paginate through all members of the group. Permission : Team
information.
Route attributes:
scope: groups.read
:param str cursor: Indicates from what point to get the next set of
groups.
:rtype: :class:`dropbox.team.GroupsMembersListResult`
:raises: :class:`.exceptions.ApiError`
If this raises, ApiError will contain:
:class:`dropbox.team.GroupsMembersListContinueError`
"""
arg = team.GroupsMembersListContinueArg(cursor)
r = self.request(
team.groups_members_list_continue,
'team',
arg,
None,
)
return r
def team_groups_members_remove(self,
group,
users,
return_members=True):
"""
Removes members from a group. The members are removed immediately.
However the revoking of group-owned resources may take additional time.
Use the :meth:`team_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.
Route attributes:
scope: groups.write
:param group: Group from which users will be removed.
:type group: :class:`dropbox.team.GroupSelector`
:param List[:class:`dropbox.team.UserSelectorArg`] users: List of users
to be removed from the group.
:rtype: :class:`dropbox.team.GroupMembersChangeResult`
:raises: :class:`.exceptions.ApiError`
If this raises, ApiError will contain:
:class:`dropbox.team.GroupMembersRemoveError`
"""
arg = team.GroupMembersRemoveArg(group,
users,
return_members)
r = self.request(
team.groups_members_remove,
'team',
arg,
None,
)
return r
def team_groups_members_set_access_type(self,
group,
user,
access_type,
return_members=True):
"""
Sets a member's access type in a group. Permission : Team member
management.
Route attributes:
scope: groups.write
:param access_type: New group access type the user will have.
:type access_type: :class:`dropbox.team.GroupAccessType`
:param bool return_members: 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.
:rtype: List[:class:`dropbox.team.GroupsGetInfoItem`]
:raises: :class:`.exceptions.ApiError`
If this raises, ApiError will contain:
:class:`dropbox.team.GroupMemberSetAccessTypeError`
"""
arg = team.GroupMembersSetAccessTypeArg(group,
user,
access_type,
return_members)
r = self.request(
team.groups_members_set_access_type,
'team',
arg,
None,
)
return r
def team_groups_update(self,
group,
return_members=True,
new_group_name=None,
new_group_external_id=None,
new_group_management_type=None):
"""
Updates a group's name and/or external ID. Permission : Team member
management.
Route attributes:
scope: groups.write
:param group: Specify a group.
:type group: :class:`dropbox.team.GroupSelector`
:param Nullable[str] new_group_name: Optional argument. Set group name
to this if provided.
:param Nullable[str] new_group_external_id: 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.
:param Nullable[:class:`dropbox.team.GroupManagementType`]
new_group_management_type: Set new group management type, if
provided.
:rtype: :class:`dropbox.team.GroupFullInfo`
:raises: :class:`.exceptions.ApiError`
If this raises, ApiError will contain:
:class:`dropbox.team.GroupUpdateError`
"""
arg = team.GroupUpdateArgs(group,
return_members,
new_group_name,
new_group_external_id,
new_group_management_type)
r = self.request(
team.groups_update,
'team',
arg,
None,
)
return r
def team_legal_holds_create_policy(self,
name,
members,
description=None,
start_date=None,
end_date=None):
"""
Creates new legal hold policy. Note: Legal Holds is a paid add-on. Not
all teams have the feature. Permission : Team member file access.
Route attributes:
scope: team_data.governance.write
:param str name: Policy name.
:param Nullable[str] description: A description of the legal hold
policy.
:param List[str] members: List of team member IDs added to the hold.
:param Nullable[datetime] start_date: start date of the legal hold
policy.
:param Nullable[datetime] end_date: end date of the legal hold policy.
:rtype: :class:`dropbox.team.LegalHoldPolicy`
:raises: :class:`.exceptions.ApiError`
If this raises, ApiError will contain:
:class:`dropbox.team.LegalHoldsPolicyCreateError`
"""
arg = team.LegalHoldsPolicyCreateArg(name,
members,
description,
start_date,
end_date)
r = self.request(
team.legal_holds_create_policy,
'team',
arg,
None,
)
return r
def team_legal_holds_get_policy(self,
id):
"""
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.
Route attributes:
scope: team_data.governance.write
:param str id: The legal hold Id.
:rtype: :class:`dropbox.team.LegalHoldPolicy`
:raises: :class:`.exceptions.ApiError`
If this raises, ApiError will contain:
:class:`dropbox.team.LegalHoldsGetPolicyError`
"""
arg = team.LegalHoldsGetPolicyArg(id)
r = self.request(
team.legal_holds_get_policy,
'team',
arg,
None,
)
return r
def team_legal_holds_list_held_revisions(self,
id):
"""
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.
Route attributes:
scope: team_data.governance.write
:param str id: The legal hold Id.
:rtype: :class:`dropbox.team.LegalHoldsListHeldRevisionResult`
:raises: :class:`.exceptions.ApiError`
If this raises, ApiError will contain:
:class:`dropbox.team.LegalHoldsListHeldRevisionsError`
"""
arg = team.LegalHoldsListHeldRevisionsArg(id)
r = self.request(
team.legal_holds_list_held_revisions,
'team',
arg,
None,
)
return r
def team_legal_holds_list_held_revisions_continue(self,
id,
cursor=None):
"""
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.
Route attributes:
scope: team_data.governance.write
:param str id: The legal hold Id.
:param Nullable[str] cursor: 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.
:rtype: :class:`dropbox.team.LegalHoldsListHeldRevisionResult`
:raises: :class:`.exceptions.ApiError`
If this raises, ApiError will contain:
:class:`dropbox.team.LegalHoldsListHeldRevisionsError`
"""
arg = team.LegalHoldsListHeldRevisionsContinueArg(id,
cursor)
r = self.request(
team.legal_holds_list_held_revisions_continue,
'team',
arg,
None,
)
return r
def team_legal_holds_list_policies(self,
include_released=False):
"""
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.
Route attributes:
scope: team_data.governance.write
:param bool include_released: Whether to return holds that were
released.
:rtype: :class:`dropbox.team.LegalHoldsListPoliciesResult`
:raises: :class:`.exceptions.ApiError`
If this raises, ApiError will contain:
:class:`dropbox.team.LegalHoldsListPoliciesError`
"""
arg = team.LegalHoldsListPoliciesArg(include_released)
r = self.request(
team.legal_holds_list_policies,
'team',
arg,
None,
)
return r
def team_legal_holds_release_policy(self,
id):
"""
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.
Route attributes:
scope: team_data.governance.write
:param str id: The legal hold Id.
:rtype: None
:raises: :class:`.exceptions.ApiError`
If this raises, ApiError will contain:
:class:`dropbox.team.LegalHoldsPolicyReleaseError`
"""
arg = team.LegalHoldsPolicyReleaseArg(id)
r = self.request(
team.legal_holds_release_policy,
'team',
arg,
None,
)
return None
def team_legal_holds_update_policy(self,
id,
name=None,
description=None,
members=None):
"""
Updates a legal hold. Note: Legal Holds is a paid add-on. Not all teams
have the feature. Permission : Team member file access.
Route attributes:
scope: team_data.governance.write
:param str id: The legal hold Id.
:param Nullable[str] name: Policy new name.
:param Nullable[str] description: Policy new description.
:param Nullable[List[str]] members: List of team member IDs to apply the
policy on.
:rtype: :class:`dropbox.team.LegalHoldPolicy`
:raises: :class:`.exceptions.ApiError`
If this raises, ApiError will contain:
:class:`dropbox.team.LegalHoldsPolicyUpdateError`
"""