8
8
async ,
9
9
auth ,
10
10
files ,
11
+ properties ,
11
12
sharing ,
12
13
team ,
14
+ team_policies ,
13
15
users ,
14
16
)
15
17
@@ -61,6 +63,47 @@ def team_devices_list_member_devices(self,
61
63
)
62
64
return r
63
65
66
+ def team_devices_list_members_devices (self ,
67
+ cursor = None ,
68
+ include_web_sessions = True ,
69
+ include_desktop_clients = True ,
70
+ include_mobile_clients = True ):
71
+ """
72
+ List all device sessions of a team.
73
+
74
+ :param Nullable cursor: At the first call to the
75
+ :meth:`devices_list_members_devices` the cursor shouldn't be passed.
76
+ Then, if the result of the call includes a cursor, the following
77
+ requests should include the received cursors in order to receive the
78
+ next sub list of team devices
79
+ :param bool include_web_sessions: Whether to list web sessions of the
80
+ team members
81
+ :param bool include_desktop_clients: Whether to list desktop clients of
82
+ the team members
83
+ :param bool include_mobile_clients: Whether to list mobile clients of
84
+ the team members
85
+ :rtype: :class:`dropbox.team.ListMembersDevicesResult`
86
+ :raises: :class:`dropbox.exceptions.ApiError`
87
+
88
+ If this raises, ApiError.reason is of type:
89
+ :class:`dropbox.team.ListMembersDevicesError`
90
+ """
91
+ arg = team .ListMembersDevicesArg (cursor ,
92
+ include_web_sessions ,
93
+ include_desktop_clients ,
94
+ include_mobile_clients )
95
+ r = self .request (
96
+ 'api' ,
97
+ 'team/devices/list_members_devices' ,
98
+ 'rpc' ,
99
+ bv .Struct (team .ListMembersDevicesArg ),
100
+ bv .Struct (team .ListMembersDevicesResult ),
101
+ bv .Union (team .ListMembersDevicesError ),
102
+ arg ,
103
+ None ,
104
+ )
105
+ return r
106
+
64
107
def team_devices_list_team_devices (self ,
65
108
cursor = None ,
66
109
include_web_sessions = True ,
@@ -335,7 +378,8 @@ def team_groups_list_continue(self,
335
378
336
379
def team_groups_members_add (self ,
337
380
group ,
338
- members ):
381
+ members ,
382
+ return_members = True ):
339
383
"""
340
384
Adds members to a group. The members are added immediately. However the
341
385
granting of group-owned resources may take additional time. Use the
@@ -352,7 +396,8 @@ def team_groups_members_add(self,
352
396
:class:`dropbox.team.GroupMembersAddError`
353
397
"""
354
398
arg = team .GroupMembersAddArg (group ,
355
- members )
399
+ members ,
400
+ return_members )
356
401
r = self .request (
357
402
'api' ,
358
403
'team/groups/members/add' ,
@@ -367,23 +412,26 @@ def team_groups_members_add(self,
367
412
368
413
def team_groups_members_remove (self ,
369
414
group ,
370
- users ):
415
+ users ,
416
+ return_members = True ):
371
417
"""
372
418
Removes members from a group. The members are removed immediately.
373
419
However the revoking of group-owned resources may take additional time.
374
420
Use the :meth:`groups_job_status_get` to determine whether this process
375
421
has completed. Permission : Team member management
376
422
423
+ :param group: Group from which users will be removed.
377
424
:type group: :class:`dropbox.team.GroupSelector`
378
- :type users: list
425
+ :param list users: List of users to be removed from the group.
379
426
:rtype: :class:`dropbox.team.GroupMembersChangeResult`
380
427
:raises: :class:`dropbox.exceptions.ApiError`
381
428
382
429
If this raises, ApiError.reason is of type:
383
430
:class:`dropbox.team.GroupMembersRemoveError`
384
431
"""
385
432
arg = team .GroupMembersRemoveArg (group ,
386
- users )
433
+ users ,
434
+ return_members )
387
435
r = self .request (
388
436
'api' ,
389
437
'team/groups/members/remove' ,
@@ -399,36 +447,43 @@ def team_groups_members_remove(self,
399
447
def team_groups_members_set_access_type (self ,
400
448
group ,
401
449
user ,
402
- access_type ):
450
+ access_type ,
451
+ return_members = True ):
403
452
"""
404
453
Sets a member's access type in a group. Permission : Team member
405
454
management
406
455
407
456
:param access_type: New group access type the user will have.
408
457
:type access_type: :class:`dropbox.team.GroupAccessType`
458
+ :param bool return_members: Whether to return the list of members in the
459
+ group. Note that the default value will cause all the group members
460
+ to be returned in the response. This may take a long time for large
461
+ groups.
409
462
:rtype: list
410
463
:raises: :class:`dropbox.exceptions.ApiError`
411
464
412
465
If this raises, ApiError.reason is of type:
413
- :class:`dropbox.team.GroupMemberSelectorError `
466
+ :class:`dropbox.team.GroupMemberSetAccessTypeError `
414
467
"""
415
468
arg = team .GroupMembersSetAccessTypeArg (group ,
416
469
user ,
417
- access_type )
470
+ access_type ,
471
+ return_members )
418
472
r = self .request (
419
473
'api' ,
420
474
'team/groups/members/set_access_type' ,
421
475
'rpc' ,
422
476
bv .Struct (team .GroupMembersSetAccessTypeArg ),
423
477
bv .List (bv .Union (team .GroupsGetInfoItem )),
424
- bv .Union (team .GroupMemberSelectorError ),
478
+ bv .Union (team .GroupMemberSetAccessTypeError ),
425
479
arg ,
426
480
None ,
427
481
)
428
482
return r
429
483
430
484
def team_groups_update (self ,
431
485
group ,
486
+ return_members = True ,
432
487
new_group_name = None ,
433
488
new_group_external_id = None ):
434
489
"""
@@ -450,6 +505,7 @@ def team_groups_update(self,
450
505
:class:`dropbox.team.GroupUpdateError`
451
506
"""
452
507
arg = team .GroupUpdateArgs (group ,
508
+ return_members ,
453
509
new_group_name ,
454
510
new_group_external_id )
455
511
r = self .request (
@@ -468,7 +524,7 @@ def team_linked_apps_list_member_linked_apps(self,
468
524
team_member_id ):
469
525
"""
470
526
List all linked applications of the team member. Note, this endpoint
471
- doesn't list any team-linked applications.
527
+ does not list any team-linked applications.
472
528
473
529
:param str team_member_id: The team member id
474
530
:rtype: :class:`dropbox.team.ListMemberAppsResult`
@@ -490,6 +546,36 @@ def team_linked_apps_list_member_linked_apps(self,
490
546
)
491
547
return r
492
548
549
+ def team_linked_apps_list_members_linked_apps (self ,
550
+ cursor = None ):
551
+ """
552
+ List all applications linked to the team members' accounts. Note, this
553
+ endpoint does not list any team-linked applications.
554
+
555
+ :param Nullable cursor: At the first call to the
556
+ :meth:`linked_apps_list_members_linked_apps` the cursor shouldn't be
557
+ passed. Then, if the result of the call includes a cursor, the
558
+ following requests should include the received cursors in order to
559
+ receive the next sub list of the team applications
560
+ :rtype: :class:`dropbox.team.ListMembersAppsResult`
561
+ :raises: :class:`dropbox.exceptions.ApiError`
562
+
563
+ If this raises, ApiError.reason is of type:
564
+ :class:`dropbox.team.ListMembersAppsError`
565
+ """
566
+ arg = team .ListMembersAppsArg (cursor )
567
+ r = self .request (
568
+ 'api' ,
569
+ 'team/linked_apps/list_members_linked_apps' ,
570
+ 'rpc' ,
571
+ bv .Struct (team .ListMembersAppsArg ),
572
+ bv .Struct (team .ListMembersAppsResult ),
573
+ bv .Union (team .ListMembersAppsError ),
574
+ arg ,
575
+ None ,
576
+ )
577
+ return r
578
+
493
579
def team_linked_apps_list_team_linked_apps (self ,
494
580
cursor = None ):
495
581
"""
@@ -644,8 +730,9 @@ def team_members_get_info(self,
644
730
members ):
645
731
"""
646
732
Returns information about multiple team members. Permission : Team
647
- information This endpoint will return an empty member_info item, for IDs
648
- (or emails) that cannot be matched to a valid team member.
733
+ information This endpoint will return
734
+ ``MembersGetInfoItem.id_not_found``, for IDs (or emails) that cannot be
735
+ matched to a valid team member.
649
736
650
737
:param list members: List of team members.
651
738
:rtype: list
@@ -948,6 +1035,125 @@ def team_members_unsuspend(self,
948
1035
)
949
1036
return None
950
1037
1038
+ def team_properties_template_add (self ,
1039
+ name ,
1040
+ description ,
1041
+ fields ):
1042
+ """
1043
+ Add a property template. See route files/properties/add to add
1044
+ properties to a file.
1045
+
1046
+ :rtype: :class:`dropbox.team.AddPropertyTemplateResult`
1047
+ :raises: :class:`dropbox.exceptions.ApiError`
1048
+
1049
+ If this raises, ApiError.reason is of type:
1050
+ :class:`dropbox.team.ModifyPropertyTemplateError`
1051
+ """
1052
+ arg = team .AddPropertyTemplateArg (name ,
1053
+ description ,
1054
+ fields )
1055
+ r = self .request (
1056
+ 'api' ,
1057
+ 'team/properties/template/add' ,
1058
+ 'rpc' ,
1059
+ bv .Struct (team .AddPropertyTemplateArg ),
1060
+ bv .Struct (team .AddPropertyTemplateResult ),
1061
+ bv .Union (properties .ModifyPropertyTemplateError ),
1062
+ arg ,
1063
+ None ,
1064
+ )
1065
+ return r
1066
+
1067
+ def team_properties_template_get (self ,
1068
+ template_id ):
1069
+ """
1070
+ Get the schema for a specified template.
1071
+
1072
+ :param str template_id: An identifier for property template added by
1073
+ route properties/template/add.
1074
+ :rtype: :class:`dropbox.team.GetPropertyTemplateResult`
1075
+ :raises: :class:`dropbox.exceptions.ApiError`
1076
+
1077
+ If this raises, ApiError.reason is of type:
1078
+ :class:`dropbox.team.PropertyTemplateError`
1079
+ """
1080
+ arg = properties .GetPropertyTemplateArg (template_id )
1081
+ r = self .request (
1082
+ 'api' ,
1083
+ 'team/properties/template/get' ,
1084
+ 'rpc' ,
1085
+ bv .Struct (properties .GetPropertyTemplateArg ),
1086
+ bv .Struct (properties .GetPropertyTemplateResult ),
1087
+ bv .Union (properties .PropertyTemplateError ),
1088
+ arg ,
1089
+ None ,
1090
+ )
1091
+ return r
1092
+
1093
+ def team_properties_template_list (self ):
1094
+ """
1095
+ Get the property template identifiers for a team. To get the schema of
1096
+ each template use :meth:`properties_template_get`.
1097
+
1098
+ :rtype: :class:`dropbox.team.ListPropertyTemplateIds`
1099
+ :raises: :class:`dropbox.exceptions.ApiError`
1100
+
1101
+ If this raises, ApiError.reason is of type:
1102
+ :class:`dropbox.team.PropertyTemplateError`
1103
+ """
1104
+ arg = None
1105
+ r = self .request (
1106
+ 'api' ,
1107
+ 'team/properties/template/list' ,
1108
+ 'rpc' ,
1109
+ bv .Void (),
1110
+ bv .Struct (properties .ListPropertyTemplateIds ),
1111
+ bv .Union (properties .PropertyTemplateError ),
1112
+ arg ,
1113
+ None ,
1114
+ )
1115
+ return r
1116
+
1117
+ def team_properties_template_update (self ,
1118
+ template_id ,
1119
+ name = None ,
1120
+ description = None ,
1121
+ add_fields = None ):
1122
+ """
1123
+ Update a property template. This route can update the template name, the
1124
+ template description and add optional properties to templates.
1125
+
1126
+ :param str template_id: An identifier for property template added by
1127
+ :meth:`properties_template_add`.
1128
+ :param Nullable name: A display name for the property template. Property
1129
+ template names can be up to 256 bytes.
1130
+ :param Nullable description: Description for new property template.
1131
+ Property template descriptions can be up to 1024 bytes.
1132
+ :param Nullable add_fields: This is a list of custom properties to add
1133
+ to the property template. There can be up to 64 properties in a
1134
+ single property template.
1135
+ :rtype: :class:`dropbox.team.UpdatePropertyTemplateResult`
1136
+ :raises: :class:`dropbox.exceptions.ApiError`
1137
+
1138
+ If this raises, ApiError.reason is of type:
1139
+ :class:`dropbox.team.ModifyPropertyTemplateError`
1140
+ """
1141
+ arg = team .UpdatePropertyTemplateArg (template_id ,
1142
+ name ,
1143
+ description ,
1144
+ add_fields )
1145
+ r = self .request (
1146
+ 'api' ,
1147
+ 'team/properties/template/update' ,
1148
+ 'rpc' ,
1149
+ bv .Struct (team .UpdatePropertyTemplateArg ),
1150
+ bv .Struct (team .UpdatePropertyTemplateResult ),
1151
+ bv .Union (properties .ModifyPropertyTemplateError ),
1152
+ arg ,
1153
+ None ,
1154
+ )
1155
+ return r
1156
+
951
1157
def team_reports_get_activity (self ,
952
1158
start_date = None ,
953
1159
end_date = None ):
0 commit comments