team_members.stone 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625
  1. namespace team
  2. import async
  3. import users
  4. import common
  5. import team_common
  6. union_closed AdminTier
  7. "Describes which team-related admin permissions a user has."
  8. team_admin
  9. "User is an administrator of the team - has all permissions."
  10. user_management_admin
  11. "User can do most user provisioning, de-provisioning and management."
  12. support_admin
  13. "User can do a limited set of common support tasks for existing users."
  14. member_only
  15. "User is not an admin of the team."
  16. example default
  17. member_only = null
  18. #
  19. # Common structs
  20. #
  21. struct TeamMemberProfile extends MemberProfile
  22. "Profile of a user as a member of a team."
  23. groups List(team_common.GroupId)
  24. "List of group IDs of groups that the user belongs to."
  25. example default
  26. team_member_id = "dbmid:FDFSVF-DFSDF"
  27. account_id = "dbid:AAH4f99T0taONIb-OurWxbNQ6ywGRopQngc"
  28. external_id = "244423"
  29. email = "tami@seagull.com"
  30. email_verified = false
  31. status = active
  32. name = default
  33. groups = ["g:e2db7665347abcd600000000001a2b3c"]
  34. membership_type = full
  35. joined_on = "2015-05-12T15:50:38Z"
  36. union_closed MemberSelectorError extends UserSelectorError
  37. user_not_in_team
  38. "The user is not a member of the team."
  39. ########################
  40. # Member info routes
  41. ########################
  42. #
  43. # Route: members/list
  44. #
  45. struct MembersListArg
  46. limit UInt32(min_value=1, max_value=1000) = 1000
  47. "Number of results to return per call."
  48. include_removed Boolean = false
  49. "Whether to return removed members."
  50. example default
  51. limit = 100
  52. include_removed = false
  53. struct TeamMemberInfo
  54. "Information about a team member."
  55. profile TeamMemberProfile
  56. "Profile of a user as a member of a team."
  57. role AdminTier
  58. "The user's role in the team."
  59. example default
  60. profile = default
  61. role = member_only
  62. struct MembersListResult
  63. members List(TeamMemberInfo)
  64. "List of team members."
  65. cursor String
  66. "Pass the cursor into :route:`members/list/continue` to obtain the additional members."
  67. has_more Boolean
  68. "Is true if there are additional team members that have not been returned
  69. yet. An additional call to :route:`members/list/continue` can retrieve them."
  70. example default
  71. members = [default]
  72. cursor = "ZtkX9_EHj3x7PMkVuFIhwKYXEpwpLwyxp9vMKomUhllil9q7eWiAu"
  73. has_more = true
  74. union MembersListError
  75. ""
  76. route members/list(MembersListArg, MembersListResult, MembersListError)
  77. "Lists members of a team.
  78. Permission : Team information"
  79. attrs
  80. auth = "team"
  81. owner = "adminx"
  82. #
  83. # Route: members/list/continue
  84. #
  85. struct MembersListContinueArg
  86. cursor String
  87. "Indicates from what point to get the next set of members."
  88. example default
  89. cursor = "ZtkX9_EHj3x7PMkVuFIhwKYXEpwpLwyxp9vMKomUhllil9q7eWiAu"
  90. union MembersListContinueError
  91. invalid_cursor
  92. "The cursor is invalid."
  93. route members/list/continue(MembersListContinueArg, MembersListResult, MembersListContinueError)
  94. "Once a cursor has been retrieved from :route:`members/list`, use this to paginate
  95. through all team members.
  96. Permission : Team information"
  97. attrs
  98. auth = "team"
  99. owner = "adminx"
  100. #
  101. # Route: members/get_info
  102. #
  103. struct MembersGetInfoArgs
  104. members List(UserSelectorArg)
  105. "List of team members."
  106. example default
  107. members = [default]
  108. union_closed MembersGetInfoItem
  109. "Describes a result obtained for a single user whose id was specified in the
  110. parameter of :route:`members/get_info`."
  111. id_not_found String
  112. "An ID that was provided as a parameter to :route:`members/get_info`,
  113. and did not match a corresponding user. This might be a team_member_id, an
  114. email, or an external ID, depending on how the method was called."
  115. member_info TeamMemberInfo
  116. "Info about a team member."
  117. example default
  118. member_info = default
  119. # Information returned by :route:`members/get_info`.
  120. # describing multiple team members."
  121. alias MembersGetInfoResult = List(MembersGetInfoItem)
  122. union MembersGetInfoError
  123. ""
  124. route members/get_info(MembersGetInfoArgs, MembersGetInfoResult, MembersGetInfoError)
  125. "Returns information about multiple team members.
  126. Permission : Team information
  127. This endpoint will return :field:`MembersGetInfoItem.id_not_found`,
  128. for IDs (or emails) that cannot be matched to a valid team member."
  129. attrs
  130. auth = "team"
  131. owner = "adminx"
  132. ##########################
  133. # Member management routes
  134. ##########################
  135. #
  136. # Route members/add
  137. #
  138. struct MemberAddArg
  139. member_email common.EmailAddress
  140. member_given_name common.NamePart?
  141. "Member's first name."
  142. member_surname common.NamePart?
  143. "Member's last name."
  144. member_external_id team_common.MemberExternalId?
  145. "External ID for member."
  146. member_persistent_id String?
  147. "Persistent ID for member. This field is only available to teams using persistent ID SAML configuration."
  148. send_welcome_email Boolean = true
  149. "Whether to send a welcome email to the member.
  150. If send_welcome_email is false, no email invitation will be sent to the user.
  151. This may be useful for apps using single sign-on (SSO) flows for onboarding that
  152. want to handle announcements themselves."
  153. role AdminTier = member_only
  154. example default
  155. member_email = "tom.s@company.com"
  156. member_given_name = "Tom"
  157. member_surname = "Silverstone"
  158. member_external_id = "company_id:342432"
  159. role = default
  160. struct MembersAddArg
  161. new_members List(MemberAddArg)
  162. "Details of new members to be added to the team."
  163. force_async Boolean = false
  164. "Whether to force the add to happen asynchronously."
  165. example default
  166. new_members = [default]
  167. union_closed MemberAddResult
  168. "Describes the result of attempting to add a single user to the team.
  169. 'success' is the only value indicating that a user was indeed added to the team -
  170. the other values explain the type of failure that occurred, and include the email
  171. of the user for which the operation has failed."
  172. success TeamMemberInfo
  173. "Describes a user that was successfully added to the team."
  174. team_license_limit common.EmailAddress
  175. "Team is already full. The organization has no available licenses."
  176. free_team_member_limit_reached common.EmailAddress
  177. "Team is already full. The free team member limit has been reached."
  178. user_already_on_team common.EmailAddress
  179. "User is already on this team. The provided email address is associated
  180. with a user who is already a member of (including in recoverable state) or invited to the team."
  181. user_on_another_team common.EmailAddress
  182. "User is already on another team. The provided email address is associated
  183. with a user that is already a member or invited to another team."
  184. user_already_paired common.EmailAddress
  185. "User is already paired."
  186. user_migration_failed common.EmailAddress
  187. "User migration has failed."
  188. duplicate_external_member_id common.EmailAddress
  189. "A user with the given external member ID already exists on the team (including in recoverable state)."
  190. duplicate_member_persistent_id common.EmailAddress
  191. "A user with the given persistent ID already exists on the team (including in recoverable state)."
  192. persistent_id_disabled common.EmailAddress
  193. "Persistent ID is only available to teams with persistent ID SAML configuration. Please contact Dropbox for more information."
  194. user_creation_failed common.EmailAddress
  195. "User creation has failed."
  196. example default
  197. success = default
  198. union_closed MembersAddLaunch extends async.LaunchResultBase
  199. complete List(MemberAddResult)
  200. example default
  201. complete = [default]
  202. route members/add(MembersAddArg, MembersAddLaunch, Void)
  203. "Adds members to a team.
  204. Permission : Team member management
  205. A maximum of 20 members can be specified in a single call.
  206. If no Dropbox account exists with the email address specified, a new Dropbox account will
  207. be created with the given email address, and that account will be invited to the team.
  208. If a personal Dropbox account exists with the email address specified in the call,
  209. this call will create a placeholder Dropbox account for the user on the team and send an
  210. email inviting the user to migrate their existing personal account onto the team.
  211. Team member management apps are required to set an initial given_name and surname for a
  212. user to use in the team invitation and for 'Perform as team member' actions taken on
  213. the user before they become 'active'."
  214. attrs
  215. auth = "team"
  216. owner = "adminx"
  217. #
  218. # Route members/add/job_status/get
  219. #
  220. union_closed MembersAddJobStatus extends async.PollResultBase
  221. complete List(MemberAddResult)
  222. "The asynchronous job has finished. For each member that was specified in the
  223. parameter :type:`MembersAddArg` that was provided to :route:`members/add`, a
  224. corresponding item is returned in this list. "
  225. failed String
  226. "The asynchronous job returned an error. The string contains an error message."
  227. example default
  228. complete = [default]
  229. route members/add/job_status/get(async.PollArg, MembersAddJobStatus, async.PollError)
  230. "Once an async_job_id is returned from :route:`members/add` ,
  231. use this to poll the status of the asynchronous request.
  232. Permission : Team member management"
  233. attrs
  234. auth = "team"
  235. owner = "adminx"
  236. #
  237. # Route members/set_profile
  238. #
  239. # Note that we do not allow changing 'familiar_name' and 'display_name from users.Name, since they
  240. # are derived from the given_name, surname and locale.
  241. struct MembersSetProfileArg
  242. "Exactly one of team_member_id, email, or external_id must be provided to identify the user account.
  243. At least one of new_email, new_external_id, new_given_name, and/or new_surname must be provided."
  244. user UserSelectorArg
  245. "Identity of user whose profile will be set."
  246. new_email common.EmailAddress?
  247. "New email for member."
  248. new_external_id team_common.MemberExternalId?
  249. "New external ID for member."
  250. new_given_name common.NamePart?
  251. "New given name for member."
  252. new_surname common.NamePart?
  253. "New surname for member."
  254. new_persistent_id String?
  255. "New persistent ID. This field only available to teams using persistent ID SAML configuration."
  256. example default
  257. user = default
  258. new_email = "t.smith@domain.com"
  259. new_surname = "Smith"
  260. union MembersSetProfileError extends MemberSelectorError
  261. external_id_and_new_external_id_unsafe
  262. "It is unsafe to use both external_id and new_external_id"
  263. no_new_data_specified
  264. "None of new_email, new_given_name, new_surname, or new_external_id are specified"
  265. email_reserved_for_other_user
  266. "Email is already reserved for another user."
  267. external_id_used_by_other_user
  268. "The external ID is already in use by another team member."
  269. set_profile_disallowed
  270. "Pending team member's email cannot be modified."
  271. param_cannot_be_empty
  272. "Parameter new_email cannot be empty."
  273. persistent_id_disabled
  274. "Persistent ID is only available to teams with persistent ID SAML configuration. Please contact Dropbox for more information."
  275. persistent_id_used_by_other_user
  276. "The persistent ID is already in use by another team member."
  277. route members/set_profile(MembersSetProfileArg, TeamMemberInfo, MembersSetProfileError)
  278. "Updates a team member's profile.
  279. Permission : Team member management"
  280. attrs
  281. auth = "team"
  282. owner = "adminx"
  283. #
  284. # Route members/set_admin_permissions
  285. #
  286. struct MembersSetPermissionsArg
  287. "Exactly one of team_member_id, email, or external_id must be provided to identify the user account."
  288. user UserSelectorArg
  289. "Identity of user whose role will be set."
  290. new_role AdminTier
  291. "The new role of the member."
  292. example default
  293. user = default
  294. new_role = default
  295. struct MembersSetPermissionsResult
  296. team_member_id team_common.TeamMemberId
  297. "The member ID of the user to which the change was applied."
  298. role AdminTier
  299. "The role after the change."
  300. example default
  301. team_member_id = "dbmid:9978889"
  302. role = default
  303. union MembersSetPermissionsError extends UserSelectorError
  304. last_admin
  305. "Cannot remove the admin setting of the last admin."
  306. user_not_in_team
  307. "The user is not a member of the team."
  308. cannot_set_permissions
  309. "Cannot remove/grant permissions."
  310. team_license_limit
  311. "Team is full. The organization has no available licenses."
  312. route members/set_admin_permissions(MembersSetPermissionsArg, MembersSetPermissionsResult, MembersSetPermissionsError)
  313. "Updates a team member's permissions.
  314. Permission : Team member management"
  315. attrs
  316. auth = "team"
  317. owner = "adminx"
  318. #
  319. # Route members/send_welcome_email
  320. #
  321. union MembersSendWelcomeError extends MemberSelectorError
  322. ""
  323. route members/send_welcome_email(UserSelectorArg, Void, MembersSendWelcomeError)
  324. "Sends welcome email to pending team member.
  325. Permission : Team member management
  326. Exactly one of team_member_id, email, or external_id must be provided to identify the user account.
  327. No-op if team member is not pending."
  328. attrs
  329. auth = "team"
  330. owner = "adminx"
  331. #
  332. # Route members/remove
  333. #
  334. struct MembersDeactivateArg
  335. "Exactly one of team_member_id, email, or external_id must be provided to identify the user account."
  336. user UserSelectorArg
  337. "Identity of user to remove/suspend."
  338. wipe_data Boolean = true
  339. "If provided, controls if the user's data will be deleted on their linked devices."
  340. example default
  341. user = default
  342. wipe_data = false
  343. struct MembersRemoveArg extends MembersDeactivateArg
  344. transfer_dest_id UserSelectorArg?
  345. "If provided, files from the deleted member account will be
  346. transferred to this user."
  347. transfer_admin_id UserSelectorArg?
  348. "If provided, errors during the transfer process will be sent via
  349. email to this user. If the transfer_dest_id argument was provided,
  350. then this argument must be provided as well."
  351. keep_account Boolean = false
  352. "Downgrade the member to a Basic account. The user will retain the email address associated with their Dropbox
  353. account and data in their account that is not restricted to team members. In order to keep the account the argument wipe_data should be set to False."
  354. example default
  355. user = default
  356. wipe_data = true
  357. transfer_dest_id = default
  358. transfer_admin_id = default
  359. keep_account = false
  360. union MembersDeactivateError extends UserSelectorError
  361. user_not_in_team
  362. "The user is not a member of the team."
  363. union MembersRemoveError extends MembersDeactivateError
  364. remove_last_admin
  365. "The user is the last admin of the team, so it cannot be removed from it."
  366. removed_and_transfer_dest_should_differ
  367. "Expected removed user and transfer_dest user to be different"
  368. removed_and_transfer_admin_should_differ
  369. "Expected removed user and transfer_admin user to be different."
  370. transfer_dest_user_not_found
  371. "No matching user found for the argument transfer_dest_id."
  372. transfer_dest_user_not_in_team
  373. "The provided transfer_dest_id does not exist on this team."
  374. transfer_admin_user_not_found
  375. "No matching user found for the argument transfer_admin_id."
  376. transfer_admin_user_not_in_team
  377. "The provided transfer_admin_id does not exist on this team."
  378. unspecified_transfer_admin_id
  379. "The transfer_admin_id argument must be provided when file transfer is requested."
  380. transfer_admin_is_not_admin
  381. "Specified transfer_admin user is not a team admin."
  382. cannot_keep_account_and_transfer
  383. "Cannot keep account and transfer the data to another user at the same time."
  384. cannot_keep_account_and_delete_data
  385. "Cannot keep account and delete the data at the same time. To keep the account the argument wipe_data should be set to False."
  386. email_address_too_long_to_be_disabled
  387. # Added value in order to handle task T82902.
  388. "The email address of the user is too long to be disabled."
  389. route members/remove(MembersRemoveArg, async.LaunchEmptyResult, MembersRemoveError)
  390. "Removes a member from a team.
  391. Permission : Team member management
  392. Exactly one of team_member_id, email, or external_id must be provided to identify the user account.
  393. Accounts can be recovered via :route:`members/recover` for a 7 day period
  394. or until the account has been permanently deleted or transferred to another account
  395. (whichever comes first). Calling :route:`members/add` while a user is still recoverable
  396. on your team will return with :field:`MemberAddResult.user_already_on_team`.
  397. This endpoint may initiate an asynchronous job. To obtain the final result
  398. of the job, the client should periodically poll :route:`members/remove/job_status/get`."
  399. attrs
  400. auth = "team"
  401. owner = "adminx"
  402. #
  403. # Route members/remove/job_status/get
  404. #
  405. route members/remove/job_status/get(async.PollArg, async.PollEmptyResult, async.PollError)
  406. "Once an async_job_id is returned from :route:`members/remove` ,
  407. use this to poll the status of the asynchronous request.
  408. Permission : Team member management"
  409. attrs
  410. auth = "team"
  411. owner = "adminx"
  412. #
  413. # Route members/suspend
  414. #
  415. union MembersSuspendError extends MembersDeactivateError
  416. suspend_inactive_user
  417. "The user is not active, so it cannot be suspended."
  418. suspend_last_admin
  419. "The user is the last admin of the team, so it cannot be suspended."
  420. team_license_limit
  421. "Team is full. The organization has no available licenses."
  422. route members/suspend(MembersDeactivateArg, Void, MembersSuspendError)
  423. "Suspend a member from a team.
  424. Permission : Team member management
  425. Exactly one of team_member_id, email, or external_id must be provided to identify the user account."
  426. attrs
  427. auth = "team"
  428. owner = "adminx"
  429. #
  430. # Route members/unsuspend
  431. #
  432. struct MembersUnsuspendArg
  433. "Exactly one of team_member_id, email, or external_id must be provided to identify the user account."
  434. user UserSelectorArg
  435. "Identity of user to unsuspend."
  436. example default
  437. user = default
  438. union MembersUnsuspendError extends MembersDeactivateError
  439. unsuspend_non_suspended_member
  440. "The user is unsuspended, so it cannot be unsuspended again."
  441. team_license_limit
  442. "Team is full. The organization has no available licenses."
  443. route members/unsuspend(MembersUnsuspendArg, Void, MembersUnsuspendError)
  444. "Unsuspend a member from a team.
  445. Permission : Team member management
  446. Exactly one of team_member_id, email, or external_id must be provided to identify the user account."
  447. attrs
  448. auth = "team"
  449. owner = "adminx"
  450. #
  451. # Route members/recover
  452. #
  453. struct MembersRecoverArg
  454. "Exactly one of team_member_id, email, or external_id must be provided to identify the user account."
  455. user UserSelectorArg
  456. "Identity of user to recover."
  457. example default
  458. user = default
  459. union MembersRecoverError extends UserSelectorError
  460. user_unrecoverable
  461. "The user is not recoverable."
  462. user_not_in_team
  463. "The user is not a member of the team."
  464. team_license_limit
  465. "Team is full. The organization has no available licenses."
  466. route members/recover(MembersRecoverArg, Void, MembersRecoverError)
  467. "Recover a deleted member.
  468. Permission : Team member management
  469. Exactly one of team_member_id, email, or external_id must be provided to identify the user account."
  470. attrs
  471. auth = "team"
  472. owner = "adminx"