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.755.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 [`app_download_s3_parquet_file_as_csv`]
19#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum AppDownloadS3ParquetFileAsCsvError {
22    UnknownValue(serde_json::Value),
23}
24
25/// struct for typed errors of method [`app_load_csv_preview`]
26#[derive(Debug, Clone, Serialize, Deserialize)]
27#[serde(untagged)]
28pub enum AppLoadCsvPreviewError {
29    UnknownValue(serde_json::Value),
30}
31
32/// struct for typed errors of method [`app_load_file_metadata`]
33#[derive(Debug, Clone, Serialize, Deserialize)]
34#[serde(untagged)]
35pub enum AppLoadFileMetadataError {
36    UnknownValue(serde_json::Value),
37}
38
39/// struct for typed errors of method [`app_load_file_preview`]
40#[derive(Debug, Clone, Serialize, Deserialize)]
41#[serde(untagged)]
42pub enum AppLoadFilePreviewError {
43    UnknownValue(serde_json::Value),
44}
45
46/// struct for typed errors of method [`app_load_parquet_preview`]
47#[derive(Debug, Clone, Serialize, Deserialize)]
48#[serde(untagged)]
49pub enum AppLoadParquetPreviewError {
50    UnknownValue(serde_json::Value),
51}
52
53/// struct for typed errors of method [`app_load_table_count`]
54#[derive(Debug, Clone, Serialize, Deserialize)]
55#[serde(untagged)]
56pub enum AppLoadTableCountError {
57    UnknownValue(serde_json::Value),
58}
59
60/// struct for typed errors of method [`create_app`]
61#[derive(Debug, Clone, Serialize, Deserialize)]
62#[serde(untagged)]
63pub enum CreateAppError {
64    UnknownValue(serde_json::Value),
65}
66
67/// struct for typed errors of method [`custom_path_exists`]
68#[derive(Debug, Clone, Serialize, Deserialize)]
69#[serde(untagged)]
70pub enum CustomPathExistsError {
71    UnknownValue(serde_json::Value),
72}
73
74/// struct for typed errors of method [`delete_app`]
75#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(untagged)]
77pub enum DeleteAppError {
78    UnknownValue(serde_json::Value),
79}
80
81/// struct for typed errors of method [`delete_s3_file_from_app`]
82#[derive(Debug, Clone, Serialize, Deserialize)]
83#[serde(untagged)]
84pub enum DeleteS3FileFromAppError {
85    UnknownValue(serde_json::Value),
86}
87
88/// struct for typed errors of method [`execute_component`]
89#[derive(Debug, Clone, Serialize, Deserialize)]
90#[serde(untagged)]
91pub enum ExecuteComponentError {
92    UnknownValue(serde_json::Value),
93}
94
95/// struct for typed errors of method [`exists_app`]
96#[derive(Debug, Clone, Serialize, Deserialize)]
97#[serde(untagged)]
98pub enum ExistsAppError {
99    UnknownValue(serde_json::Value),
100}
101
102/// struct for typed errors of method [`get_app_by_path`]
103#[derive(Debug, Clone, Serialize, Deserialize)]
104#[serde(untagged)]
105pub enum GetAppByPathError {
106    UnknownValue(serde_json::Value),
107}
108
109/// struct for typed errors of method [`get_app_by_version`]
110#[derive(Debug, Clone, Serialize, Deserialize)]
111#[serde(untagged)]
112pub enum GetAppByVersionError {
113    UnknownValue(serde_json::Value),
114}
115
116/// struct for typed errors of method [`get_app_embed_token_by_custom_path`]
117#[derive(Debug, Clone, Serialize, Deserialize)]
118#[serde(untagged)]
119pub enum GetAppEmbedTokenByCustomPathError {
120    UnknownValue(serde_json::Value),
121}
122
123/// struct for typed errors of method [`get_app_embed_token_by_path`]
124#[derive(Debug, Clone, Serialize, Deserialize)]
125#[serde(untagged)]
126pub enum GetAppEmbedTokenByPathError {
127    UnknownValue(serde_json::Value),
128}
129
130/// struct for typed errors of method [`get_app_embed_token_by_secret`]
131#[derive(Debug, Clone, Serialize, Deserialize)]
132#[serde(untagged)]
133pub enum GetAppEmbedTokenBySecretError {
134    UnknownValue(serde_json::Value),
135}
136
137/// struct for typed errors of method [`get_app_history_by_path`]
138#[derive(Debug, Clone, Serialize, Deserialize)]
139#[serde(untagged)]
140pub enum GetAppHistoryByPathError {
141    UnknownValue(serde_json::Value),
142}
143
144/// struct for typed errors of method [`get_app_latest_version`]
145#[derive(Debug, Clone, Serialize, Deserialize)]
146#[serde(untagged)]
147pub enum GetAppLatestVersionError {
148    UnknownValue(serde_json::Value),
149}
150
151/// struct for typed errors of method [`get_app_lite_by_path`]
152#[derive(Debug, Clone, Serialize, Deserialize)]
153#[serde(untagged)]
154pub enum GetAppLiteByPathError {
155    UnknownValue(serde_json::Value),
156}
157
158/// struct for typed errors of method [`get_hub_app_by_id`]
159#[derive(Debug, Clone, Serialize, Deserialize)]
160#[serde(untagged)]
161pub enum GetHubAppByIdError {
162    UnknownValue(serde_json::Value),
163}
164
165/// struct for typed errors of method [`get_hub_raw_app_by_id`]
166#[derive(Debug, Clone, Serialize, Deserialize)]
167#[serde(untagged)]
168pub enum GetHubRawAppByIdError {
169    UnknownValue(serde_json::Value),
170}
171
172/// struct for typed errors of method [`get_public_app_by_custom_path`]
173#[derive(Debug, Clone, Serialize, Deserialize)]
174#[serde(untagged)]
175pub enum GetPublicAppByCustomPathError {
176    UnknownValue(serde_json::Value),
177}
178
179/// struct for typed errors of method [`get_public_app_by_secret`]
180#[derive(Debug, Clone, Serialize, Deserialize)]
181#[serde(untagged)]
182pub enum GetPublicAppBySecretError {
183    UnknownValue(serde_json::Value),
184}
185
186/// struct for typed errors of method [`get_public_resource`]
187#[derive(Debug, Clone, Serialize, Deserialize)]
188#[serde(untagged)]
189pub enum GetPublicResourceError {
190    UnknownValue(serde_json::Value),
191}
192
193/// struct for typed errors of method [`get_public_secret_of_app`]
194#[derive(Debug, Clone, Serialize, Deserialize)]
195#[serde(untagged)]
196pub enum GetPublicSecretOfAppError {
197    UnknownValue(serde_json::Value),
198}
199
200/// struct for typed errors of method [`get_public_secret_of_latest_version_of_app`]
201#[derive(Debug, Clone, Serialize, Deserialize)]
202#[serde(untagged)]
203pub enum GetPublicSecretOfLatestVersionOfAppError {
204    UnknownValue(serde_json::Value),
205}
206
207/// struct for typed errors of method [`get_raw_app_data`]
208#[derive(Debug, Clone, Serialize, Deserialize)]
209#[serde(untagged)]
210pub enum GetRawAppDataError {
211    UnknownValue(serde_json::Value),
212}
213
214/// struct for typed errors of method [`list_app_paths_from_workspace_runnable`]
215#[derive(Debug, Clone, Serialize, Deserialize)]
216#[serde(untagged)]
217pub enum ListAppPathsFromWorkspaceRunnableError {
218    UnknownValue(serde_json::Value),
219}
220
221/// struct for typed errors of method [`list_apps`]
222#[derive(Debug, Clone, Serialize, Deserialize)]
223#[serde(untagged)]
224pub enum ListAppsError {
225    UnknownValue(serde_json::Value),
226}
227
228/// struct for typed errors of method [`list_hub_apps`]
229#[derive(Debug, Clone, Serialize, Deserialize)]
230#[serde(untagged)]
231pub enum ListHubAppsError {
232    UnknownValue(serde_json::Value),
233}
234
235/// struct for typed errors of method [`list_search_app`]
236#[derive(Debug, Clone, Serialize, Deserialize)]
237#[serde(untagged)]
238pub enum ListSearchAppError {
239    UnknownValue(serde_json::Value),
240}
241
242/// struct for typed errors of method [`sign_s3_objects`]
243#[derive(Debug, Clone, Serialize, Deserialize)]
244#[serde(untagged)]
245pub enum SignS3ObjectsError {
246    UnknownValue(serde_json::Value),
247}
248
249/// struct for typed errors of method [`update_app`]
250#[derive(Debug, Clone, Serialize, Deserialize)]
251#[serde(untagged)]
252pub enum UpdateAppError {
253    UnknownValue(serde_json::Value),
254}
255
256/// struct for typed errors of method [`update_app_history`]
257#[derive(Debug, Clone, Serialize, Deserialize)]
258#[serde(untagged)]
259pub enum UpdateAppHistoryError {
260    UnknownValue(serde_json::Value),
261}
262
263/// struct for typed errors of method [`upload_s3_file_from_app`]
264#[derive(Debug, Clone, Serialize, Deserialize)]
265#[serde(untagged)]
266pub enum UploadS3FileFromAppError {
267    UnknownValue(serde_json::Value),
268}
269
270
271pub async fn app_download_s3_parquet_file_as_csv(configuration: &configuration::Configuration, workspace: &str, path: &str, file_key: &str, storage: Option<&str>) -> Result<String, Error<AppDownloadS3ParquetFileAsCsvError>> {
272    let local_var_configuration = configuration;
273
274    let local_var_client = &local_var_configuration.client;
275
276    let local_var_uri_str = format!("{}/w/{workspace}/apps_u/download_s3_parquet_file_as_csv/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
277    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
278
279    local_var_req_builder = local_var_req_builder.query(&[("file_key", &file_key.to_string())]);
280    if let Some(ref local_var_str) = storage {
281        local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
282    }
283    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
284        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
285    }
286    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
287        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
288    };
289
290    let local_var_req = local_var_req_builder.build()?;
291    let local_var_resp = local_var_client.execute(local_var_req).await?;
292
293    let local_var_status = local_var_resp.status();
294    let local_var_content = local_var_resp.text().await?;
295
296    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
297        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
298    } else {
299        let local_var_entity: Option<AppDownloadS3ParquetFileAsCsvError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
300        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
301        Err(Error::ResponseError(local_var_error))
302    }
303}
304
305pub async fn app_load_csv_preview(configuration: &configuration::Configuration, workspace: &str, path: &str, file_key: &str, offset: Option<f64>, limit: Option<f64>, sort_col: Option<&str>, sort_desc: Option<bool>, search_col: Option<&str>, search_term: Option<&str>, storage: Option<&str>, csv_separator: Option<&str>) -> Result<(), Error<AppLoadCsvPreviewError>> {
306    let local_var_configuration = configuration;
307
308    let local_var_client = &local_var_configuration.client;
309
310    let local_var_uri_str = format!("{}/w/{workspace}/apps_u/load_csv_preview/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
311    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
312
313    local_var_req_builder = local_var_req_builder.query(&[("file_key", &file_key.to_string())]);
314    if let Some(ref local_var_str) = offset {
315        local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]);
316    }
317    if let Some(ref local_var_str) = limit {
318        local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]);
319    }
320    if let Some(ref local_var_str) = sort_col {
321        local_var_req_builder = local_var_req_builder.query(&[("sort_col", &local_var_str.to_string())]);
322    }
323    if let Some(ref local_var_str) = sort_desc {
324        local_var_req_builder = local_var_req_builder.query(&[("sort_desc", &local_var_str.to_string())]);
325    }
326    if let Some(ref local_var_str) = search_col {
327        local_var_req_builder = local_var_req_builder.query(&[("search_col", &local_var_str.to_string())]);
328    }
329    if let Some(ref local_var_str) = search_term {
330        local_var_req_builder = local_var_req_builder.query(&[("search_term", &local_var_str.to_string())]);
331    }
332    if let Some(ref local_var_str) = storage {
333        local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
334    }
335    if let Some(ref local_var_str) = csv_separator {
336        local_var_req_builder = local_var_req_builder.query(&[("csv_separator", &local_var_str.to_string())]);
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
345    let local_var_req = local_var_req_builder.build()?;
346    let local_var_resp = local_var_client.execute(local_var_req).await?;
347
348    let local_var_status = local_var_resp.status();
349    let local_var_content = local_var_resp.text().await?;
350
351    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
352        Ok(())
353    } else {
354        let local_var_entity: Option<AppLoadCsvPreviewError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
355        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
356        Err(Error::ResponseError(local_var_error))
357    }
358}
359
360pub async fn app_load_file_metadata(configuration: &configuration::Configuration, workspace: &str, path: &str, file_key: &str, storage: Option<&str>) -> Result<models::WindmillFileMetadata, Error<AppLoadFileMetadataError>> {
361    let local_var_configuration = configuration;
362
363    let local_var_client = &local_var_configuration.client;
364
365    let local_var_uri_str = format!("{}/w/{workspace}/apps_u/load_file_metadata/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
366    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
367
368    local_var_req_builder = local_var_req_builder.query(&[("file_key", &file_key.to_string())]);
369    if let Some(ref local_var_str) = storage {
370        local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
371    }
372    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
373        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
374    }
375    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
376        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
377    };
378
379    let local_var_req = local_var_req_builder.build()?;
380    let local_var_resp = local_var_client.execute(local_var_req).await?;
381
382    let local_var_status = local_var_resp.status();
383    let local_var_content = local_var_resp.text().await?;
384
385    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
386        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
387    } else {
388        let local_var_entity: Option<AppLoadFileMetadataError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
389        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
390        Err(Error::ResponseError(local_var_error))
391    }
392}
393
394pub async fn app_load_file_preview(configuration: &configuration::Configuration, workspace: &str, path: &str, file_key: &str, read_bytes_from: i32, read_bytes_length: i32, file_size_in_bytes: Option<i32>, file_mime_type: Option<&str>, csv_separator: Option<&str>, csv_has_header: Option<bool>, storage: Option<&str>) -> Result<models::WindmillFilePreview, Error<AppLoadFilePreviewError>> {
395    let local_var_configuration = configuration;
396
397    let local_var_client = &local_var_configuration.client;
398
399    let local_var_uri_str = format!("{}/w/{workspace}/apps_u/load_file_preview/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
400    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
401
402    local_var_req_builder = local_var_req_builder.query(&[("file_key", &file_key.to_string())]);
403    if let Some(ref local_var_str) = file_size_in_bytes {
404        local_var_req_builder = local_var_req_builder.query(&[("file_size_in_bytes", &local_var_str.to_string())]);
405    }
406    if let Some(ref local_var_str) = file_mime_type {
407        local_var_req_builder = local_var_req_builder.query(&[("file_mime_type", &local_var_str.to_string())]);
408    }
409    if let Some(ref local_var_str) = csv_separator {
410        local_var_req_builder = local_var_req_builder.query(&[("csv_separator", &local_var_str.to_string())]);
411    }
412    if let Some(ref local_var_str) = csv_has_header {
413        local_var_req_builder = local_var_req_builder.query(&[("csv_has_header", &local_var_str.to_string())]);
414    }
415    local_var_req_builder = local_var_req_builder.query(&[("read_bytes_from", &read_bytes_from.to_string())]);
416    local_var_req_builder = local_var_req_builder.query(&[("read_bytes_length", &read_bytes_length.to_string())]);
417    if let Some(ref local_var_str) = storage {
418        local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
419    }
420    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
421        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
422    }
423    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
424        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
425    };
426
427    let local_var_req = local_var_req_builder.build()?;
428    let local_var_resp = local_var_client.execute(local_var_req).await?;
429
430    let local_var_status = local_var_resp.status();
431    let local_var_content = local_var_resp.text().await?;
432
433    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
434        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
435    } else {
436        let local_var_entity: Option<AppLoadFilePreviewError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
437        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
438        Err(Error::ResponseError(local_var_error))
439    }
440}
441
442pub async fn app_load_parquet_preview(configuration: &configuration::Configuration, workspace: &str, path: &str, file_key: &str, offset: Option<f64>, limit: Option<f64>, sort_col: Option<&str>, sort_desc: Option<bool>, search_col: Option<&str>, search_term: Option<&str>, storage: Option<&str>) -> Result<(), Error<AppLoadParquetPreviewError>> {
443    let local_var_configuration = configuration;
444
445    let local_var_client = &local_var_configuration.client;
446
447    let local_var_uri_str = format!("{}/w/{workspace}/apps_u/load_parquet_preview/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
448    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
449
450    local_var_req_builder = local_var_req_builder.query(&[("file_key", &file_key.to_string())]);
451    if let Some(ref local_var_str) = offset {
452        local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]);
453    }
454    if let Some(ref local_var_str) = limit {
455        local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]);
456    }
457    if let Some(ref local_var_str) = sort_col {
458        local_var_req_builder = local_var_req_builder.query(&[("sort_col", &local_var_str.to_string())]);
459    }
460    if let Some(ref local_var_str) = sort_desc {
461        local_var_req_builder = local_var_req_builder.query(&[("sort_desc", &local_var_str.to_string())]);
462    }
463    if let Some(ref local_var_str) = search_col {
464        local_var_req_builder = local_var_req_builder.query(&[("search_col", &local_var_str.to_string())]);
465    }
466    if let Some(ref local_var_str) = search_term {
467        local_var_req_builder = local_var_req_builder.query(&[("search_term", &local_var_str.to_string())]);
468    }
469    if let Some(ref local_var_str) = storage {
470        local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
471    }
472    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
473        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
474    }
475    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
476        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
477    };
478
479    let local_var_req = local_var_req_builder.build()?;
480    let local_var_resp = local_var_client.execute(local_var_req).await?;
481
482    let local_var_status = local_var_resp.status();
483    let local_var_content = local_var_resp.text().await?;
484
485    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
486        Ok(())
487    } else {
488        let local_var_entity: Option<AppLoadParquetPreviewError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
489        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
490        Err(Error::ResponseError(local_var_error))
491    }
492}
493
494pub async fn app_load_table_count(configuration: &configuration::Configuration, workspace: &str, path: &str, file_key: &str, search_col: Option<&str>, search_term: Option<&str>, storage: Option<&str>) -> Result<models::AppLoadTableCount200Response, Error<AppLoadTableCountError>> {
495    let local_var_configuration = configuration;
496
497    let local_var_client = &local_var_configuration.client;
498
499    let local_var_uri_str = format!("{}/w/{workspace}/apps_u/load_table_count/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
500    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
501
502    local_var_req_builder = local_var_req_builder.query(&[("file_key", &file_key.to_string())]);
503    if let Some(ref local_var_str) = search_col {
504        local_var_req_builder = local_var_req_builder.query(&[("search_col", &local_var_str.to_string())]);
505    }
506    if let Some(ref local_var_str) = search_term {
507        local_var_req_builder = local_var_req_builder.query(&[("search_term", &local_var_str.to_string())]);
508    }
509    if let Some(ref local_var_str) = storage {
510        local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
511    }
512    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
513        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
514    }
515    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
516        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
517    };
518
519    let local_var_req = local_var_req_builder.build()?;
520    let local_var_resp = local_var_client.execute(local_var_req).await?;
521
522    let local_var_status = local_var_resp.status();
523    let local_var_content = local_var_resp.text().await?;
524
525    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
526        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
527    } else {
528        let local_var_entity: Option<AppLoadTableCountError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
529        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
530        Err(Error::ResponseError(local_var_error))
531    }
532}
533
534pub async fn create_app(configuration: &configuration::Configuration, workspace: &str, create_app_request: models::CreateAppRequest) -> Result<String, Error<CreateAppError>> {
535    let local_var_configuration = configuration;
536
537    let local_var_client = &local_var_configuration.client;
538
539    let local_var_uri_str = format!("{}/w/{workspace}/apps/create", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
540    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
541
542    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
543        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
544    }
545    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
546        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
547    };
548    local_var_req_builder = local_var_req_builder.json(&create_app_request);
549
550    let local_var_req = local_var_req_builder.build()?;
551    let local_var_resp = local_var_client.execute(local_var_req).await?;
552
553    let local_var_status = local_var_resp.status();
554    let local_var_content = local_var_resp.text().await?;
555
556    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
557        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
558    } else {
559        let local_var_entity: Option<CreateAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
560        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
561        Err(Error::ResponseError(local_var_error))
562    }
563}
564
565pub async fn custom_path_exists(configuration: &configuration::Configuration, workspace: &str, custom_path: &str) -> Result<bool, Error<CustomPathExistsError>> {
566    let local_var_configuration = configuration;
567
568    let local_var_client = &local_var_configuration.client;
569
570    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));
571    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
572
573    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
574        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
575    }
576    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
577        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
578    };
579
580    let local_var_req = local_var_req_builder.build()?;
581    let local_var_resp = local_var_client.execute(local_var_req).await?;
582
583    let local_var_status = local_var_resp.status();
584    let local_var_content = local_var_resp.text().await?;
585
586    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
587        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
588    } else {
589        let local_var_entity: Option<CustomPathExistsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
590        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
591        Err(Error::ResponseError(local_var_error))
592    }
593}
594
595pub async fn delete_app(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<String, Error<DeleteAppError>> {
596    let local_var_configuration = configuration;
597
598    let local_var_client = &local_var_configuration.client;
599
600    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));
601    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
602
603    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
604        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
605    }
606    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
607        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
608    };
609
610    let local_var_req = local_var_req_builder.build()?;
611    let local_var_resp = local_var_client.execute(local_var_req).await?;
612
613    let local_var_status = local_var_resp.status();
614    let local_var_content = local_var_resp.text().await?;
615
616    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
617        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
618    } else {
619        let local_var_entity: Option<DeleteAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
620        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
621        Err(Error::ResponseError(local_var_error))
622    }
623}
624
625pub async fn delete_s3_file_from_app(configuration: &configuration::Configuration, workspace: &str, delete_token: &str) -> Result<String, Error<DeleteS3FileFromAppError>> {
626    let local_var_configuration = configuration;
627
628    let local_var_client = &local_var_configuration.client;
629
630    let local_var_uri_str = format!("{}/w/{workspace}/apps_u/delete_s3_file", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
631    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
632
633    local_var_req_builder = local_var_req_builder.query(&[("delete_token", &delete_token.to_string())]);
634    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
635        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
636    }
637    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
638        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
639    };
640
641    let local_var_req = local_var_req_builder.build()?;
642    let local_var_resp = local_var_client.execute(local_var_req).await?;
643
644    let local_var_status = local_var_resp.status();
645    let local_var_content = local_var_resp.text().await?;
646
647    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
648        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
649    } else {
650        let local_var_entity: Option<DeleteS3FileFromAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
651        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
652        Err(Error::ResponseError(local_var_error))
653    }
654}
655
656pub async fn execute_component(configuration: &configuration::Configuration, workspace: &str, path: &str, execute_component_request: models::ExecuteComponentRequest) -> Result<String, Error<ExecuteComponentError>> {
657    let local_var_configuration = configuration;
658
659    let local_var_client = &local_var_configuration.client;
660
661    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));
662    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
663
664    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
665        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
666    }
667    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
668        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
669    };
670    local_var_req_builder = local_var_req_builder.json(&execute_component_request);
671
672    let local_var_req = local_var_req_builder.build()?;
673    let local_var_resp = local_var_client.execute(local_var_req).await?;
674
675    let local_var_status = local_var_resp.status();
676    let local_var_content = local_var_resp.text().await?;
677
678    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
679        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
680    } else {
681        let local_var_entity: Option<ExecuteComponentError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
682        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
683        Err(Error::ResponseError(local_var_error))
684    }
685}
686
687pub async fn exists_app(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<bool, Error<ExistsAppError>> {
688    let local_var_configuration = configuration;
689
690    let local_var_client = &local_var_configuration.client;
691
692    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));
693    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
694
695    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
696        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
697    }
698    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
699        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
700    };
701
702    let local_var_req = local_var_req_builder.build()?;
703    let local_var_resp = local_var_client.execute(local_var_req).await?;
704
705    let local_var_status = local_var_resp.status();
706    let local_var_content = local_var_resp.text().await?;
707
708    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
709        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
710    } else {
711        let local_var_entity: Option<ExistsAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
712        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
713        Err(Error::ResponseError(local_var_error))
714    }
715}
716
717pub async fn get_app_by_path(configuration: &configuration::Configuration, workspace: &str, path: &str, with_starred_info: Option<bool>, get_draft: Option<bool>, raw_app: Option<bool>) -> Result<models::GetAppByPath200Response, Error<GetAppByPathError>> {
718    let local_var_configuration = configuration;
719
720    let local_var_client = &local_var_configuration.client;
721
722    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));
723    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
724
725    if let Some(ref local_var_str) = with_starred_info {
726        local_var_req_builder = local_var_req_builder.query(&[("with_starred_info", &local_var_str.to_string())]);
727    }
728    if let Some(ref local_var_str) = get_draft {
729        local_var_req_builder = local_var_req_builder.query(&[("get_draft", &local_var_str.to_string())]);
730    }
731    if let Some(ref local_var_str) = raw_app {
732        local_var_req_builder = local_var_req_builder.query(&[("raw_app", &local_var_str.to_string())]);
733    }
734    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
735        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
736    }
737    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
738        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
739    };
740
741    let local_var_req = local_var_req_builder.build()?;
742    let local_var_resp = local_var_client.execute(local_var_req).await?;
743
744    let local_var_status = local_var_resp.status();
745    let local_var_content = local_var_resp.text().await?;
746
747    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
748        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
749    } else {
750        let local_var_entity: Option<GetAppByPathError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
751        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
752        Err(Error::ResponseError(local_var_error))
753    }
754}
755
756pub async fn get_app_by_version(configuration: &configuration::Configuration, workspace: &str, id: i32) -> Result<models::AppWithLastVersion, Error<GetAppByVersionError>> {
757    let local_var_configuration = configuration;
758
759    let local_var_client = &local_var_configuration.client;
760
761    let local_var_uri_str = format!("{}/w/{workspace}/apps/get/v/{id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=id);
762    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
763
764    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
765        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
766    }
767    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
768        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
769    };
770
771    let local_var_req = local_var_req_builder.build()?;
772    let local_var_resp = local_var_client.execute(local_var_req).await?;
773
774    let local_var_status = local_var_resp.status();
775    let local_var_content = local_var_resp.text().await?;
776
777    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
778        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
779    } else {
780        let local_var_entity: Option<GetAppByVersionError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
781        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
782        Err(Error::ResponseError(local_var_error))
783    }
784}
785
786pub async fn get_app_embed_token_by_custom_path(configuration: &configuration::Configuration, custom_path: &str) -> Result<models::EmbedTokenResponse, Error<GetAppEmbedTokenByCustomPathError>> {
787    let local_var_configuration = configuration;
788
789    let local_var_client = &local_var_configuration.client;
790
791    let local_var_uri_str = format!("{}/apps_u/embed_token_by_custom_path/{custom_path}", local_var_configuration.base_path, custom_path=crate::apis::urlencode(custom_path));
792    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
793
794    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
795        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
796    }
797    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
798        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
799    };
800
801    let local_var_req = local_var_req_builder.build()?;
802    let local_var_resp = local_var_client.execute(local_var_req).await?;
803
804    let local_var_status = local_var_resp.status();
805    let local_var_content = local_var_resp.text().await?;
806
807    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
808        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
809    } else {
810        let local_var_entity: Option<GetAppEmbedTokenByCustomPathError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
811        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
812        Err(Error::ResponseError(local_var_error))
813    }
814}
815
816pub async fn get_app_embed_token_by_path(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<models::EmbedTokenResponse, Error<GetAppEmbedTokenByPathError>> {
817    let local_var_configuration = configuration;
818
819    let local_var_client = &local_var_configuration.client;
820
821    let local_var_uri_str = format!("{}/w/{workspace}/apps/embed_token/p/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
822    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
823
824    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
825        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
826    }
827    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
828        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
829    };
830
831    let local_var_req = local_var_req_builder.build()?;
832    let local_var_resp = local_var_client.execute(local_var_req).await?;
833
834    let local_var_status = local_var_resp.status();
835    let local_var_content = local_var_resp.text().await?;
836
837    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
838        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
839    } else {
840        let local_var_entity: Option<GetAppEmbedTokenByPathError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
841        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
842        Err(Error::ResponseError(local_var_error))
843    }
844}
845
846pub async fn get_app_embed_token_by_secret(configuration: &configuration::Configuration, workspace: &str, secret: &str) -> Result<models::EmbedTokenResponse, Error<GetAppEmbedTokenBySecretError>> {
847    let local_var_configuration = configuration;
848
849    let local_var_client = &local_var_configuration.client;
850
851    let local_var_uri_str = format!("{}/w/{workspace}/apps_u/embed_token/{secret}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), secret=crate::apis::urlencode(secret));
852    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
853
854    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
855        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
856    }
857    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
858        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
859    };
860
861    let local_var_req = local_var_req_builder.build()?;
862    let local_var_resp = local_var_client.execute(local_var_req).await?;
863
864    let local_var_status = local_var_resp.status();
865    let local_var_content = local_var_resp.text().await?;
866
867    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
868        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
869    } else {
870        let local_var_entity: Option<GetAppEmbedTokenBySecretError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
871        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
872        Err(Error::ResponseError(local_var_error))
873    }
874}
875
876pub async fn get_app_history_by_path(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<Vec<models::AppHistory>, Error<GetAppHistoryByPathError>> {
877    let local_var_configuration = configuration;
878
879    let local_var_client = &local_var_configuration.client;
880
881    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));
882    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
883
884    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
885        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
886    }
887    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
888        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
889    };
890
891    let local_var_req = local_var_req_builder.build()?;
892    let local_var_resp = local_var_client.execute(local_var_req).await?;
893
894    let local_var_status = local_var_resp.status();
895    let local_var_content = local_var_resp.text().await?;
896
897    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
898        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
899    } else {
900        let local_var_entity: Option<GetAppHistoryByPathError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
901        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
902        Err(Error::ResponseError(local_var_error))
903    }
904}
905
906pub async fn get_app_latest_version(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<models::AppHistory, Error<GetAppLatestVersionError>> {
907    let local_var_configuration = configuration;
908
909    let local_var_client = &local_var_configuration.client;
910
911    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));
912    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
913
914    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
915        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
916    }
917    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
918        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
919    };
920
921    let local_var_req = local_var_req_builder.build()?;
922    let local_var_resp = local_var_client.execute(local_var_req).await?;
923
924    let local_var_status = local_var_resp.status();
925    let local_var_content = local_var_resp.text().await?;
926
927    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
928        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
929    } else {
930        let local_var_entity: Option<GetAppLatestVersionError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
931        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
932        Err(Error::ResponseError(local_var_error))
933    }
934}
935
936pub async fn get_app_lite_by_path(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<models::AppWithLastVersion, Error<GetAppLiteByPathError>> {
937    let local_var_configuration = configuration;
938
939    let local_var_client = &local_var_configuration.client;
940
941    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));
942    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
943
944    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
945        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
946    }
947    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
948        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
949    };
950
951    let local_var_req = local_var_req_builder.build()?;
952    let local_var_resp = local_var_client.execute(local_var_req).await?;
953
954    let local_var_status = local_var_resp.status();
955    let local_var_content = local_var_resp.text().await?;
956
957    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
958        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
959    } else {
960        let local_var_entity: Option<GetAppLiteByPathError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
961        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
962        Err(Error::ResponseError(local_var_error))
963    }
964}
965
966pub async fn get_hub_app_by_id(configuration: &configuration::Configuration, id: i32) -> Result<models::GetHubAppById200Response, Error<GetHubAppByIdError>> {
967    let local_var_configuration = configuration;
968
969    let local_var_client = &local_var_configuration.client;
970
971    let local_var_uri_str = format!("{}/apps/hub/get/{id}", local_var_configuration.base_path, id=id);
972    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
973
974    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
975        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
976    }
977    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
978        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
979    };
980
981    let local_var_req = local_var_req_builder.build()?;
982    let local_var_resp = local_var_client.execute(local_var_req).await?;
983
984    let local_var_status = local_var_resp.status();
985    let local_var_content = local_var_resp.text().await?;
986
987    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
988        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
989    } else {
990        let local_var_entity: Option<GetHubAppByIdError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
991        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
992        Err(Error::ResponseError(local_var_error))
993    }
994}
995
996pub async fn get_hub_raw_app_by_id(configuration: &configuration::Configuration, id: i32) -> Result<models::GetHubAppById200Response, Error<GetHubRawAppByIdError>> {
997    let local_var_configuration = configuration;
998
999    let local_var_client = &local_var_configuration.client;
1000
1001    let local_var_uri_str = format!("{}/apps/hub/get_raw/{id}", local_var_configuration.base_path, id=id);
1002    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1003
1004    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1005        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1006    }
1007    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1008        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1009    };
1010
1011    let local_var_req = local_var_req_builder.build()?;
1012    let local_var_resp = local_var_client.execute(local_var_req).await?;
1013
1014    let local_var_status = local_var_resp.status();
1015    let local_var_content = local_var_resp.text().await?;
1016
1017    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1018        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1019    } else {
1020        let local_var_entity: Option<GetHubRawAppByIdError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1021        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1022        Err(Error::ResponseError(local_var_error))
1023    }
1024}
1025
1026pub async fn get_public_app_by_custom_path(configuration: &configuration::Configuration, custom_path: &str) -> Result<models::GetPublicAppByCustomPath200Response, Error<GetPublicAppByCustomPathError>> {
1027    let local_var_configuration = configuration;
1028
1029    let local_var_client = &local_var_configuration.client;
1030
1031    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));
1032    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1033
1034    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1035        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1036    }
1037    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1038        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1039    };
1040
1041    let local_var_req = local_var_req_builder.build()?;
1042    let local_var_resp = local_var_client.execute(local_var_req).await?;
1043
1044    let local_var_status = local_var_resp.status();
1045    let local_var_content = local_var_resp.text().await?;
1046
1047    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1048        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1049    } else {
1050        let local_var_entity: Option<GetPublicAppByCustomPathError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1051        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1052        Err(Error::ResponseError(local_var_error))
1053    }
1054}
1055
1056pub async fn get_public_app_by_secret(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<models::AppWithLastVersion, Error<GetPublicAppBySecretError>> {
1057    let local_var_configuration = configuration;
1058
1059    let local_var_client = &local_var_configuration.client;
1060
1061    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));
1062    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1063
1064    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1065        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1066    }
1067    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1068        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1069    };
1070
1071    let local_var_req = local_var_req_builder.build()?;
1072    let local_var_resp = local_var_client.execute(local_var_req).await?;
1073
1074    let local_var_status = local_var_resp.status();
1075    let local_var_content = local_var_resp.text().await?;
1076
1077    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1078        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1079    } else {
1080        let local_var_entity: Option<GetPublicAppBySecretError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1081        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1082        Err(Error::ResponseError(local_var_error))
1083    }
1084}
1085
1086pub async fn get_public_resource(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<serde_json::Value, Error<GetPublicResourceError>> {
1087    let local_var_configuration = configuration;
1088
1089    let local_var_client = &local_var_configuration.client;
1090
1091    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));
1092    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1093
1094    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1095        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1096    }
1097    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1098        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1099    };
1100
1101    let local_var_req = local_var_req_builder.build()?;
1102    let local_var_resp = local_var_client.execute(local_var_req).await?;
1103
1104    let local_var_status = local_var_resp.status();
1105    let local_var_content = local_var_resp.text().await?;
1106
1107    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1108        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1109    } else {
1110        let local_var_entity: Option<GetPublicResourceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1111        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1112        Err(Error::ResponseError(local_var_error))
1113    }
1114}
1115
1116pub async fn get_public_secret_of_app(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<String, Error<GetPublicSecretOfAppError>> {
1117    let local_var_configuration = configuration;
1118
1119    let local_var_client = &local_var_configuration.client;
1120
1121    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));
1122    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1123
1124    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1125        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1126    }
1127    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1128        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1129    };
1130
1131    let local_var_req = local_var_req_builder.build()?;
1132    let local_var_resp = local_var_client.execute(local_var_req).await?;
1133
1134    let local_var_status = local_var_resp.status();
1135    let local_var_content = local_var_resp.text().await?;
1136
1137    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1138        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1139    } else {
1140        let local_var_entity: Option<GetPublicSecretOfAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1141        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1142        Err(Error::ResponseError(local_var_error))
1143    }
1144}
1145
1146pub async fn get_public_secret_of_latest_version_of_app(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<String, Error<GetPublicSecretOfLatestVersionOfAppError>> {
1147    let local_var_configuration = configuration;
1148
1149    let local_var_client = &local_var_configuration.client;
1150
1151    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));
1152    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1153
1154    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1155        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1156    }
1157    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1158        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1159    };
1160
1161    let local_var_req = local_var_req_builder.build()?;
1162    let local_var_resp = local_var_client.execute(local_var_req).await?;
1163
1164    let local_var_status = local_var_resp.status();
1165    let local_var_content = local_var_resp.text().await?;
1166
1167    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1168        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1169    } else {
1170        let local_var_entity: Option<GetPublicSecretOfLatestVersionOfAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1171        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1172        Err(Error::ResponseError(local_var_error))
1173    }
1174}
1175
1176pub async fn get_raw_app_data(configuration: &configuration::Configuration, workspace: &str, secret_with_extension: &str) -> Result<String, Error<GetRawAppDataError>> {
1177    let local_var_configuration = configuration;
1178
1179    let local_var_client = &local_var_configuration.client;
1180
1181    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));
1182    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1183
1184    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1185        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1186    }
1187    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1188        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1189    };
1190
1191    let local_var_req = local_var_req_builder.build()?;
1192    let local_var_resp = local_var_client.execute(local_var_req).await?;
1193
1194    let local_var_status = local_var_resp.status();
1195    let local_var_content = local_var_resp.text().await?;
1196
1197    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1198        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1199    } else {
1200        let local_var_entity: Option<GetRawAppDataError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1201        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1202        Err(Error::ResponseError(local_var_error))
1203    }
1204}
1205
1206pub async fn list_app_paths_from_workspace_runnable(configuration: &configuration::Configuration, workspace: &str, runnable_kind: &str, path: &str) -> Result<Vec<String>, Error<ListAppPathsFromWorkspaceRunnableError>> {
1207    let local_var_configuration = configuration;
1208
1209    let local_var_client = &local_var_configuration.client;
1210
1211    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));
1212    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1213
1214    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1215        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1216    }
1217    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1218        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1219    };
1220
1221    let local_var_req = local_var_req_builder.build()?;
1222    let local_var_resp = local_var_client.execute(local_var_req).await?;
1223
1224    let local_var_status = local_var_resp.status();
1225    let local_var_content = local_var_resp.text().await?;
1226
1227    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1228        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1229    } else {
1230        let local_var_entity: Option<ListAppPathsFromWorkspaceRunnableError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1231        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1232        Err(Error::ResponseError(local_var_error))
1233    }
1234}
1235
1236pub 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>, label: Option<&str>) -> Result<Vec<models::ListableApp>, Error<ListAppsError>> {
1237    let local_var_configuration = configuration;
1238
1239    let local_var_client = &local_var_configuration.client;
1240
1241    let local_var_uri_str = format!("{}/w/{workspace}/apps/list", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1242    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1243
1244    if let Some(ref local_var_str) = page {
1245        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1246    }
1247    if let Some(ref local_var_str) = per_page {
1248        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
1249    }
1250    if let Some(ref local_var_str) = order_desc {
1251        local_var_req_builder = local_var_req_builder.query(&[("order_desc", &local_var_str.to_string())]);
1252    }
1253    if let Some(ref local_var_str) = created_by {
1254        local_var_req_builder = local_var_req_builder.query(&[("created_by", &local_var_str.to_string())]);
1255    }
1256    if let Some(ref local_var_str) = path_start {
1257        local_var_req_builder = local_var_req_builder.query(&[("path_start", &local_var_str.to_string())]);
1258    }
1259    if let Some(ref local_var_str) = path_exact {
1260        local_var_req_builder = local_var_req_builder.query(&[("path_exact", &local_var_str.to_string())]);
1261    }
1262    if let Some(ref local_var_str) = starred_only {
1263        local_var_req_builder = local_var_req_builder.query(&[("starred_only", &local_var_str.to_string())]);
1264    }
1265    if let Some(ref local_var_str) = include_draft_only {
1266        local_var_req_builder = local_var_req_builder.query(&[("include_draft_only", &local_var_str.to_string())]);
1267    }
1268    if let Some(ref local_var_str) = with_deployment_msg {
1269        local_var_req_builder = local_var_req_builder.query(&[("with_deployment_msg", &local_var_str.to_string())]);
1270    }
1271    if let Some(ref local_var_str) = label {
1272        local_var_req_builder = local_var_req_builder.query(&[("label", &local_var_str.to_string())]);
1273    }
1274    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1275        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1276    }
1277    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1278        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1279    };
1280
1281    let local_var_req = local_var_req_builder.build()?;
1282    let local_var_resp = local_var_client.execute(local_var_req).await?;
1283
1284    let local_var_status = local_var_resp.status();
1285    let local_var_content = local_var_resp.text().await?;
1286
1287    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1288        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1289    } else {
1290        let local_var_entity: Option<ListAppsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1291        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1292        Err(Error::ResponseError(local_var_error))
1293    }
1294}
1295
1296pub async fn list_hub_apps(configuration: &configuration::Configuration, ) -> Result<models::ListHubApps200Response, Error<ListHubAppsError>> {
1297    let local_var_configuration = configuration;
1298
1299    let local_var_client = &local_var_configuration.client;
1300
1301    let local_var_uri_str = format!("{}/apps/hub/list", local_var_configuration.base_path);
1302    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1303
1304    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1305        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1306    }
1307    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1308        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1309    };
1310
1311    let local_var_req = local_var_req_builder.build()?;
1312    let local_var_resp = local_var_client.execute(local_var_req).await?;
1313
1314    let local_var_status = local_var_resp.status();
1315    let local_var_content = local_var_resp.text().await?;
1316
1317    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1318        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1319    } else {
1320        let local_var_entity: Option<ListHubAppsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1321        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1322        Err(Error::ResponseError(local_var_error))
1323    }
1324}
1325
1326pub async fn list_search_app(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::ListSearchResource200ResponseInner>, Error<ListSearchAppError>> {
1327    let local_var_configuration = configuration;
1328
1329    let local_var_client = &local_var_configuration.client;
1330
1331    let local_var_uri_str = format!("{}/w/{workspace}/apps/list_search", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1332    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1333
1334    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1335        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1336    }
1337    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1338        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1339    };
1340
1341    let local_var_req = local_var_req_builder.build()?;
1342    let local_var_resp = local_var_client.execute(local_var_req).await?;
1343
1344    let local_var_status = local_var_resp.status();
1345    let local_var_content = local_var_resp.text().await?;
1346
1347    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1348        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1349    } else {
1350        let local_var_entity: Option<ListSearchAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1351        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1352        Err(Error::ResponseError(local_var_error))
1353    }
1354}
1355
1356pub async fn sign_s3_objects(configuration: &configuration::Configuration, workspace: &str, sign_s3_objects_request: models::SignS3ObjectsRequest) -> Result<Vec<models::S3Object>, Error<SignS3ObjectsError>> {
1357    let local_var_configuration = configuration;
1358
1359    let local_var_client = &local_var_configuration.client;
1360
1361    let local_var_uri_str = format!("{}/w/{workspace}/apps/sign_s3_objects", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1362    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1363
1364    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1365        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1366    }
1367    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1368        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1369    };
1370    local_var_req_builder = local_var_req_builder.json(&sign_s3_objects_request);
1371
1372    let local_var_req = local_var_req_builder.build()?;
1373    let local_var_resp = local_var_client.execute(local_var_req).await?;
1374
1375    let local_var_status = local_var_resp.status();
1376    let local_var_content = local_var_resp.text().await?;
1377
1378    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1379        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1380    } else {
1381        let local_var_entity: Option<SignS3ObjectsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1382        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1383        Err(Error::ResponseError(local_var_error))
1384    }
1385}
1386
1387pub async fn update_app(configuration: &configuration::Configuration, workspace: &str, path: &str, update_app_request: models::UpdateAppRequest) -> Result<String, Error<UpdateAppError>> {
1388    let local_var_configuration = configuration;
1389
1390    let local_var_client = &local_var_configuration.client;
1391
1392    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));
1393    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1394
1395    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1396        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1397    }
1398    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1399        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1400    };
1401    local_var_req_builder = local_var_req_builder.json(&update_app_request);
1402
1403    let local_var_req = local_var_req_builder.build()?;
1404    let local_var_resp = local_var_client.execute(local_var_req).await?;
1405
1406    let local_var_status = local_var_resp.status();
1407    let local_var_content = local_var_resp.text().await?;
1408
1409    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1410        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1411    } else {
1412        let local_var_entity: Option<UpdateAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1413        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1414        Err(Error::ResponseError(local_var_error))
1415    }
1416}
1417
1418pub async fn update_app_history(configuration: &configuration::Configuration, workspace: &str, id: i32, version: i32, update_script_history_request: models::UpdateScriptHistoryRequest) -> Result<String, Error<UpdateAppHistoryError>> {
1419    let local_var_configuration = configuration;
1420
1421    let local_var_client = &local_var_configuration.client;
1422
1423    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);
1424    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1425
1426    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1427        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1428    }
1429    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1430        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1431    };
1432    local_var_req_builder = local_var_req_builder.json(&update_script_history_request);
1433
1434    let local_var_req = local_var_req_builder.build()?;
1435    let local_var_resp = local_var_client.execute(local_var_req).await?;
1436
1437    let local_var_status = local_var_resp.status();
1438    let local_var_content = local_var_resp.text().await?;
1439
1440    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1441        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1442    } else {
1443        let local_var_entity: Option<UpdateAppHistoryError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1444        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1445        Err(Error::ResponseError(local_var_error))
1446    }
1447}
1448
1449pub 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>> {
1450    let local_var_configuration = configuration;
1451
1452    let local_var_client = &local_var_configuration.client;
1453
1454    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));
1455    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1456
1457    if let Some(ref local_var_str) = file_key {
1458        local_var_req_builder = local_var_req_builder.query(&[("file_key", &local_var_str.to_string())]);
1459    }
1460    if let Some(ref local_var_str) = file_extension {
1461        local_var_req_builder = local_var_req_builder.query(&[("file_extension", &local_var_str.to_string())]);
1462    }
1463    if let Some(ref local_var_str) = s3_resource_path {
1464        local_var_req_builder = local_var_req_builder.query(&[("s3_resource_path", &local_var_str.to_string())]);
1465    }
1466    if let Some(ref local_var_str) = resource_type {
1467        local_var_req_builder = local_var_req_builder.query(&[("resource_type", &local_var_str.to_string())]);
1468    }
1469    if let Some(ref local_var_str) = storage {
1470        local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
1471    }
1472    if let Some(ref local_var_str) = content_type {
1473        local_var_req_builder = local_var_req_builder.query(&[("content_type", &local_var_str.to_string())]);
1474    }
1475    if let Some(ref local_var_str) = content_disposition {
1476        local_var_req_builder = local_var_req_builder.query(&[("content_disposition", &local_var_str.to_string())]);
1477    }
1478    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1479        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1480    }
1481    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1482        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1483    };
1484    local_var_req_builder = local_var_req_builder.json(&body);
1485
1486    let local_var_req = local_var_req_builder.build()?;
1487    let local_var_resp = local_var_client.execute(local_var_req).await?;
1488
1489    let local_var_status = local_var_resp.status();
1490    let local_var_content = local_var_resp.text().await?;
1491
1492    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1493        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1494    } else {
1495        let local_var_entity: Option<UploadS3FileFromAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1496        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1497        Err(Error::ResponseError(local_var_error))
1498    }
1499}
1500