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