dropbox_sdk/generated/async_routes/
paper.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::paper::*;
13
14/// Marks the given Paper doc as archived. This action can be performed or undone by anyone with
15/// edit permissions to the doc. Note that this endpoint will continue to work for content created
16/// by users on the older version of Paper. To check which version of Paper a user is on, use
17/// /users/features/get_values. If the paper_as_files feature is enabled, then the user is running
18/// the new version of Paper. This endpoint will be retired in September 2020. Refer to the [Paper
19/// Migration Guide](https://www.dropbox.com/lp/developers/reference/paper-migration-guide) for more
20/// information.
21#[deprecated]
22pub fn docs_archive<'a>(
23    client: &'a impl crate::async_client_trait::UserAuthClient,
24    arg: &'a RefPaperDoc,
25) -> impl std::future::Future<Output=Result<(), crate::Error<DocLookupError>>> + Send + 'a {
26    crate::client_helpers::request(
27        client,
28        crate::client_trait_common::Endpoint::Api,
29        crate::client_trait_common::Style::Rpc,
30        "paper/docs/archive",
31        arg,
32        None)
33}
34
35/// Creates a new Paper doc with the provided content. Note that this endpoint will continue to work
36/// for content created by users on the older version of Paper. To check which version of Paper a
37/// user is on, use /users/features/get_values. If the paper_as_files feature is enabled, then the
38/// user is running the new version of Paper. This endpoint will be retired in September 2020. Refer
39/// to the [Paper Migration
40/// Guide](https://www.dropbox.com/lp/developers/reference/paper-migration-guide) for more
41/// information.
42#[deprecated]
43pub fn docs_create<'a>(
44    client: &'a impl crate::async_client_trait::UserAuthClient,
45    arg: &'a PaperDocCreateArgs,
46    body: bytes::Bytes,
47) -> impl std::future::Future<Output=Result<PaperDocCreateUpdateResult, crate::Error<PaperDocCreateError>>> + Send + 'a {
48    crate::client_helpers::request(
49        client,
50        crate::client_trait_common::Endpoint::Api,
51        crate::client_trait_common::Style::Upload,
52        "paper/docs/create",
53        arg,
54        Some(crate::client_helpers::Body::from(body)))
55}
56
57/// Exports and downloads Paper doc either as HTML or markdown. Note that this endpoint will
58/// continue to work for content created by users on the older version of Paper. To check which
59/// version of Paper a user is on, use /users/features/get_values. If the paper_as_files feature is
60/// enabled, then the user is running the new version of Paper. Refer to the [Paper Migration
61/// Guide](https://www.dropbox.com/lp/developers/reference/paper-migration-guide) for migration
62/// information.
63#[deprecated]
64pub fn docs_download<'a>(
65    client: &'a impl crate::async_client_trait::UserAuthClient,
66    arg: &'a PaperDocExport,
67    range_start: Option<u64>,
68    range_end: Option<u64>,
69) -> impl std::future::Future<Output=Result<crate::async_client_trait::HttpRequestResult<PaperDocExportResult>, crate::Error<DocLookupError>>> + Send + 'a {
70    crate::client_helpers::request_with_body(
71        client,
72        crate::client_trait_common::Endpoint::Api,
73        crate::client_trait_common::Style::Download,
74        "paper/docs/download",
75        arg,
76        None,
77        range_start,
78        range_end)
79}
80
81/// Lists the users who are explicitly invited to the Paper folder in which the Paper doc is
82/// contained. For private folders all users (including owner) shared on the folder are listed and
83/// for team folders all non-team users shared on the folder are returned. Note that this endpoint
84/// will continue to work for content created by users on the older version of Paper. To check which
85/// version of Paper a user is on, use /users/features/get_values. If the paper_as_files feature is
86/// enabled, then the user is running the new version of Paper. Refer to the [Paper Migration
87/// Guide](https://www.dropbox.com/lp/developers/reference/paper-migration-guide) for migration
88/// information.
89#[deprecated]
90pub fn docs_folder_users_list<'a>(
91    client: &'a impl crate::async_client_trait::UserAuthClient,
92    arg: &'a ListUsersOnFolderArgs,
93) -> impl std::future::Future<Output=Result<ListUsersOnFolderResponse, crate::Error<DocLookupError>>> + Send + 'a {
94    crate::client_helpers::request(
95        client,
96        crate::client_trait_common::Endpoint::Api,
97        crate::client_trait_common::Style::Rpc,
98        "paper/docs/folder_users/list",
99        arg,
100        None)
101}
102
103/// Once a cursor has been retrieved from
104/// [`docs_folder_users_list()`](crate::paper::docs_folder_users_list), use this to paginate through
105/// all users on the Paper folder. Note that this endpoint will continue to work for content created
106/// by users on the older version of Paper. To check which version of Paper a user is on, use
107/// /users/features/get_values. If the paper_as_files feature is enabled, then the user is running
108/// the new version of Paper. Refer to the [Paper Migration
109/// Guide](https://www.dropbox.com/lp/developers/reference/paper-migration-guide) for migration
110/// information.
111#[deprecated]
112pub fn docs_folder_users_list_continue<'a>(
113    client: &'a impl crate::async_client_trait::UserAuthClient,
114    arg: &'a ListUsersOnFolderContinueArgs,
115) -> impl std::future::Future<Output=Result<ListUsersOnFolderResponse, crate::Error<ListUsersCursorError>>> + Send + 'a {
116    crate::client_helpers::request(
117        client,
118        crate::client_trait_common::Endpoint::Api,
119        crate::client_trait_common::Style::Rpc,
120        "paper/docs/folder_users/list/continue",
121        arg,
122        None)
123}
124
125/// Retrieves folder information for the given Paper doc. This includes:   - folder sharing policy;
126/// permissions for subfolders are set by the top-level folder.   - full 'filepath', i.e. the list
127/// of folders (both folderId and folderName) from     the root folder to the folder directly
128/// containing the Paper doc.
129///
130/// If the Paper doc is not in any folder (aka unfiled) the response will be empty. Note that this
131/// endpoint will continue to work for content created by users on the older version of Paper. To
132/// check which version of Paper a user is on, use /users/features/get_values. If the paper_as_files
133/// feature is enabled, then the user is running the new version of Paper. Refer to the [Paper
134/// Migration Guide](https://www.dropbox.com/lp/developers/reference/paper-migration-guide) for
135/// migration information.
136#[deprecated]
137pub fn docs_get_folder_info<'a>(
138    client: &'a impl crate::async_client_trait::UserAuthClient,
139    arg: &'a RefPaperDoc,
140) -> impl std::future::Future<Output=Result<FoldersContainingPaperDoc, crate::Error<DocLookupError>>> + Send + 'a {
141    crate::client_helpers::request(
142        client,
143        crate::client_trait_common::Endpoint::Api,
144        crate::client_trait_common::Style::Rpc,
145        "paper/docs/get_folder_info",
146        arg,
147        None)
148}
149
150/// Return the list of all Paper docs according to the argument specifications. To iterate over
151/// through the full pagination, pass the cursor to
152/// [`docs_list_continue()`](crate::paper::docs_list_continue). Note that this endpoint will
153/// continue to work for content created by users on the older version of Paper. To check which
154/// version of Paper a user is on, use /users/features/get_values. If the paper_as_files feature is
155/// enabled, then the user is running the new version of Paper. Refer to the [Paper Migration
156/// Guide](https://www.dropbox.com/lp/developers/reference/paper-migration-guide) for migration
157/// information.
158#[deprecated]
159pub fn docs_list<'a>(
160    client: &'a impl crate::async_client_trait::UserAuthClient,
161    arg: &'a ListPaperDocsArgs,
162) -> impl std::future::Future<Output=Result<ListPaperDocsResponse, crate::Error<crate::NoError>>> + Send + 'a {
163    crate::client_helpers::request(
164        client,
165        crate::client_trait_common::Endpoint::Api,
166        crate::client_trait_common::Style::Rpc,
167        "paper/docs/list",
168        arg,
169        None)
170}
171
172/// Once a cursor has been retrieved from [`docs_list()`](crate::paper::docs_list), use this to
173/// paginate through all Paper doc. Note that this endpoint will continue to work for content
174/// created by users on the older version of Paper. To check which version of Paper a user is on,
175/// use /users/features/get_values. If the paper_as_files feature is enabled, then the user is
176/// running the new version of Paper. Refer to the [Paper Migration
177/// Guide](https://www.dropbox.com/lp/developers/reference/paper-migration-guide) for migration
178/// information.
179#[deprecated]
180pub fn docs_list_continue<'a>(
181    client: &'a impl crate::async_client_trait::UserAuthClient,
182    arg: &'a ListPaperDocsContinueArgs,
183) -> impl std::future::Future<Output=Result<ListPaperDocsResponse, crate::Error<ListDocsCursorError>>> + Send + 'a {
184    crate::client_helpers::request(
185        client,
186        crate::client_trait_common::Endpoint::Api,
187        crate::client_trait_common::Style::Rpc,
188        "paper/docs/list/continue",
189        arg,
190        None)
191}
192
193/// Permanently deletes the given Paper doc. This operation is final as the doc cannot be recovered.
194/// This action can be performed only by the doc owner. Note that this endpoint will continue to
195/// work for content created by users on the older version of Paper. To check which version of Paper
196/// a user is on, use /users/features/get_values. If the paper_as_files feature is enabled, then the
197/// user is running the new version of Paper. Refer to the [Paper Migration
198/// Guide](https://www.dropbox.com/lp/developers/reference/paper-migration-guide) for migration
199/// information.
200#[deprecated]
201pub fn docs_permanently_delete<'a>(
202    client: &'a impl crate::async_client_trait::UserAuthClient,
203    arg: &'a RefPaperDoc,
204) -> impl std::future::Future<Output=Result<(), crate::Error<DocLookupError>>> + Send + 'a {
205    crate::client_helpers::request(
206        client,
207        crate::client_trait_common::Endpoint::Api,
208        crate::client_trait_common::Style::Rpc,
209        "paper/docs/permanently_delete",
210        arg,
211        None)
212}
213
214/// Gets the default sharing policy for the given Paper doc. Note that this endpoint will continue
215/// to work for content created by users on the older version of Paper. To check which version of
216/// Paper a user is on, use /users/features/get_values. If the paper_as_files feature is enabled,
217/// then the user is running the new version of Paper. Refer to the [Paper Migration
218/// Guide](https://www.dropbox.com/lp/developers/reference/paper-migration-guide) for migration
219/// information.
220#[deprecated]
221pub fn docs_sharing_policy_get<'a>(
222    client: &'a impl crate::async_client_trait::UserAuthClient,
223    arg: &'a RefPaperDoc,
224) -> impl std::future::Future<Output=Result<SharingPolicy, crate::Error<DocLookupError>>> + Send + 'a {
225    crate::client_helpers::request(
226        client,
227        crate::client_trait_common::Endpoint::Api,
228        crate::client_trait_common::Style::Rpc,
229        "paper/docs/sharing_policy/get",
230        arg,
231        None)
232}
233
234/// Sets the default sharing policy for the given Paper doc. The default 'team_sharing_policy' can
235/// be changed only by teams, omit this field for personal accounts. The 'public_sharing_policy'
236/// policy can't be set to the value 'disabled' because this setting can be changed only via the
237/// team admin console. Note that this endpoint will continue to work for content created by users
238/// on the older version of Paper. To check which version of Paper a user is on, use
239/// /users/features/get_values. If the paper_as_files feature is enabled, then the user is running
240/// the new version of Paper. Refer to the [Paper Migration
241/// Guide](https://www.dropbox.com/lp/developers/reference/paper-migration-guide) for migration
242/// information.
243#[deprecated]
244pub fn docs_sharing_policy_set<'a>(
245    client: &'a impl crate::async_client_trait::UserAuthClient,
246    arg: &'a PaperDocSharingPolicy,
247) -> impl std::future::Future<Output=Result<(), crate::Error<DocLookupError>>> + Send + 'a {
248    crate::client_helpers::request(
249        client,
250        crate::client_trait_common::Endpoint::Api,
251        crate::client_trait_common::Style::Rpc,
252        "paper/docs/sharing_policy/set",
253        arg,
254        None)
255}
256
257/// Updates an existing Paper doc with the provided content. Note that this endpoint will continue
258/// to work for content created by users on the older version of Paper. To check which version of
259/// Paper a user is on, use /users/features/get_values. If the paper_as_files feature is enabled,
260/// then the user is running the new version of Paper. This endpoint will be retired in September
261/// 2020. Refer to the [Paper Migration
262/// Guide](https://www.dropbox.com/lp/developers/reference/paper-migration-guide) for more
263/// information.
264#[deprecated]
265pub fn docs_update<'a>(
266    client: &'a impl crate::async_client_trait::UserAuthClient,
267    arg: &'a PaperDocUpdateArgs,
268    body: bytes::Bytes,
269) -> impl std::future::Future<Output=Result<PaperDocCreateUpdateResult, crate::Error<PaperDocUpdateError>>> + Send + 'a {
270    crate::client_helpers::request(
271        client,
272        crate::client_trait_common::Endpoint::Api,
273        crate::client_trait_common::Style::Upload,
274        "paper/docs/update",
275        arg,
276        Some(crate::client_helpers::Body::from(body)))
277}
278
279/// Allows an owner or editor to add users to a Paper doc or change their permissions using their
280/// email address or Dropbox account ID. The doc owner's permissions cannot be changed. Note that
281/// this endpoint will continue to work for content created by users on the older version of Paper.
282/// To check which version of Paper a user is on, use /users/features/get_values. If the
283/// paper_as_files feature is enabled, then the user is running the new version of Paper. Refer to
284/// the [Paper Migration
285/// Guide](https://www.dropbox.com/lp/developers/reference/paper-migration-guide) for migration
286/// information.
287#[deprecated]
288pub fn docs_users_add<'a>(
289    client: &'a impl crate::async_client_trait::UserAuthClient,
290    arg: &'a AddPaperDocUser,
291) -> impl std::future::Future<Output=Result<Vec<AddPaperDocUserMemberResult>, crate::Error<DocLookupError>>> + Send + 'a {
292    crate::client_helpers::request(
293        client,
294        crate::client_trait_common::Endpoint::Api,
295        crate::client_trait_common::Style::Rpc,
296        "paper/docs/users/add",
297        arg,
298        None)
299}
300
301/// Lists all users who visited the Paper doc or users with explicit access. This call excludes
302/// users who have been removed. The list is sorted by the date of the visit or the share date. The
303/// list will include both users, the explicitly shared ones as well as those who came in using the
304/// Paper url link. Note that this endpoint will continue to work for content created by users on
305/// the older version of Paper. To check which version of Paper a user is on, use
306/// /users/features/get_values. If the paper_as_files feature is enabled, then the user is running
307/// the new version of Paper. Refer to the [Paper Migration
308/// Guide](https://www.dropbox.com/lp/developers/reference/paper-migration-guide) for migration
309/// information.
310#[deprecated]
311pub fn docs_users_list<'a>(
312    client: &'a impl crate::async_client_trait::UserAuthClient,
313    arg: &'a ListUsersOnPaperDocArgs,
314) -> impl std::future::Future<Output=Result<ListUsersOnPaperDocResponse, crate::Error<DocLookupError>>> + Send + 'a {
315    crate::client_helpers::request(
316        client,
317        crate::client_trait_common::Endpoint::Api,
318        crate::client_trait_common::Style::Rpc,
319        "paper/docs/users/list",
320        arg,
321        None)
322}
323
324/// Once a cursor has been retrieved from [`docs_users_list()`](crate::paper::docs_users_list), use
325/// this to paginate through all users on the Paper doc. Note that this endpoint will continue to
326/// work for content created by users on the older version of Paper. To check which version of Paper
327/// a user is on, use /users/features/get_values. If the paper_as_files feature is enabled, then the
328/// user is running the new version of Paper. Refer to the [Paper Migration
329/// Guide](https://www.dropbox.com/lp/developers/reference/paper-migration-guide) for migration
330/// information.
331#[deprecated]
332pub fn docs_users_list_continue<'a>(
333    client: &'a impl crate::async_client_trait::UserAuthClient,
334    arg: &'a ListUsersOnPaperDocContinueArgs,
335) -> impl std::future::Future<Output=Result<ListUsersOnPaperDocResponse, crate::Error<ListUsersCursorError>>> + Send + 'a {
336    crate::client_helpers::request(
337        client,
338        crate::client_trait_common::Endpoint::Api,
339        crate::client_trait_common::Style::Rpc,
340        "paper/docs/users/list/continue",
341        arg,
342        None)
343}
344
345/// Allows an owner or editor to remove users from a Paper doc using their email address or Dropbox
346/// account ID. The doc owner cannot be removed. Note that this endpoint will continue to work for
347/// content created by users on the older version of Paper. To check which version of Paper a user
348/// is on, use /users/features/get_values. If the paper_as_files feature is enabled, then the user
349/// is running the new version of Paper. Refer to the [Paper Migration
350/// Guide](https://www.dropbox.com/lp/developers/reference/paper-migration-guide) for migration
351/// information.
352#[deprecated]
353pub fn docs_users_remove<'a>(
354    client: &'a impl crate::async_client_trait::UserAuthClient,
355    arg: &'a RemovePaperDocUser,
356) -> impl std::future::Future<Output=Result<(), crate::Error<DocLookupError>>> + Send + 'a {
357    crate::client_helpers::request(
358        client,
359        crate::client_trait_common::Endpoint::Api,
360        crate::client_trait_common::Style::Rpc,
361        "paper/docs/users/remove",
362        arg,
363        None)
364}
365
366/// Create a new Paper folder with the provided info. Note that this endpoint will continue to work
367/// for content created by users on the older version of Paper. To check which version of Paper a
368/// user is on, use /users/features/get_values. If the paper_as_files feature is enabled, then the
369/// user is running the new version of Paper. Refer to the [Paper Migration
370/// Guide](https://www.dropbox.com/lp/developers/reference/paper-migration-guide) for migration
371/// information.
372#[deprecated]
373pub fn folders_create<'a>(
374    client: &'a impl crate::async_client_trait::UserAuthClient,
375    arg: &'a PaperFolderCreateArg,
376) -> impl std::future::Future<Output=Result<PaperFolderCreateResult, crate::Error<PaperFolderCreateError>>> + Send + 'a {
377    crate::client_helpers::request(
378        client,
379        crate::client_trait_common::Endpoint::Api,
380        crate::client_trait_common::Style::Rpc,
381        "paper/folders/create",
382        arg,
383        None)
384}
385