dropbox_sdk/generated/async_routes/
sharing.rs

1// DO NOT EDIT
2// This file was @generated by Stone
3
4#![allow(
5    clippy::too_many_arguments,
6    clippy::large_enum_variant,
7    clippy::result_large_err,
8    clippy::doc_markdown,
9)]
10
11#[allow(unused_imports)]
12pub use crate::generated::types::sharing::*;
13
14/// Adds specified members to a file.
15pub fn add_file_member<'a>(
16    client: &'a impl crate::async_client_trait::UserAuthClient,
17    arg: &'a AddFileMemberArgs,
18) -> impl std::future::Future<Output=Result<Vec<FileMemberActionResult>, crate::Error<AddFileMemberError>>> + Send + 'a {
19    crate::client_helpers::request(
20        client,
21        crate::client_trait_common::Endpoint::Api,
22        crate::client_trait_common::Style::Rpc,
23        "sharing/add_file_member",
24        arg,
25        None)
26}
27
28/// Allows an owner or editor (if the ACL update policy allows) of a shared folder to add another
29/// member. For the new member to get access to all the functionality for this folder, you will need
30/// to call [`mount_folder()`](crate::sharing::mount_folder) on their behalf.
31pub fn add_folder_member<'a>(
32    client: &'a impl crate::async_client_trait::UserAuthClient,
33    arg: &'a AddFolderMemberArg,
34) -> impl std::future::Future<Output=Result<(), crate::Error<AddFolderMemberError>>> + Send + 'a {
35    crate::client_helpers::request(
36        client,
37        crate::client_trait_common::Endpoint::Api,
38        crate::client_trait_common::Style::Rpc,
39        "sharing/add_folder_member",
40        arg,
41        None)
42}
43
44/// Returns the status of an asynchronous job.
45pub fn check_job_status<'a>(
46    client: &'a impl crate::async_client_trait::UserAuthClient,
47    arg: &'a crate::types::dbx_async::PollArg,
48) -> impl std::future::Future<Output=Result<JobStatus, crate::Error<crate::types::dbx_async::PollError>>> + Send + 'a {
49    crate::client_helpers::request(
50        client,
51        crate::client_trait_common::Endpoint::Api,
52        crate::client_trait_common::Style::Rpc,
53        "sharing/check_job_status",
54        arg,
55        None)
56}
57
58/// Returns the status of an asynchronous job for sharing a folder.
59pub fn check_remove_member_job_status<'a>(
60    client: &'a impl crate::async_client_trait::UserAuthClient,
61    arg: &'a crate::types::dbx_async::PollArg,
62) -> impl std::future::Future<Output=Result<RemoveMemberJobStatus, crate::Error<crate::types::dbx_async::PollError>>> + Send + 'a {
63    crate::client_helpers::request(
64        client,
65        crate::client_trait_common::Endpoint::Api,
66        crate::client_trait_common::Style::Rpc,
67        "sharing/check_remove_member_job_status",
68        arg,
69        None)
70}
71
72/// Returns the status of an asynchronous job for sharing a folder.
73pub fn check_share_job_status<'a>(
74    client: &'a impl crate::async_client_trait::UserAuthClient,
75    arg: &'a crate::types::dbx_async::PollArg,
76) -> impl std::future::Future<Output=Result<ShareFolderJobStatus, crate::Error<crate::types::dbx_async::PollError>>> + Send + 'a {
77    crate::client_helpers::request(
78        client,
79        crate::client_trait_common::Endpoint::Api,
80        crate::client_trait_common::Style::Rpc,
81        "sharing/check_share_job_status",
82        arg,
83        None)
84}
85
86/// Create a shared link. If a shared link already exists for the given path, that link is returned.
87/// Previously, it was technically possible to break a shared link by moving or renaming the
88/// corresponding file or folder. In the future, this will no longer be the case, so your app
89/// shouldn't rely on this behavior. Instead, if your app needs to revoke a shared link, use
90/// [`revoke_shared_link()`](crate::sharing::revoke_shared_link).
91#[deprecated(note = "replaced by create_shared_link_with_settings")]
92pub fn create_shared_link<'a>(
93    client: &'a impl crate::async_client_trait::UserAuthClient,
94    arg: &'a CreateSharedLinkArg,
95) -> impl std::future::Future<Output=Result<PathLinkMetadata, crate::Error<CreateSharedLinkError>>> + Send + 'a {
96    crate::client_helpers::request(
97        client,
98        crate::client_trait_common::Endpoint::Api,
99        crate::client_trait_common::Style::Rpc,
100        "sharing/create_shared_link",
101        arg,
102        None)
103}
104
105/// Create a shared link with custom settings. If no settings are given then the default visibility
106/// is [`RequestedVisibility::Public`] (The resolved visibility, though, may depend on other aspects
107/// such as team and shared folder settings).
108pub fn create_shared_link_with_settings<'a>(
109    client: &'a impl crate::async_client_trait::UserAuthClient,
110    arg: &'a CreateSharedLinkWithSettingsArg,
111) -> impl std::future::Future<Output=Result<SharedLinkMetadata, crate::Error<CreateSharedLinkWithSettingsError>>> + Send + 'a {
112    crate::client_helpers::request(
113        client,
114        crate::client_trait_common::Endpoint::Api,
115        crate::client_trait_common::Style::Rpc,
116        "sharing/create_shared_link_with_settings",
117        arg,
118        None)
119}
120
121/// Returns shared file metadata.
122pub fn get_file_metadata<'a>(
123    client: &'a impl crate::async_client_trait::UserAuthClient,
124    arg: &'a GetFileMetadataArg,
125) -> impl std::future::Future<Output=Result<SharedFileMetadata, crate::Error<GetFileMetadataError>>> + Send + 'a {
126    crate::client_helpers::request(
127        client,
128        crate::client_trait_common::Endpoint::Api,
129        crate::client_trait_common::Style::Rpc,
130        "sharing/get_file_metadata",
131        arg,
132        None)
133}
134
135/// Returns shared file metadata.
136pub fn get_file_metadata_batch<'a>(
137    client: &'a impl crate::async_client_trait::UserAuthClient,
138    arg: &'a GetFileMetadataBatchArg,
139) -> impl std::future::Future<Output=Result<Vec<GetFileMetadataBatchResult>, crate::Error<SharingUserError>>> + Send + 'a {
140    crate::client_helpers::request(
141        client,
142        crate::client_trait_common::Endpoint::Api,
143        crate::client_trait_common::Style::Rpc,
144        "sharing/get_file_metadata/batch",
145        arg,
146        None)
147}
148
149/// Returns shared folder metadata by its folder ID.
150pub fn get_folder_metadata<'a>(
151    client: &'a impl crate::async_client_trait::UserAuthClient,
152    arg: &'a GetMetadataArgs,
153) -> impl std::future::Future<Output=Result<SharedFolderMetadata, crate::Error<SharedFolderAccessError>>> + Send + 'a {
154    crate::client_helpers::request(
155        client,
156        crate::client_trait_common::Endpoint::Api,
157        crate::client_trait_common::Style::Rpc,
158        "sharing/get_folder_metadata",
159        arg,
160        None)
161}
162
163/// Download the shared link's file from a user's Dropbox.
164pub fn get_shared_link_file<'a>(
165    client: &'a impl crate::async_client_trait::UserAuthClient,
166    arg: &'a GetSharedLinkFileArg,
167    range_start: Option<u64>,
168    range_end: Option<u64>,
169) -> impl std::future::Future<Output=Result<crate::async_client_trait::HttpRequestResult<SharedLinkMetadata>, crate::Error<GetSharedLinkFileError>>> + Send + 'a {
170    crate::client_helpers::request_with_body(
171        client,
172        crate::client_trait_common::Endpoint::Content,
173        crate::client_trait_common::Style::Download,
174        "sharing/get_shared_link_file",
175        arg,
176        None,
177        range_start,
178        range_end)
179}
180
181/// Get the shared link's metadata.
182pub fn get_shared_link_metadata<'a>(
183    client: &'a impl crate::async_client_trait::UserAuthClient,
184    arg: &'a GetSharedLinkMetadataArg,
185) -> impl std::future::Future<Output=Result<SharedLinkMetadata, crate::Error<SharedLinkError>>> + Send + 'a {
186    crate::client_helpers::request(
187        client,
188        crate::client_trait_common::Endpoint::Api,
189        crate::client_trait_common::Style::Rpc,
190        "sharing/get_shared_link_metadata",
191        arg,
192        None)
193}
194
195/// Get the shared link's metadata.
196pub fn get_shared_link_metadata_app_auth<'a>(
197    client: &'a impl crate::async_client_trait::AppAuthClient,
198    arg: &'a GetSharedLinkMetadataArg,
199) -> impl std::future::Future<Output=Result<SharedLinkMetadata, crate::Error<SharedLinkError>>> + Send + 'a {
200    crate::client_helpers::request(
201        client,
202        crate::client_trait_common::Endpoint::Api,
203        crate::client_trait_common::Style::Rpc,
204        "sharing/get_shared_link_metadata",
205        arg,
206        None)
207}
208
209/// Returns a list of [`LinkMetadata`] objects for this user, including collection links. If no path
210/// is given, returns a list of all shared links for the current user, including collection links,
211/// up to a maximum of 1000 links. If a non-empty path is given, returns a list of all shared links
212/// that allow access to the given path.  Collection links are never returned in this case.
213#[deprecated(note = "replaced by list_shared_links")]
214pub fn get_shared_links<'a>(
215    client: &'a impl crate::async_client_trait::UserAuthClient,
216    arg: &'a GetSharedLinksArg,
217) -> impl std::future::Future<Output=Result<GetSharedLinksResult, crate::Error<GetSharedLinksError>>> + Send + 'a {
218    crate::client_helpers::request(
219        client,
220        crate::client_trait_common::Endpoint::Api,
221        crate::client_trait_common::Style::Rpc,
222        "sharing/get_shared_links",
223        arg,
224        None)
225}
226
227/// Use to obtain the members who have been invited to a file, both inherited and uninherited
228/// members.
229pub fn list_file_members<'a>(
230    client: &'a impl crate::async_client_trait::UserAuthClient,
231    arg: &'a ListFileMembersArg,
232) -> impl std::future::Future<Output=Result<SharedFileMembers, crate::Error<ListFileMembersError>>> + Send + 'a {
233    crate::client_helpers::request(
234        client,
235        crate::client_trait_common::Endpoint::Api,
236        crate::client_trait_common::Style::Rpc,
237        "sharing/list_file_members",
238        arg,
239        None)
240}
241
242/// Get members of multiple files at once. The arguments to this route are more limited, and the
243/// limit on query result size per file is more strict. To customize the results more, use the
244/// individual file endpoint. Inherited users and groups are not included in the result, and
245/// permissions are not returned for this endpoint.
246pub fn list_file_members_batch<'a>(
247    client: &'a impl crate::async_client_trait::UserAuthClient,
248    arg: &'a ListFileMembersBatchArg,
249) -> impl std::future::Future<Output=Result<Vec<ListFileMembersBatchResult>, crate::Error<SharingUserError>>> + Send + 'a {
250    crate::client_helpers::request(
251        client,
252        crate::client_trait_common::Endpoint::Api,
253        crate::client_trait_common::Style::Rpc,
254        "sharing/list_file_members/batch",
255        arg,
256        None)
257}
258
259/// Once a cursor has been retrieved from [`list_file_members()`](crate::sharing::list_file_members)
260/// or [`list_file_members_batch()`](crate::sharing::list_file_members_batch), use this to paginate
261/// through all shared file members.
262pub fn list_file_members_continue<'a>(
263    client: &'a impl crate::async_client_trait::UserAuthClient,
264    arg: &'a ListFileMembersContinueArg,
265) -> impl std::future::Future<Output=Result<SharedFileMembers, crate::Error<ListFileMembersContinueError>>> + Send + 'a {
266    crate::client_helpers::request(
267        client,
268        crate::client_trait_common::Endpoint::Api,
269        crate::client_trait_common::Style::Rpc,
270        "sharing/list_file_members/continue",
271        arg,
272        None)
273}
274
275/// Returns shared folder membership by its folder ID.
276pub fn list_folder_members<'a>(
277    client: &'a impl crate::async_client_trait::UserAuthClient,
278    arg: &'a ListFolderMembersArgs,
279) -> impl std::future::Future<Output=Result<SharedFolderMembers, crate::Error<SharedFolderAccessError>>> + Send + 'a {
280    crate::client_helpers::request(
281        client,
282        crate::client_trait_common::Endpoint::Api,
283        crate::client_trait_common::Style::Rpc,
284        "sharing/list_folder_members",
285        arg,
286        None)
287}
288
289/// Once a cursor has been retrieved from
290/// [`list_folder_members()`](crate::sharing::list_folder_members), use this to paginate through all
291/// shared folder members.
292pub fn list_folder_members_continue<'a>(
293    client: &'a impl crate::async_client_trait::UserAuthClient,
294    arg: &'a ListFolderMembersContinueArg,
295) -> impl std::future::Future<Output=Result<SharedFolderMembers, crate::Error<ListFolderMembersContinueError>>> + Send + 'a {
296    crate::client_helpers::request(
297        client,
298        crate::client_trait_common::Endpoint::Api,
299        crate::client_trait_common::Style::Rpc,
300        "sharing/list_folder_members/continue",
301        arg,
302        None)
303}
304
305/// Return the list of all shared folders the current user has access to.
306pub fn list_folders<'a>(
307    client: &'a impl crate::async_client_trait::UserAuthClient,
308    arg: &'a ListFoldersArgs,
309) -> impl std::future::Future<Output=Result<ListFoldersResult, crate::Error<crate::NoError>>> + Send + 'a {
310    crate::client_helpers::request(
311        client,
312        crate::client_trait_common::Endpoint::Api,
313        crate::client_trait_common::Style::Rpc,
314        "sharing/list_folders",
315        arg,
316        None)
317}
318
319/// Once a cursor has been retrieved from [`list_folders()`](crate::sharing::list_folders), use this
320/// to paginate through all shared folders. The cursor must come from a previous call to
321/// [`list_folders()`](crate::sharing::list_folders) or
322/// [`list_folders_continue()`](crate::sharing::list_folders_continue).
323pub fn list_folders_continue<'a>(
324    client: &'a impl crate::async_client_trait::UserAuthClient,
325    arg: &'a ListFoldersContinueArg,
326) -> impl std::future::Future<Output=Result<ListFoldersResult, crate::Error<ListFoldersContinueError>>> + Send + 'a {
327    crate::client_helpers::request(
328        client,
329        crate::client_trait_common::Endpoint::Api,
330        crate::client_trait_common::Style::Rpc,
331        "sharing/list_folders/continue",
332        arg,
333        None)
334}
335
336/// Return the list of all shared folders the current user can mount or unmount.
337pub fn list_mountable_folders<'a>(
338    client: &'a impl crate::async_client_trait::UserAuthClient,
339    arg: &'a ListFoldersArgs,
340) -> impl std::future::Future<Output=Result<ListFoldersResult, crate::Error<crate::NoError>>> + Send + 'a {
341    crate::client_helpers::request(
342        client,
343        crate::client_trait_common::Endpoint::Api,
344        crate::client_trait_common::Style::Rpc,
345        "sharing/list_mountable_folders",
346        arg,
347        None)
348}
349
350/// Once a cursor has been retrieved from
351/// [`list_mountable_folders()`](crate::sharing::list_mountable_folders), use this to paginate
352/// through all mountable shared folders. The cursor must come from a previous call to
353/// [`list_mountable_folders()`](crate::sharing::list_mountable_folders) or
354/// [`list_mountable_folders_continue()`](crate::sharing::list_mountable_folders_continue).
355pub fn list_mountable_folders_continue<'a>(
356    client: &'a impl crate::async_client_trait::UserAuthClient,
357    arg: &'a ListFoldersContinueArg,
358) -> impl std::future::Future<Output=Result<ListFoldersResult, crate::Error<ListFoldersContinueError>>> + Send + 'a {
359    crate::client_helpers::request(
360        client,
361        crate::client_trait_common::Endpoint::Api,
362        crate::client_trait_common::Style::Rpc,
363        "sharing/list_mountable_folders/continue",
364        arg,
365        None)
366}
367
368/// Returns a list of all files shared with current user.  Does not include files the user has
369/// received via shared folders, and does  not include unclaimed invitations.
370pub fn list_received_files<'a>(
371    client: &'a impl crate::async_client_trait::UserAuthClient,
372    arg: &'a ListFilesArg,
373) -> impl std::future::Future<Output=Result<ListFilesResult, crate::Error<SharingUserError>>> + Send + 'a {
374    crate::client_helpers::request(
375        client,
376        crate::client_trait_common::Endpoint::Api,
377        crate::client_trait_common::Style::Rpc,
378        "sharing/list_received_files",
379        arg,
380        None)
381}
382
383/// Get more results with a cursor from
384/// [`list_received_files()`](crate::sharing::list_received_files).
385pub fn list_received_files_continue<'a>(
386    client: &'a impl crate::async_client_trait::UserAuthClient,
387    arg: &'a ListFilesContinueArg,
388) -> impl std::future::Future<Output=Result<ListFilesResult, crate::Error<ListFilesContinueError>>> + Send + 'a {
389    crate::client_helpers::request(
390        client,
391        crate::client_trait_common::Endpoint::Api,
392        crate::client_trait_common::Style::Rpc,
393        "sharing/list_received_files/continue",
394        arg,
395        None)
396}
397
398/// List shared links of this user. If no path is given, returns a list of all shared links for the
399/// current user. For members of business teams using team space and member folders, returns all
400/// shared links in the team member's home folder unless the team space ID is specified in the
401/// request header. For more information, refer to the [Namespace
402/// Guide](https://www.dropbox.com/developers/reference/namespace-guide). If a non-empty path is
403/// given, returns a list of all shared links that allow access to the given path - direct links to
404/// the given path and links to parent folders of the given path. Links to parent folders can be
405/// suppressed by setting direct_only to true.
406pub fn list_shared_links<'a>(
407    client: &'a impl crate::async_client_trait::UserAuthClient,
408    arg: &'a ListSharedLinksArg,
409) -> impl std::future::Future<Output=Result<ListSharedLinksResult, crate::Error<ListSharedLinksError>>> + Send + 'a {
410    crate::client_helpers::request(
411        client,
412        crate::client_trait_common::Endpoint::Api,
413        crate::client_trait_common::Style::Rpc,
414        "sharing/list_shared_links",
415        arg,
416        None)
417}
418
419/// Modify the shared link's settings. If the requested visibility conflict with the shared links
420/// policy of the team or the shared folder (in case the linked file is part of a shared folder)
421/// then the [`LinkPermissions::resolved_visibility`](LinkPermissions) of the returned
422/// [`SharedLinkMetadata`] will reflect the actual visibility of the shared link and the
423/// [`LinkPermissions::requested_visibility`](LinkPermissions) will reflect the requested
424/// visibility.
425pub fn modify_shared_link_settings<'a>(
426    client: &'a impl crate::async_client_trait::UserAuthClient,
427    arg: &'a ModifySharedLinkSettingsArgs,
428) -> impl std::future::Future<Output=Result<SharedLinkMetadata, crate::Error<ModifySharedLinkSettingsError>>> + Send + 'a {
429    crate::client_helpers::request(
430        client,
431        crate::client_trait_common::Endpoint::Api,
432        crate::client_trait_common::Style::Rpc,
433        "sharing/modify_shared_link_settings",
434        arg,
435        None)
436}
437
438/// The current user mounts the designated folder. Mount a shared folder for a user after they have
439/// been added as a member. Once mounted, the shared folder will appear in their Dropbox.
440pub fn mount_folder<'a>(
441    client: &'a impl crate::async_client_trait::UserAuthClient,
442    arg: &'a MountFolderArg,
443) -> impl std::future::Future<Output=Result<SharedFolderMetadata, crate::Error<MountFolderError>>> + Send + 'a {
444    crate::client_helpers::request(
445        client,
446        crate::client_trait_common::Endpoint::Api,
447        crate::client_trait_common::Style::Rpc,
448        "sharing/mount_folder",
449        arg,
450        None)
451}
452
453/// The current user relinquishes their membership in the designated file. Note that the current
454/// user may still have inherited access to this file through the parent folder.
455pub fn relinquish_file_membership<'a>(
456    client: &'a impl crate::async_client_trait::UserAuthClient,
457    arg: &'a RelinquishFileMembershipArg,
458) -> impl std::future::Future<Output=Result<(), crate::Error<RelinquishFileMembershipError>>> + Send + 'a {
459    crate::client_helpers::request(
460        client,
461        crate::client_trait_common::Endpoint::Api,
462        crate::client_trait_common::Style::Rpc,
463        "sharing/relinquish_file_membership",
464        arg,
465        None)
466}
467
468/// The current user relinquishes their membership in the designated shared folder and will no
469/// longer have access to the folder.  A folder owner cannot relinquish membership in their own
470/// folder. This will run synchronously if leave_a_copy is false, and asynchronously if leave_a_copy
471/// is true.
472pub fn relinquish_folder_membership<'a>(
473    client: &'a impl crate::async_client_trait::UserAuthClient,
474    arg: &'a RelinquishFolderMembershipArg,
475) -> impl std::future::Future<Output=Result<crate::types::dbx_async::LaunchEmptyResult, crate::Error<RelinquishFolderMembershipError>>> + Send + 'a {
476    crate::client_helpers::request(
477        client,
478        crate::client_trait_common::Endpoint::Api,
479        crate::client_trait_common::Style::Rpc,
480        "sharing/relinquish_folder_membership",
481        arg,
482        None)
483}
484
485/// Identical to remove_file_member_2 but with less information returned.
486#[deprecated(note = "replaced by remove_file_member_2")]
487pub fn remove_file_member<'a>(
488    client: &'a impl crate::async_client_trait::UserAuthClient,
489    arg: &'a RemoveFileMemberArg,
490) -> impl std::future::Future<Output=Result<FileMemberActionIndividualResult, crate::Error<RemoveFileMemberError>>> + Send + 'a {
491    crate::client_helpers::request(
492        client,
493        crate::client_trait_common::Endpoint::Api,
494        crate::client_trait_common::Style::Rpc,
495        "sharing/remove_file_member",
496        arg,
497        None)
498}
499
500/// Removes a specified member from the file.
501pub fn remove_file_member_2<'a>(
502    client: &'a impl crate::async_client_trait::UserAuthClient,
503    arg: &'a RemoveFileMemberArg,
504) -> impl std::future::Future<Output=Result<FileMemberRemoveActionResult, crate::Error<RemoveFileMemberError>>> + Send + 'a {
505    crate::client_helpers::request(
506        client,
507        crate::client_trait_common::Endpoint::Api,
508        crate::client_trait_common::Style::Rpc,
509        "sharing/remove_file_member_2",
510        arg,
511        None)
512}
513
514/// Allows an owner or editor (if the ACL update policy allows) of a shared folder to remove another
515/// member.
516pub fn remove_folder_member<'a>(
517    client: &'a impl crate::async_client_trait::UserAuthClient,
518    arg: &'a RemoveFolderMemberArg,
519) -> impl std::future::Future<Output=Result<crate::types::dbx_async::LaunchResultBase, crate::Error<RemoveFolderMemberError>>> + Send + 'a {
520    crate::client_helpers::request(
521        client,
522        crate::client_trait_common::Endpoint::Api,
523        crate::client_trait_common::Style::Rpc,
524        "sharing/remove_folder_member",
525        arg,
526        None)
527}
528
529/// Revoke a shared link. Note that even after revoking a shared link to a file, the file may be
530/// accessible if there are shared links leading to any of the file parent folders. To list all
531/// shared links that enable access to a specific file, you can use the
532/// [`list_shared_links()`](crate::sharing::list_shared_links) with the file as the
533/// [`ListSharedLinksArg::path`](ListSharedLinksArg) argument.
534pub fn revoke_shared_link<'a>(
535    client: &'a impl crate::async_client_trait::UserAuthClient,
536    arg: &'a RevokeSharedLinkArg,
537) -> impl std::future::Future<Output=Result<(), crate::Error<RevokeSharedLinkError>>> + Send + 'a {
538    crate::client_helpers::request(
539        client,
540        crate::client_trait_common::Endpoint::Api,
541        crate::client_trait_common::Style::Rpc,
542        "sharing/revoke_shared_link",
543        arg,
544        None)
545}
546
547/// Change the inheritance policy of an existing Shared Folder. Only permitted for shared folders in
548/// a shared team root. If a [`ShareFolderLaunch::AsyncJobId`] is returned, you'll need to call
549/// [`check_share_job_status()`](crate::sharing::check_share_job_status) until the action completes
550/// to get the metadata for the folder.
551pub fn set_access_inheritance<'a>(
552    client: &'a impl crate::async_client_trait::UserAuthClient,
553    arg: &'a SetAccessInheritanceArg,
554) -> impl std::future::Future<Output=Result<ShareFolderLaunch, crate::Error<SetAccessInheritanceError>>> + Send + 'a {
555    crate::client_helpers::request(
556        client,
557        crate::client_trait_common::Endpoint::Api,
558        crate::client_trait_common::Style::Rpc,
559        "sharing/set_access_inheritance",
560        arg,
561        None)
562}
563
564/// Share a folder with collaborators. Most sharing will be completed synchronously. Large folders
565/// will be completed asynchronously. To make testing the async case repeatable, set
566/// `ShareFolderArg.force_async`. If a [`ShareFolderLaunch::AsyncJobId`] is returned, you'll need to
567/// call [`check_share_job_status()`](crate::sharing::check_share_job_status) until the action
568/// completes to get the metadata for the folder.
569pub fn share_folder<'a>(
570    client: &'a impl crate::async_client_trait::UserAuthClient,
571    arg: &'a ShareFolderArg,
572) -> impl std::future::Future<Output=Result<ShareFolderLaunch, crate::Error<ShareFolderError>>> + Send + 'a {
573    crate::client_helpers::request(
574        client,
575        crate::client_trait_common::Endpoint::Api,
576        crate::client_trait_common::Style::Rpc,
577        "sharing/share_folder",
578        arg,
579        None)
580}
581
582/// Transfer ownership of a shared folder to a member of the shared folder. User must have
583/// [`AccessLevel::Owner`] access to the shared folder to perform a transfer.
584pub fn transfer_folder<'a>(
585    client: &'a impl crate::async_client_trait::UserAuthClient,
586    arg: &'a TransferFolderArg,
587) -> impl std::future::Future<Output=Result<(), crate::Error<TransferFolderError>>> + Send + 'a {
588    crate::client_helpers::request(
589        client,
590        crate::client_trait_common::Endpoint::Api,
591        crate::client_trait_common::Style::Rpc,
592        "sharing/transfer_folder",
593        arg,
594        None)
595}
596
597/// The current user unmounts the designated folder. They can re-mount the folder at a later time
598/// using [`mount_folder()`](crate::sharing::mount_folder).
599pub fn unmount_folder<'a>(
600    client: &'a impl crate::async_client_trait::UserAuthClient,
601    arg: &'a UnmountFolderArg,
602) -> impl std::future::Future<Output=Result<(), crate::Error<UnmountFolderError>>> + Send + 'a {
603    crate::client_helpers::request(
604        client,
605        crate::client_trait_common::Endpoint::Api,
606        crate::client_trait_common::Style::Rpc,
607        "sharing/unmount_folder",
608        arg,
609        None)
610}
611
612/// Remove all members from this file. Does not remove inherited members.
613pub fn unshare_file<'a>(
614    client: &'a impl crate::async_client_trait::UserAuthClient,
615    arg: &'a UnshareFileArg,
616) -> impl std::future::Future<Output=Result<(), crate::Error<UnshareFileError>>> + Send + 'a {
617    crate::client_helpers::request(
618        client,
619        crate::client_trait_common::Endpoint::Api,
620        crate::client_trait_common::Style::Rpc,
621        "sharing/unshare_file",
622        arg,
623        None)
624}
625
626/// Allows a shared folder owner to unshare the folder. You'll need to call
627/// [`check_job_status()`](crate::sharing::check_job_status) to determine if the action has
628/// completed successfully.
629pub fn unshare_folder<'a>(
630    client: &'a impl crate::async_client_trait::UserAuthClient,
631    arg: &'a UnshareFolderArg,
632) -> impl std::future::Future<Output=Result<crate::types::dbx_async::LaunchEmptyResult, crate::Error<UnshareFolderError>>> + Send + 'a {
633    crate::client_helpers::request(
634        client,
635        crate::client_trait_common::Endpoint::Api,
636        crate::client_trait_common::Style::Rpc,
637        "sharing/unshare_folder",
638        arg,
639        None)
640}
641
642/// Changes a member's access on a shared file.
643pub fn update_file_member<'a>(
644    client: &'a impl crate::async_client_trait::UserAuthClient,
645    arg: &'a UpdateFileMemberArgs,
646) -> impl std::future::Future<Output=Result<MemberAccessLevelResult, crate::Error<FileMemberActionError>>> + Send + 'a {
647    crate::client_helpers::request(
648        client,
649        crate::client_trait_common::Endpoint::Api,
650        crate::client_trait_common::Style::Rpc,
651        "sharing/update_file_member",
652        arg,
653        None)
654}
655
656/// Allows an owner or editor of a shared folder to update another member's permissions.
657pub fn update_folder_member<'a>(
658    client: &'a impl crate::async_client_trait::UserAuthClient,
659    arg: &'a UpdateFolderMemberArg,
660) -> impl std::future::Future<Output=Result<MemberAccessLevelResult, crate::Error<UpdateFolderMemberError>>> + Send + 'a {
661    crate::client_helpers::request(
662        client,
663        crate::client_trait_common::Endpoint::Api,
664        crate::client_trait_common::Style::Rpc,
665        "sharing/update_folder_member",
666        arg,
667        None)
668}
669
670/// Update the sharing policies for a shared folder. User must have [`AccessLevel::Owner`] access to
671/// the shared folder to update its policies.
672pub fn update_folder_policy<'a>(
673    client: &'a impl crate::async_client_trait::UserAuthClient,
674    arg: &'a UpdateFolderPolicyArg,
675) -> impl std::future::Future<Output=Result<SharedFolderMetadata, crate::Error<UpdateFolderPolicyError>>> + Send + 'a {
676    crate::client_helpers::request(
677        client,
678        crate::client_trait_common::Endpoint::Api,
679        crate::client_trait_common::Style::Rpc,
680        "sharing/update_folder_policy",
681        arg,
682        None)
683}
684