mattermost_rust_client/apis/
plugins_api.rs

1/*
2 * Mattermost API Reference
3 *
4 * There is also a work-in-progress [Postman API reference](https://documenter.getpostman.com/view/4508214/RW8FERUn). 
5 *
6 * The version of the OpenAPI document: 4.0.0
7 * Contact: feedback@mattermost.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12use reqwest;
13
14use crate::apis::ResponseContent;
15use super::{Error, configuration};
16
17
18/// struct for typed errors of method [`disable_plugin`]
19#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum DisablePluginError {
22    Status400(crate::models::AppError),
23    Status401(crate::models::AppError),
24    Status403(crate::models::AppError),
25    Status404(crate::models::AppError),
26    Status501(crate::models::AppError),
27    UnknownValue(serde_json::Value),
28}
29
30/// struct for typed errors of method [`enable_plugin`]
31#[derive(Debug, Clone, Serialize, Deserialize)]
32#[serde(untagged)]
33pub enum EnablePluginError {
34    Status400(crate::models::AppError),
35    Status401(crate::models::AppError),
36    Status403(crate::models::AppError),
37    Status404(crate::models::AppError),
38    Status501(crate::models::AppError),
39    UnknownValue(serde_json::Value),
40}
41
42/// struct for typed errors of method [`get_marketplace_plugins`]
43#[derive(Debug, Clone, Serialize, Deserialize)]
44#[serde(untagged)]
45pub enum GetMarketplacePluginsError {
46    Status400(crate::models::AppError),
47    Status401(crate::models::AppError),
48    Status403(crate::models::AppError),
49    Status501(crate::models::AppError),
50    UnknownValue(serde_json::Value),
51}
52
53/// struct for typed errors of method [`get_marketplace_visited_by_admin`]
54#[derive(Debug, Clone, Serialize, Deserialize)]
55#[serde(untagged)]
56pub enum GetMarketplaceVisitedByAdminError {
57    Status403(crate::models::AppError),
58    Status500(crate::models::AppError),
59    UnknownValue(serde_json::Value),
60}
61
62/// struct for typed errors of method [`get_plugin_statuses`]
63#[derive(Debug, Clone, Serialize, Deserialize)]
64#[serde(untagged)]
65pub enum GetPluginStatusesError {
66    Status400(crate::models::AppError),
67    Status401(crate::models::AppError),
68    Status403(crate::models::AppError),
69    Status501(crate::models::AppError),
70    UnknownValue(serde_json::Value),
71}
72
73/// struct for typed errors of method [`get_plugins`]
74#[derive(Debug, Clone, Serialize, Deserialize)]
75#[serde(untagged)]
76pub enum GetPluginsError {
77    Status400(crate::models::AppError),
78    Status401(crate::models::AppError),
79    Status403(crate::models::AppError),
80    Status501(crate::models::AppError),
81    UnknownValue(serde_json::Value),
82}
83
84/// struct for typed errors of method [`get_webapp_plugins`]
85#[derive(Debug, Clone, Serialize, Deserialize)]
86#[serde(untagged)]
87pub enum GetWebappPluginsError {
88    Status400(crate::models::AppError),
89    Status401(crate::models::AppError),
90    Status403(crate::models::AppError),
91    Status501(crate::models::AppError),
92    UnknownValue(serde_json::Value),
93}
94
95/// struct for typed errors of method [`install_marketplace_plugin`]
96#[derive(Debug, Clone, Serialize, Deserialize)]
97#[serde(untagged)]
98pub enum InstallMarketplacePluginError {
99    Status400(crate::models::AppError),
100    Status401(crate::models::AppError),
101    Status403(crate::models::AppError),
102    Status404(crate::models::AppError),
103    Status501(crate::models::AppError),
104    UnknownValue(serde_json::Value),
105}
106
107/// struct for typed errors of method [`install_plugin_from_url`]
108#[derive(Debug, Clone, Serialize, Deserialize)]
109#[serde(untagged)]
110pub enum InstallPluginFromUrlError {
111    Status400(crate::models::AppError),
112    Status403(crate::models::AppError),
113    Status501(crate::models::AppError),
114    UnknownValue(serde_json::Value),
115}
116
117/// struct for typed errors of method [`remove_plugin`]
118#[derive(Debug, Clone, Serialize, Deserialize)]
119#[serde(untagged)]
120pub enum RemovePluginError {
121    Status400(crate::models::AppError),
122    Status401(crate::models::AppError),
123    Status403(crate::models::AppError),
124    Status404(crate::models::AppError),
125    Status501(crate::models::AppError),
126    UnknownValue(serde_json::Value),
127}
128
129/// struct for typed errors of method [`upload_plugin`]
130#[derive(Debug, Clone, Serialize, Deserialize)]
131#[serde(untagged)]
132pub enum UploadPluginError {
133    Status400(crate::models::AppError),
134    Status401(crate::models::AppError),
135    Status403(crate::models::AppError),
136    Status413(crate::models::AppError),
137    Status501(crate::models::AppError),
138    UnknownValue(serde_json::Value),
139}
140
141
142/// Disable a previously enabled plugin. Plugins must be enabled in the server's config settings.  ##### Permissions Must have `manage_system` permission.  __Minimum server version__: 4.4 
143pub async fn disable_plugin(configuration: &configuration::Configuration, plugin_id: &str) -> Result<crate::models::StatusOk, Error<DisablePluginError>> {
144    let local_var_configuration = configuration;
145
146    let local_var_client = &local_var_configuration.client;
147
148    let local_var_uri_str = format!("{}/plugins/{plugin_id}/disable", local_var_configuration.base_path, plugin_id=crate::apis::urlencode(plugin_id));
149    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
150
151    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
152        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
153    }
154    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
155        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
156    };
157
158    let local_var_req = local_var_req_builder.build()?;
159    let local_var_resp = local_var_client.execute(local_var_req).await?;
160
161    let local_var_status = local_var_resp.status();
162    let local_var_content = local_var_resp.text().await?;
163
164    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
165        serde_json::from_str(&local_var_content).map_err(Error::from)
166    } else {
167        let local_var_entity: Option<DisablePluginError> = serde_json::from_str(&local_var_content).ok();
168        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
169        Err(Error::ResponseError(local_var_error))
170    }
171}
172
173/// Enable a previously uploaded plugin. Plugins must be enabled in the server's config settings.  ##### Permissions Must have `manage_system` permission.  __Minimum server version__: 4.4 
174pub async fn enable_plugin(configuration: &configuration::Configuration, plugin_id: &str) -> Result<crate::models::StatusOk, Error<EnablePluginError>> {
175    let local_var_configuration = configuration;
176
177    let local_var_client = &local_var_configuration.client;
178
179    let local_var_uri_str = format!("{}/plugins/{plugin_id}/enable", local_var_configuration.base_path, plugin_id=crate::apis::urlencode(plugin_id));
180    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
181
182    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
183        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
184    }
185    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
186        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
187    };
188
189    let local_var_req = local_var_req_builder.build()?;
190    let local_var_resp = local_var_client.execute(local_var_req).await?;
191
192    let local_var_status = local_var_resp.status();
193    let local_var_content = local_var_resp.text().await?;
194
195    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
196        serde_json::from_str(&local_var_content).map_err(Error::from)
197    } else {
198        let local_var_entity: Option<EnablePluginError> = serde_json::from_str(&local_var_content).ok();
199        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
200        Err(Error::ResponseError(local_var_error))
201    }
202}
203
204/// Gets all plugins from the marketplace server, merging data from locally installed plugins as well as prepackaged plugins shipped with the server.  ##### Permissions Must have `manage_system` permission.  __Minimum server version__: 5.16 
205pub async fn get_marketplace_plugins(configuration: &configuration::Configuration, page: Option<i32>, per_page: Option<i32>, filter: Option<&str>, server_version: Option<&str>, local_only: Option<bool>) -> Result<Vec<crate::models::MarketplacePlugin>, Error<GetMarketplacePluginsError>> {
206    let local_var_configuration = configuration;
207
208    let local_var_client = &local_var_configuration.client;
209
210    let local_var_uri_str = format!("{}/plugins/marketplace", local_var_configuration.base_path);
211    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
212
213    if let Some(ref local_var_str) = page {
214        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
215    }
216    if let Some(ref local_var_str) = per_page {
217        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
218    }
219    if let Some(ref local_var_str) = filter {
220        local_var_req_builder = local_var_req_builder.query(&[("filter", &local_var_str.to_string())]);
221    }
222    if let Some(ref local_var_str) = server_version {
223        local_var_req_builder = local_var_req_builder.query(&[("server_version", &local_var_str.to_string())]);
224    }
225    if let Some(ref local_var_str) = local_only {
226        local_var_req_builder = local_var_req_builder.query(&[("local_only", &local_var_str.to_string())]);
227    }
228    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
229        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
230    }
231    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
232        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
233    };
234
235    let local_var_req = local_var_req_builder.build()?;
236    let local_var_resp = local_var_client.execute(local_var_req).await?;
237
238    let local_var_status = local_var_resp.status();
239    let local_var_content = local_var_resp.text().await?;
240
241    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
242        serde_json::from_str(&local_var_content).map_err(Error::from)
243    } else {
244        let local_var_entity: Option<GetMarketplacePluginsError> = serde_json::from_str(&local_var_content).ok();
245        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
246        Err(Error::ResponseError(local_var_error))
247    }
248}
249
250/// Retrieves the status that specifies that at least one System Admin has visited the in-product Plugin Marketplace. __Minimum server version: 5.33__ ##### Permissions Must have `manage_system` permissions. 
251pub async fn get_marketplace_visited_by_admin(configuration: &configuration::Configuration, ) -> Result<crate::models::System, Error<GetMarketplaceVisitedByAdminError>> {
252    let local_var_configuration = configuration;
253
254    let local_var_client = &local_var_configuration.client;
255
256    let local_var_uri_str = format!("{}/plugins/marketplace/first_admin_visit", local_var_configuration.base_path);
257    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
258
259    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
260        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
261    }
262    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
263        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
264    };
265
266    let local_var_req = local_var_req_builder.build()?;
267    let local_var_resp = local_var_client.execute(local_var_req).await?;
268
269    let local_var_status = local_var_resp.status();
270    let local_var_content = local_var_resp.text().await?;
271
272    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
273        serde_json::from_str(&local_var_content).map_err(Error::from)
274    } else {
275        let local_var_entity: Option<GetMarketplaceVisitedByAdminError> = serde_json::from_str(&local_var_content).ok();
276        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
277        Err(Error::ResponseError(local_var_error))
278    }
279}
280
281/// Returns the status for plugins installed anywhere in the cluster  ##### Permissions No permissions required.  __Minimum server version__: 4.4 
282pub async fn get_plugin_statuses(configuration: &configuration::Configuration, ) -> Result<Vec<crate::models::PluginStatus>, Error<GetPluginStatusesError>> {
283    let local_var_configuration = configuration;
284
285    let local_var_client = &local_var_configuration.client;
286
287    let local_var_uri_str = format!("{}/plugins/statuses", local_var_configuration.base_path);
288    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
289
290    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
291        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
292    }
293    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
294        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
295    };
296
297    let local_var_req = local_var_req_builder.build()?;
298    let local_var_resp = local_var_client.execute(local_var_req).await?;
299
300    let local_var_status = local_var_resp.status();
301    let local_var_content = local_var_resp.text().await?;
302
303    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
304        serde_json::from_str(&local_var_content).map_err(Error::from)
305    } else {
306        let local_var_entity: Option<GetPluginStatusesError> = serde_json::from_str(&local_var_content).ok();
307        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
308        Err(Error::ResponseError(local_var_error))
309    }
310}
311
312/// Get a list of inactive and a list of active plugin manifests. Plugins must be enabled in the server's config settings.  ##### Permissions Must have `manage_system` permission.  __Minimum server version__: 4.4 
313pub async fn get_plugins(configuration: &configuration::Configuration, ) -> Result<crate::models::GetPlugins200Response, Error<GetPluginsError>> {
314    let local_var_configuration = configuration;
315
316    let local_var_client = &local_var_configuration.client;
317
318    let local_var_uri_str = format!("{}/plugins", local_var_configuration.base_path);
319    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
320
321    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
322        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
323    }
324    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
325        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
326    };
327
328    let local_var_req = local_var_req_builder.build()?;
329    let local_var_resp = local_var_client.execute(local_var_req).await?;
330
331    let local_var_status = local_var_resp.status();
332    let local_var_content = local_var_resp.text().await?;
333
334    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
335        serde_json::from_str(&local_var_content).map_err(Error::from)
336    } else {
337        let local_var_entity: Option<GetPluginsError> = serde_json::from_str(&local_var_content).ok();
338        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
339        Err(Error::ResponseError(local_var_error))
340    }
341}
342
343/// Get a list of web app plugins installed and activated on the server.  ##### Permissions No permissions required.  __Minimum server version__: 4.4 
344pub async fn get_webapp_plugins(configuration: &configuration::Configuration, ) -> Result<Vec<crate::models::PluginManifestWebapp>, Error<GetWebappPluginsError>> {
345    let local_var_configuration = configuration;
346
347    let local_var_client = &local_var_configuration.client;
348
349    let local_var_uri_str = format!("{}/plugins/webapp", local_var_configuration.base_path);
350    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
351
352    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
353        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
354    }
355    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
356        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
357    };
358
359    let local_var_req = local_var_req_builder.build()?;
360    let local_var_resp = local_var_client.execute(local_var_req).await?;
361
362    let local_var_status = local_var_resp.status();
363    let local_var_content = local_var_resp.text().await?;
364
365    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
366        serde_json::from_str(&local_var_content).map_err(Error::from)
367    } else {
368        let local_var_entity: Option<GetWebappPluginsError> = serde_json::from_str(&local_var_content).ok();
369        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
370        Err(Error::ResponseError(local_var_error))
371    }
372}
373
374/// Installs a plugin listed in the marketplace server.  ##### Permissions Must have `manage_system` permission.  __Minimum server version__: 5.16 
375pub async fn install_marketplace_plugin(configuration: &configuration::Configuration, install_marketplace_plugin_request: crate::models::InstallMarketplacePluginRequest) -> Result<crate::models::PluginManifest, Error<InstallMarketplacePluginError>> {
376    let local_var_configuration = configuration;
377
378    let local_var_client = &local_var_configuration.client;
379
380    let local_var_uri_str = format!("{}/plugins/marketplace", local_var_configuration.base_path);
381    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
382
383    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
384        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
385    }
386    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
387        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
388    };
389    local_var_req_builder = local_var_req_builder.json(&install_marketplace_plugin_request);
390
391    let local_var_req = local_var_req_builder.build()?;
392    let local_var_resp = local_var_client.execute(local_var_req).await?;
393
394    let local_var_status = local_var_resp.status();
395    let local_var_content = local_var_resp.text().await?;
396
397    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
398        serde_json::from_str(&local_var_content).map_err(Error::from)
399    } else {
400        let local_var_entity: Option<InstallMarketplacePluginError> = serde_json::from_str(&local_var_content).ok();
401        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
402        Err(Error::ResponseError(local_var_error))
403    }
404}
405
406/// Supply a URL to a plugin compressed in a .tar.gz file. Plugins must be enabled in the server's config settings.  ##### Permissions Must have `manage_system` permission.  __Minimum server version__: 5.14 
407pub async fn install_plugin_from_url(configuration: &configuration::Configuration, plugin_download_url: &str, force: Option<&str>) -> Result<crate::models::StatusOk, Error<InstallPluginFromUrlError>> {
408    let local_var_configuration = configuration;
409
410    let local_var_client = &local_var_configuration.client;
411
412    let local_var_uri_str = format!("{}/plugins/install_from_url", local_var_configuration.base_path);
413    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
414
415    local_var_req_builder = local_var_req_builder.query(&[("plugin_download_url", &plugin_download_url.to_string())]);
416    if let Some(ref local_var_str) = force {
417        local_var_req_builder = local_var_req_builder.query(&[("force", &local_var_str.to_string())]);
418    }
419    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
420        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
421    }
422    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
423        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
424    };
425
426    let local_var_req = local_var_req_builder.build()?;
427    let local_var_resp = local_var_client.execute(local_var_req).await?;
428
429    let local_var_status = local_var_resp.status();
430    let local_var_content = local_var_resp.text().await?;
431
432    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
433        serde_json::from_str(&local_var_content).map_err(Error::from)
434    } else {
435        let local_var_entity: Option<InstallPluginFromUrlError> = serde_json::from_str(&local_var_content).ok();
436        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
437        Err(Error::ResponseError(local_var_error))
438    }
439}
440
441/// Remove the plugin with the provided ID from the server. All plugin files are deleted. Plugins must be enabled in the server's config settings.  ##### Permissions Must have `manage_system` permission.  __Minimum server version__: 4.4 
442pub async fn remove_plugin(configuration: &configuration::Configuration, plugin_id: &str) -> Result<crate::models::StatusOk, Error<RemovePluginError>> {
443    let local_var_configuration = configuration;
444
445    let local_var_client = &local_var_configuration.client;
446
447    let local_var_uri_str = format!("{}/plugins/{plugin_id}", local_var_configuration.base_path, plugin_id=crate::apis::urlencode(plugin_id));
448    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
449
450    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
451        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
452    }
453    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
454        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
455    };
456
457    let local_var_req = local_var_req_builder.build()?;
458    let local_var_resp = local_var_client.execute(local_var_req).await?;
459
460    let local_var_status = local_var_resp.status();
461    let local_var_content = local_var_resp.text().await?;
462
463    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
464        serde_json::from_str(&local_var_content).map_err(Error::from)
465    } else {
466        let local_var_entity: Option<RemovePluginError> = serde_json::from_str(&local_var_content).ok();
467        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
468        Err(Error::ResponseError(local_var_error))
469    }
470}
471
472/// Upload a plugin that is contained within a compressed .tar.gz file. Plugins and plugin uploads must be enabled in the server's config settings.  ##### Permissions Must have `manage_system` permission.  __Minimum server version__: 4.4 
473pub async fn upload_plugin(configuration: &configuration::Configuration, plugin: std::path::PathBuf, force: Option<&str>) -> Result<crate::models::StatusOk, Error<UploadPluginError>> {
474    let local_var_configuration = configuration;
475
476    let local_var_client = &local_var_configuration.client;
477
478    let local_var_uri_str = format!("{}/plugins", local_var_configuration.base_path);
479    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
480
481    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
482        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
483    }
484    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
485        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
486    };
487    let mut local_var_form = reqwest::multipart::Form::new();
488    // TODO: support file upload for 'plugin' parameter
489    if let Some(local_var_param_value) = force {
490        local_var_form = local_var_form.text("force", local_var_param_value.to_string());
491    }
492    local_var_req_builder = local_var_req_builder.multipart(local_var_form);
493
494    let local_var_req = local_var_req_builder.build()?;
495    let local_var_resp = local_var_client.execute(local_var_req).await?;
496
497    let local_var_status = local_var_resp.status();
498    let local_var_content = local_var_resp.text().await?;
499
500    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
501        serde_json::from_str(&local_var_content).map_err(Error::from)
502    } else {
503        let local_var_entity: Option<UploadPluginError> = serde_json::from_str(&local_var_content).ok();
504        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
505        Err(Error::ResponseError(local_var_error))
506    }
507}
508