Skip to main content

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