-
Notifications
You must be signed in to change notification settings - Fork 41
/
team_groups.stone
560 lines (413 loc) · 16.5 KB
/
team_groups.stone
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
namespace team
import async
import team_common
#
# Common types.
#
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"]
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
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."
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`."
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."
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."
####################
# Group Info methods
####################
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
#
# route groups/list
#
struct GroupsListArg
limit UInt32(min_value=1, max_value=1000) = 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
route groups/list(GroupsListArg, GroupsListResult, Void)
"Lists groups on a team.
Permission : Team Information."
attrs
auth = "team"
scope = "groups.read"
#
# route groups/list/continue
#
struct GroupsListContinueArg
cursor String
"Indicates from what point to get the next set of groups."
example default
cursor = "ZtkX9_EHj3x7PMkVuFIhwKYXEpwpLwyxp9vMKomUhllil9q7eWiAu"
union GroupsListContinueError
invalid_cursor
"The cursor is invalid."
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
#
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
alias GroupsGetInfoResult = List(GroupsGetInfoItem)
union GroupsGetInfoError
group_not_on_team
"The group is not on your team."
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"
##########################
# Group management methods
##########################
#
# route groups/create
#
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"
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."
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 (async method)
#
union GroupDeleteError extends GroupSelectorWithTeamGroupError
group_already_deleted
"This group has already been deleted."
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
#
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
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."
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"
#
# Structures common to groups/members/add and groups/members/remove
#
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
"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"
#
# route groups/members/add (async method)
#
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]
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."
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 (async method)
#
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]
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."
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
#
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
union GroupMemberSetAccessTypeError extends GroupMemberSelectorError
user_cannot_be_manager_of_company_managed_group
"A company managed group cannot be managed by a user."
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
#
struct GroupsMembersListArg
group GroupSelector
"The group whose members are to be listed."
limit UInt32(min_value=1, max_value=1000) = 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
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
#
struct GroupsMembersListContinueArg
cursor String
"Indicates from what point to get the next set of groups."
example default
cursor = "ZtkX9_EHj3x7PMkVuFIhwKYXEpwpLwyxp9vMKomUhllil9q7eWiAu"
union GroupsMembersListContinueError
invalid_cursor
"The cursor is invalid."
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
#
union GroupsPollError extends async.PollError
access_denied
"You are not allowed to poll this job."
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"