sharing_folders.stone 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186
  1. namespace sharing
  2. import async
  3. import common
  4. import files
  5. import team_common
  6. import users_common
  7. alias DropboxId = String(min_length=1)
  8. union AccessLevel
  9. "Defines the access levels for collaborators."
  10. owner
  11. "The collaborator is the owner of the shared folder. Owners can
  12. view and edit the shared folder as well as set the folder's
  13. policies using :route:`update_folder_policy`."
  14. editor
  15. "The collaborator can both view and edit the shared folder."
  16. viewer
  17. "The collaborator can only view the shared folder."
  18. viewer_no_comment
  19. "The collaborator can only view the shared folder and does
  20. not have any access to comments."
  21. struct FolderPolicy
  22. "A set of policies governing membership and privileges for a shared
  23. folder."
  24. member_policy MemberPolicy?
  25. "Who can be a member of this shared folder, as set on the folder itself.
  26. The effective policy may differ from this value if the team-wide policy
  27. is more restrictive. Present only if the folder is owned by a team."
  28. resolved_member_policy MemberPolicy?
  29. "Who can be a member of this shared folder, taking into account both the
  30. folder and the team-wide policy. This value may differ from that of
  31. member_policy if the team-wide policy is more restrictive than the folder
  32. policy. Present only if the folder is owned by a team."
  33. acl_update_policy AclUpdatePolicy
  34. "Who can add and remove members from this shared folder."
  35. shared_link_policy SharedLinkPolicy
  36. "Who links can be shared with."
  37. viewer_info_policy ViewerInfoPolicy?
  38. "Who can enable/disable viewer info for this shared folder."
  39. example default
  40. member_policy = anyone
  41. resolved_member_policy = team
  42. acl_update_policy = owner
  43. shared_link_policy = anyone
  44. union FolderAction
  45. "Actions that may be taken on shared folders."
  46. change_options
  47. "Change folder options, such as who can be invited to join the folder."
  48. disable_viewer_info
  49. "Disable viewer information for this folder."
  50. edit_contents
  51. "Change or edit contents of the folder."
  52. enable_viewer_info
  53. "Enable viewer information on the folder."
  54. invite_editor
  55. "Invite a user or group to join the folder with read and write permission."
  56. invite_viewer
  57. "Invite a user or group to join the folder with read permission."
  58. invite_viewer_no_comment
  59. "Invite a user or group to join the folder with read permission but no comment permissions."
  60. relinquish_membership
  61. "Relinquish one's own membership in the folder."
  62. unmount
  63. "Unmount the folder."
  64. unshare
  65. "Stop sharing this folder."
  66. leave_a_copy
  67. "Keep a copy of the contents upon leaving or being kicked from the folder."
  68. share_link
  69. "This action is deprecated. Use create_link instead."
  70. create_link
  71. "Create a shared link for folder."
  72. struct FolderPermission
  73. "Whether the user is allowed to take the action on the shared folder."
  74. action FolderAction
  75. "The action that the user may wish to take on the folder."
  76. allow Boolean
  77. "True if the user is allowed to take the action."
  78. reason PermissionDeniedReason?
  79. "The reason why the user is denied the permission. Not present if the action
  80. is allowed, or if no reason is available."
  81. example default
  82. action = edit_contents
  83. allow = false
  84. reason = user_not_same_team_as_owner
  85. union MemberPolicy
  86. "Policy governing who can be a member of a shared folder. Only applicable
  87. to folders owned by a user on a team."
  88. team
  89. "Only a teammate can become a member."
  90. anyone
  91. "Anyone can become a member."
  92. union MemberAction
  93. "Actions that may be taken on members of a shared folder."
  94. leave_a_copy
  95. "Allow the member to keep a copy of the folder when removing."
  96. make_editor
  97. "Make the member an editor of the folder."
  98. make_owner
  99. "Make the member an owner of the folder."
  100. make_viewer
  101. "Make the member a viewer of the folder."
  102. make_viewer_no_comment
  103. "Make the member a viewer of the folder without commenting permissions."
  104. remove
  105. "Remove the member from the folder."
  106. struct MemberPermission
  107. "Whether the user is allowed to take the action on the associated member."
  108. action MemberAction
  109. "The action that the user may wish to take on the member."
  110. allow Boolean
  111. "True if the user is allowed to take the action."
  112. reason PermissionDeniedReason?
  113. "The reason why the user is denied the permission. Not present if the action is allowed."
  114. example default
  115. action = make_owner
  116. allow = false
  117. reason = target_is_indirect_member
  118. union PermissionDeniedReason
  119. "Possible reasons the user is denied a permission."
  120. user_not_same_team_as_owner
  121. "User is not on the same team as the folder owner."
  122. user_not_allowed_by_owner
  123. "User is prohibited by the owner from taking the action."
  124. target_is_indirect_member
  125. "Target is indirectly a member of the folder, for example by being part of a group."
  126. target_is_owner
  127. "Target is the owner of the folder."
  128. target_is_self
  129. "Target is the user itself."
  130. target_not_active
  131. "Target is not an active member of the team."
  132. folder_is_limited_team_folder
  133. "Folder is team folder for a limited team."
  134. owner_not_on_team
  135. "The content owner needs to be on a Dropbox team to perform this action."
  136. permission_denied
  137. "The user does not have permission to perform this action on the link."
  138. restricted_by_team
  139. "The user's team policy prevents performing this action on the link."
  140. user_account_type
  141. "The user's account type does not support this action."
  142. user_not_on_team
  143. "The user needs to be on a Dropbox team to perform this action."
  144. folder_is_inside_shared_folder
  145. "Folder is inside of another shared folder."
  146. union AclUpdatePolicy
  147. "Who can change a shared folder's access control list (ACL). In other words, who can add,
  148. remove, or change the privileges of members."
  149. owner
  150. "Only the owner can update the ACL."
  151. editors
  152. "Any editor can update the ACL. This may be further restricted to
  153. editors on the same team."
  154. union SharedLinkPolicy
  155. "Who can view shared links in this folder."
  156. anyone
  157. "Links can be shared with anyone."
  158. team
  159. "Links can be shared with anyone on the same team as the owner."
  160. members
  161. "Links can only be shared among members of the shared folder."
  162. struct MembershipInfo
  163. "The information about a member of the shared content."
  164. access_type AccessLevel
  165. "The access type for this member."
  166. permissions List(MemberPermission)?
  167. "The permissions that requesting user has on this member. The set of
  168. permissions corresponds to the MemberActions in the request."
  169. initials String?
  170. "Suggested name initials for a member."
  171. is_inherited Boolean = false
  172. "True if the member has access from a parent folder."
  173. example default
  174. access_type = owner
  175. permissions = []
  176. initials = "JD"
  177. is_inherited = false
  178. struct UserInfo
  179. "Basic information about a user. Use :route:`users.get_account` and
  180. :route:`users.get_account_batch` to obtain more detailed information."
  181. account_id users_common.AccountId
  182. "The account ID of the user."
  183. same_team Boolean
  184. "If the user is in the same team as current user."
  185. team_member_id String?
  186. "The team member ID of the shared folder member. Only present if
  187. :field:`same_team` is true."
  188. example default
  189. account_id = "dbid:AAH4f99T0taONIb-OurWxbNQ6ywGRopQngc"
  190. same_team = true
  191. team_member_id = "dbmid:abcd1234"
  192. struct UserMembershipInfo extends MembershipInfo
  193. "The information about a user member of the shared content."
  194. user UserInfo
  195. "The account information for the membership user."
  196. example default
  197. user = default
  198. access_type = owner
  199. permissions = []
  200. union InviteeInfo
  201. "Information about the recipient of a shared content invitation."
  202. email common.EmailAddress
  203. "E-mail address of invited user."
  204. example default
  205. email = "jessica@example.com"
  206. struct InviteeMembershipInfo extends MembershipInfo
  207. "Information about an invited member of a shared content."
  208. invitee InviteeInfo
  209. "Recipient of the invitation."
  210. user UserInfo?
  211. "The user this invitation is tied to, if available."
  212. example default
  213. invitee = default
  214. access_type = viewer
  215. permissions = []
  216. struct GroupInfo extends team_common.GroupSummary
  217. "The information about a group. Groups is a way to manage a list of users
  218. who need same access permission to the shared folder."
  219. group_type team_common.GroupType
  220. "The type of group."
  221. is_member Boolean
  222. "If the current user is a member of the group."
  223. is_owner Boolean
  224. "If the current user is an owner of the group."
  225. same_team Boolean
  226. "If the group is owned by the current user's team."
  227. example default
  228. group_name = "Test group"
  229. group_id = "g:e2db7665347abcd600000000001a2b3c"
  230. member_count = 10
  231. group_management_type = user_managed
  232. group_type = user_managed
  233. is_member = false
  234. is_owner = false
  235. same_team = true
  236. struct GroupMembershipInfo extends MembershipInfo
  237. "The information about a group member of the shared content."
  238. group GroupInfo
  239. "The information about the membership group."
  240. example default
  241. group = default
  242. access_type = editor
  243. permissions = []
  244. struct SharedFolderMetadataBase
  245. "Properties of the shared folder."
  246. access_type AccessLevel
  247. "The current user's access level for this shared folder."
  248. is_inside_team_folder Boolean
  249. "Whether this folder is inside of a team folder."
  250. is_team_folder Boolean
  251. "Whether this folder is a
  252. :link:`team folder https://www.dropbox.com/en/help/986`."
  253. owner_team users.Team?
  254. "The team that owns the folder. This field is not present if the folder
  255. is not owned by a team."
  256. parent_shared_folder_id common.SharedFolderId?
  257. "The ID of the parent shared folder. This field is present only if the
  258. folder is contained within another shared folder."
  259. path_lower String?
  260. "The lower-cased full path of this shared folder. Absent for unmounted folders."
  261. example default
  262. access_type = owner
  263. is_inside_team_folder = false
  264. is_team_folder = false
  265. owner_team = default
  266. # NOTE: If you modify this struct, also modify InternalSharedFolderMetadata,
  267. # which is used by mobile
  268. struct SharedFolderMetadata extends SharedFolderMetadataBase
  269. "The metadata which includes basic information about the shared folder."
  270. link_metadata SharedContentLinkMetadata?
  271. "The metadata of the shared content link to this shared folder. Absent if there is no
  272. link on the folder. This is for an unreleased feature so it may not be returned yet."
  273. name String
  274. "The name of the this shared folder."
  275. permissions List(FolderPermission)?
  276. "Actions the current user may perform on the folder and its contents.
  277. The set of permissions corresponds to the FolderActions in the request."
  278. policy FolderPolicy
  279. "Policies governing this shared folder."
  280. preview_url String
  281. "URL for displaying a web preview of the shared folder."
  282. shared_folder_id common.SharedFolderId
  283. "The ID of the shared folder."
  284. time_invited common.DropboxTimestamp
  285. "Timestamp indicating when the current user was invited to this shared folder."
  286. example default
  287. path_lower = "/dir"
  288. link_metadata = default
  289. name = "dir"
  290. shared_folder_id = "84528192421"
  291. permissions = []
  292. access_type = owner
  293. is_inside_team_folder = false
  294. is_team_folder = false
  295. policy = default
  296. time_invited = "2016-01-20T00:00:00Z"
  297. preview_url = "https://www.dropbox.com/scl/fo/fir9vjelf"
  298. union SharedFolderAccessError
  299. "There is an error accessing the shared folder."
  300. invalid_id
  301. "This shared folder ID is invalid."
  302. not_a_member
  303. "The user is not a member of the shared folder
  304. thus cannot access it."
  305. email_unverified
  306. "The current user's e-mail address is unverified."
  307. unmounted
  308. "The shared folder is unmounted."
  309. struct MemberAccessLevelResult
  310. "Contains information about a member's access level to content after an operation."
  311. access_level AccessLevel?
  312. "The member still has this level of access to the content through a parent folder."
  313. warning String?
  314. "A localized string with additional information about why the user
  315. has this access level to the content."
  316. access_details List(ParentFolderAccessInfo)?
  317. "The parent folders that a member has access to. The field is present if the user
  318. has access to the first parent folder where the member gains access."
  319. example default
  320. struct ParentFolderAccessInfo
  321. "Contains information about a parent folder that a member has access to."
  322. folder_name String
  323. "Display name for the folder."
  324. shared_folder_id common.SharedFolderId
  325. "The identifier of the parent shared folder."
  326. permissions List(MemberPermission)
  327. "The user's permissions for the parent shared folder."
  328. path String
  329. "The full path to the parent shared folder relative to the acting user's root."
  330. example default
  331. folder_name = "Shared Folder"
  332. shared_folder_id = "84528192421"
  333. permissions = []
  334. path = "/Shared Folder"
  335. # --
  336. route list_folders(ListFoldersArgs, ListFoldersResult, Void)
  337. "Return the list of all shared folders the current user has access to.
  338. Apps must have full Dropbox access to use this endpoint."
  339. attrs
  340. owner = "sfi"
  341. struct ListFoldersArgs
  342. limit UInt32(min_value=1, max_value=1000) = 1000
  343. "The maximum number of results to return per request."
  344. actions List(FolderAction)?
  345. "A list of `FolderAction`s corresponding to `FolderPermission`s that should appear in the
  346. response's :field:`SharedFolderMetadata.permissions` field describing the actions the
  347. authenticated user can perform on the folder."
  348. example default
  349. limit = 100
  350. actions = []
  351. struct ListFoldersResult
  352. "Result for :route:`list_folders` or :route:`list_mountable_folders`, depending on which
  353. endpoint was requested.
  354. Unmounted shared folders can be identified by the absence of
  355. :field:`SharedFolderMetadata.path_lower`."
  356. entries List(SharedFolderMetadata)
  357. "List of all shared folders the authenticated user has access to."
  358. cursor String?
  359. "Present if there are additional shared folders that have not been returned yet. Pass the
  360. cursor into the corresponding continue endpoint (either :route:`list_folders/continue`
  361. or :route:`list_mountable_folders/continue`) to list additional folders."
  362. example default
  363. entries = [default]
  364. cursor = "ZtkX9_EHj3x7PMkVuFIhwKYXEpwpLwyxp9vMKomUhllil9q7eWiAu"
  365. # --
  366. route list_folders/continue(ListFoldersContinueArg, ListFoldersResult, ListFoldersContinueError)
  367. "Once a cursor has been retrieved from :route:`list_folders`, use this to paginate through all
  368. shared folders. The cursor must come from a previous call to :route:`list_folders` or
  369. :route:`list_folders/continue`.
  370. Apps must have full Dropbox access to use this endpoint."
  371. attrs
  372. owner = "sfi"
  373. struct ListFoldersContinueArg
  374. cursor String
  375. "The cursor returned by the previous API call specified in the endpoint description."
  376. example default
  377. cursor = "ZtkX9_EHj3x7PMkVuFIhwKYXEpwpLwyxp9vMKomUhllil9q7eWiAu"
  378. union ListFoldersContinueError
  379. invalid_cursor
  380. ":field:`ListFoldersContinueArg.cursor` is invalid."
  381. # --
  382. route list_mountable_folders(ListFoldersArgs, ListFoldersResult, Void)
  383. "Return the list of all shared folders the current user can mount or unmount.
  384. Apps must have full Dropbox access to use this endpoint."
  385. attrs
  386. owner = "sfi"
  387. # --
  388. route list_mountable_folders/continue(ListFoldersContinueArg, ListFoldersResult, ListFoldersContinueError)
  389. "Once a cursor has been retrieved from :route:`list_mountable_folders`, use this to paginate through all
  390. mountable shared folders. The cursor must come from a previous call to :route:`list_mountable_folders` or
  391. :route:`list_mountable_folders/continue`.
  392. Apps must have full Dropbox access to use this endpoint."
  393. attrs
  394. owner = "sfi"
  395. # --
  396. route get_folder_metadata(GetMetadataArgs, SharedFolderMetadata, SharedFolderAccessError)
  397. "Returns shared folder metadata by its folder ID.
  398. Apps must have full Dropbox access to use this endpoint."
  399. attrs
  400. owner = "sfi"
  401. api_group = "truelink-alpha"
  402. struct GetMetadataArgs
  403. shared_folder_id common.SharedFolderId
  404. "The ID for the shared folder."
  405. actions List(FolderAction)?
  406. "A list of `FolderAction`s corresponding to `FolderPermission`s that should appear in the
  407. response's :field:`SharedFolderMetadata.permissions` field describing the actions the
  408. authenticated user can perform on the folder."
  409. example default
  410. shared_folder_id = "84528192421"
  411. actions = []
  412. # --
  413. route list_folder_members(ListFolderMembersArgs, SharedFolderMembers, SharedFolderAccessError)
  414. "Returns shared folder membership by its folder ID.
  415. Apps must have full Dropbox access to use this endpoint."
  416. attrs
  417. owner = "sfi"
  418. struct ListFolderMembersCursorArg
  419. actions List(MemberAction)?
  420. "This is a list indicating whether each returned member will include a boolean value
  421. :field:`MemberPermission.allow` that describes whether the current user can perform
  422. the MemberAction on the member."
  423. limit UInt32(min_value=1, max_value=1000) = 1000
  424. "The maximum number of results that include members, groups and invitees to return per request."
  425. example default
  426. actions = []
  427. limit = 10
  428. struct ListFolderMembersArgs extends ListFolderMembersCursorArg
  429. shared_folder_id common.SharedFolderId
  430. "The ID for the shared folder."
  431. example default
  432. shared_folder_id = "84528192421"
  433. actions = []
  434. limit = 10
  435. struct SharedFolderMembers
  436. "Shared folder user and group membership."
  437. users List(UserMembershipInfo)
  438. "The list of user members of the shared folder."
  439. groups List(GroupMembershipInfo)
  440. "The list of group members of the shared folder."
  441. invitees List(InviteeMembershipInfo)
  442. "The list of invitees to the shared folder."
  443. cursor String?
  444. "Present if there are additional shared folder members that have not been returned yet. Pass
  445. the cursor into :route:`list_folder_members/continue` to list additional members."
  446. example default
  447. users = [default]
  448. groups = [default]
  449. invitees = [default]
  450. cursor = "ZtkX9_EHj3x7PMkVuFIhwKYXEpwpLwyxp9vMKomUhllil9q7eWiAu"
  451. # --
  452. route list_folder_members/continue(ListFolderMembersContinueArg, SharedFolderMembers, ListFolderMembersContinueError)
  453. "Once a cursor has been retrieved from :route:`list_folder_members`, use this to paginate
  454. through all shared folder members.
  455. Apps must have full Dropbox access to use this endpoint."
  456. attrs
  457. owner = "sfi"
  458. struct ListFolderMembersContinueArg
  459. cursor String
  460. "The cursor returned by your last call to :route:`list_folder_members` or
  461. :route:`list_folder_members/continue`."
  462. example default
  463. cursor = "ZtkX9_EHj3x7PMkVuFIhwKYXEpwpLwyxp9vMKomUhllil9q7eWiAu"
  464. union ListFolderMembersContinueError
  465. access_error SharedFolderAccessError
  466. invalid_cursor
  467. ":field:`ListFolderMembersContinueArg.cursor` is invalid."
  468. # --
  469. route share_folder(ShareFolderArg, ShareFolderLaunch, ShareFolderError )
  470. "Share a folder with collaborators.
  471. Most sharing will be completed synchronously. Large folders will be
  472. completed asynchronously. To make testing the async case repeatable, set
  473. `ShareFolderArg.force_async`.
  474. If a :field:`ShareFolderLaunch.async_job_id` is returned, you'll need to
  475. call :route:`check_share_job_status` until the action completes to get the
  476. metadata for the folder.
  477. Apps must have full Dropbox access to use this endpoint."
  478. attrs
  479. owner = "sfi"
  480. api_group = "truelink-alpha"
  481. struct ShareFolderArg
  482. path files.WritePath
  483. "The path to the folder to share. If it does not exist, then a new one
  484. is created."
  485. member_policy MemberPolicy?
  486. "Who can be a member of this shared folder. Only applicable if the
  487. current user is on a team."
  488. acl_update_policy AclUpdatePolicy?
  489. "Who can add and remove members of this shared folder."
  490. shared_link_policy SharedLinkPolicy?
  491. "The policy to apply to shared links created for content inside this
  492. shared folder. The current user must be on a team to set this policy to
  493. :field:`SharedLinkPolicy.members`."
  494. force_async Boolean = false
  495. "Whether to force the share to happen asynchronously."
  496. actions List(FolderAction)?
  497. "A list of `FolderAction`s corresponding to `FolderPermission`s that should appear in the
  498. response's :field:`SharedFolderMetadata.permissions` field describing the actions the
  499. authenticated user can perform on the folder."
  500. link_settings LinkSettings?
  501. "Settings on the link for this folder."
  502. viewer_info_policy ViewerInfoPolicy?
  503. "Who can enable/disable viewer info for this shared folder."
  504. example default
  505. path = "/example/workspace"
  506. member_policy = team
  507. acl_update_policy = editors
  508. shared_link_policy = members
  509. union ShareFolderErrorBase
  510. email_unverified
  511. "The current user's e-mail address is unverified."
  512. bad_path SharePathError
  513. ":field:`ShareFolderArg.path` is invalid."
  514. team_policy_disallows_member_policy
  515. "Team policy is more restrictive than :field:`ShareFolderArg.member_policy`."
  516. disallowed_shared_link_policy
  517. "The current user's account is not allowed to select the specified
  518. :field:`ShareFolderArg.shared_link_policy`."
  519. union ShareFolderError extends ShareFolderErrorBase
  520. no_permission
  521. "The current user does not have permission to perform this action."
  522. union SharePathError
  523. is_file
  524. "A file is at the specified path."
  525. inside_shared_folder
  526. "We do not support sharing a folder inside a shared folder."
  527. contains_shared_folder
  528. "We do not support shared folders that contain shared folders."
  529. contains_app_folder
  530. "We do not support shared folders that contain app folders."
  531. contains_team_folder
  532. "We do not support shared folders that contain team folders."
  533. is_app_folder
  534. "We do not support sharing an app folder."
  535. inside_app_folder
  536. "We do not support sharing a folder inside an app folder."
  537. is_public_folder
  538. "A public folder can't be shared this way. Use a public link instead."
  539. inside_public_folder
  540. "A folder inside a public folder can't be shared this way. Use a public
  541. link instead."
  542. already_shared SharedFolderMetadata
  543. "Folder is already shared. Contains metadata about the existing shared folder."
  544. invalid_path
  545. "Path is not valid."
  546. is_osx_package
  547. "We do not support sharing a Mac OS X package."
  548. inside_osx_package
  549. "We do not support sharing a folder inside a Mac OS X package."
  550. # --
  551. union_closed ShareFolderJobStatus extends async.PollResultBase
  552. complete SharedFolderMetadata
  553. "The share job has finished. The value is the metadata for the folder."
  554. failed ShareFolderError
  555. example default
  556. complete = default
  557. union_closed ShareFolderLaunch extends async.LaunchResultBase
  558. complete SharedFolderMetadata
  559. example default
  560. complete = default
  561. route check_share_job_status(async.PollArg, ShareFolderJobStatus, async.PollError)
  562. "Returns the status of an asynchronous job for sharing a folder.
  563. Apps must have full Dropbox access to use this endpoint."
  564. attrs
  565. owner = "sfi"
  566. union_closed JobStatus extends async.PollResultBase
  567. complete
  568. "The asynchronous job has finished."
  569. failed JobError
  570. "The asynchronous job returned an error."
  571. # --
  572. union SharedFolderMemberError
  573. invalid_dropbox_id
  574. "The target dropbox_id is invalid."
  575. not_a_member
  576. "The target dropbox_id is not a member of the shared folder."
  577. no_explicit_access MemberAccessLevelResult
  578. "The target member only has inherited access to the shared folder."
  579. union JobError
  580. "Error occurred while performing an asynchronous job from :route:`unshare_folder`
  581. or :route:`remove_folder_member`."
  582. unshare_folder_error UnshareFolderError
  583. "Error occurred while performing :route:`unshare_folder` action."
  584. remove_folder_member_error RemoveFolderMemberError
  585. "Error occurred while performing :route:`remove_folder_member` action."
  586. relinquish_folder_membership_error RelinquishFolderMembershipError
  587. "Error occurred while performing :route:`relinquish_folder_membership` action."
  588. route check_job_status(async.PollArg, JobStatus, async.PollError)
  589. "Returns the status of an asynchronous job.
  590. Apps must have full Dropbox access to use this endpoint."
  591. attrs
  592. owner = "sfi"
  593. # --
  594. route unshare_folder(UnshareFolderArg, async.LaunchEmptyResult, UnshareFolderError)
  595. "Allows a shared folder owner to unshare the folder.
  596. You'll need to call :route:`check_job_status` to determine if the action has
  597. completed successfully.
  598. Apps must have full Dropbox access to use this endpoint."
  599. attrs
  600. owner = "sfi"
  601. api_group = "truelink-alpha"
  602. struct UnshareFolderArg
  603. shared_folder_id common.SharedFolderId
  604. "The ID for the shared folder."
  605. leave_a_copy Boolean = false
  606. "If true, members of this shared folder will get a copy of this folder
  607. after it's unshared. Otherwise, it will be removed from their Dropbox.
  608. The current user, who is an owner, will always retain their copy."
  609. example default
  610. shared_folder_id = "84528192421"
  611. leave_a_copy = false
  612. union UnshareFolderError
  613. access_error SharedFolderAccessError
  614. team_folder
  615. "This action cannot be performed on a team shared folder."
  616. no_permission
  617. "The current user does not have permission to perform this action."
  618. too_many_files
  619. "This shared folder has too many files to be unshared."
  620. # --
  621. route transfer_folder(TransferFolderArg, Void, TransferFolderError)
  622. "Transfer ownership of a shared folder to a member of the shared folder.
  623. User must have :field:`AccessLevel.owner` access to the shared folder to perform a transfer.
  624. Apps must have full Dropbox access to use this endpoint."
  625. attrs
  626. owner = "sfi"
  627. struct TransferFolderArg
  628. shared_folder_id common.SharedFolderId
  629. "The ID for the shared folder."
  630. to_dropbox_id DropboxId
  631. "A account or team member ID to transfer ownership to."
  632. example default
  633. shared_folder_id = "84528192421"
  634. to_dropbox_id = "dbid:AAEufNrMPSPe0dMQijRP0N_aZtBJRm26W4Q"
  635. union TransferFolderError
  636. access_error SharedFolderAccessError
  637. invalid_dropbox_id
  638. ":field:`TransferFolderArg.to_dropbox_id` is invalid."
  639. new_owner_not_a_member
  640. "The new designated owner is not currently a member of the shared folder."
  641. new_owner_unmounted
  642. "The new designated owner has not added the folder to their Dropbox."
  643. new_owner_email_unverified
  644. "The new designated owner's e-mail address is unverified."
  645. team_folder
  646. "This action cannot be performed on a team shared folder."
  647. no_permission
  648. "The current user does not have permission to perform this action."
  649. # --
  650. route update_folder_policy(UpdateFolderPolicyArg, SharedFolderMetadata, UpdateFolderPolicyError)
  651. "Update the sharing policies for a shared folder.
  652. User must have :field:`AccessLevel.owner` access to the shared folder to update its policies.
  653. Apps must have full Dropbox access to use this endpoint."
  654. attrs
  655. owner = "sfi"
  656. api_group = "truelink-alpha"
  657. struct UpdateFolderPolicyArg
  658. "If any of the policies are unset, then they retain their current setting."
  659. shared_folder_id common.SharedFolderId
  660. "The ID for the shared folder."
  661. member_policy MemberPolicy?
  662. "Who can be a member of this shared folder. Only applicable if the
  663. current user is on a team."
  664. acl_update_policy AclUpdatePolicy?
  665. "Who can add and remove members of this shared folder."
  666. viewer_info_policy ViewerInfoPolicy?
  667. "Who can enable/disable viewer info for this shared folder."
  668. shared_link_policy SharedLinkPolicy?
  669. "The policy to apply to shared links created for content inside this
  670. shared folder. The current user must be on a team to set this policy to
  671. :field:`SharedLinkPolicy.members`."
  672. link_settings LinkSettings?
  673. "Settings on the link for this folder."
  674. actions List(FolderAction)?
  675. "A list of `FolderAction`s corresponding to `FolderPermission`s that should appear in the
  676. response's :field:`SharedFolderMetadata.permissions` field describing the actions the
  677. authenticated user can perform on the folder."
  678. example default
  679. shared_folder_id = "84528192421"
  680. member_policy = team
  681. acl_update_policy = owner
  682. shared_link_policy = members
  683. union UpdateFolderPolicyError
  684. access_error SharedFolderAccessError
  685. not_on_team
  686. ":field:`UpdateFolderPolicyArg.member_policy` was set even though user
  687. is not on a team."
  688. team_policy_disallows_member_policy
  689. "Team policy is more restrictive than :field:`ShareFolderArg.member_policy`."
  690. disallowed_shared_link_policy
  691. "The current account is not allowed to select the specified
  692. :field:`ShareFolderArg.shared_link_policy`."
  693. no_permission
  694. "The current user does not have permission to perform this action."
  695. team_folder
  696. "This action cannot be performed on a team shared folder."
  697. # --
  698. route add_folder_member(AddFolderMemberArg, Void, AddFolderMemberError)
  699. "Allows an owner or editor (if the ACL update policy allows) of a shared
  700. folder to add another member.
  701. For the new member to get access to all the functionality for this folder,
  702. you will need to call :route:`mount_folder` on their behalf.
  703. Apps must have full Dropbox access to use this endpoint."
  704. attrs
  705. owner = "sfi"
  706. struct AddFolderMemberArg
  707. shared_folder_id common.SharedFolderId
  708. "The ID for the shared folder."
  709. members List(AddMember)
  710. "The intended list of members to add. Added members will receive
  711. invites to join the shared folder."
  712. quiet Boolean = false
  713. "Whether added members should be notified via email and device
  714. notifications of their invite."
  715. custom_message String(min_length=1)?
  716. "Optional message to display to added members in their invitation."
  717. example default
  718. members = [default, account]
  719. shared_folder_id = "84528192421"
  720. custom_message = "Documentation for launch day"
  721. struct AddMember
  722. "The member and type of access the member should have when added to a shared folder."
  723. member MemberSelector
  724. "The member to add to the shared folder."
  725. access_level AccessLevel = viewer
  726. "The access level to grant :field:`member` to the shared folder. :field:`AccessLevel.owner`
  727. is disallowed."
  728. example default
  729. member = default
  730. access_level = editor
  731. example account
  732. member = account
  733. access_level = viewer
  734. union MemberSelector
  735. "Includes different ways to identify a member of a shared folder."
  736. dropbox_id DropboxId
  737. "Dropbox account, team member, or group ID of member."
  738. email common.EmailAddress
  739. "E-mail address of member."
  740. example default
  741. email = "justin@example.com"
  742. example account
  743. dropbox_id = "dbid:AAEufNrMPSPe0dMQijRP0N_aZtBJRm26W4Q"
  744. example group
  745. dropbox_id = "g:98d36ed08e6290c2e9d536a392f974ee"
  746. union AddFolderMemberError
  747. access_error SharedFolderAccessError
  748. "Unable to access shared folder."
  749. email_unverified
  750. "The current user's e-mail address is unverified."
  751. bad_member AddMemberSelectorError
  752. ":field:`AddFolderMemberArg.members` contains a bad invitation recipient."
  753. cant_share_outside_team
  754. "Your team policy does not allow sharing outside of the team."
  755. too_many_members UInt64
  756. "The value is the member limit that was reached."
  757. too_many_pending_invites UInt64
  758. "The value is the pending invite limit that was reached."
  759. rate_limit
  760. "The current user has hit the limit of invites they can send per day. Try again in 24 hours."
  761. too_many_invitees
  762. "The current user is trying to share with too many people at once."
  763. insufficient_plan
  764. "The current user's account doesn't support this action. An example of
  765. this is when adding a read-only member. This action can only be
  766. performed by users that have upgraded to a Pro or Business plan."
  767. team_folder
  768. "This action cannot be performed on a team shared folder."
  769. no_permission
  770. "The current user does not have permission to perform this action."
  771. example default
  772. no_permission = null
  773. example member
  774. bad_member = default
  775. union AddMemberSelectorError
  776. automatic_group
  777. "Automatically created groups can only be added to team folders."
  778. invalid_dropbox_id DropboxId
  779. "The value is the ID that could not be identified."
  780. invalid_email common.EmailAddress
  781. "The value is the e-email address that is malformed."
  782. unverified_dropbox_id DropboxId
  783. "The value is the ID of the Dropbox user with an unverified e-mail
  784. address. Invite unverified users by e-mail address instead of by their
  785. Dropbox ID."
  786. group_deleted
  787. "At least one of the specified groups in :field:`AddFolderMemberArg.members`
  788. is deleted."
  789. group_not_on_team
  790. "Sharing to a group that is not on the current user's team."
  791. example default
  792. invalid_dropbox_id = "dbid:AAEufNrMPSPe0dMQijRP0N_aZtBJRm26W4Q"
  793. # --
  794. route remove_folder_member(RemoveFolderMemberArg, async.LaunchResultBase, RemoveFolderMemberError)
  795. "Allows an owner or editor (if the ACL update policy allows) of a shared
  796. folder to remove another member.
  797. Apps must have full Dropbox access to use this endpoint."
  798. attrs
  799. owner = "sfi"
  800. struct RemoveFolderMemberArg
  801. shared_folder_id common.SharedFolderId
  802. "The ID for the shared folder."
  803. member MemberSelector
  804. "The member to remove from the folder."
  805. leave_a_copy Boolean
  806. "If true, the removed user will keep their copy of the folder after
  807. it's unshared, assuming it was mounted. Otherwise, it will be removed
  808. from their Dropbox. Also, this must be set to false when kicking a
  809. group."
  810. example default
  811. shared_folder_id = "84528192421"
  812. member = default
  813. leave_a_copy = false
  814. union RemoveFolderMemberError
  815. access_error SharedFolderAccessError
  816. member_error SharedFolderMemberError
  817. folder_owner
  818. "The target user is the owner of the shared folder. You can't remove
  819. this user until ownership has been transferred to another member."
  820. group_access
  821. "The target user has access to the shared folder via a group."
  822. team_folder
  823. "This action cannot be performed on a team shared folder."
  824. no_permission
  825. "The current user does not have permission to perform this action."
  826. union_closed RemoveMemberJobStatus extends async.PollResultBase
  827. complete MemberAccessLevelResult
  828. "Removing the folder member has finished. The value is information about
  829. whether the member has another form of access."
  830. failed RemoveFolderMemberError
  831. example default
  832. complete = default
  833. route check_remove_member_job_status(async.PollArg, RemoveMemberJobStatus, async.PollError)
  834. "Returns the status of an asynchronous job for sharing a folder.
  835. Apps must have full Dropbox access to use this endpoint."
  836. attrs
  837. owner = "sfi"
  838. # --
  839. route update_folder_member(UpdateFolderMemberArg, MemberAccessLevelResult, UpdateFolderMemberError)
  840. "Allows an owner or editor of a shared folder to update another member's
  841. permissions.
  842. Apps must have full Dropbox access to use this endpoint."
  843. attrs
  844. owner = "sfi"
  845. struct UpdateFolderMemberArg
  846. shared_folder_id common.SharedFolderId
  847. "The ID for the shared folder."
  848. member MemberSelector
  849. "The member of the shared folder to update. Only the
  850. :field:`MemberSelector.dropbox_id` may be set at this time."
  851. access_level AccessLevel
  852. "The new access level for :field:`member`. :field:`AccessLevel.owner`
  853. is disallowed."
  854. example default
  855. shared_folder_id = "84528192421"
  856. member = default
  857. access_level = editor
  858. union UpdateFolderMemberError
  859. access_error SharedFolderAccessError
  860. member_error SharedFolderMemberError
  861. no_explicit_access AddFolderMemberError
  862. "If updating the access type required the member to be added to the shared folder
  863. and there was an error when adding the member."
  864. insufficient_plan
  865. "The current user's account doesn't support this action. An example of
  866. this is when downgrading a member from editor to viewer. This action
  867. can only be performed by users that have upgraded to a Pro or Business
  868. plan."
  869. no_permission
  870. "The current user does not have permission to perform this action."
  871. # --
  872. route mount_folder(MountFolderArg, SharedFolderMetadata, MountFolderError)
  873. "The current user mounts the designated folder.
  874. Mount a shared folder for a user after they have been added as a member.
  875. Once mounted, the shared folder will appear in their Dropbox.
  876. Apps must have full Dropbox access to use this endpoint."
  877. attrs
  878. owner = "sfi"
  879. # TODO(kelkabany): Consider exposing mount path as an argument. More error
  880. # cases will be possible.
  881. struct MountFolderArg
  882. shared_folder_id common.SharedFolderId
  883. "The ID of the shared folder to mount."
  884. example default
  885. shared_folder_id = "84528192421"
  886. struct InsufficientQuotaAmounts
  887. space_needed UInt64
  888. "The amount of space needed to add the item (the size of the item)."
  889. space_shortage UInt64
  890. "The amount of extra space needed to add the item."
  891. space_left UInt64
  892. "The amount of space left in the user's Dropbox, less than space_needed."
  893. union MountFolderError
  894. access_error SharedFolderAccessError
  895. inside_shared_folder
  896. "Mounting would cause a shared folder to be inside another, which is
  897. disallowed."
  898. insufficient_quota InsufficientQuotaAmounts
  899. "The current user does not have enough space to mount the shared
  900. folder."
  901. already_mounted
  902. "The shared folder is already mounted."
  903. no_permission
  904. "The current user does not have permission to perform this action."
  905. not_mountable
  906. "The shared folder is not mountable. One example where this can occur
  907. is when the shared folder belongs within a team folder in the user's
  908. Dropbox."
  909. # --
  910. route unmount_folder(UnmountFolderArg, Void, UnmountFolderError)
  911. "The current user unmounts the designated folder. They can re-mount the
  912. folder at a later time using :route:`mount_folder`.
  913. Apps must have full Dropbox access to use this endpoint."
  914. attrs
  915. owner = "sfi"
  916. struct UnmountFolderArg
  917. shared_folder_id common.SharedFolderId
  918. "The ID for the shared folder."
  919. example default
  920. shared_folder_id = "84528192421"
  921. union UnmountFolderError
  922. access_error SharedFolderAccessError
  923. no_permission
  924. "The current user does not have permission to perform this action."
  925. not_unmountable
  926. "The shared folder can't be unmounted. One example where this can occur
  927. is when the shared folder's parent folder is also a shared folder that
  928. resides in the current user's Dropbox."
  929. # --
  930. route relinquish_folder_membership(RelinquishFolderMembershipArg, async.LaunchEmptyResult, RelinquishFolderMembershipError)
  931. "The current user relinquishes their membership in the designated shared
  932. folder and will no longer have access to the folder. A folder owner cannot
  933. relinquish membership in their own folder.
  934. This will run synchronously if leave_a_copy is false, and asynchronously
  935. if leave_a_copy is true.
  936. Apps must have full Dropbox access to use this endpoint."
  937. attrs
  938. owner = "sfi"
  939. struct RelinquishFolderMembershipArg
  940. shared_folder_id common.SharedFolderId
  941. "The ID for the shared folder."
  942. leave_a_copy Boolean = false
  943. "Keep a copy of the folder's contents upon relinquishing membership."
  944. example default
  945. shared_folder_id = "84528192421"
  946. leave_a_copy = false
  947. union RelinquishFolderMembershipError
  948. access_error SharedFolderAccessError
  949. folder_owner
  950. "The current user is the owner of the shared folder. Owners cannot relinquish membership to
  951. their own folders. Try unsharing or transferring ownership first."
  952. mounted
  953. "The shared folder is currently mounted. Unmount the shared folder before relinquishing
  954. membership."
  955. group_access
  956. "The current user has access to the shared folder via a group. You can't relinquish
  957. membership to folders shared via groups."
  958. team_folder
  959. "This action cannot be performed on a team shared folder."
  960. no_permission
  961. "The current user does not have permission to perform this action."
  962. no_explicit_access
  963. "The current user only has inherited access to the shared folder. You can't relinquish
  964. inherited membership to folders."