dropbox_sdk/generated/async_routes/
files.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::files::*;
13
14/// Returns the metadata for a file or folder. This is an alpha endpoint compatible with the
15/// properties API. Note: Metadata for the root folder is unsupported.
16///
17/// # Stability
18/// *PREVIEW*: This function may change or disappear without notice.
19#[cfg(feature = "unstable")]
20#[cfg_attr(docsrs, doc(cfg(feature = "unstable")))]
21#[deprecated(note = "replaced by get_metadata")]
22pub fn alpha_get_metadata<'a>(
23    client: &'a impl crate::async_client_trait::UserAuthClient,
24    arg: &'a AlphaGetMetadataArg,
25) -> impl std::future::Future<Output=Result<Metadata, crate::Error<AlphaGetMetadataError>>> + Send + 'a {
26    crate::client_helpers::request(
27        client,
28        crate::client_trait_common::Endpoint::Api,
29        crate::client_trait_common::Style::Rpc,
30        "files/alpha/get_metadata",
31        arg,
32        None)
33}
34
35/// Create a new file with the contents provided in the request. Note that the behavior of this
36/// alpha endpoint is unstable and subject to change. Do not use this to upload a file larger than
37/// 150 MB. Instead, create an upload session with
38/// [`upload_session_start()`](crate::files::upload_session_start).
39///
40/// # Stability
41/// *PREVIEW*: This function may change or disappear without notice.
42#[cfg(feature = "unstable")]
43#[cfg_attr(docsrs, doc(cfg(feature = "unstable")))]
44#[deprecated(note = "replaced by upload")]
45pub fn alpha_upload<'a>(
46    client: &'a impl crate::async_client_trait::UserAuthClient,
47    arg: &'a UploadArg,
48    body: bytes::Bytes,
49) -> impl std::future::Future<Output=Result<FileMetadata, crate::Error<UploadError>>> + Send + 'a {
50    crate::client_helpers::request(
51        client,
52        crate::client_trait_common::Endpoint::Content,
53        crate::client_trait_common::Style::Upload,
54        "files/alpha/upload",
55        arg,
56        Some(crate::client_helpers::Body::from(body)))
57}
58
59/// Copy a file or folder to a different location in the user's Dropbox. If the source path is a
60/// folder all its contents will be copied.
61pub fn copy_v2<'a>(
62    client: &'a impl crate::async_client_trait::UserAuthClient,
63    arg: &'a RelocationArg,
64) -> impl std::future::Future<Output=Result<RelocationResult, crate::Error<RelocationError>>> + Send + 'a {
65    crate::client_helpers::request(
66        client,
67        crate::client_trait_common::Endpoint::Api,
68        crate::client_trait_common::Style::Rpc,
69        "files/copy_v2",
70        arg,
71        None)
72}
73
74/// Copy a file or folder to a different location in the user's Dropbox. If the source path is a
75/// folder all its contents will be copied.
76#[deprecated(note = "replaced by copy_v2")]
77pub fn copy<'a>(
78    client: &'a impl crate::async_client_trait::UserAuthClient,
79    arg: &'a RelocationArg,
80) -> impl std::future::Future<Output=Result<Metadata, crate::Error<RelocationError>>> + Send + 'a {
81    crate::client_helpers::request(
82        client,
83        crate::client_trait_common::Endpoint::Api,
84        crate::client_trait_common::Style::Rpc,
85        "files/copy",
86        arg,
87        None)
88}
89
90/// Copy multiple files or folders to different locations at once in the user's Dropbox. This route
91/// will replace [`copy_batch()`](crate::files::copy_batch). The main difference is this route will
92/// return status for each entry, while [`copy_batch()`](crate::files::copy_batch) raises failure if
93/// any entry fails. This route will either finish synchronously, or return a job ID and do the
94/// async copy job in background. Please use
95/// [`copy_batch_check_v2()`](crate::files::copy_batch_check_v2) to check the job status.
96pub fn copy_batch_v2<'a>(
97    client: &'a impl crate::async_client_trait::UserAuthClient,
98    arg: &'a CopyBatchArg,
99) -> impl std::future::Future<Output=Result<RelocationBatchV2Launch, crate::Error<crate::NoError>>> + Send + 'a {
100    crate::client_helpers::request(
101        client,
102        crate::client_trait_common::Endpoint::Api,
103        crate::client_trait_common::Style::Rpc,
104        "files/copy_batch_v2",
105        arg,
106        None)
107}
108
109/// Copy multiple files or folders to different locations at once in the user's Dropbox. This route
110/// will return job ID immediately and do the async copy job in background. Please use
111/// [`copy_batch_check()`](crate::files::copy_batch_check) to check the job status.
112#[deprecated(note = "replaced by copy_batch_v2")]
113pub fn copy_batch<'a>(
114    client: &'a impl crate::async_client_trait::UserAuthClient,
115    arg: &'a RelocationBatchArg,
116) -> impl std::future::Future<Output=Result<RelocationBatchLaunch, crate::Error<crate::NoError>>> + Send + 'a {
117    crate::client_helpers::request(
118        client,
119        crate::client_trait_common::Endpoint::Api,
120        crate::client_trait_common::Style::Rpc,
121        "files/copy_batch",
122        arg,
123        None)
124}
125
126/// Returns the status of an asynchronous job for [`copy_batch_v2()`](crate::files::copy_batch_v2).
127/// It returns list of results for each entry.
128pub fn copy_batch_check_v2<'a>(
129    client: &'a impl crate::async_client_trait::UserAuthClient,
130    arg: &'a crate::types::dbx_async::PollArg,
131) -> impl std::future::Future<Output=Result<RelocationBatchV2JobStatus, crate::Error<crate::types::dbx_async::PollError>>> + Send + 'a {
132    crate::client_helpers::request(
133        client,
134        crate::client_trait_common::Endpoint::Api,
135        crate::client_trait_common::Style::Rpc,
136        "files/copy_batch/check_v2",
137        arg,
138        None)
139}
140
141/// Returns the status of an asynchronous job for [`copy_batch()`](crate::files::copy_batch). If
142/// success, it returns list of results for each entry.
143#[deprecated(note = "replaced by copy_batch_check_v2")]
144pub fn copy_batch_check<'a>(
145    client: &'a impl crate::async_client_trait::UserAuthClient,
146    arg: &'a crate::types::dbx_async::PollArg,
147) -> impl std::future::Future<Output=Result<RelocationBatchJobStatus, crate::Error<crate::types::dbx_async::PollError>>> + Send + 'a {
148    crate::client_helpers::request(
149        client,
150        crate::client_trait_common::Endpoint::Api,
151        crate::client_trait_common::Style::Rpc,
152        "files/copy_batch/check",
153        arg,
154        None)
155}
156
157/// Get a copy reference to a file or folder. This reference string can be used to save that file or
158/// folder to another user's Dropbox by passing it to
159/// [`copy_reference_save()`](crate::files::copy_reference_save).
160pub fn copy_reference_get<'a>(
161    client: &'a impl crate::async_client_trait::UserAuthClient,
162    arg: &'a GetCopyReferenceArg,
163) -> impl std::future::Future<Output=Result<GetCopyReferenceResult, crate::Error<GetCopyReferenceError>>> + Send + 'a {
164    crate::client_helpers::request(
165        client,
166        crate::client_trait_common::Endpoint::Api,
167        crate::client_trait_common::Style::Rpc,
168        "files/copy_reference/get",
169        arg,
170        None)
171}
172
173/// Save a copy reference returned by [`copy_reference_get()`](crate::files::copy_reference_get) to
174/// the user's Dropbox.
175pub fn copy_reference_save<'a>(
176    client: &'a impl crate::async_client_trait::UserAuthClient,
177    arg: &'a SaveCopyReferenceArg,
178) -> impl std::future::Future<Output=Result<SaveCopyReferenceResult, crate::Error<SaveCopyReferenceError>>> + Send + 'a {
179    crate::client_helpers::request(
180        client,
181        crate::client_trait_common::Endpoint::Api,
182        crate::client_trait_common::Style::Rpc,
183        "files/copy_reference/save",
184        arg,
185        None)
186}
187
188/// Create a folder at a given path.
189pub fn create_folder_v2<'a>(
190    client: &'a impl crate::async_client_trait::UserAuthClient,
191    arg: &'a CreateFolderArg,
192) -> impl std::future::Future<Output=Result<CreateFolderResult, crate::Error<CreateFolderError>>> + Send + 'a {
193    crate::client_helpers::request(
194        client,
195        crate::client_trait_common::Endpoint::Api,
196        crate::client_trait_common::Style::Rpc,
197        "files/create_folder_v2",
198        arg,
199        None)
200}
201
202/// Create a folder at a given path.
203#[deprecated(note = "replaced by create_folder_v2")]
204pub fn create_folder<'a>(
205    client: &'a impl crate::async_client_trait::UserAuthClient,
206    arg: &'a CreateFolderArg,
207) -> impl std::future::Future<Output=Result<FolderMetadata, crate::Error<CreateFolderError>>> + Send + 'a {
208    crate::client_helpers::request(
209        client,
210        crate::client_trait_common::Endpoint::Api,
211        crate::client_trait_common::Style::Rpc,
212        "files/create_folder",
213        arg,
214        None)
215}
216
217/// Create multiple folders at once. This route is asynchronous for large batches, which returns a
218/// job ID immediately and runs the create folder batch asynchronously. Otherwise, creates the
219/// folders and returns the result synchronously for smaller inputs. You can force asynchronous
220/// behaviour by using the [`CreateFolderBatchArg::force_async`](CreateFolderBatchArg) flag.  Use
221/// [`create_folder_batch_check()`](crate::files::create_folder_batch_check) to check the job
222/// status.
223pub fn create_folder_batch<'a>(
224    client: &'a impl crate::async_client_trait::UserAuthClient,
225    arg: &'a CreateFolderBatchArg,
226) -> impl std::future::Future<Output=Result<CreateFolderBatchLaunch, crate::Error<crate::NoError>>> + Send + 'a {
227    crate::client_helpers::request(
228        client,
229        crate::client_trait_common::Endpoint::Api,
230        crate::client_trait_common::Style::Rpc,
231        "files/create_folder_batch",
232        arg,
233        None)
234}
235
236/// Returns the status of an asynchronous job for
237/// [`create_folder_batch()`](crate::files::create_folder_batch). If success, it returns list of
238/// result for each entry.
239pub fn create_folder_batch_check<'a>(
240    client: &'a impl crate::async_client_trait::UserAuthClient,
241    arg: &'a crate::types::dbx_async::PollArg,
242) -> impl std::future::Future<Output=Result<CreateFolderBatchJobStatus, crate::Error<crate::types::dbx_async::PollError>>> + Send + 'a {
243    crate::client_helpers::request(
244        client,
245        crate::client_trait_common::Endpoint::Api,
246        crate::client_trait_common::Style::Rpc,
247        "files/create_folder_batch/check",
248        arg,
249        None)
250}
251
252/// Delete the file or folder at a given path. If the path is a folder, all its contents will be
253/// deleted too. A successful response indicates that the file or folder was deleted. The returned
254/// metadata will be the corresponding [`FileMetadata`] or [`FolderMetadata`] for the item at time
255/// of deletion, and not a [`DeletedMetadata`] object.
256pub fn delete_v2<'a>(
257    client: &'a impl crate::async_client_trait::UserAuthClient,
258    arg: &'a DeleteArg,
259) -> impl std::future::Future<Output=Result<DeleteResult, crate::Error<DeleteError>>> + Send + 'a {
260    crate::client_helpers::request(
261        client,
262        crate::client_trait_common::Endpoint::Api,
263        crate::client_trait_common::Style::Rpc,
264        "files/delete_v2",
265        arg,
266        None)
267}
268
269/// Delete the file or folder at a given path. If the path is a folder, all its contents will be
270/// deleted too. A successful response indicates that the file or folder was deleted. The returned
271/// metadata will be the corresponding [`FileMetadata`] or [`FolderMetadata`] for the item at time
272/// of deletion, and not a [`DeletedMetadata`] object.
273#[deprecated(note = "replaced by delete_v2")]
274pub fn delete<'a>(
275    client: &'a impl crate::async_client_trait::UserAuthClient,
276    arg: &'a DeleteArg,
277) -> impl std::future::Future<Output=Result<Metadata, crate::Error<DeleteError>>> + Send + 'a {
278    crate::client_helpers::request(
279        client,
280        crate::client_trait_common::Endpoint::Api,
281        crate::client_trait_common::Style::Rpc,
282        "files/delete",
283        arg,
284        None)
285}
286
287/// Delete multiple files/folders at once. This route is asynchronous, which returns a job ID
288/// immediately and runs the delete batch asynchronously. Use
289/// [`delete_batch_check()`](crate::files::delete_batch_check) to check the job status.
290pub fn delete_batch<'a>(
291    client: &'a impl crate::async_client_trait::UserAuthClient,
292    arg: &'a DeleteBatchArg,
293) -> impl std::future::Future<Output=Result<DeleteBatchLaunch, crate::Error<crate::NoError>>> + Send + 'a {
294    crate::client_helpers::request(
295        client,
296        crate::client_trait_common::Endpoint::Api,
297        crate::client_trait_common::Style::Rpc,
298        "files/delete_batch",
299        arg,
300        None)
301}
302
303/// Returns the status of an asynchronous job for [`delete_batch()`](crate::files::delete_batch). If
304/// success, it returns list of result for each entry.
305pub fn delete_batch_check<'a>(
306    client: &'a impl crate::async_client_trait::UserAuthClient,
307    arg: &'a crate::types::dbx_async::PollArg,
308) -> impl std::future::Future<Output=Result<DeleteBatchJobStatus, crate::Error<crate::types::dbx_async::PollError>>> + Send + 'a {
309    crate::client_helpers::request(
310        client,
311        crate::client_trait_common::Endpoint::Api,
312        crate::client_trait_common::Style::Rpc,
313        "files/delete_batch/check",
314        arg,
315        None)
316}
317
318/// Download a file from a user's Dropbox.
319pub fn download<'a>(
320    client: &'a impl crate::async_client_trait::UserAuthClient,
321    arg: &'a DownloadArg,
322    range_start: Option<u64>,
323    range_end: Option<u64>,
324) -> impl std::future::Future<Output=Result<crate::async_client_trait::HttpRequestResult<FileMetadata>, crate::Error<DownloadError>>> + Send + 'a {
325    crate::client_helpers::request_with_body(
326        client,
327        crate::client_trait_common::Endpoint::Content,
328        crate::client_trait_common::Style::Download,
329        "files/download",
330        arg,
331        None,
332        range_start,
333        range_end)
334}
335
336/// Download a folder from the user's Dropbox, as a zip file. The folder must be less than 20 GB in
337/// size and any single file within must be less than 4 GB in size. The resulting zip must have
338/// fewer than 10,000 total file and folder entries, including the top level folder. The input
339/// cannot be a single file. Note: this endpoint does not support HTTP range requests.
340pub fn download_zip<'a>(
341    client: &'a impl crate::async_client_trait::UserAuthClient,
342    arg: &'a DownloadZipArg,
343    range_start: Option<u64>,
344    range_end: Option<u64>,
345) -> impl std::future::Future<Output=Result<crate::async_client_trait::HttpRequestResult<DownloadZipResult>, crate::Error<DownloadZipError>>> + Send + 'a {
346    crate::client_helpers::request_with_body(
347        client,
348        crate::client_trait_common::Endpoint::Content,
349        crate::client_trait_common::Style::Download,
350        "files/download_zip",
351        arg,
352        None,
353        range_start,
354        range_end)
355}
356
357/// Export a file from a user's Dropbox. This route only supports exporting files that cannot be
358/// downloaded directly  and whose [`ExportResult::file_metadata`](ExportResult) has
359/// [`ExportInfo::export_as`](ExportInfo) populated.
360///
361/// # Stability
362/// *PREVIEW*: This function may change or disappear without notice.
363#[cfg(feature = "unstable")]
364#[cfg_attr(docsrs, doc(cfg(feature = "unstable")))]
365pub fn export<'a>(
366    client: &'a impl crate::async_client_trait::UserAuthClient,
367    arg: &'a ExportArg,
368    range_start: Option<u64>,
369    range_end: Option<u64>,
370) -> impl std::future::Future<Output=Result<crate::async_client_trait::HttpRequestResult<ExportResult>, crate::Error<ExportError>>> + Send + 'a {
371    crate::client_helpers::request_with_body(
372        client,
373        crate::client_trait_common::Endpoint::Content,
374        crate::client_trait_common::Style::Download,
375        "files/export",
376        arg,
377        None,
378        range_start,
379        range_end)
380}
381
382/// Return the lock metadata for the given list of paths.
383pub fn get_file_lock_batch<'a>(
384    client: &'a impl crate::async_client_trait::UserAuthClient,
385    arg: &'a LockFileBatchArg,
386) -> impl std::future::Future<Output=Result<LockFileBatchResult, crate::Error<LockFileError>>> + Send + 'a {
387    crate::client_helpers::request(
388        client,
389        crate::client_trait_common::Endpoint::Api,
390        crate::client_trait_common::Style::Rpc,
391        "files/get_file_lock_batch",
392        arg,
393        None)
394}
395
396/// Returns the metadata for a file or folder. Note: Metadata for the root folder is unsupported.
397pub fn get_metadata<'a>(
398    client: &'a impl crate::async_client_trait::UserAuthClient,
399    arg: &'a GetMetadataArg,
400) -> impl std::future::Future<Output=Result<Metadata, crate::Error<GetMetadataError>>> + Send + 'a {
401    crate::client_helpers::request(
402        client,
403        crate::client_trait_common::Endpoint::Api,
404        crate::client_trait_common::Style::Rpc,
405        "files/get_metadata",
406        arg,
407        None)
408}
409
410/// Get a preview for a file. Currently, PDF previews are generated for files with the following
411/// extensions: .ai, .doc, .docm, .docx, .eps, .gdoc, .gslides, .odp, .odt, .pps, .ppsm, .ppsx,
412/// .ppt, .pptm, .pptx, .rtf. HTML previews are generated for files with the following extensions:
413/// .csv, .ods, .xls, .xlsm, .gsheet, .xlsx. Other formats will return an unsupported extension
414/// error.
415pub fn get_preview<'a>(
416    client: &'a impl crate::async_client_trait::UserAuthClient,
417    arg: &'a PreviewArg,
418    range_start: Option<u64>,
419    range_end: Option<u64>,
420) -> impl std::future::Future<Output=Result<crate::async_client_trait::HttpRequestResult<FileMetadata>, crate::Error<PreviewError>>> + Send + 'a {
421    crate::client_helpers::request_with_body(
422        client,
423        crate::client_trait_common::Endpoint::Content,
424        crate::client_trait_common::Style::Download,
425        "files/get_preview",
426        arg,
427        None,
428        range_start,
429        range_end)
430}
431
432/// Get a temporary link to stream content of a file. This link will expire in four hours and
433/// afterwards you will get 410 Gone. This URL should not be used to display content directly in the
434/// browser. The Content-Type of the link is determined automatically by the file's mime type.
435pub fn get_temporary_link<'a>(
436    client: &'a impl crate::async_client_trait::UserAuthClient,
437    arg: &'a GetTemporaryLinkArg,
438) -> impl std::future::Future<Output=Result<GetTemporaryLinkResult, crate::Error<GetTemporaryLinkError>>> + Send + 'a {
439    crate::client_helpers::request(
440        client,
441        crate::client_trait_common::Endpoint::Api,
442        crate::client_trait_common::Style::Rpc,
443        "files/get_temporary_link",
444        arg,
445        None)
446}
447
448/// Get a one-time use temporary upload link to upload a file to a Dropbox location.
449///
450/// This endpoint acts as a delayed [`upload()`](crate::files::upload). The returned temporary
451/// upload link may be used to make a POST request with the data to be uploaded. The upload will
452/// then be perfomed with the [`CommitInfo`] previously provided to
453/// [`get_temporary_upload_link()`](crate::files::get_temporary_upload_link) but evaluated only upon
454/// consumption. Hence, errors stemming from invalid [`CommitInfo`] with respect to the state of the
455/// user's Dropbox will only be communicated at consumption time. Additionally, these errors are
456/// surfaced as generic HTTP 409 Conflict responses, potentially hiding issue details. The maximum
457/// temporary upload link duration is 4 hours. Upon consumption or expiration, a new link will have
458/// to be generated. Multiple links may exist for a specific upload path at any given time.
459///
460/// The POST request on the temporary upload link must have its Content-Type set to
461/// "application/octet-stream".
462///
463/// Example temporary upload link consumption request:
464///
465/// curl -X POST https://content.dropboxapi.com/apitul/1/bNi2uIYF51cVBND --header "Content-Type:
466/// application/octet-stream" --data-binary @local_file.txt
467///
468/// A successful temporary upload link consumption request returns the content hash of the uploaded
469/// data in JSON format.
470///
471/// Example successful temporary upload link consumption response: {"content-hash":
472/// "599d71033d700ac892a0e48fa61b125d2f5994"}
473///
474/// An unsuccessful temporary upload link consumption request returns any of the following status
475/// codes:
476///
477/// HTTP 400 Bad Request: Content-Type is not one of application/octet-stream and text/plain or
478/// request is invalid. HTTP 409 Conflict: The temporary upload link does not exist or is currently
479/// unavailable, the upload failed, or another error happened. HTTP 410 Gone: The temporary upload
480/// link is expired or consumed.
481///
482/// Example unsuccessful temporary upload link consumption response: Temporary upload link has been
483/// recently consumed.
484pub fn get_temporary_upload_link<'a>(
485    client: &'a impl crate::async_client_trait::UserAuthClient,
486    arg: &'a GetTemporaryUploadLinkArg,
487) -> impl std::future::Future<Output=Result<GetTemporaryUploadLinkResult, crate::Error<crate::NoError>>> + Send + 'a {
488    crate::client_helpers::request(
489        client,
490        crate::client_trait_common::Endpoint::Api,
491        crate::client_trait_common::Style::Rpc,
492        "files/get_temporary_upload_link",
493        arg,
494        None)
495}
496
497/// Get a thumbnail for an image. This method currently supports files with the following file
498/// extensions: jpg, jpeg, png, tiff, tif, gif, webp, ppm and bmp. Photos that are larger than 20MB
499/// in size won't be converted to a thumbnail.
500pub fn get_thumbnail<'a>(
501    client: &'a impl crate::async_client_trait::UserAuthClient,
502    arg: &'a ThumbnailArg,
503    range_start: Option<u64>,
504    range_end: Option<u64>,
505) -> impl std::future::Future<Output=Result<crate::async_client_trait::HttpRequestResult<FileMetadata>, crate::Error<ThumbnailError>>> + Send + 'a {
506    crate::client_helpers::request_with_body(
507        client,
508        crate::client_trait_common::Endpoint::Content,
509        crate::client_trait_common::Style::Download,
510        "files/get_thumbnail",
511        arg,
512        None,
513        range_start,
514        range_end)
515}
516
517/// Get a thumbnail for an image. This method currently supports files with the following file
518/// extensions: jpg, jpeg, png, tiff, tif, gif, webp, ppm and bmp. Photos that are larger than 20MB
519/// in size won't be converted to a thumbnail.
520pub fn get_thumbnail_v2<'a>(
521    client: &'a impl crate::async_client_trait::UserAuthClient,
522    arg: &'a ThumbnailV2Arg,
523    range_start: Option<u64>,
524    range_end: Option<u64>,
525) -> impl std::future::Future<Output=Result<crate::async_client_trait::HttpRequestResult<PreviewResult>, crate::Error<ThumbnailV2Error>>> + Send + 'a {
526    crate::client_helpers::request_with_body(
527        client,
528        crate::client_trait_common::Endpoint::Content,
529        crate::client_trait_common::Style::Download,
530        "files/get_thumbnail_v2",
531        arg,
532        None,
533        range_start,
534        range_end)
535}
536
537/// Get a thumbnail for an image. This method currently supports files with the following file
538/// extensions: jpg, jpeg, png, tiff, tif, gif, webp, ppm and bmp. Photos that are larger than 20MB
539/// in size won't be converted to a thumbnail.
540pub fn get_thumbnail_v2_app_auth<'a>(
541    client: &'a impl crate::async_client_trait::AppAuthClient,
542    arg: &'a ThumbnailV2Arg,
543    range_start: Option<u64>,
544    range_end: Option<u64>,
545) -> impl std::future::Future<Output=Result<crate::async_client_trait::HttpRequestResult<PreviewResult>, crate::Error<ThumbnailV2Error>>> + Send + 'a {
546    crate::client_helpers::request_with_body(
547        client,
548        crate::client_trait_common::Endpoint::Content,
549        crate::client_trait_common::Style::Download,
550        "files/get_thumbnail_v2",
551        arg,
552        None,
553        range_start,
554        range_end)
555}
556
557/// Get thumbnails for a list of images. We allow up to 25 thumbnails in a single batch. This method
558/// currently supports files with the following file extensions: jpg, jpeg, png, tiff, tif, gif,
559/// webp, ppm and bmp. Photos that are larger than 20MB in size won't be converted to a thumbnail.
560pub fn get_thumbnail_batch<'a>(
561    client: &'a impl crate::async_client_trait::UserAuthClient,
562    arg: &'a GetThumbnailBatchArg,
563) -> impl std::future::Future<Output=Result<GetThumbnailBatchResult, crate::Error<GetThumbnailBatchError>>> + Send + 'a {
564    crate::client_helpers::request(
565        client,
566        crate::client_trait_common::Endpoint::Content,
567        crate::client_trait_common::Style::Rpc,
568        "files/get_thumbnail_batch",
569        arg,
570        None)
571}
572
573/// Starts returning the contents of a folder. If the result's
574/// [`ListFolderResult::has_more`](ListFolderResult) field is `true`, call
575/// [`list_folder_continue()`](crate::files::list_folder_continue) with the returned
576/// [`ListFolderResult::cursor`](ListFolderResult) to retrieve more entries. If you're using
577/// [`ListFolderArg::recursive`](ListFolderArg) set to `true` to keep a local cache of the contents
578/// of a Dropbox account, iterate through each entry in order and process them as follows to keep
579/// your local state in sync: For each [`FileMetadata`], store the new entry at the given path in
580/// your local state. If the required parent folders don't exist yet, create them. If there's
581/// already something else at the given path, replace it and remove all its children. For each
582/// [`FolderMetadata`], store the new entry at the given path in your local state. If the required
583/// parent folders don't exist yet, create them. If there's already something else at the given
584/// path, replace it but leave the children as they are. Check the new entry's
585/// [`FolderSharingInfo::read_only`](FolderSharingInfo) and set all its children's read-only
586/// statuses to match. For each [`DeletedMetadata`], if your local state has something at the given
587/// path, remove it and all its children. If there's nothing at the given path, ignore this entry.
588/// Note: [`auth::RateLimitError`](crate::types::auth::RateLimitError) may be returned if multiple
589/// [`list_folder()`](crate::files::list_folder) or
590/// [`list_folder_continue()`](crate::files::list_folder_continue) calls with same parameters are
591/// made simultaneously by same API app for same user. If your app implements retry logic, please
592/// hold off the retry until the previous request finishes.
593pub fn list_folder<'a>(
594    client: &'a impl crate::async_client_trait::UserAuthClient,
595    arg: &'a ListFolderArg,
596) -> impl std::future::Future<Output=Result<ListFolderResult, crate::Error<ListFolderError>>> + Send + 'a {
597    crate::client_helpers::request(
598        client,
599        crate::client_trait_common::Endpoint::Api,
600        crate::client_trait_common::Style::Rpc,
601        "files/list_folder",
602        arg,
603        None)
604}
605
606/// Starts returning the contents of a folder. If the result's
607/// [`ListFolderResult::has_more`](ListFolderResult) field is `true`, call
608/// [`list_folder_continue()`](crate::files::list_folder_continue) with the returned
609/// [`ListFolderResult::cursor`](ListFolderResult) to retrieve more entries. If you're using
610/// [`ListFolderArg::recursive`](ListFolderArg) set to `true` to keep a local cache of the contents
611/// of a Dropbox account, iterate through each entry in order and process them as follows to keep
612/// your local state in sync: For each [`FileMetadata`], store the new entry at the given path in
613/// your local state. If the required parent folders don't exist yet, create them. If there's
614/// already something else at the given path, replace it and remove all its children. For each
615/// [`FolderMetadata`], store the new entry at the given path in your local state. If the required
616/// parent folders don't exist yet, create them. If there's already something else at the given
617/// path, replace it but leave the children as they are. Check the new entry's
618/// [`FolderSharingInfo::read_only`](FolderSharingInfo) and set all its children's read-only
619/// statuses to match. For each [`DeletedMetadata`], if your local state has something at the given
620/// path, remove it and all its children. If there's nothing at the given path, ignore this entry.
621/// Note: [`auth::RateLimitError`](crate::types::auth::RateLimitError) may be returned if multiple
622/// [`list_folder()`](crate::files::list_folder) or
623/// [`list_folder_continue()`](crate::files::list_folder_continue) calls with same parameters are
624/// made simultaneously by same API app for same user. If your app implements retry logic, please
625/// hold off the retry until the previous request finishes.
626pub fn list_folder_app_auth<'a>(
627    client: &'a impl crate::async_client_trait::AppAuthClient,
628    arg: &'a ListFolderArg,
629) -> impl std::future::Future<Output=Result<ListFolderResult, crate::Error<ListFolderError>>> + Send + 'a {
630    crate::client_helpers::request(
631        client,
632        crate::client_trait_common::Endpoint::Api,
633        crate::client_trait_common::Style::Rpc,
634        "files/list_folder",
635        arg,
636        None)
637}
638
639/// Once a cursor has been retrieved from [`list_folder()`](crate::files::list_folder), use this to
640/// paginate through all files and retrieve updates to the folder, following the same rules as
641/// documented for [`list_folder()`](crate::files::list_folder).
642pub fn list_folder_continue<'a>(
643    client: &'a impl crate::async_client_trait::UserAuthClient,
644    arg: &'a ListFolderContinueArg,
645) -> impl std::future::Future<Output=Result<ListFolderResult, crate::Error<ListFolderContinueError>>> + Send + 'a {
646    crate::client_helpers::request(
647        client,
648        crate::client_trait_common::Endpoint::Api,
649        crate::client_trait_common::Style::Rpc,
650        "files/list_folder/continue",
651        arg,
652        None)
653}
654
655/// Once a cursor has been retrieved from [`list_folder()`](crate::files::list_folder), use this to
656/// paginate through all files and retrieve updates to the folder, following the same rules as
657/// documented for [`list_folder()`](crate::files::list_folder).
658pub fn list_folder_continue_app_auth<'a>(
659    client: &'a impl crate::async_client_trait::AppAuthClient,
660    arg: &'a ListFolderContinueArg,
661) -> impl std::future::Future<Output=Result<ListFolderResult, crate::Error<ListFolderContinueError>>> + Send + 'a {
662    crate::client_helpers::request(
663        client,
664        crate::client_trait_common::Endpoint::Api,
665        crate::client_trait_common::Style::Rpc,
666        "files/list_folder/continue",
667        arg,
668        None)
669}
670
671/// A way to quickly get a cursor for the folder's state. Unlike
672/// [`list_folder()`](crate::files::list_folder),
673/// [`list_folder_get_latest_cursor()`](crate::files::list_folder_get_latest_cursor) doesn't return
674/// any entries. This endpoint is for app which only needs to know about new files and modifications
675/// and doesn't need to know about files that already exist in Dropbox.
676pub fn list_folder_get_latest_cursor<'a>(
677    client: &'a impl crate::async_client_trait::UserAuthClient,
678    arg: &'a ListFolderArg,
679) -> impl std::future::Future<Output=Result<ListFolderGetLatestCursorResult, crate::Error<ListFolderError>>> + Send + 'a {
680    crate::client_helpers::request(
681        client,
682        crate::client_trait_common::Endpoint::Api,
683        crate::client_trait_common::Style::Rpc,
684        "files/list_folder/get_latest_cursor",
685        arg,
686        None)
687}
688
689/// A longpoll endpoint to wait for changes on an account. In conjunction with
690/// [`list_folder_continue()`](crate::files::list_folder_continue), this call gives you a
691/// low-latency way to monitor an account for file changes. The connection will block until there
692/// are changes available or a timeout occurs. This endpoint is useful mostly for client-side apps.
693/// If you're looking for server-side notifications, check out our [webhooks
694/// documentation](https://www.dropbox.com/developers/reference/webhooks).
695pub fn list_folder_longpoll<'a>(
696    client: &'a impl crate::async_client_trait::NoauthClient,
697    arg: &'a ListFolderLongpollArg,
698) -> impl std::future::Future<Output=Result<ListFolderLongpollResult, crate::Error<ListFolderLongpollError>>> + Send + 'a {
699    crate::client_helpers::request(
700        client,
701        crate::client_trait_common::Endpoint::Notify,
702        crate::client_trait_common::Style::Rpc,
703        "files/list_folder/longpoll",
704        arg,
705        None)
706}
707
708/// Returns revisions for files based on a file path or a file id. The file path or file id is
709/// identified from the latest file entry at the given file path or id. This end point allows your
710/// app to query either by file path or file id by setting the mode parameter appropriately. In the
711/// [`ListRevisionsMode::Path`] (default) mode, all revisions at the same file path as the latest
712/// file entry are returned. If revisions with the same file id are desired, then mode must be set
713/// to [`ListRevisionsMode::Id`]. The [`ListRevisionsMode::Id`] mode is useful to retrieve revisions
714/// for a given file across moves or renames.
715pub fn list_revisions<'a>(
716    client: &'a impl crate::async_client_trait::UserAuthClient,
717    arg: &'a ListRevisionsArg,
718) -> impl std::future::Future<Output=Result<ListRevisionsResult, crate::Error<ListRevisionsError>>> + Send + 'a {
719    crate::client_helpers::request(
720        client,
721        crate::client_trait_common::Endpoint::Api,
722        crate::client_trait_common::Style::Rpc,
723        "files/list_revisions",
724        arg,
725        None)
726}
727
728/// Lock the files at the given paths. A locked file will be writable only by the lock holder. A
729/// successful response indicates that the file has been locked. Returns a list of the locked file
730/// paths and their metadata after this operation.
731pub fn lock_file_batch<'a>(
732    client: &'a impl crate::async_client_trait::UserAuthClient,
733    arg: &'a LockFileBatchArg,
734) -> impl std::future::Future<Output=Result<LockFileBatchResult, crate::Error<LockFileError>>> + Send + 'a {
735    crate::client_helpers::request(
736        client,
737        crate::client_trait_common::Endpoint::Api,
738        crate::client_trait_common::Style::Rpc,
739        "files/lock_file_batch",
740        arg,
741        None)
742}
743
744/// Move a file or folder to a different location in the user's Dropbox. If the source path is a
745/// folder all its contents will be moved. Note that we do not currently support case-only renaming.
746pub fn move_v2<'a>(
747    client: &'a impl crate::async_client_trait::UserAuthClient,
748    arg: &'a RelocationArg,
749) -> impl std::future::Future<Output=Result<RelocationResult, crate::Error<RelocationError>>> + Send + 'a {
750    crate::client_helpers::request(
751        client,
752        crate::client_trait_common::Endpoint::Api,
753        crate::client_trait_common::Style::Rpc,
754        "files/move_v2",
755        arg,
756        None)
757}
758
759/// Move a file or folder to a different location in the user's Dropbox. If the source path is a
760/// folder all its contents will be moved.
761#[deprecated(note = "replaced by move_v2")]
762pub fn do_move<'a>(
763    client: &'a impl crate::async_client_trait::UserAuthClient,
764    arg: &'a RelocationArg,
765) -> impl std::future::Future<Output=Result<Metadata, crate::Error<RelocationError>>> + Send + 'a {
766    crate::client_helpers::request(
767        client,
768        crate::client_trait_common::Endpoint::Api,
769        crate::client_trait_common::Style::Rpc,
770        "files/move",
771        arg,
772        None)
773}
774
775/// Move multiple files or folders to different locations at once in the user's Dropbox. Note that
776/// we do not currently support case-only renaming. This route will replace
777/// [`move_batch()`](crate::files::move_batch). The main difference is this route will return status
778/// for each entry, while [`move_batch()`](crate::files::move_batch) raises failure if any entry
779/// fails. This route will either finish synchronously, or return a job ID and do the async move job
780/// in background. Please use [`move_batch_check_v2()`](crate::files::move_batch_check_v2) to check
781/// the job status.
782pub fn move_batch_v2<'a>(
783    client: &'a impl crate::async_client_trait::UserAuthClient,
784    arg: &'a MoveBatchArg,
785) -> impl std::future::Future<Output=Result<RelocationBatchV2Launch, crate::Error<crate::NoError>>> + Send + 'a {
786    crate::client_helpers::request(
787        client,
788        crate::client_trait_common::Endpoint::Api,
789        crate::client_trait_common::Style::Rpc,
790        "files/move_batch_v2",
791        arg,
792        None)
793}
794
795/// Move multiple files or folders to different locations at once in the user's Dropbox. This route
796/// will return job ID immediately and do the async moving job in background. Please use
797/// [`move_batch_check()`](crate::files::move_batch_check) to check the job status.
798#[deprecated(note = "replaced by move_batch_v2")]
799pub fn move_batch<'a>(
800    client: &'a impl crate::async_client_trait::UserAuthClient,
801    arg: &'a RelocationBatchArg,
802) -> impl std::future::Future<Output=Result<RelocationBatchLaunch, crate::Error<crate::NoError>>> + Send + 'a {
803    crate::client_helpers::request(
804        client,
805        crate::client_trait_common::Endpoint::Api,
806        crate::client_trait_common::Style::Rpc,
807        "files/move_batch",
808        arg,
809        None)
810}
811
812/// Returns the status of an asynchronous job for [`move_batch_v2()`](crate::files::move_batch_v2).
813/// It returns list of results for each entry.
814pub fn move_batch_check_v2<'a>(
815    client: &'a impl crate::async_client_trait::UserAuthClient,
816    arg: &'a crate::types::dbx_async::PollArg,
817) -> impl std::future::Future<Output=Result<RelocationBatchV2JobStatus, crate::Error<crate::types::dbx_async::PollError>>> + Send + 'a {
818    crate::client_helpers::request(
819        client,
820        crate::client_trait_common::Endpoint::Api,
821        crate::client_trait_common::Style::Rpc,
822        "files/move_batch/check_v2",
823        arg,
824        None)
825}
826
827/// Returns the status of an asynchronous job for [`move_batch()`](crate::files::move_batch). If
828/// success, it returns list of results for each entry.
829#[deprecated(note = "replaced by move_batch_check_v2")]
830pub fn move_batch_check<'a>(
831    client: &'a impl crate::async_client_trait::UserAuthClient,
832    arg: &'a crate::types::dbx_async::PollArg,
833) -> impl std::future::Future<Output=Result<RelocationBatchJobStatus, crate::Error<crate::types::dbx_async::PollError>>> + Send + 'a {
834    crate::client_helpers::request(
835        client,
836        crate::client_trait_common::Endpoint::Api,
837        crate::client_trait_common::Style::Rpc,
838        "files/move_batch/check",
839        arg,
840        None)
841}
842
843/// Creates a new Paper doc with the provided content.
844///
845/// # Stability
846/// *PREVIEW*: This function may change or disappear without notice.
847#[cfg(feature = "unstable")]
848#[cfg_attr(docsrs, doc(cfg(feature = "unstable")))]
849pub fn paper_create<'a>(
850    client: &'a impl crate::async_client_trait::UserAuthClient,
851    arg: &'a PaperCreateArg,
852    body: bytes::Bytes,
853) -> impl std::future::Future<Output=Result<PaperCreateResult, crate::Error<PaperCreateError>>> + Send + 'a {
854    crate::client_helpers::request(
855        client,
856        crate::client_trait_common::Endpoint::Api,
857        crate::client_trait_common::Style::Upload,
858        "files/paper/create",
859        arg,
860        Some(crate::client_helpers::Body::from(body)))
861}
862
863/// Updates an existing Paper doc with the provided content.
864///
865/// # Stability
866/// *PREVIEW*: This function may change or disappear without notice.
867#[cfg(feature = "unstable")]
868#[cfg_attr(docsrs, doc(cfg(feature = "unstable")))]
869pub fn paper_update<'a>(
870    client: &'a impl crate::async_client_trait::UserAuthClient,
871    arg: &'a PaperUpdateArg,
872    body: bytes::Bytes,
873) -> impl std::future::Future<Output=Result<PaperUpdateResult, crate::Error<PaperUpdateError>>> + Send + 'a {
874    crate::client_helpers::request(
875        client,
876        crate::client_trait_common::Endpoint::Api,
877        crate::client_trait_common::Style::Upload,
878        "files/paper/update",
879        arg,
880        Some(crate::client_helpers::Body::from(body)))
881}
882
883/// Permanently delete the file or folder at a given path (see https://www.dropbox.com/en/help/40).
884/// If the given file or folder is not yet deleted, this route will first delete it. It is possible
885/// for this route to successfully delete, then fail to permanently delete. Note: This endpoint is
886/// only available for Dropbox Business apps.
887pub fn permanently_delete<'a>(
888    client: &'a impl crate::async_client_trait::UserAuthClient,
889    arg: &'a DeleteArg,
890) -> impl std::future::Future<Output=Result<(), crate::Error<DeleteError>>> + Send + 'a {
891    crate::client_helpers::request(
892        client,
893        crate::client_trait_common::Endpoint::Api,
894        crate::client_trait_common::Style::Rpc,
895        "files/permanently_delete",
896        arg,
897        None)
898}
899
900#[deprecated]
901pub fn properties_add<'a>(
902    client: &'a impl crate::async_client_trait::UserAuthClient,
903    arg: &'a crate::types::file_properties::AddPropertiesArg,
904) -> impl std::future::Future<Output=Result<(), crate::Error<crate::types::file_properties::AddPropertiesError>>> + Send + 'a {
905    crate::client_helpers::request(
906        client,
907        crate::client_trait_common::Endpoint::Api,
908        crate::client_trait_common::Style::Rpc,
909        "files/properties/add",
910        arg,
911        None)
912}
913
914#[deprecated]
915pub fn properties_overwrite<'a>(
916    client: &'a impl crate::async_client_trait::UserAuthClient,
917    arg: &'a crate::types::file_properties::OverwritePropertyGroupArg,
918) -> impl std::future::Future<Output=Result<(), crate::Error<crate::types::file_properties::InvalidPropertyGroupError>>> + Send + 'a {
919    crate::client_helpers::request(
920        client,
921        crate::client_trait_common::Endpoint::Api,
922        crate::client_trait_common::Style::Rpc,
923        "files/properties/overwrite",
924        arg,
925        None)
926}
927
928#[deprecated]
929pub fn properties_remove<'a>(
930    client: &'a impl crate::async_client_trait::UserAuthClient,
931    arg: &'a crate::types::file_properties::RemovePropertiesArg,
932) -> impl std::future::Future<Output=Result<(), crate::Error<crate::types::file_properties::RemovePropertiesError>>> + Send + 'a {
933    crate::client_helpers::request(
934        client,
935        crate::client_trait_common::Endpoint::Api,
936        crate::client_trait_common::Style::Rpc,
937        "files/properties/remove",
938        arg,
939        None)
940}
941
942#[deprecated]
943pub fn properties_template_get<'a>(
944    client: &'a impl crate::async_client_trait::UserAuthClient,
945    arg: &'a crate::types::file_properties::GetTemplateArg,
946) -> impl std::future::Future<Output=Result<crate::types::file_properties::GetTemplateResult, crate::Error<crate::types::file_properties::TemplateError>>> + Send + 'a {
947    crate::client_helpers::request(
948        client,
949        crate::client_trait_common::Endpoint::Api,
950        crate::client_trait_common::Style::Rpc,
951        "files/properties/template/get",
952        arg,
953        None)
954}
955
956#[deprecated]
957pub fn properties_template_list(
958    client: &impl crate::async_client_trait::UserAuthClient,
959) -> impl std::future::Future<Output=Result<crate::types::file_properties::ListTemplateResult, crate::Error<crate::types::file_properties::TemplateError>>> + Send + '_ {
960    crate::client_helpers::request(
961        client,
962        crate::client_trait_common::Endpoint::Api,
963        crate::client_trait_common::Style::Rpc,
964        "files/properties/template/list",
965        &(),
966        None)
967}
968
969#[deprecated]
970pub fn properties_update<'a>(
971    client: &'a impl crate::async_client_trait::UserAuthClient,
972    arg: &'a crate::types::file_properties::UpdatePropertiesArg,
973) -> impl std::future::Future<Output=Result<(), crate::Error<crate::types::file_properties::UpdatePropertiesError>>> + Send + 'a {
974    crate::client_helpers::request(
975        client,
976        crate::client_trait_common::Endpoint::Api,
977        crate::client_trait_common::Style::Rpc,
978        "files/properties/update",
979        arg,
980        None)
981}
982
983/// Restore a specific revision of a file to the given path.
984pub fn restore<'a>(
985    client: &'a impl crate::async_client_trait::UserAuthClient,
986    arg: &'a RestoreArg,
987) -> impl std::future::Future<Output=Result<FileMetadata, crate::Error<RestoreError>>> + Send + 'a {
988    crate::client_helpers::request(
989        client,
990        crate::client_trait_common::Endpoint::Api,
991        crate::client_trait_common::Style::Rpc,
992        "files/restore",
993        arg,
994        None)
995}
996
997/// Save the data from a specified URL into a file in user's Dropbox. Note that the transfer from
998/// the URL must complete within 15 minutes, or the operation will time out and the job will fail.
999/// If the given path already exists, the file will be renamed to avoid the conflict (e.g. myfile
1000/// (1).txt).
1001pub fn save_url<'a>(
1002    client: &'a impl crate::async_client_trait::UserAuthClient,
1003    arg: &'a SaveUrlArg,
1004) -> impl std::future::Future<Output=Result<SaveUrlResult, crate::Error<SaveUrlError>>> + Send + 'a {
1005    crate::client_helpers::request(
1006        client,
1007        crate::client_trait_common::Endpoint::Api,
1008        crate::client_trait_common::Style::Rpc,
1009        "files/save_url",
1010        arg,
1011        None)
1012}
1013
1014/// Check the status of a [`save_url()`](crate::files::save_url) job.
1015pub fn save_url_check_job_status<'a>(
1016    client: &'a impl crate::async_client_trait::UserAuthClient,
1017    arg: &'a crate::types::dbx_async::PollArg,
1018) -> impl std::future::Future<Output=Result<SaveUrlJobStatus, crate::Error<crate::types::dbx_async::PollError>>> + Send + 'a {
1019    crate::client_helpers::request(
1020        client,
1021        crate::client_trait_common::Endpoint::Api,
1022        crate::client_trait_common::Style::Rpc,
1023        "files/save_url/check_job_status",
1024        arg,
1025        None)
1026}
1027
1028/// Searches for files and folders. Note: Recent changes will be reflected in search results within
1029/// a few seconds and older revisions of existing files may still match your query for up to a few
1030/// days.
1031#[deprecated(note = "replaced by search_v2")]
1032pub fn search<'a>(
1033    client: &'a impl crate::async_client_trait::UserAuthClient,
1034    arg: &'a SearchArg,
1035) -> impl std::future::Future<Output=Result<SearchResult, crate::Error<SearchError>>> + Send + 'a {
1036    crate::client_helpers::request(
1037        client,
1038        crate::client_trait_common::Endpoint::Api,
1039        crate::client_trait_common::Style::Rpc,
1040        "files/search",
1041        arg,
1042        None)
1043}
1044
1045/// Searches for files and folders. Note: [`search_v2()`](crate::files::search_v2) along with
1046/// [`search_continue_v2()`](crate::files::search_continue_v2) can only be used to retrieve a
1047/// maximum of 10,000 matches. Recent changes may not immediately be reflected in search results due
1048/// to a short delay in indexing. Duplicate results may be returned across pages. Some results may
1049/// not be returned.
1050pub fn search_v2<'a>(
1051    client: &'a impl crate::async_client_trait::UserAuthClient,
1052    arg: &'a SearchV2Arg,
1053) -> impl std::future::Future<Output=Result<SearchV2Result, crate::Error<SearchError>>> + Send + 'a {
1054    crate::client_helpers::request(
1055        client,
1056        crate::client_trait_common::Endpoint::Api,
1057        crate::client_trait_common::Style::Rpc,
1058        "files/search_v2",
1059        arg,
1060        None)
1061}
1062
1063/// Fetches the next page of search results returned from [`search_v2()`](crate::files::search_v2).
1064/// Note: [`search_v2()`](crate::files::search_v2) along with
1065/// [`search_continue_v2()`](crate::files::search_continue_v2) can only be used to retrieve a
1066/// maximum of 10,000 matches. Recent changes may not immediately be reflected in search results due
1067/// to a short delay in indexing. Duplicate results may be returned across pages. Some results may
1068/// not be returned.
1069pub fn search_continue_v2<'a>(
1070    client: &'a impl crate::async_client_trait::UserAuthClient,
1071    arg: &'a SearchV2ContinueArg,
1072) -> impl std::future::Future<Output=Result<SearchV2Result, crate::Error<SearchError>>> + Send + 'a {
1073    crate::client_helpers::request(
1074        client,
1075        crate::client_trait_common::Endpoint::Api,
1076        crate::client_trait_common::Style::Rpc,
1077        "files/search/continue_v2",
1078        arg,
1079        None)
1080}
1081
1082/// Add a tag to an item. A tag is a string. The strings are automatically converted to lowercase
1083/// letters. No more than 20 tags can be added to a given item.
1084///
1085/// # Stability
1086/// *PREVIEW*: This function may change or disappear without notice.
1087#[cfg(feature = "unstable")]
1088#[cfg_attr(docsrs, doc(cfg(feature = "unstable")))]
1089pub fn tags_add<'a>(
1090    client: &'a impl crate::async_client_trait::UserAuthClient,
1091    arg: &'a AddTagArg,
1092) -> impl std::future::Future<Output=Result<(), crate::Error<AddTagError>>> + Send + 'a {
1093    crate::client_helpers::request(
1094        client,
1095        crate::client_trait_common::Endpoint::Api,
1096        crate::client_trait_common::Style::Rpc,
1097        "files/tags/add",
1098        arg,
1099        None)
1100}
1101
1102/// Get list of tags assigned to items.
1103///
1104/// # Stability
1105/// *PREVIEW*: This function may change or disappear without notice.
1106#[cfg(feature = "unstable")]
1107#[cfg_attr(docsrs, doc(cfg(feature = "unstable")))]
1108pub fn tags_get<'a>(
1109    client: &'a impl crate::async_client_trait::UserAuthClient,
1110    arg: &'a GetTagsArg,
1111) -> impl std::future::Future<Output=Result<GetTagsResult, crate::Error<BaseTagError>>> + Send + 'a {
1112    crate::client_helpers::request(
1113        client,
1114        crate::client_trait_common::Endpoint::Api,
1115        crate::client_trait_common::Style::Rpc,
1116        "files/tags/get",
1117        arg,
1118        None)
1119}
1120
1121/// Remove a tag from an item.
1122///
1123/// # Stability
1124/// *PREVIEW*: This function may change or disappear without notice.
1125#[cfg(feature = "unstable")]
1126#[cfg_attr(docsrs, doc(cfg(feature = "unstable")))]
1127pub fn tags_remove<'a>(
1128    client: &'a impl crate::async_client_trait::UserAuthClient,
1129    arg: &'a RemoveTagArg,
1130) -> impl std::future::Future<Output=Result<(), crate::Error<RemoveTagError>>> + Send + 'a {
1131    crate::client_helpers::request(
1132        client,
1133        crate::client_trait_common::Endpoint::Api,
1134        crate::client_trait_common::Style::Rpc,
1135        "files/tags/remove",
1136        arg,
1137        None)
1138}
1139
1140/// Unlock the files at the given paths. A locked file can only be unlocked by the lock holder or,
1141/// if a business account, a team admin. A successful response indicates that the file has been
1142/// unlocked. Returns a list of the unlocked file paths and their metadata after this operation.
1143pub fn unlock_file_batch<'a>(
1144    client: &'a impl crate::async_client_trait::UserAuthClient,
1145    arg: &'a UnlockFileBatchArg,
1146) -> impl std::future::Future<Output=Result<LockFileBatchResult, crate::Error<LockFileError>>> + Send + 'a {
1147    crate::client_helpers::request(
1148        client,
1149        crate::client_trait_common::Endpoint::Api,
1150        crate::client_trait_common::Style::Rpc,
1151        "files/unlock_file_batch",
1152        arg,
1153        None)
1154}
1155
1156/// Create a new file with the contents provided in the request. Do not use this to upload a file
1157/// larger than 150 MB. Instead, create an upload session with
1158/// [`upload_session_start()`](crate::files::upload_session_start). Calls to this endpoint will
1159/// count as data transport calls for any Dropbox Business teams with a limit on the number of data
1160/// transport calls allowed per month. For more information, see the [Data transport limit
1161/// page](https://www.dropbox.com/developers/reference/data-transport-limit).
1162pub fn upload<'a>(
1163    client: &'a impl crate::async_client_trait::UserAuthClient,
1164    arg: &'a UploadArg,
1165    body: bytes::Bytes,
1166) -> impl std::future::Future<Output=Result<FileMetadata, crate::Error<UploadError>>> + Send + 'a {
1167    crate::client_helpers::request(
1168        client,
1169        crate::client_trait_common::Endpoint::Content,
1170        crate::client_trait_common::Style::Upload,
1171        "files/upload",
1172        arg,
1173        Some(crate::client_helpers::Body::from(body)))
1174}
1175
1176/// Append more data to an upload session. When the parameter close is set, this call will close the
1177/// session. A single request should not upload more than 150 MB. The maximum size of a file one can
1178/// upload to an upload session is 350 GB. Calls to this endpoint will count as data transport calls
1179/// for any Dropbox Business teams with a limit on the number of data transport calls allowed per
1180/// month. For more information, see the [Data transport limit
1181/// page](https://www.dropbox.com/developers/reference/data-transport-limit).
1182pub fn upload_session_append_v2<'a>(
1183    client: &'a impl crate::async_client_trait::UserAuthClient,
1184    arg: &'a UploadSessionAppendArg,
1185    body: bytes::Bytes,
1186) -> impl std::future::Future<Output=Result<(), crate::Error<UploadSessionAppendError>>> + Send + 'a {
1187    crate::client_helpers::request(
1188        client,
1189        crate::client_trait_common::Endpoint::Content,
1190        crate::client_trait_common::Style::Upload,
1191        "files/upload_session/append_v2",
1192        arg,
1193        Some(crate::client_helpers::Body::from(body)))
1194}
1195
1196/// Append more data to an upload session. A single request should not upload more than 150 MB. The
1197/// maximum size of a file one can upload to an upload session is 350 GB. Calls to this endpoint
1198/// will count as data transport calls for any Dropbox Business teams with a limit on the number of
1199/// data transport calls allowed per month. For more information, see the [Data transport limit
1200/// page](https://www.dropbox.com/developers/reference/data-transport-limit).
1201#[deprecated(note = "replaced by upload_session_append_v2")]
1202pub fn upload_session_append<'a>(
1203    client: &'a impl crate::async_client_trait::UserAuthClient,
1204    arg: &'a UploadSessionCursor,
1205    body: bytes::Bytes,
1206) -> impl std::future::Future<Output=Result<(), crate::Error<UploadSessionAppendError>>> + Send + 'a {
1207    crate::client_helpers::request(
1208        client,
1209        crate::client_trait_common::Endpoint::Content,
1210        crate::client_trait_common::Style::Upload,
1211        "files/upload_session/append",
1212        arg,
1213        Some(crate::client_helpers::Body::from(body)))
1214}
1215
1216/// Finish an upload session and save the uploaded data to the given file path. A single request
1217/// should not upload more than 150 MB. The maximum size of a file one can upload to an upload
1218/// session is 350 GB. Calls to this endpoint will count as data transport calls for any Dropbox
1219/// Business teams with a limit on the number of data transport calls allowed per month. For more
1220/// information, see the [Data transport limit
1221/// page](https://www.dropbox.com/developers/reference/data-transport-limit).
1222pub fn upload_session_finish<'a>(
1223    client: &'a impl crate::async_client_trait::UserAuthClient,
1224    arg: &'a UploadSessionFinishArg,
1225    body: bytes::Bytes,
1226) -> impl std::future::Future<Output=Result<FileMetadata, crate::Error<UploadSessionFinishError>>> + Send + 'a {
1227    crate::client_helpers::request(
1228        client,
1229        crate::client_trait_common::Endpoint::Content,
1230        crate::client_trait_common::Style::Upload,
1231        "files/upload_session/finish",
1232        arg,
1233        Some(crate::client_helpers::Body::from(body)))
1234}
1235
1236/// This route helps you commit many files at once into a user's Dropbox. Use
1237/// [`upload_session_start()`](crate::files::upload_session_start) and
1238/// [`upload_session_append_v2()`](crate::files::upload_session_append_v2) to upload file contents.
1239/// We recommend uploading many files in parallel to increase throughput. Once the file contents
1240/// have been uploaded, rather than calling
1241/// [`upload_session_finish()`](crate::files::upload_session_finish), use this route to finish all
1242/// your upload sessions in a single request.
1243/// [`UploadSessionStartArg::close`](UploadSessionStartArg) or
1244/// [`UploadSessionAppendArg::close`](UploadSessionAppendArg) needs to be true for the last
1245/// [`upload_session_start()`](crate::files::upload_session_start) or
1246/// [`upload_session_append_v2()`](crate::files::upload_session_append_v2) call. The maximum size of
1247/// a file one can upload to an upload session is 350 GB. This route will return a job_id
1248/// immediately and do the async commit job in background. Use
1249/// [`upload_session_finish_batch_check()`](crate::files::upload_session_finish_batch_check) to
1250/// check the job status. For the same account, this route should be executed serially. That means
1251/// you should not start the next job before current job finishes. We allow up to 1000 entries in a
1252/// single request. Calls to this endpoint will count as data transport calls for any Dropbox
1253/// Business teams with a limit on the number of data transport calls allowed per month. For more
1254/// information, see the [Data transport limit
1255/// page](https://www.dropbox.com/developers/reference/data-transport-limit).
1256#[deprecated(note = "replaced by upload_session_finish_batch_v2")]
1257pub fn upload_session_finish_batch<'a>(
1258    client: &'a impl crate::async_client_trait::UserAuthClient,
1259    arg: &'a UploadSessionFinishBatchArg,
1260) -> impl std::future::Future<Output=Result<UploadSessionFinishBatchLaunch, crate::Error<crate::NoError>>> + Send + 'a {
1261    crate::client_helpers::request(
1262        client,
1263        crate::client_trait_common::Endpoint::Api,
1264        crate::client_trait_common::Style::Rpc,
1265        "files/upload_session/finish_batch",
1266        arg,
1267        None)
1268}
1269
1270/// This route helps you commit many files at once into a user's Dropbox. Use
1271/// [`upload_session_start()`](crate::files::upload_session_start) and
1272/// [`upload_session_append_v2()`](crate::files::upload_session_append_v2) to upload file contents.
1273/// We recommend uploading many files in parallel to increase throughput. Once the file contents
1274/// have been uploaded, rather than calling
1275/// [`upload_session_finish()`](crate::files::upload_session_finish), use this route to finish all
1276/// your upload sessions in a single request.
1277/// [`UploadSessionStartArg::close`](UploadSessionStartArg) or
1278/// [`UploadSessionAppendArg::close`](UploadSessionAppendArg) needs to be true for the last
1279/// [`upload_session_start()`](crate::files::upload_session_start) or
1280/// [`upload_session_append_v2()`](crate::files::upload_session_append_v2) call of each upload
1281/// session. The maximum size of a file one can upload to an upload session is 350 GB. We allow up
1282/// to 1000 entries in a single request. Calls to this endpoint will count as data transport calls
1283/// for any Dropbox Business teams with a limit on the number of data transport calls allowed per
1284/// month. For more information, see the [Data transport limit
1285/// page](https://www.dropbox.com/developers/reference/data-transport-limit).
1286pub fn upload_session_finish_batch_v2<'a>(
1287    client: &'a impl crate::async_client_trait::UserAuthClient,
1288    arg: &'a UploadSessionFinishBatchArg,
1289) -> impl std::future::Future<Output=Result<UploadSessionFinishBatchResult, crate::Error<crate::NoError>>> + Send + 'a {
1290    crate::client_helpers::request(
1291        client,
1292        crate::client_trait_common::Endpoint::Api,
1293        crate::client_trait_common::Style::Rpc,
1294        "files/upload_session/finish_batch_v2",
1295        arg,
1296        None)
1297}
1298
1299/// Returns the status of an asynchronous job for
1300/// [`upload_session_finish_batch()`](crate::files::upload_session_finish_batch). If success, it
1301/// returns list of result for each entry.
1302pub fn upload_session_finish_batch_check<'a>(
1303    client: &'a impl crate::async_client_trait::UserAuthClient,
1304    arg: &'a crate::types::dbx_async::PollArg,
1305) -> impl std::future::Future<Output=Result<UploadSessionFinishBatchJobStatus, crate::Error<crate::types::dbx_async::PollError>>> + Send + 'a {
1306    crate::client_helpers::request(
1307        client,
1308        crate::client_trait_common::Endpoint::Api,
1309        crate::client_trait_common::Style::Rpc,
1310        "files/upload_session/finish_batch/check",
1311        arg,
1312        None)
1313}
1314
1315/// Upload sessions allow you to upload a single file in one or more requests, for example where the
1316/// size of the file is greater than 150 MB.  This call starts a new upload session with the given
1317/// data. You can then use [`upload_session_append_v2()`](crate::files::upload_session_append_v2) to
1318/// add more data and [`upload_session_finish()`](crate::files::upload_session_finish) to save all
1319/// the data to a file in Dropbox. A single request should not upload more than 150 MB. The maximum
1320/// size of a file one can upload to an upload session is 350 GB. An upload session can be used for
1321/// a maximum of 7 days. Attempting to use an
1322/// [`UploadSessionStartResult::session_id`](UploadSessionStartResult) with
1323/// [`upload_session_append_v2()`](crate::files::upload_session_append_v2) or
1324/// [`upload_session_finish()`](crate::files::upload_session_finish) more than 7 days after its
1325/// creation will return a [`UploadSessionLookupError::NotFound`]. Calls to this endpoint will count
1326/// as data transport calls for any Dropbox Business teams with a limit on the number of data
1327/// transport calls allowed per month. For more information, see the [Data transport limit
1328/// page](https://www.dropbox.com/developers/reference/data-transport-limit). By default, upload
1329/// sessions require you to send content of the file in sequential order via consecutive
1330/// [`upload_session_start()`](crate::files::upload_session_start),
1331/// [`upload_session_append_v2()`](crate::files::upload_session_append_v2),
1332/// [`upload_session_finish()`](crate::files::upload_session_finish) calls. For better performance,
1333/// you can instead optionally use a [`UploadSessionType::Concurrent`] upload session. To start a
1334/// new concurrent session, set [`UploadSessionStartArg::session_type`](UploadSessionStartArg) to
1335/// [`UploadSessionType::Concurrent`]. After that, you can send file data in concurrent
1336/// [`upload_session_append_v2()`](crate::files::upload_session_append_v2) requests. Finally finish
1337/// the session with [`upload_session_finish()`](crate::files::upload_session_finish). There are
1338/// couple of constraints with concurrent sessions to make them work. You can not send data with
1339/// [`upload_session_start()`](crate::files::upload_session_start) or
1340/// [`upload_session_finish()`](crate::files::upload_session_finish) call, only with
1341/// [`upload_session_append_v2()`](crate::files::upload_session_append_v2) call. Also data uploaded
1342/// in [`upload_session_append_v2()`](crate::files::upload_session_append_v2) call must be multiple
1343/// of 4194304 bytes (except for last
1344/// [`upload_session_append_v2()`](crate::files::upload_session_append_v2) with
1345/// [`UploadSessionStartArg::close`](UploadSessionStartArg) to `true`, that may contain any
1346/// remaining data).
1347pub fn upload_session_start<'a>(
1348    client: &'a impl crate::async_client_trait::UserAuthClient,
1349    arg: &'a UploadSessionStartArg,
1350    body: bytes::Bytes,
1351) -> impl std::future::Future<Output=Result<UploadSessionStartResult, crate::Error<UploadSessionStartError>>> + Send + 'a {
1352    crate::client_helpers::request(
1353        client,
1354        crate::client_trait_common::Endpoint::Content,
1355        crate::client_trait_common::Style::Upload,
1356        "files/upload_session/start",
1357        arg,
1358        Some(crate::client_helpers::Body::from(body)))
1359}
1360
1361/// This route starts batch of upload_sessions. Please refer to `upload_session/start` usage. Calls
1362/// to this endpoint will count as data transport calls for any Dropbox Business teams with a limit
1363/// on the number of data transport calls allowed per month. For more information, see the [Data
1364/// transport limit page](https://www.dropbox.com/developers/reference/data-transport-limit).
1365pub fn upload_session_start_batch<'a>(
1366    client: &'a impl crate::async_client_trait::UserAuthClient,
1367    arg: &'a UploadSessionStartBatchArg,
1368) -> impl std::future::Future<Output=Result<UploadSessionStartBatchResult, crate::Error<crate::NoError>>> + Send + 'a {
1369    crate::client_helpers::request(
1370        client,
1371        crate::client_trait_common::Endpoint::Api,
1372        crate::client_trait_common::Style::Rpc,
1373        "files/upload_session/start_batch",
1374        arg,
1375        None)
1376}
1377