windmill_api/apis/
app_api.rs

1/*
2 * Windmill API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 1.505.0
7 * Contact: contact@windmill.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12use reqwest;
13use serde::{Deserialize, Serialize};
14use crate::{apis::ResponseContent, models};
15use super::{Error, configuration};
16
17
18/// struct for typed errors of method [`create_app`]
19#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum CreateAppError {
22    UnknownValue(serde_json::Value),
23}
24
25/// struct for typed errors of method [`custom_path_exists`]
26#[derive(Debug, Clone, Serialize, Deserialize)]
27#[serde(untagged)]
28pub enum CustomPathExistsError {
29    UnknownValue(serde_json::Value),
30}
31
32/// struct for typed errors of method [`delete_app`]
33#[derive(Debug, Clone, Serialize, Deserialize)]
34#[serde(untagged)]
35pub enum DeleteAppError {
36    UnknownValue(serde_json::Value),
37}
38
39/// struct for typed errors of method [`delete_s3_file_from_app`]
40#[derive(Debug, Clone, Serialize, Deserialize)]
41#[serde(untagged)]
42pub enum DeleteS3FileFromAppError {
43    UnknownValue(serde_json::Value),
44}
45
46/// struct for typed errors of method [`execute_component`]
47#[derive(Debug, Clone, Serialize, Deserialize)]
48#[serde(untagged)]
49pub enum ExecuteComponentError {
50    UnknownValue(serde_json::Value),
51}
52
53/// struct for typed errors of method [`exists_app`]
54#[derive(Debug, Clone, Serialize, Deserialize)]
55#[serde(untagged)]
56pub enum ExistsAppError {
57    UnknownValue(serde_json::Value),
58}
59
60/// struct for typed errors of method [`get_app_by_path`]
61#[derive(Debug, Clone, Serialize, Deserialize)]
62#[serde(untagged)]
63pub enum GetAppByPathError {
64    UnknownValue(serde_json::Value),
65}
66
67/// struct for typed errors of method [`get_app_by_path_with_draft`]
68#[derive(Debug, Clone, Serialize, Deserialize)]
69#[serde(untagged)]
70pub enum GetAppByPathWithDraftError {
71    UnknownValue(serde_json::Value),
72}
73
74/// struct for typed errors of method [`get_app_by_version`]
75#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(untagged)]
77pub enum GetAppByVersionError {
78    UnknownValue(serde_json::Value),
79}
80
81/// struct for typed errors of method [`get_app_history_by_path`]
82#[derive(Debug, Clone, Serialize, Deserialize)]
83#[serde(untagged)]
84pub enum GetAppHistoryByPathError {
85    UnknownValue(serde_json::Value),
86}
87
88/// struct for typed errors of method [`get_app_latest_version`]
89#[derive(Debug, Clone, Serialize, Deserialize)]
90#[serde(untagged)]
91pub enum GetAppLatestVersionError {
92    UnknownValue(serde_json::Value),
93}
94
95/// struct for typed errors of method [`get_app_lite_by_path`]
96#[derive(Debug, Clone, Serialize, Deserialize)]
97#[serde(untagged)]
98pub enum GetAppLiteByPathError {
99    UnknownValue(serde_json::Value),
100}
101
102/// struct for typed errors of method [`get_hub_app_by_id`]
103#[derive(Debug, Clone, Serialize, Deserialize)]
104#[serde(untagged)]
105pub enum GetHubAppByIdError {
106    UnknownValue(serde_json::Value),
107}
108
109/// struct for typed errors of method [`get_public_app_by_custom_path`]
110#[derive(Debug, Clone, Serialize, Deserialize)]
111#[serde(untagged)]
112pub enum GetPublicAppByCustomPathError {
113    UnknownValue(serde_json::Value),
114}
115
116/// struct for typed errors of method [`get_public_app_by_secret`]
117#[derive(Debug, Clone, Serialize, Deserialize)]
118#[serde(untagged)]
119pub enum GetPublicAppBySecretError {
120    UnknownValue(serde_json::Value),
121}
122
123/// struct for typed errors of method [`get_public_resource`]
124#[derive(Debug, Clone, Serialize, Deserialize)]
125#[serde(untagged)]
126pub enum GetPublicResourceError {
127    UnknownValue(serde_json::Value),
128}
129
130/// struct for typed errors of method [`get_public_secret_of_app`]
131#[derive(Debug, Clone, Serialize, Deserialize)]
132#[serde(untagged)]
133pub enum GetPublicSecretOfAppError {
134    UnknownValue(serde_json::Value),
135}
136
137/// struct for typed errors of method [`list_app_paths_from_workspace_runnable`]
138#[derive(Debug, Clone, Serialize, Deserialize)]
139#[serde(untagged)]
140pub enum ListAppPathsFromWorkspaceRunnableError {
141    UnknownValue(serde_json::Value),
142}
143
144/// struct for typed errors of method [`list_apps`]
145#[derive(Debug, Clone, Serialize, Deserialize)]
146#[serde(untagged)]
147pub enum ListAppsError {
148    UnknownValue(serde_json::Value),
149}
150
151/// struct for typed errors of method [`list_hub_apps`]
152#[derive(Debug, Clone, Serialize, Deserialize)]
153#[serde(untagged)]
154pub enum ListHubAppsError {
155    UnknownValue(serde_json::Value),
156}
157
158/// struct for typed errors of method [`list_search_app`]
159#[derive(Debug, Clone, Serialize, Deserialize)]
160#[serde(untagged)]
161pub enum ListSearchAppError {
162    UnknownValue(serde_json::Value),
163}
164
165/// struct for typed errors of method [`sign_s3_objects`]
166#[derive(Debug, Clone, Serialize, Deserialize)]
167#[serde(untagged)]
168pub enum SignS3ObjectsError {
169    UnknownValue(serde_json::Value),
170}
171
172/// struct for typed errors of method [`update_app`]
173#[derive(Debug, Clone, Serialize, Deserialize)]
174#[serde(untagged)]
175pub enum UpdateAppError {
176    UnknownValue(serde_json::Value),
177}
178
179/// struct for typed errors of method [`update_app_history`]
180#[derive(Debug, Clone, Serialize, Deserialize)]
181#[serde(untagged)]
182pub enum UpdateAppHistoryError {
183    UnknownValue(serde_json::Value),
184}
185
186/// struct for typed errors of method [`upload_s3_file_from_app`]
187#[derive(Debug, Clone, Serialize, Deserialize)]
188#[serde(untagged)]
189pub enum UploadS3FileFromAppError {
190    UnknownValue(serde_json::Value),
191}
192
193
194pub async fn create_app(configuration: &configuration::Configuration, workspace: &str, create_app_request: models::CreateAppRequest) -> Result<String, Error<CreateAppError>> {
195    let local_var_configuration = configuration;
196
197    let local_var_client = &local_var_configuration.client;
198
199    let local_var_uri_str = format!("{}/w/{workspace}/apps/create", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
200    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
201
202    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
203        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
204    }
205    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
206        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
207    };
208    local_var_req_builder = local_var_req_builder.json(&create_app_request);
209
210    let local_var_req = local_var_req_builder.build()?;
211    let local_var_resp = local_var_client.execute(local_var_req).await?;
212
213    let local_var_status = local_var_resp.status();
214    let local_var_content = local_var_resp.text().await?;
215
216    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
217        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
218    } else {
219        let local_var_entity: Option<CreateAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
220        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
221        Err(Error::ResponseError(local_var_error))
222    }
223}
224
225pub async fn custom_path_exists(configuration: &configuration::Configuration, workspace: &str, custom_path: &str) -> Result<bool, Error<CustomPathExistsError>> {
226    let local_var_configuration = configuration;
227
228    let local_var_client = &local_var_configuration.client;
229
230    let local_var_uri_str = format!("{}/w/{workspace}/apps/custom_path_exists/{custom_path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), custom_path=crate::apis::urlencode(custom_path));
231    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
232
233    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
234        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
235    }
236    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
237        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
238    };
239
240    let local_var_req = local_var_req_builder.build()?;
241    let local_var_resp = local_var_client.execute(local_var_req).await?;
242
243    let local_var_status = local_var_resp.status();
244    let local_var_content = local_var_resp.text().await?;
245
246    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
247        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
248    } else {
249        let local_var_entity: Option<CustomPathExistsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
250        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
251        Err(Error::ResponseError(local_var_error))
252    }
253}
254
255pub async fn delete_app(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<String, Error<DeleteAppError>> {
256    let local_var_configuration = configuration;
257
258    let local_var_client = &local_var_configuration.client;
259
260    let local_var_uri_str = format!("{}/w/{workspace}/apps/delete/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
261    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
262
263    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
264        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
265    }
266    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
267        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
268    };
269
270    let local_var_req = local_var_req_builder.build()?;
271    let local_var_resp = local_var_client.execute(local_var_req).await?;
272
273    let local_var_status = local_var_resp.status();
274    let local_var_content = local_var_resp.text().await?;
275
276    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
277        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
278    } else {
279        let local_var_entity: Option<DeleteAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
280        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
281        Err(Error::ResponseError(local_var_error))
282    }
283}
284
285pub async fn delete_s3_file_from_app(configuration: &configuration::Configuration, workspace: &str, delete_token: &str) -> Result<String, Error<DeleteS3FileFromAppError>> {
286    let local_var_configuration = configuration;
287
288    let local_var_client = &local_var_configuration.client;
289
290    let local_var_uri_str = format!("{}/w/{workspace}/apps_u/delete_s3_file", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
291    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
292
293    local_var_req_builder = local_var_req_builder.query(&[("delete_token", &delete_token.to_string())]);
294    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
295        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
296    }
297    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
298        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
299    };
300
301    let local_var_req = local_var_req_builder.build()?;
302    let local_var_resp = local_var_client.execute(local_var_req).await?;
303
304    let local_var_status = local_var_resp.status();
305    let local_var_content = local_var_resp.text().await?;
306
307    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
308        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
309    } else {
310        let local_var_entity: Option<DeleteS3FileFromAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
311        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
312        Err(Error::ResponseError(local_var_error))
313    }
314}
315
316pub async fn execute_component(configuration: &configuration::Configuration, workspace: &str, path: &str, execute_component_request: models::ExecuteComponentRequest) -> Result<String, Error<ExecuteComponentError>> {
317    let local_var_configuration = configuration;
318
319    let local_var_client = &local_var_configuration.client;
320
321    let local_var_uri_str = format!("{}/w/{workspace}/apps_u/execute_component/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
322    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
323
324    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
325        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
326    }
327    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
328        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
329    };
330    local_var_req_builder = local_var_req_builder.json(&execute_component_request);
331
332    let local_var_req = local_var_req_builder.build()?;
333    let local_var_resp = local_var_client.execute(local_var_req).await?;
334
335    let local_var_status = local_var_resp.status();
336    let local_var_content = local_var_resp.text().await?;
337
338    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
339        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
340    } else {
341        let local_var_entity: Option<ExecuteComponentError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
342        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
343        Err(Error::ResponseError(local_var_error))
344    }
345}
346
347pub async fn exists_app(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<bool, Error<ExistsAppError>> {
348    let local_var_configuration = configuration;
349
350    let local_var_client = &local_var_configuration.client;
351
352    let local_var_uri_str = format!("{}/w/{workspace}/apps/exists/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
353    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
354
355    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
356        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
357    }
358    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
359        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
360    };
361
362    let local_var_req = local_var_req_builder.build()?;
363    let local_var_resp = local_var_client.execute(local_var_req).await?;
364
365    let local_var_status = local_var_resp.status();
366    let local_var_content = local_var_resp.text().await?;
367
368    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
369        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
370    } else {
371        let local_var_entity: Option<ExistsAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
372        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
373        Err(Error::ResponseError(local_var_error))
374    }
375}
376
377pub async fn get_app_by_path(configuration: &configuration::Configuration, workspace: &str, path: &str, with_starred_info: Option<bool>) -> Result<models::AppWithLastVersion, Error<GetAppByPathError>> {
378    let local_var_configuration = configuration;
379
380    let local_var_client = &local_var_configuration.client;
381
382    let local_var_uri_str = format!("{}/w/{workspace}/apps/get/p/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
383    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
384
385    if let Some(ref local_var_str) = with_starred_info {
386        local_var_req_builder = local_var_req_builder.query(&[("with_starred_info", &local_var_str.to_string())]);
387    }
388    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
389        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
390    }
391    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
392        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
393    };
394
395    let local_var_req = local_var_req_builder.build()?;
396    let local_var_resp = local_var_client.execute(local_var_req).await?;
397
398    let local_var_status = local_var_resp.status();
399    let local_var_content = local_var_resp.text().await?;
400
401    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
402        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
403    } else {
404        let local_var_entity: Option<GetAppByPathError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
405        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
406        Err(Error::ResponseError(local_var_error))
407    }
408}
409
410pub async fn get_app_by_path_with_draft(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<models::AppWithLastVersionWDraft, Error<GetAppByPathWithDraftError>> {
411    let local_var_configuration = configuration;
412
413    let local_var_client = &local_var_configuration.client;
414
415    let local_var_uri_str = format!("{}/w/{workspace}/apps/get/draft/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
416    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
417
418    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
419        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
420    }
421    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
422        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
423    };
424
425    let local_var_req = local_var_req_builder.build()?;
426    let local_var_resp = local_var_client.execute(local_var_req).await?;
427
428    let local_var_status = local_var_resp.status();
429    let local_var_content = local_var_resp.text().await?;
430
431    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
432        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
433    } else {
434        let local_var_entity: Option<GetAppByPathWithDraftError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
435        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
436        Err(Error::ResponseError(local_var_error))
437    }
438}
439
440pub async fn get_app_by_version(configuration: &configuration::Configuration, workspace: &str, id: i32) -> Result<models::AppWithLastVersion, Error<GetAppByVersionError>> {
441    let local_var_configuration = configuration;
442
443    let local_var_client = &local_var_configuration.client;
444
445    let local_var_uri_str = format!("{}/w/{workspace}/apps/get/v/{id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=id);
446    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
447
448    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
449        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
450    }
451    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
452        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
453    };
454
455    let local_var_req = local_var_req_builder.build()?;
456    let local_var_resp = local_var_client.execute(local_var_req).await?;
457
458    let local_var_status = local_var_resp.status();
459    let local_var_content = local_var_resp.text().await?;
460
461    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
462        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
463    } else {
464        let local_var_entity: Option<GetAppByVersionError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
465        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
466        Err(Error::ResponseError(local_var_error))
467    }
468}
469
470pub async fn get_app_history_by_path(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<Vec<models::AppHistory>, Error<GetAppHistoryByPathError>> {
471    let local_var_configuration = configuration;
472
473    let local_var_client = &local_var_configuration.client;
474
475    let local_var_uri_str = format!("{}/w/{workspace}/apps/history/p/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
476    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
477
478    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
479        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
480    }
481    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
482        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
483    };
484
485    let local_var_req = local_var_req_builder.build()?;
486    let local_var_resp = local_var_client.execute(local_var_req).await?;
487
488    let local_var_status = local_var_resp.status();
489    let local_var_content = local_var_resp.text().await?;
490
491    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
492        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
493    } else {
494        let local_var_entity: Option<GetAppHistoryByPathError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
495        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
496        Err(Error::ResponseError(local_var_error))
497    }
498}
499
500pub async fn get_app_latest_version(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<models::AppHistory, Error<GetAppLatestVersionError>> {
501    let local_var_configuration = configuration;
502
503    let local_var_client = &local_var_configuration.client;
504
505    let local_var_uri_str = format!("{}/w/{workspace}/apps/get_latest_version/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
506    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
507
508    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
509        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
510    }
511    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
512        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
513    };
514
515    let local_var_req = local_var_req_builder.build()?;
516    let local_var_resp = local_var_client.execute(local_var_req).await?;
517
518    let local_var_status = local_var_resp.status();
519    let local_var_content = local_var_resp.text().await?;
520
521    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
522        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
523    } else {
524        let local_var_entity: Option<GetAppLatestVersionError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
525        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
526        Err(Error::ResponseError(local_var_error))
527    }
528}
529
530pub async fn get_app_lite_by_path(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<models::AppWithLastVersion, Error<GetAppLiteByPathError>> {
531    let local_var_configuration = configuration;
532
533    let local_var_client = &local_var_configuration.client;
534
535    let local_var_uri_str = format!("{}/w/{workspace}/apps/get/lite/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
536    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
537
538    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
539        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
540    }
541    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
542        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
543    };
544
545    let local_var_req = local_var_req_builder.build()?;
546    let local_var_resp = local_var_client.execute(local_var_req).await?;
547
548    let local_var_status = local_var_resp.status();
549    let local_var_content = local_var_resp.text().await?;
550
551    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
552        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
553    } else {
554        let local_var_entity: Option<GetAppLiteByPathError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
555        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
556        Err(Error::ResponseError(local_var_error))
557    }
558}
559
560pub async fn get_hub_app_by_id(configuration: &configuration::Configuration, id: i32) -> Result<models::GetHubAppById200Response, Error<GetHubAppByIdError>> {
561    let local_var_configuration = configuration;
562
563    let local_var_client = &local_var_configuration.client;
564
565    let local_var_uri_str = format!("{}/apps/hub/get/{id}", local_var_configuration.base_path, id=id);
566    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
567
568    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
569        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
570    }
571    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
572        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
573    };
574
575    let local_var_req = local_var_req_builder.build()?;
576    let local_var_resp = local_var_client.execute(local_var_req).await?;
577
578    let local_var_status = local_var_resp.status();
579    let local_var_content = local_var_resp.text().await?;
580
581    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
582        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
583    } else {
584        let local_var_entity: Option<GetHubAppByIdError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
585        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
586        Err(Error::ResponseError(local_var_error))
587    }
588}
589
590pub async fn get_public_app_by_custom_path(configuration: &configuration::Configuration, custom_path: &str) -> Result<models::GetPublicAppByCustomPath200Response, Error<GetPublicAppByCustomPathError>> {
591    let local_var_configuration = configuration;
592
593    let local_var_client = &local_var_configuration.client;
594
595    let local_var_uri_str = format!("{}/apps_u/public_app_by_custom_path/{custom_path}", local_var_configuration.base_path, custom_path=crate::apis::urlencode(custom_path));
596    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
597
598    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
599        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
600    }
601    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
602        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
603    };
604
605    let local_var_req = local_var_req_builder.build()?;
606    let local_var_resp = local_var_client.execute(local_var_req).await?;
607
608    let local_var_status = local_var_resp.status();
609    let local_var_content = local_var_resp.text().await?;
610
611    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
612        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
613    } else {
614        let local_var_entity: Option<GetPublicAppByCustomPathError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
615        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
616        Err(Error::ResponseError(local_var_error))
617    }
618}
619
620pub async fn get_public_app_by_secret(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<models::AppWithLastVersion, Error<GetPublicAppBySecretError>> {
621    let local_var_configuration = configuration;
622
623    let local_var_client = &local_var_configuration.client;
624
625    let local_var_uri_str = format!("{}/w/{workspace}/apps_u/public_app/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
626    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
627
628    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
629        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
630    }
631    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
632        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
633    };
634
635    let local_var_req = local_var_req_builder.build()?;
636    let local_var_resp = local_var_client.execute(local_var_req).await?;
637
638    let local_var_status = local_var_resp.status();
639    let local_var_content = local_var_resp.text().await?;
640
641    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
642        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
643    } else {
644        let local_var_entity: Option<GetPublicAppBySecretError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
645        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
646        Err(Error::ResponseError(local_var_error))
647    }
648}
649
650pub async fn get_public_resource(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<serde_json::Value, Error<GetPublicResourceError>> {
651    let local_var_configuration = configuration;
652
653    let local_var_client = &local_var_configuration.client;
654
655    let local_var_uri_str = format!("{}/w/{workspace}/apps_u/public_resource/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
656    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
657
658    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
659        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
660    }
661    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
662        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
663    };
664
665    let local_var_req = local_var_req_builder.build()?;
666    let local_var_resp = local_var_client.execute(local_var_req).await?;
667
668    let local_var_status = local_var_resp.status();
669    let local_var_content = local_var_resp.text().await?;
670
671    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
672        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
673    } else {
674        let local_var_entity: Option<GetPublicResourceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
675        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
676        Err(Error::ResponseError(local_var_error))
677    }
678}
679
680pub async fn get_public_secret_of_app(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<String, Error<GetPublicSecretOfAppError>> {
681    let local_var_configuration = configuration;
682
683    let local_var_client = &local_var_configuration.client;
684
685    let local_var_uri_str = format!("{}/w/{workspace}/apps/secret_of/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
686    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
687
688    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
689        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
690    }
691    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
692        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
693    };
694
695    let local_var_req = local_var_req_builder.build()?;
696    let local_var_resp = local_var_client.execute(local_var_req).await?;
697
698    let local_var_status = local_var_resp.status();
699    let local_var_content = local_var_resp.text().await?;
700
701    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
702        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
703    } else {
704        let local_var_entity: Option<GetPublicSecretOfAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
705        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
706        Err(Error::ResponseError(local_var_error))
707    }
708}
709
710pub async fn list_app_paths_from_workspace_runnable(configuration: &configuration::Configuration, workspace: &str, runnable_kind: &str, path: &str) -> Result<Vec<String>, Error<ListAppPathsFromWorkspaceRunnableError>> {
711    let local_var_configuration = configuration;
712
713    let local_var_client = &local_var_configuration.client;
714
715    let local_var_uri_str = format!("{}/w/{workspace}/apps/list_paths_from_workspace_runnable/{runnable_kind}/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), runnable_kind=crate::apis::urlencode(runnable_kind), path=crate::apis::urlencode(path));
716    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
717
718    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
719        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
720    }
721    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
722        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
723    };
724
725    let local_var_req = local_var_req_builder.build()?;
726    let local_var_resp = local_var_client.execute(local_var_req).await?;
727
728    let local_var_status = local_var_resp.status();
729    let local_var_content = local_var_resp.text().await?;
730
731    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
732        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
733    } else {
734        let local_var_entity: Option<ListAppPathsFromWorkspaceRunnableError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
735        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
736        Err(Error::ResponseError(local_var_error))
737    }
738}
739
740pub async fn list_apps(configuration: &configuration::Configuration, workspace: &str, page: Option<i32>, per_page: Option<i32>, order_desc: Option<bool>, created_by: Option<&str>, path_start: Option<&str>, path_exact: Option<&str>, starred_only: Option<bool>, include_draft_only: Option<bool>, with_deployment_msg: Option<bool>) -> Result<Vec<models::ListableApp>, Error<ListAppsError>> {
741    let local_var_configuration = configuration;
742
743    let local_var_client = &local_var_configuration.client;
744
745    let local_var_uri_str = format!("{}/w/{workspace}/apps/list", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
746    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
747
748    if let Some(ref local_var_str) = page {
749        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
750    }
751    if let Some(ref local_var_str) = per_page {
752        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
753    }
754    if let Some(ref local_var_str) = order_desc {
755        local_var_req_builder = local_var_req_builder.query(&[("order_desc", &local_var_str.to_string())]);
756    }
757    if let Some(ref local_var_str) = created_by {
758        local_var_req_builder = local_var_req_builder.query(&[("created_by", &local_var_str.to_string())]);
759    }
760    if let Some(ref local_var_str) = path_start {
761        local_var_req_builder = local_var_req_builder.query(&[("path_start", &local_var_str.to_string())]);
762    }
763    if let Some(ref local_var_str) = path_exact {
764        local_var_req_builder = local_var_req_builder.query(&[("path_exact", &local_var_str.to_string())]);
765    }
766    if let Some(ref local_var_str) = starred_only {
767        local_var_req_builder = local_var_req_builder.query(&[("starred_only", &local_var_str.to_string())]);
768    }
769    if let Some(ref local_var_str) = include_draft_only {
770        local_var_req_builder = local_var_req_builder.query(&[("include_draft_only", &local_var_str.to_string())]);
771    }
772    if let Some(ref local_var_str) = with_deployment_msg {
773        local_var_req_builder = local_var_req_builder.query(&[("with_deployment_msg", &local_var_str.to_string())]);
774    }
775    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
776        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
777    }
778    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
779        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
780    };
781
782    let local_var_req = local_var_req_builder.build()?;
783    let local_var_resp = local_var_client.execute(local_var_req).await?;
784
785    let local_var_status = local_var_resp.status();
786    let local_var_content = local_var_resp.text().await?;
787
788    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
789        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
790    } else {
791        let local_var_entity: Option<ListAppsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
792        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
793        Err(Error::ResponseError(local_var_error))
794    }
795}
796
797pub async fn list_hub_apps(configuration: &configuration::Configuration, ) -> Result<models::ListHubApps200Response, Error<ListHubAppsError>> {
798    let local_var_configuration = configuration;
799
800    let local_var_client = &local_var_configuration.client;
801
802    let local_var_uri_str = format!("{}/apps/hub/list", local_var_configuration.base_path);
803    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
804
805    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
806        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
807    }
808    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
809        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
810    };
811
812    let local_var_req = local_var_req_builder.build()?;
813    let local_var_resp = local_var_client.execute(local_var_req).await?;
814
815    let local_var_status = local_var_resp.status();
816    let local_var_content = local_var_resp.text().await?;
817
818    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
819        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
820    } else {
821        let local_var_entity: Option<ListHubAppsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
822        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
823        Err(Error::ResponseError(local_var_error))
824    }
825}
826
827pub async fn list_search_app(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::ListSearchResource200ResponseInner>, Error<ListSearchAppError>> {
828    let local_var_configuration = configuration;
829
830    let local_var_client = &local_var_configuration.client;
831
832    let local_var_uri_str = format!("{}/w/{workspace}/apps/list_search", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
833    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
834
835    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
836        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
837    }
838    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
839        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
840    };
841
842    let local_var_req = local_var_req_builder.build()?;
843    let local_var_resp = local_var_client.execute(local_var_req).await?;
844
845    let local_var_status = local_var_resp.status();
846    let local_var_content = local_var_resp.text().await?;
847
848    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
849        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
850    } else {
851        let local_var_entity: Option<ListSearchAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
852        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
853        Err(Error::ResponseError(local_var_error))
854    }
855}
856
857pub async fn sign_s3_objects(configuration: &configuration::Configuration, workspace: &str, sign_s3_objects_request: models::SignS3ObjectsRequest) -> Result<Vec<models::S3Object>, Error<SignS3ObjectsError>> {
858    let local_var_configuration = configuration;
859
860    let local_var_client = &local_var_configuration.client;
861
862    let local_var_uri_str = format!("{}/w/{workspace}/apps/sign_s3_objects", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
863    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
864
865    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
866        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
867    }
868    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
869        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
870    };
871    local_var_req_builder = local_var_req_builder.json(&sign_s3_objects_request);
872
873    let local_var_req = local_var_req_builder.build()?;
874    let local_var_resp = local_var_client.execute(local_var_req).await?;
875
876    let local_var_status = local_var_resp.status();
877    let local_var_content = local_var_resp.text().await?;
878
879    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
880        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
881    } else {
882        let local_var_entity: Option<SignS3ObjectsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
883        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
884        Err(Error::ResponseError(local_var_error))
885    }
886}
887
888pub async fn update_app(configuration: &configuration::Configuration, workspace: &str, path: &str, update_app_request: models::UpdateAppRequest) -> Result<String, Error<UpdateAppError>> {
889    let local_var_configuration = configuration;
890
891    let local_var_client = &local_var_configuration.client;
892
893    let local_var_uri_str = format!("{}/w/{workspace}/apps/update/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
894    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
895
896    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
897        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
898    }
899    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
900        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
901    };
902    local_var_req_builder = local_var_req_builder.json(&update_app_request);
903
904    let local_var_req = local_var_req_builder.build()?;
905    let local_var_resp = local_var_client.execute(local_var_req).await?;
906
907    let local_var_status = local_var_resp.status();
908    let local_var_content = local_var_resp.text().await?;
909
910    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
911        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
912    } else {
913        let local_var_entity: Option<UpdateAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
914        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
915        Err(Error::ResponseError(local_var_error))
916    }
917}
918
919pub async fn update_app_history(configuration: &configuration::Configuration, workspace: &str, id: i32, version: i32, update_script_history_request: models::UpdateScriptHistoryRequest) -> Result<String, Error<UpdateAppHistoryError>> {
920    let local_var_configuration = configuration;
921
922    let local_var_client = &local_var_configuration.client;
923
924    let local_var_uri_str = format!("{}/w/{workspace}/apps/history_update/a/{id}/v/{version}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=id, version=version);
925    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
926
927    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
928        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
929    }
930    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
931        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
932    };
933    local_var_req_builder = local_var_req_builder.json(&update_script_history_request);
934
935    let local_var_req = local_var_req_builder.build()?;
936    let local_var_resp = local_var_client.execute(local_var_req).await?;
937
938    let local_var_status = local_var_resp.status();
939    let local_var_content = local_var_resp.text().await?;
940
941    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
942        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
943    } else {
944        let local_var_entity: Option<UpdateAppHistoryError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
945        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
946        Err(Error::ResponseError(local_var_error))
947    }
948}
949
950pub async fn upload_s3_file_from_app(configuration: &configuration::Configuration, workspace: &str, path: &str, body: std::path::PathBuf, file_key: Option<&str>, file_extension: Option<&str>, s3_resource_path: Option<&str>, resource_type: Option<&str>, storage: Option<&str>, content_type: Option<&str>, content_disposition: Option<&str>) -> Result<models::UploadS3FileFromApp200Response, Error<UploadS3FileFromAppError>> {
951    let local_var_configuration = configuration;
952
953    let local_var_client = &local_var_configuration.client;
954
955    let local_var_uri_str = format!("{}/w/{workspace}/apps_u/upload_s3_file/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
956    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
957
958    if let Some(ref local_var_str) = file_key {
959        local_var_req_builder = local_var_req_builder.query(&[("file_key", &local_var_str.to_string())]);
960    }
961    if let Some(ref local_var_str) = file_extension {
962        local_var_req_builder = local_var_req_builder.query(&[("file_extension", &local_var_str.to_string())]);
963    }
964    if let Some(ref local_var_str) = s3_resource_path {
965        local_var_req_builder = local_var_req_builder.query(&[("s3_resource_path", &local_var_str.to_string())]);
966    }
967    if let Some(ref local_var_str) = resource_type {
968        local_var_req_builder = local_var_req_builder.query(&[("resource_type", &local_var_str.to_string())]);
969    }
970    if let Some(ref local_var_str) = storage {
971        local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
972    }
973    if let Some(ref local_var_str) = content_type {
974        local_var_req_builder = local_var_req_builder.query(&[("content_type", &local_var_str.to_string())]);
975    }
976    if let Some(ref local_var_str) = content_disposition {
977        local_var_req_builder = local_var_req_builder.query(&[("content_disposition", &local_var_str.to_string())]);
978    }
979    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
980        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
981    }
982    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
983        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
984    };
985    local_var_req_builder = local_var_req_builder.json(&body);
986
987    let local_var_req = local_var_req_builder.build()?;
988    let local_var_resp = local_var_client.execute(local_var_req).await?;
989
990    let local_var_status = local_var_resp.status();
991    let local_var_content = local_var_resp.text().await?;
992
993    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
994        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
995    } else {
996        let local_var_entity: Option<UploadS3FileFromAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
997        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
998        Err(Error::ResponseError(local_var_error))
999    }
1000}
1001