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