Skip to main content

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.619.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 [`get_public_secret_of_latest_version_of_app`]
138#[derive(Debug, Clone, Serialize, Deserialize)]
139#[serde(untagged)]
140pub enum GetPublicSecretOfLatestVersionOfAppError {
141    UnknownValue(serde_json::Value),
142}
143
144/// struct for typed errors of method [`get_raw_app_data`]
145#[derive(Debug, Clone, Serialize, Deserialize)]
146#[serde(untagged)]
147pub enum GetRawAppDataError {
148    UnknownValue(serde_json::Value),
149}
150
151/// struct for typed errors of method [`list_app_paths_from_workspace_runnable`]
152#[derive(Debug, Clone, Serialize, Deserialize)]
153#[serde(untagged)]
154pub enum ListAppPathsFromWorkspaceRunnableError {
155    UnknownValue(serde_json::Value),
156}
157
158/// struct for typed errors of method [`list_apps`]
159#[derive(Debug, Clone, Serialize, Deserialize)]
160#[serde(untagged)]
161pub enum ListAppsError {
162    UnknownValue(serde_json::Value),
163}
164
165/// struct for typed errors of method [`list_hub_apps`]
166#[derive(Debug, Clone, Serialize, Deserialize)]
167#[serde(untagged)]
168pub enum ListHubAppsError {
169    UnknownValue(serde_json::Value),
170}
171
172/// struct for typed errors of method [`list_search_app`]
173#[derive(Debug, Clone, Serialize, Deserialize)]
174#[serde(untagged)]
175pub enum ListSearchAppError {
176    UnknownValue(serde_json::Value),
177}
178
179/// struct for typed errors of method [`sign_s3_objects`]
180#[derive(Debug, Clone, Serialize, Deserialize)]
181#[serde(untagged)]
182pub enum SignS3ObjectsError {
183    UnknownValue(serde_json::Value),
184}
185
186/// struct for typed errors of method [`update_app`]
187#[derive(Debug, Clone, Serialize, Deserialize)]
188#[serde(untagged)]
189pub enum UpdateAppError {
190    UnknownValue(serde_json::Value),
191}
192
193/// struct for typed errors of method [`update_app_history`]
194#[derive(Debug, Clone, Serialize, Deserialize)]
195#[serde(untagged)]
196pub enum UpdateAppHistoryError {
197    UnknownValue(serde_json::Value),
198}
199
200/// struct for typed errors of method [`upload_s3_file_from_app`]
201#[derive(Debug, Clone, Serialize, Deserialize)]
202#[serde(untagged)]
203pub enum UploadS3FileFromAppError {
204    UnknownValue(serde_json::Value),
205}
206
207
208pub async fn create_app(configuration: &configuration::Configuration, workspace: &str, create_app_request: models::CreateAppRequest) -> Result<String, Error<CreateAppError>> {
209    let local_var_configuration = configuration;
210
211    let local_var_client = &local_var_configuration.client;
212
213    let local_var_uri_str = format!("{}/w/{workspace}/apps/create", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
214    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
215
216    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
217        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
218    }
219    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
220        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
221    };
222    local_var_req_builder = local_var_req_builder.json(&create_app_request);
223
224    let local_var_req = local_var_req_builder.build()?;
225    let local_var_resp = local_var_client.execute(local_var_req).await?;
226
227    let local_var_status = local_var_resp.status();
228    let local_var_content = local_var_resp.text().await?;
229
230    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
231        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
232    } else {
233        let local_var_entity: Option<CreateAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
234        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
235        Err(Error::ResponseError(local_var_error))
236    }
237}
238
239pub async fn custom_path_exists(configuration: &configuration::Configuration, workspace: &str, custom_path: &str) -> Result<bool, Error<CustomPathExistsError>> {
240    let local_var_configuration = configuration;
241
242    let local_var_client = &local_var_configuration.client;
243
244    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));
245    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
246
247    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
248        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
249    }
250    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
251        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
252    };
253
254    let local_var_req = local_var_req_builder.build()?;
255    let local_var_resp = local_var_client.execute(local_var_req).await?;
256
257    let local_var_status = local_var_resp.status();
258    let local_var_content = local_var_resp.text().await?;
259
260    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
261        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
262    } else {
263        let local_var_entity: Option<CustomPathExistsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
264        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
265        Err(Error::ResponseError(local_var_error))
266    }
267}
268
269pub async fn delete_app(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<String, Error<DeleteAppError>> {
270    let local_var_configuration = configuration;
271
272    let local_var_client = &local_var_configuration.client;
273
274    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));
275    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
276
277    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
278        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
279    }
280    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
281        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
282    };
283
284    let local_var_req = local_var_req_builder.build()?;
285    let local_var_resp = local_var_client.execute(local_var_req).await?;
286
287    let local_var_status = local_var_resp.status();
288    let local_var_content = local_var_resp.text().await?;
289
290    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
291        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
292    } else {
293        let local_var_entity: Option<DeleteAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
294        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
295        Err(Error::ResponseError(local_var_error))
296    }
297}
298
299pub async fn delete_s3_file_from_app(configuration: &configuration::Configuration, workspace: &str, delete_token: &str) -> Result<String, Error<DeleteS3FileFromAppError>> {
300    let local_var_configuration = configuration;
301
302    let local_var_client = &local_var_configuration.client;
303
304    let local_var_uri_str = format!("{}/w/{workspace}/apps_u/delete_s3_file", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
305    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
306
307    local_var_req_builder = local_var_req_builder.query(&[("delete_token", &delete_token.to_string())]);
308    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
309        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
310    }
311    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
312        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
313    };
314
315    let local_var_req = local_var_req_builder.build()?;
316    let local_var_resp = local_var_client.execute(local_var_req).await?;
317
318    let local_var_status = local_var_resp.status();
319    let local_var_content = local_var_resp.text().await?;
320
321    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
322        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
323    } else {
324        let local_var_entity: Option<DeleteS3FileFromAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
325        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
326        Err(Error::ResponseError(local_var_error))
327    }
328}
329
330pub async fn execute_component(configuration: &configuration::Configuration, workspace: &str, path: &str, execute_component_request: models::ExecuteComponentRequest) -> Result<String, Error<ExecuteComponentError>> {
331    let local_var_configuration = configuration;
332
333    let local_var_client = &local_var_configuration.client;
334
335    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));
336    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
337
338    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
339        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
340    }
341    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
342        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
343    };
344    local_var_req_builder = local_var_req_builder.json(&execute_component_request);
345
346    let local_var_req = local_var_req_builder.build()?;
347    let local_var_resp = local_var_client.execute(local_var_req).await?;
348
349    let local_var_status = local_var_resp.status();
350    let local_var_content = local_var_resp.text().await?;
351
352    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
353        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
354    } else {
355        let local_var_entity: Option<ExecuteComponentError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
356        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
357        Err(Error::ResponseError(local_var_error))
358    }
359}
360
361pub async fn exists_app(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<bool, Error<ExistsAppError>> {
362    let local_var_configuration = configuration;
363
364    let local_var_client = &local_var_configuration.client;
365
366    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));
367    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
368
369    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
370        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
371    }
372    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
373        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
374    };
375
376    let local_var_req = local_var_req_builder.build()?;
377    let local_var_resp = local_var_client.execute(local_var_req).await?;
378
379    let local_var_status = local_var_resp.status();
380    let local_var_content = local_var_resp.text().await?;
381
382    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
383        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
384    } else {
385        let local_var_entity: Option<ExistsAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
386        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
387        Err(Error::ResponseError(local_var_error))
388    }
389}
390
391pub async fn get_app_by_path(configuration: &configuration::Configuration, workspace: &str, path: &str, with_starred_info: Option<bool>) -> Result<models::AppWithLastVersion, Error<GetAppByPathError>> {
392    let local_var_configuration = configuration;
393
394    let local_var_client = &local_var_configuration.client;
395
396    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));
397    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
398
399    if let Some(ref local_var_str) = with_starred_info {
400        local_var_req_builder = local_var_req_builder.query(&[("with_starred_info", &local_var_str.to_string())]);
401    }
402    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
403        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
404    }
405    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
406        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
407    };
408
409    let local_var_req = local_var_req_builder.build()?;
410    let local_var_resp = local_var_client.execute(local_var_req).await?;
411
412    let local_var_status = local_var_resp.status();
413    let local_var_content = local_var_resp.text().await?;
414
415    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
416        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
417    } else {
418        let local_var_entity: Option<GetAppByPathError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
419        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
420        Err(Error::ResponseError(local_var_error))
421    }
422}
423
424pub async fn get_app_by_path_with_draft(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<models::AppWithLastVersionWDraft, Error<GetAppByPathWithDraftError>> {
425    let local_var_configuration = configuration;
426
427    let local_var_client = &local_var_configuration.client;
428
429    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));
430    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
431
432    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
433        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
434    }
435    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
436        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
437    };
438
439    let local_var_req = local_var_req_builder.build()?;
440    let local_var_resp = local_var_client.execute(local_var_req).await?;
441
442    let local_var_status = local_var_resp.status();
443    let local_var_content = local_var_resp.text().await?;
444
445    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
446        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
447    } else {
448        let local_var_entity: Option<GetAppByPathWithDraftError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
449        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
450        Err(Error::ResponseError(local_var_error))
451    }
452}
453
454pub async fn get_app_by_version(configuration: &configuration::Configuration, workspace: &str, id: i32) -> Result<models::AppWithLastVersion, Error<GetAppByVersionError>> {
455    let local_var_configuration = configuration;
456
457    let local_var_client = &local_var_configuration.client;
458
459    let local_var_uri_str = format!("{}/w/{workspace}/apps/get/v/{id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=id);
460    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
461
462    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
463        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
464    }
465    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
466        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
467    };
468
469    let local_var_req = local_var_req_builder.build()?;
470    let local_var_resp = local_var_client.execute(local_var_req).await?;
471
472    let local_var_status = local_var_resp.status();
473    let local_var_content = local_var_resp.text().await?;
474
475    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
476        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
477    } else {
478        let local_var_entity: Option<GetAppByVersionError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
479        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
480        Err(Error::ResponseError(local_var_error))
481    }
482}
483
484pub async fn get_app_history_by_path(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<Vec<models::AppHistory>, Error<GetAppHistoryByPathError>> {
485    let local_var_configuration = configuration;
486
487    let local_var_client = &local_var_configuration.client;
488
489    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));
490    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
491
492    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
493        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
494    }
495    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
496        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
497    };
498
499    let local_var_req = local_var_req_builder.build()?;
500    let local_var_resp = local_var_client.execute(local_var_req).await?;
501
502    let local_var_status = local_var_resp.status();
503    let local_var_content = local_var_resp.text().await?;
504
505    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
506        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
507    } else {
508        let local_var_entity: Option<GetAppHistoryByPathError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
509        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
510        Err(Error::ResponseError(local_var_error))
511    }
512}
513
514pub async fn get_app_latest_version(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<models::AppHistory, Error<GetAppLatestVersionError>> {
515    let local_var_configuration = configuration;
516
517    let local_var_client = &local_var_configuration.client;
518
519    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));
520    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
521
522    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
523        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
524    }
525    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
526        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
527    };
528
529    let local_var_req = local_var_req_builder.build()?;
530    let local_var_resp = local_var_client.execute(local_var_req).await?;
531
532    let local_var_status = local_var_resp.status();
533    let local_var_content = local_var_resp.text().await?;
534
535    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
536        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
537    } else {
538        let local_var_entity: Option<GetAppLatestVersionError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
539        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
540        Err(Error::ResponseError(local_var_error))
541    }
542}
543
544pub async fn get_app_lite_by_path(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<models::AppWithLastVersion, Error<GetAppLiteByPathError>> {
545    let local_var_configuration = configuration;
546
547    let local_var_client = &local_var_configuration.client;
548
549    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));
550    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
551
552    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
553        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
554    }
555    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
556        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
557    };
558
559    let local_var_req = local_var_req_builder.build()?;
560    let local_var_resp = local_var_client.execute(local_var_req).await?;
561
562    let local_var_status = local_var_resp.status();
563    let local_var_content = local_var_resp.text().await?;
564
565    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
566        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
567    } else {
568        let local_var_entity: Option<GetAppLiteByPathError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
569        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
570        Err(Error::ResponseError(local_var_error))
571    }
572}
573
574pub async fn get_hub_app_by_id(configuration: &configuration::Configuration, id: i32) -> Result<models::GetHubAppById200Response, Error<GetHubAppByIdError>> {
575    let local_var_configuration = configuration;
576
577    let local_var_client = &local_var_configuration.client;
578
579    let local_var_uri_str = format!("{}/apps/hub/get/{id}", local_var_configuration.base_path, id=id);
580    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
581
582    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
583        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
584    }
585    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
586        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
587    };
588
589    let local_var_req = local_var_req_builder.build()?;
590    let local_var_resp = local_var_client.execute(local_var_req).await?;
591
592    let local_var_status = local_var_resp.status();
593    let local_var_content = local_var_resp.text().await?;
594
595    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
596        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
597    } else {
598        let local_var_entity: Option<GetHubAppByIdError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
599        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
600        Err(Error::ResponseError(local_var_error))
601    }
602}
603
604pub async fn get_public_app_by_custom_path(configuration: &configuration::Configuration, custom_path: &str) -> Result<models::GetPublicAppByCustomPath200Response, Error<GetPublicAppByCustomPathError>> {
605    let local_var_configuration = configuration;
606
607    let local_var_client = &local_var_configuration.client;
608
609    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));
610    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
611
612    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
613        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
614    }
615    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
616        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
617    };
618
619    let local_var_req = local_var_req_builder.build()?;
620    let local_var_resp = local_var_client.execute(local_var_req).await?;
621
622    let local_var_status = local_var_resp.status();
623    let local_var_content = local_var_resp.text().await?;
624
625    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
626        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
627    } else {
628        let local_var_entity: Option<GetPublicAppByCustomPathError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
629        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
630        Err(Error::ResponseError(local_var_error))
631    }
632}
633
634pub async fn get_public_app_by_secret(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<models::AppWithLastVersion, Error<GetPublicAppBySecretError>> {
635    let local_var_configuration = configuration;
636
637    let local_var_client = &local_var_configuration.client;
638
639    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));
640    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
641
642    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
643        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
644    }
645    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
646        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
647    };
648
649    let local_var_req = local_var_req_builder.build()?;
650    let local_var_resp = local_var_client.execute(local_var_req).await?;
651
652    let local_var_status = local_var_resp.status();
653    let local_var_content = local_var_resp.text().await?;
654
655    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
656        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
657    } else {
658        let local_var_entity: Option<GetPublicAppBySecretError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
659        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
660        Err(Error::ResponseError(local_var_error))
661    }
662}
663
664pub async fn get_public_resource(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<serde_json::Value, Error<GetPublicResourceError>> {
665    let local_var_configuration = configuration;
666
667    let local_var_client = &local_var_configuration.client;
668
669    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));
670    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
671
672    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
673        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
674    }
675    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
676        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
677    };
678
679    let local_var_req = local_var_req_builder.build()?;
680    let local_var_resp = local_var_client.execute(local_var_req).await?;
681
682    let local_var_status = local_var_resp.status();
683    let local_var_content = local_var_resp.text().await?;
684
685    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
686        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
687    } else {
688        let local_var_entity: Option<GetPublicResourceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
689        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
690        Err(Error::ResponseError(local_var_error))
691    }
692}
693
694pub async fn get_public_secret_of_app(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<String, Error<GetPublicSecretOfAppError>> {
695    let local_var_configuration = configuration;
696
697    let local_var_client = &local_var_configuration.client;
698
699    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));
700    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
701
702    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
703        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
704    }
705    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
706        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
707    };
708
709    let local_var_req = local_var_req_builder.build()?;
710    let local_var_resp = local_var_client.execute(local_var_req).await?;
711
712    let local_var_status = local_var_resp.status();
713    let local_var_content = local_var_resp.text().await?;
714
715    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
716        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
717    } else {
718        let local_var_entity: Option<GetPublicSecretOfAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
719        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
720        Err(Error::ResponseError(local_var_error))
721    }
722}
723
724pub async fn get_public_secret_of_latest_version_of_app(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<String, Error<GetPublicSecretOfLatestVersionOfAppError>> {
725    let local_var_configuration = configuration;
726
727    let local_var_client = &local_var_configuration.client;
728
729    let local_var_uri_str = format!("{}/w/{workspace}/apps/secret_of_latest_version/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
730    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
731
732    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
733        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
734    }
735    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
736        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
737    };
738
739    let local_var_req = local_var_req_builder.build()?;
740    let local_var_resp = local_var_client.execute(local_var_req).await?;
741
742    let local_var_status = local_var_resp.status();
743    let local_var_content = local_var_resp.text().await?;
744
745    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
746        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
747    } else {
748        let local_var_entity: Option<GetPublicSecretOfLatestVersionOfAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
749        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
750        Err(Error::ResponseError(local_var_error))
751    }
752}
753
754pub async fn get_raw_app_data(configuration: &configuration::Configuration, workspace: &str, secret_with_extension: &str) -> Result<String, Error<GetRawAppDataError>> {
755    let local_var_configuration = configuration;
756
757    let local_var_client = &local_var_configuration.client;
758
759    let local_var_uri_str = format!("{}/w/{workspace}/apps/get_data/v/{secretWithExtension}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), secretWithExtension=crate::apis::urlencode(secret_with_extension));
760    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
761
762    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
763        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
764    }
765    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
766        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
767    };
768
769    let local_var_req = local_var_req_builder.build()?;
770    let local_var_resp = local_var_client.execute(local_var_req).await?;
771
772    let local_var_status = local_var_resp.status();
773    let local_var_content = local_var_resp.text().await?;
774
775    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
776        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
777    } else {
778        let local_var_entity: Option<GetRawAppDataError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
779        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
780        Err(Error::ResponseError(local_var_error))
781    }
782}
783
784pub async fn list_app_paths_from_workspace_runnable(configuration: &configuration::Configuration, workspace: &str, runnable_kind: &str, path: &str) -> Result<Vec<String>, Error<ListAppPathsFromWorkspaceRunnableError>> {
785    let local_var_configuration = configuration;
786
787    let local_var_client = &local_var_configuration.client;
788
789    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));
790    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
791
792    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
793        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
794    }
795    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
796        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
797    };
798
799    let local_var_req = local_var_req_builder.build()?;
800    let local_var_resp = local_var_client.execute(local_var_req).await?;
801
802    let local_var_status = local_var_resp.status();
803    let local_var_content = local_var_resp.text().await?;
804
805    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
806        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
807    } else {
808        let local_var_entity: Option<ListAppPathsFromWorkspaceRunnableError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
809        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
810        Err(Error::ResponseError(local_var_error))
811    }
812}
813
814pub 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>> {
815    let local_var_configuration = configuration;
816
817    let local_var_client = &local_var_configuration.client;
818
819    let local_var_uri_str = format!("{}/w/{workspace}/apps/list", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
820    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
821
822    if let Some(ref local_var_str) = page {
823        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
824    }
825    if let Some(ref local_var_str) = per_page {
826        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
827    }
828    if let Some(ref local_var_str) = order_desc {
829        local_var_req_builder = local_var_req_builder.query(&[("order_desc", &local_var_str.to_string())]);
830    }
831    if let Some(ref local_var_str) = created_by {
832        local_var_req_builder = local_var_req_builder.query(&[("created_by", &local_var_str.to_string())]);
833    }
834    if let Some(ref local_var_str) = path_start {
835        local_var_req_builder = local_var_req_builder.query(&[("path_start", &local_var_str.to_string())]);
836    }
837    if let Some(ref local_var_str) = path_exact {
838        local_var_req_builder = local_var_req_builder.query(&[("path_exact", &local_var_str.to_string())]);
839    }
840    if let Some(ref local_var_str) = starred_only {
841        local_var_req_builder = local_var_req_builder.query(&[("starred_only", &local_var_str.to_string())]);
842    }
843    if let Some(ref local_var_str) = include_draft_only {
844        local_var_req_builder = local_var_req_builder.query(&[("include_draft_only", &local_var_str.to_string())]);
845    }
846    if let Some(ref local_var_str) = with_deployment_msg {
847        local_var_req_builder = local_var_req_builder.query(&[("with_deployment_msg", &local_var_str.to_string())]);
848    }
849    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
850        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
851    }
852    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
853        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
854    };
855
856    let local_var_req = local_var_req_builder.build()?;
857    let local_var_resp = local_var_client.execute(local_var_req).await?;
858
859    let local_var_status = local_var_resp.status();
860    let local_var_content = local_var_resp.text().await?;
861
862    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
863        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
864    } else {
865        let local_var_entity: Option<ListAppsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
866        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
867        Err(Error::ResponseError(local_var_error))
868    }
869}
870
871pub async fn list_hub_apps(configuration: &configuration::Configuration, ) -> Result<models::ListHubApps200Response, Error<ListHubAppsError>> {
872    let local_var_configuration = configuration;
873
874    let local_var_client = &local_var_configuration.client;
875
876    let local_var_uri_str = format!("{}/apps/hub/list", local_var_configuration.base_path);
877    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
878
879    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
880        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
881    }
882    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
883        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
884    };
885
886    let local_var_req = local_var_req_builder.build()?;
887    let local_var_resp = local_var_client.execute(local_var_req).await?;
888
889    let local_var_status = local_var_resp.status();
890    let local_var_content = local_var_resp.text().await?;
891
892    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
893        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
894    } else {
895        let local_var_entity: Option<ListHubAppsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
896        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
897        Err(Error::ResponseError(local_var_error))
898    }
899}
900
901pub async fn list_search_app(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::ListSearchResource200ResponseInner>, Error<ListSearchAppError>> {
902    let local_var_configuration = configuration;
903
904    let local_var_client = &local_var_configuration.client;
905
906    let local_var_uri_str = format!("{}/w/{workspace}/apps/list_search", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
907    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
908
909    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
910        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
911    }
912    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
913        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
914    };
915
916    let local_var_req = local_var_req_builder.build()?;
917    let local_var_resp = local_var_client.execute(local_var_req).await?;
918
919    let local_var_status = local_var_resp.status();
920    let local_var_content = local_var_resp.text().await?;
921
922    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
923        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
924    } else {
925        let local_var_entity: Option<ListSearchAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
926        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
927        Err(Error::ResponseError(local_var_error))
928    }
929}
930
931pub async fn sign_s3_objects(configuration: &configuration::Configuration, workspace: &str, sign_s3_objects_request: models::SignS3ObjectsRequest) -> Result<Vec<models::S3Object>, Error<SignS3ObjectsError>> {
932    let local_var_configuration = configuration;
933
934    let local_var_client = &local_var_configuration.client;
935
936    let local_var_uri_str = format!("{}/w/{workspace}/apps/sign_s3_objects", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
937    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
938
939    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
940        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
941    }
942    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
943        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
944    };
945    local_var_req_builder = local_var_req_builder.json(&sign_s3_objects_request);
946
947    let local_var_req = local_var_req_builder.build()?;
948    let local_var_resp = local_var_client.execute(local_var_req).await?;
949
950    let local_var_status = local_var_resp.status();
951    let local_var_content = local_var_resp.text().await?;
952
953    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
954        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
955    } else {
956        let local_var_entity: Option<SignS3ObjectsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
957        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
958        Err(Error::ResponseError(local_var_error))
959    }
960}
961
962pub async fn update_app(configuration: &configuration::Configuration, workspace: &str, path: &str, update_app_request: models::UpdateAppRequest) -> Result<String, Error<UpdateAppError>> {
963    let local_var_configuration = configuration;
964
965    let local_var_client = &local_var_configuration.client;
966
967    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));
968    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
969
970    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
971        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
972    }
973    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
974        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
975    };
976    local_var_req_builder = local_var_req_builder.json(&update_app_request);
977
978    let local_var_req = local_var_req_builder.build()?;
979    let local_var_resp = local_var_client.execute(local_var_req).await?;
980
981    let local_var_status = local_var_resp.status();
982    let local_var_content = local_var_resp.text().await?;
983
984    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
985        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
986    } else {
987        let local_var_entity: Option<UpdateAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
988        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
989        Err(Error::ResponseError(local_var_error))
990    }
991}
992
993pub async fn update_app_history(configuration: &configuration::Configuration, workspace: &str, id: i32, version: i32, update_script_history_request: models::UpdateScriptHistoryRequest) -> Result<String, Error<UpdateAppHistoryError>> {
994    let local_var_configuration = configuration;
995
996    let local_var_client = &local_var_configuration.client;
997
998    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);
999    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1000
1001    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1002        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1003    }
1004    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1005        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1006    };
1007    local_var_req_builder = local_var_req_builder.json(&update_script_history_request);
1008
1009    let local_var_req = local_var_req_builder.build()?;
1010    let local_var_resp = local_var_client.execute(local_var_req).await?;
1011
1012    let local_var_status = local_var_resp.status();
1013    let local_var_content = local_var_resp.text().await?;
1014
1015    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1016        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1017    } else {
1018        let local_var_entity: Option<UpdateAppHistoryError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1019        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1020        Err(Error::ResponseError(local_var_error))
1021    }
1022}
1023
1024pub 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>> {
1025    let local_var_configuration = configuration;
1026
1027    let local_var_client = &local_var_configuration.client;
1028
1029    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));
1030    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1031
1032    if let Some(ref local_var_str) = file_key {
1033        local_var_req_builder = local_var_req_builder.query(&[("file_key", &local_var_str.to_string())]);
1034    }
1035    if let Some(ref local_var_str) = file_extension {
1036        local_var_req_builder = local_var_req_builder.query(&[("file_extension", &local_var_str.to_string())]);
1037    }
1038    if let Some(ref local_var_str) = s3_resource_path {
1039        local_var_req_builder = local_var_req_builder.query(&[("s3_resource_path", &local_var_str.to_string())]);
1040    }
1041    if let Some(ref local_var_str) = resource_type {
1042        local_var_req_builder = local_var_req_builder.query(&[("resource_type", &local_var_str.to_string())]);
1043    }
1044    if let Some(ref local_var_str) = storage {
1045        local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
1046    }
1047    if let Some(ref local_var_str) = content_type {
1048        local_var_req_builder = local_var_req_builder.query(&[("content_type", &local_var_str.to_string())]);
1049    }
1050    if let Some(ref local_var_str) = content_disposition {
1051        local_var_req_builder = local_var_req_builder.query(&[("content_disposition", &local_var_str.to_string())]);
1052    }
1053    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1054        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1055    }
1056    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1057        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1058    };
1059    local_var_req_builder = local_var_req_builder.json(&body);
1060
1061    let local_var_req = local_var_req_builder.build()?;
1062    let local_var_resp = local_var_client.execute(local_var_req).await?;
1063
1064    let local_var_status = local_var_resp.status();
1065    let local_var_content = local_var_resp.text().await?;
1066
1067    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1068        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1069    } else {
1070        let local_var_entity: Option<UploadS3FileFromAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1071        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1072        Err(Error::ResponseError(local_var_error))
1073    }
1074}
1075