dropbox_sdk/generated/async_routes/
file_properties.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::file_properties::*;
13
14/// Add property groups to a Dropbox file. See
15/// [`templates_add_for_user()`](crate::file_properties::templates_add_for_user) or
16/// [`templates_add_for_team()`](crate::file_properties::templates_add_for_team) to create new
17/// templates.
18pub fn properties_add<'a>(
19    client: &'a impl crate::async_client_trait::UserAuthClient,
20    arg: &'a AddPropertiesArg,
21) -> impl std::future::Future<Output=Result<(), crate::Error<AddPropertiesError>>> + Send + 'a {
22    crate::client_helpers::request(
23        client,
24        crate::client_trait_common::Endpoint::Api,
25        crate::client_trait_common::Style::Rpc,
26        "file_properties/properties/add",
27        arg,
28        None)
29}
30
31/// Overwrite property groups associated with a file. This endpoint should be used instead of
32/// [`properties_update()`](crate::file_properties::properties_update) when property groups are
33/// being updated via a "snapshot" instead of via a "delta". In other words, this endpoint will
34/// delete all omitted fields from a property group, whereas
35/// [`properties_update()`](crate::file_properties::properties_update) will only delete fields that
36/// are explicitly marked for deletion.
37pub fn properties_overwrite<'a>(
38    client: &'a impl crate::async_client_trait::UserAuthClient,
39    arg: &'a OverwritePropertyGroupArg,
40) -> impl std::future::Future<Output=Result<(), crate::Error<InvalidPropertyGroupError>>> + Send + 'a {
41    crate::client_helpers::request(
42        client,
43        crate::client_trait_common::Endpoint::Api,
44        crate::client_trait_common::Style::Rpc,
45        "file_properties/properties/overwrite",
46        arg,
47        None)
48}
49
50/// Permanently removes the specified property group from the file. To remove specific property
51/// field key value pairs, see [`properties_update()`](crate::file_properties::properties_update).
52/// To update a template, see
53/// [`templates_update_for_user()`](crate::file_properties::templates_update_for_user) or
54/// [`templates_update_for_team()`](crate::file_properties::templates_update_for_team). To remove a
55/// template, see [`templates_remove_for_user()`](crate::file_properties::templates_remove_for_user)
56/// or [`templates_remove_for_team()`](crate::file_properties::templates_remove_for_team).
57pub fn properties_remove<'a>(
58    client: &'a impl crate::async_client_trait::UserAuthClient,
59    arg: &'a RemovePropertiesArg,
60) -> impl std::future::Future<Output=Result<(), crate::Error<RemovePropertiesError>>> + Send + 'a {
61    crate::client_helpers::request(
62        client,
63        crate::client_trait_common::Endpoint::Api,
64        crate::client_trait_common::Style::Rpc,
65        "file_properties/properties/remove",
66        arg,
67        None)
68}
69
70/// Search across property templates for particular property field values.
71pub fn properties_search<'a>(
72    client: &'a impl crate::async_client_trait::UserAuthClient,
73    arg: &'a PropertiesSearchArg,
74) -> impl std::future::Future<Output=Result<PropertiesSearchResult, crate::Error<PropertiesSearchError>>> + Send + 'a {
75    crate::client_helpers::request(
76        client,
77        crate::client_trait_common::Endpoint::Api,
78        crate::client_trait_common::Style::Rpc,
79        "file_properties/properties/search",
80        arg,
81        None)
82}
83
84/// Once a cursor has been retrieved from
85/// [`properties_search()`](crate::file_properties::properties_search), use this to paginate through
86/// all search results.
87pub fn properties_search_continue<'a>(
88    client: &'a impl crate::async_client_trait::UserAuthClient,
89    arg: &'a PropertiesSearchContinueArg,
90) -> impl std::future::Future<Output=Result<PropertiesSearchResult, crate::Error<PropertiesSearchContinueError>>> + Send + 'a {
91    crate::client_helpers::request(
92        client,
93        crate::client_trait_common::Endpoint::Api,
94        crate::client_trait_common::Style::Rpc,
95        "file_properties/properties/search/continue",
96        arg,
97        None)
98}
99
100/// Add, update or remove properties associated with the supplied file and templates. This endpoint
101/// should be used instead of
102/// [`properties_overwrite()`](crate::file_properties::properties_overwrite) when property groups
103/// are being updated via a "delta" instead of via a "snapshot" . In other words, this endpoint will
104/// not delete any omitted fields from a property group, whereas
105/// [`properties_overwrite()`](crate::file_properties::properties_overwrite) will delete any fields
106/// that are omitted from a property group.
107pub fn properties_update<'a>(
108    client: &'a impl crate::async_client_trait::UserAuthClient,
109    arg: &'a UpdatePropertiesArg,
110) -> impl std::future::Future<Output=Result<(), crate::Error<UpdatePropertiesError>>> + Send + 'a {
111    crate::client_helpers::request(
112        client,
113        crate::client_trait_common::Endpoint::Api,
114        crate::client_trait_common::Style::Rpc,
115        "file_properties/properties/update",
116        arg,
117        None)
118}
119
120/// Add a template associated with a team. See
121/// [`properties_add()`](crate::file_properties::properties_add) to add properties to a file or
122/// folder. Note: this endpoint will create team-owned templates.
123pub fn templates_add_for_team<'a>(
124    client: &'a impl crate::async_client_trait::TeamAuthClient,
125    arg: &'a AddTemplateArg,
126) -> impl std::future::Future<Output=Result<AddTemplateResult, crate::Error<ModifyTemplateError>>> + Send + 'a {
127    crate::client_helpers::request(
128        client,
129        crate::client_trait_common::Endpoint::Api,
130        crate::client_trait_common::Style::Rpc,
131        "file_properties/templates/add_for_team",
132        arg,
133        None)
134}
135
136/// Add a template associated with a user. See
137/// [`properties_add()`](crate::file_properties::properties_add) to add properties to a file. This
138/// endpoint can't be called on a team member or admin's behalf.
139pub fn templates_add_for_user<'a>(
140    client: &'a impl crate::async_client_trait::UserAuthClient,
141    arg: &'a AddTemplateArg,
142) -> impl std::future::Future<Output=Result<AddTemplateResult, crate::Error<ModifyTemplateError>>> + Send + 'a {
143    crate::client_helpers::request(
144        client,
145        crate::client_trait_common::Endpoint::Api,
146        crate::client_trait_common::Style::Rpc,
147        "file_properties/templates/add_for_user",
148        arg,
149        None)
150}
151
152/// Get the schema for a specified template.
153pub fn templates_get_for_team<'a>(
154    client: &'a impl crate::async_client_trait::TeamAuthClient,
155    arg: &'a GetTemplateArg,
156) -> impl std::future::Future<Output=Result<GetTemplateResult, crate::Error<TemplateError>>> + Send + 'a {
157    crate::client_helpers::request(
158        client,
159        crate::client_trait_common::Endpoint::Api,
160        crate::client_trait_common::Style::Rpc,
161        "file_properties/templates/get_for_team",
162        arg,
163        None)
164}
165
166/// Get the schema for a specified template. This endpoint can't be called on a team member or
167/// admin's behalf.
168pub fn templates_get_for_user<'a>(
169    client: &'a impl crate::async_client_trait::UserAuthClient,
170    arg: &'a GetTemplateArg,
171) -> impl std::future::Future<Output=Result<GetTemplateResult, crate::Error<TemplateError>>> + Send + 'a {
172    crate::client_helpers::request(
173        client,
174        crate::client_trait_common::Endpoint::Api,
175        crate::client_trait_common::Style::Rpc,
176        "file_properties/templates/get_for_user",
177        arg,
178        None)
179}
180
181/// Get the template identifiers for a team. To get the schema of each template use
182/// [`templates_get_for_team()`](crate::file_properties::templates_get_for_team).
183pub fn templates_list_for_team(
184    client: &impl crate::async_client_trait::TeamAuthClient,
185) -> impl std::future::Future<Output=Result<ListTemplateResult, crate::Error<TemplateError>>> + Send + '_ {
186    crate::client_helpers::request(
187        client,
188        crate::client_trait_common::Endpoint::Api,
189        crate::client_trait_common::Style::Rpc,
190        "file_properties/templates/list_for_team",
191        &(),
192        None)
193}
194
195/// Get the template identifiers for a team. To get the schema of each template use
196/// [`templates_get_for_user()`](crate::file_properties::templates_get_for_user). This endpoint
197/// can't be called on a team member or admin's behalf.
198pub fn templates_list_for_user(
199    client: &impl crate::async_client_trait::UserAuthClient,
200) -> impl std::future::Future<Output=Result<ListTemplateResult, crate::Error<TemplateError>>> + Send + '_ {
201    crate::client_helpers::request(
202        client,
203        crate::client_trait_common::Endpoint::Api,
204        crate::client_trait_common::Style::Rpc,
205        "file_properties/templates/list_for_user",
206        &(),
207        None)
208}
209
210/// Permanently removes the specified template created from
211/// [`templates_add_for_user()`](crate::file_properties::templates_add_for_user). All properties
212/// associated with the template will also be removed. This action cannot be undone.
213pub fn templates_remove_for_team<'a>(
214    client: &'a impl crate::async_client_trait::TeamAuthClient,
215    arg: &'a RemoveTemplateArg,
216) -> impl std::future::Future<Output=Result<(), crate::Error<TemplateError>>> + Send + 'a {
217    crate::client_helpers::request(
218        client,
219        crate::client_trait_common::Endpoint::Api,
220        crate::client_trait_common::Style::Rpc,
221        "file_properties/templates/remove_for_team",
222        arg,
223        None)
224}
225
226/// Permanently removes the specified template created from
227/// [`templates_add_for_user()`](crate::file_properties::templates_add_for_user). All properties
228/// associated with the template will also be removed. This action cannot be undone.
229pub fn templates_remove_for_user<'a>(
230    client: &'a impl crate::async_client_trait::UserAuthClient,
231    arg: &'a RemoveTemplateArg,
232) -> impl std::future::Future<Output=Result<(), crate::Error<TemplateError>>> + Send + 'a {
233    crate::client_helpers::request(
234        client,
235        crate::client_trait_common::Endpoint::Api,
236        crate::client_trait_common::Style::Rpc,
237        "file_properties/templates/remove_for_user",
238        arg,
239        None)
240}
241
242/// Update a template associated with a team. This route can update the template name, the template
243/// description and add optional properties to templates.
244pub fn templates_update_for_team<'a>(
245    client: &'a impl crate::async_client_trait::TeamAuthClient,
246    arg: &'a UpdateTemplateArg,
247) -> impl std::future::Future<Output=Result<UpdateTemplateResult, crate::Error<ModifyTemplateError>>> + Send + 'a {
248    crate::client_helpers::request(
249        client,
250        crate::client_trait_common::Endpoint::Api,
251        crate::client_trait_common::Style::Rpc,
252        "file_properties/templates/update_for_team",
253        arg,
254        None)
255}
256
257/// Update a template associated with a user. This route can update the template name, the template
258/// description and add optional properties to templates. This endpoint can't be called on a team
259/// member or admin's behalf.
260pub fn templates_update_for_user<'a>(
261    client: &'a impl crate::async_client_trait::UserAuthClient,
262    arg: &'a UpdateTemplateArg,
263) -> impl std::future::Future<Output=Result<UpdateTemplateResult, crate::Error<ModifyTemplateError>>> + Send + 'a {
264    crate::client_helpers::request(
265        client,
266        crate::client_trait_common::Endpoint::Api,
267        crate::client_trait_common::Style::Rpc,
268        "file_properties/templates/update_for_user",
269        arg,
270        None)
271}
272