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.809.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 [`create_app_raw_source`]
68#[derive(Debug, Clone, Serialize, Deserialize)]
69#[serde(untagged)]
70pub enum CreateAppRawSourceError {
71    UnknownValue(serde_json::Value),
72}
73
74/// struct for typed errors of method [`custom_path_exists`]
75#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(untagged)]
77pub enum CustomPathExistsError {
78    UnknownValue(serde_json::Value),
79}
80
81/// struct for typed errors of method [`delete_app`]
82#[derive(Debug, Clone, Serialize, Deserialize)]
83#[serde(untagged)]
84pub enum DeleteAppError {
85    UnknownValue(serde_json::Value),
86}
87
88/// struct for typed errors of method [`delete_s3_file_from_app`]
89#[derive(Debug, Clone, Serialize, Deserialize)]
90#[serde(untagged)]
91pub enum DeleteS3FileFromAppError {
92    UnknownValue(serde_json::Value),
93}
94
95/// struct for typed errors of method [`execute_component`]
96#[derive(Debug, Clone, Serialize, Deserialize)]
97#[serde(untagged)]
98pub enum ExecuteComponentError {
99    UnknownValue(serde_json::Value),
100}
101
102/// struct for typed errors of method [`exists_app`]
103#[derive(Debug, Clone, Serialize, Deserialize)]
104#[serde(untagged)]
105pub enum ExistsAppError {
106    UnknownValue(serde_json::Value),
107}
108
109/// struct for typed errors of method [`get_app_by_path`]
110#[derive(Debug, Clone, Serialize, Deserialize)]
111#[serde(untagged)]
112pub enum GetAppByPathError {
113    UnknownValue(serde_json::Value),
114}
115
116/// struct for typed errors of method [`get_app_by_version`]
117#[derive(Debug, Clone, Serialize, Deserialize)]
118#[serde(untagged)]
119pub enum GetAppByVersionError {
120    UnknownValue(serde_json::Value),
121}
122
123/// struct for typed errors of method [`get_app_embed_token_by_custom_path`]
124#[derive(Debug, Clone, Serialize, Deserialize)]
125#[serde(untagged)]
126pub enum GetAppEmbedTokenByCustomPathError {
127    UnknownValue(serde_json::Value),
128}
129
130/// struct for typed errors of method [`get_app_embed_token_by_path`]
131#[derive(Debug, Clone, Serialize, Deserialize)]
132#[serde(untagged)]
133pub enum GetAppEmbedTokenByPathError {
134    UnknownValue(serde_json::Value),
135}
136
137/// struct for typed errors of method [`get_app_embed_token_by_secret`]
138#[derive(Debug, Clone, Serialize, Deserialize)]
139#[serde(untagged)]
140pub enum GetAppEmbedTokenBySecretError {
141    UnknownValue(serde_json::Value),
142}
143
144/// struct for typed errors of method [`get_app_history_by_path`]
145#[derive(Debug, Clone, Serialize, Deserialize)]
146#[serde(untagged)]
147pub enum GetAppHistoryByPathError {
148    UnknownValue(serde_json::Value),
149}
150
151/// struct for typed errors of method [`get_app_latest_version`]
152#[derive(Debug, Clone, Serialize, Deserialize)]
153#[serde(untagged)]
154pub enum GetAppLatestVersionError {
155    UnknownValue(serde_json::Value),
156}
157
158/// struct for typed errors of method [`get_app_lite_by_path`]
159#[derive(Debug, Clone, Serialize, Deserialize)]
160#[serde(untagged)]
161pub enum GetAppLiteByPathError {
162    UnknownValue(serde_json::Value),
163}
164
165/// struct for typed errors of method [`get_guest_entry`]
166#[derive(Debug, Clone, Serialize, Deserialize)]
167#[serde(untagged)]
168pub enum GetGuestEntryError {
169    UnknownValue(serde_json::Value),
170}
171
172/// struct for typed errors of method [`get_guest_entry_by_custom_path`]
173#[derive(Debug, Clone, Serialize, Deserialize)]
174#[serde(untagged)]
175pub enum GetGuestEntryByCustomPathError {
176    UnknownValue(serde_json::Value),
177}
178
179/// struct for typed errors of method [`get_hub_app_by_id`]
180#[derive(Debug, Clone, Serialize, Deserialize)]
181#[serde(untagged)]
182pub enum GetHubAppByIdError {
183    UnknownValue(serde_json::Value),
184}
185
186/// struct for typed errors of method [`get_hub_raw_app_by_id`]
187#[derive(Debug, Clone, Serialize, Deserialize)]
188#[serde(untagged)]
189pub enum GetHubRawAppByIdError {
190    UnknownValue(serde_json::Value),
191}
192
193/// struct for typed errors of method [`get_public_app_by_custom_path`]
194#[derive(Debug, Clone, Serialize, Deserialize)]
195#[serde(untagged)]
196pub enum GetPublicAppByCustomPathError {
197    UnknownValue(serde_json::Value),
198}
199
200/// struct for typed errors of method [`get_public_app_by_secret`]
201#[derive(Debug, Clone, Serialize, Deserialize)]
202#[serde(untagged)]
203pub enum GetPublicAppBySecretError {
204    UnknownValue(serde_json::Value),
205}
206
207/// struct for typed errors of method [`get_public_resource`]
208#[derive(Debug, Clone, Serialize, Deserialize)]
209#[serde(untagged)]
210pub enum GetPublicResourceError {
211    UnknownValue(serde_json::Value),
212}
213
214/// struct for typed errors of method [`get_public_secret_of_app`]
215#[derive(Debug, Clone, Serialize, Deserialize)]
216#[serde(untagged)]
217pub enum GetPublicSecretOfAppError {
218    UnknownValue(serde_json::Value),
219}
220
221/// struct for typed errors of method [`get_public_secret_of_latest_version_of_app`]
222#[derive(Debug, Clone, Serialize, Deserialize)]
223#[serde(untagged)]
224pub enum GetPublicSecretOfLatestVersionOfAppError {
225    UnknownValue(serde_json::Value),
226}
227
228/// struct for typed errors of method [`get_raw_app_data`]
229#[derive(Debug, Clone, Serialize, Deserialize)]
230#[serde(untagged)]
231pub enum GetRawAppDataError {
232    UnknownValue(serde_json::Value),
233}
234
235/// struct for typed errors of method [`list_app_paths_from_workspace_runnable`]
236#[derive(Debug, Clone, Serialize, Deserialize)]
237#[serde(untagged)]
238pub enum ListAppPathsFromWorkspaceRunnableError {
239    UnknownValue(serde_json::Value),
240}
241
242/// struct for typed errors of method [`list_apps`]
243#[derive(Debug, Clone, Serialize, Deserialize)]
244#[serde(untagged)]
245pub enum ListAppsError {
246    UnknownValue(serde_json::Value),
247}
248
249/// struct for typed errors of method [`list_hub_apps`]
250#[derive(Debug, Clone, Serialize, Deserialize)]
251#[serde(untagged)]
252pub enum ListHubAppsError {
253    UnknownValue(serde_json::Value),
254}
255
256/// struct for typed errors of method [`list_search_app`]
257#[derive(Debug, Clone, Serialize, Deserialize)]
258#[serde(untagged)]
259pub enum ListSearchAppError {
260    UnknownValue(serde_json::Value),
261}
262
263/// struct for typed errors of method [`mint_preview_sdk_token`]
264#[derive(Debug, Clone, Serialize, Deserialize)]
265#[serde(untagged)]
266pub enum MintPreviewSdkTokenError {
267    UnknownValue(serde_json::Value),
268}
269
270/// struct for typed errors of method [`sign_s3_objects`]
271#[derive(Debug, Clone, Serialize, Deserialize)]
272#[serde(untagged)]
273pub enum SignS3ObjectsError {
274    UnknownValue(serde_json::Value),
275}
276
277/// struct for typed errors of method [`update_app`]
278#[derive(Debug, Clone, Serialize, Deserialize)]
279#[serde(untagged)]
280pub enum UpdateAppError {
281    UnknownValue(serde_json::Value),
282}
283
284/// struct for typed errors of method [`update_app_history`]
285#[derive(Debug, Clone, Serialize, Deserialize)]
286#[serde(untagged)]
287pub enum UpdateAppHistoryError {
288    UnknownValue(serde_json::Value),
289}
290
291/// struct for typed errors of method [`update_app_raw_source`]
292#[derive(Debug, Clone, Serialize, Deserialize)]
293#[serde(untagged)]
294pub enum UpdateAppRawSourceError {
295    UnknownValue(serde_json::Value),
296}
297
298/// struct for typed errors of method [`upload_s3_file_from_app`]
299#[derive(Debug, Clone, Serialize, Deserialize)]
300#[serde(untagged)]
301pub enum UploadS3FileFromAppError {
302    UnknownValue(serde_json::Value),
303}
304
305
306pub 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>> {
307    let local_var_configuration = configuration;
308
309    let local_var_client = &local_var_configuration.client;
310
311    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));
312    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
313
314    local_var_req_builder = local_var_req_builder.query(&[("file_key", &file_key.to_string())]);
315    if let Some(ref local_var_str) = storage {
316        local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
317    }
318    if let Some(ref local_var_str) = sig {
319        local_var_req_builder = local_var_req_builder.query(&[("sig", &local_var_str.to_string())]);
320    }
321    if let Some(ref local_var_str) = exp {
322        local_var_req_builder = local_var_req_builder.query(&[("exp", &local_var_str.to_string())]);
323    }
324    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
325        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
326    }
327    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
328        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
329    };
330
331    let local_var_req = local_var_req_builder.build()?;
332    let local_var_resp = local_var_client.execute(local_var_req).await?;
333
334    let local_var_status = local_var_resp.status();
335    let local_var_content = local_var_resp.text().await?;
336
337    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
338        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
339    } else {
340        let local_var_entity: Option<AppDownloadS3ParquetFileAsCsvError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
341        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
342        Err(Error::ResponseError(local_var_error))
343    }
344}
345
346pub 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>> {
347    let local_var_configuration = configuration;
348
349    let local_var_client = &local_var_configuration.client;
350
351    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));
352    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
353
354    local_var_req_builder = local_var_req_builder.query(&[("file_key", &file_key.to_string())]);
355    if let Some(ref local_var_str) = offset {
356        local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]);
357    }
358    if let Some(ref local_var_str) = limit {
359        local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]);
360    }
361    if let Some(ref local_var_str) = sort_col {
362        local_var_req_builder = local_var_req_builder.query(&[("sort_col", &local_var_str.to_string())]);
363    }
364    if let Some(ref local_var_str) = sort_desc {
365        local_var_req_builder = local_var_req_builder.query(&[("sort_desc", &local_var_str.to_string())]);
366    }
367    if let Some(ref local_var_str) = search_col {
368        local_var_req_builder = local_var_req_builder.query(&[("search_col", &local_var_str.to_string())]);
369    }
370    if let Some(ref local_var_str) = search_term {
371        local_var_req_builder = local_var_req_builder.query(&[("search_term", &local_var_str.to_string())]);
372    }
373    if let Some(ref local_var_str) = storage {
374        local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
375    }
376    if let Some(ref local_var_str) = csv_separator {
377        local_var_req_builder = local_var_req_builder.query(&[("csv_separator", &local_var_str.to_string())]);
378    }
379    if let Some(ref local_var_str) = sig {
380        local_var_req_builder = local_var_req_builder.query(&[("sig", &local_var_str.to_string())]);
381    }
382    if let Some(ref local_var_str) = exp {
383        local_var_req_builder = local_var_req_builder.query(&[("exp", &local_var_str.to_string())]);
384    }
385    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
386        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
387    }
388    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
389        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
390    };
391
392    let local_var_req = local_var_req_builder.build()?;
393    let local_var_resp = local_var_client.execute(local_var_req).await?;
394
395    let local_var_status = local_var_resp.status();
396    let local_var_content = local_var_resp.text().await?;
397
398    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
399        Ok(())
400    } else {
401        let local_var_entity: Option<AppLoadCsvPreviewError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
402        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
403        Err(Error::ResponseError(local_var_error))
404    }
405}
406
407pub 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>> {
408    let local_var_configuration = configuration;
409
410    let local_var_client = &local_var_configuration.client;
411
412    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));
413    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
414
415    local_var_req_builder = local_var_req_builder.query(&[("file_key", &file_key.to_string())]);
416    if let Some(ref local_var_str) = storage {
417        local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
418    }
419    if let Some(ref local_var_str) = sig {
420        local_var_req_builder = local_var_req_builder.query(&[("sig", &local_var_str.to_string())]);
421    }
422    if let Some(ref local_var_str) = exp {
423        local_var_req_builder = local_var_req_builder.query(&[("exp", &local_var_str.to_string())]);
424    }
425    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
426        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
427    }
428    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
429        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
430    };
431
432    let local_var_req = local_var_req_builder.build()?;
433    let local_var_resp = local_var_client.execute(local_var_req).await?;
434
435    let local_var_status = local_var_resp.status();
436    let local_var_content = local_var_resp.text().await?;
437
438    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
439        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
440    } else {
441        let local_var_entity: Option<AppLoadFileMetadataError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
442        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
443        Err(Error::ResponseError(local_var_error))
444    }
445}
446
447pub 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>> {
448    let local_var_configuration = configuration;
449
450    let local_var_client = &local_var_configuration.client;
451
452    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));
453    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
454
455    local_var_req_builder = local_var_req_builder.query(&[("file_key", &file_key.to_string())]);
456    if let Some(ref local_var_str) = file_size_in_bytes {
457        local_var_req_builder = local_var_req_builder.query(&[("file_size_in_bytes", &local_var_str.to_string())]);
458    }
459    if let Some(ref local_var_str) = file_mime_type {
460        local_var_req_builder = local_var_req_builder.query(&[("file_mime_type", &local_var_str.to_string())]);
461    }
462    if let Some(ref local_var_str) = csv_separator {
463        local_var_req_builder = local_var_req_builder.query(&[("csv_separator", &local_var_str.to_string())]);
464    }
465    if let Some(ref local_var_str) = csv_has_header {
466        local_var_req_builder = local_var_req_builder.query(&[("csv_has_header", &local_var_str.to_string())]);
467    }
468    local_var_req_builder = local_var_req_builder.query(&[("read_bytes_from", &read_bytes_from.to_string())]);
469    local_var_req_builder = local_var_req_builder.query(&[("read_bytes_length", &read_bytes_length.to_string())]);
470    if let Some(ref local_var_str) = storage {
471        local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
472    }
473    if let Some(ref local_var_str) = sig {
474        local_var_req_builder = local_var_req_builder.query(&[("sig", &local_var_str.to_string())]);
475    }
476    if let Some(ref local_var_str) = exp {
477        local_var_req_builder = local_var_req_builder.query(&[("exp", &local_var_str.to_string())]);
478    }
479    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
480        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
481    }
482    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
483        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
484    };
485
486    let local_var_req = local_var_req_builder.build()?;
487    let local_var_resp = local_var_client.execute(local_var_req).await?;
488
489    let local_var_status = local_var_resp.status();
490    let local_var_content = local_var_resp.text().await?;
491
492    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
493        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
494    } else {
495        let local_var_entity: Option<AppLoadFilePreviewError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
496        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
497        Err(Error::ResponseError(local_var_error))
498    }
499}
500
501pub 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>> {
502    let local_var_configuration = configuration;
503
504    let local_var_client = &local_var_configuration.client;
505
506    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));
507    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
508
509    local_var_req_builder = local_var_req_builder.query(&[("file_key", &file_key.to_string())]);
510    if let Some(ref local_var_str) = offset {
511        local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]);
512    }
513    if let Some(ref local_var_str) = limit {
514        local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]);
515    }
516    if let Some(ref local_var_str) = sort_col {
517        local_var_req_builder = local_var_req_builder.query(&[("sort_col", &local_var_str.to_string())]);
518    }
519    if let Some(ref local_var_str) = sort_desc {
520        local_var_req_builder = local_var_req_builder.query(&[("sort_desc", &local_var_str.to_string())]);
521    }
522    if let Some(ref local_var_str) = search_col {
523        local_var_req_builder = local_var_req_builder.query(&[("search_col", &local_var_str.to_string())]);
524    }
525    if let Some(ref local_var_str) = search_term {
526        local_var_req_builder = local_var_req_builder.query(&[("search_term", &local_var_str.to_string())]);
527    }
528    if let Some(ref local_var_str) = storage {
529        local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
530    }
531    if let Some(ref local_var_str) = sig {
532        local_var_req_builder = local_var_req_builder.query(&[("sig", &local_var_str.to_string())]);
533    }
534    if let Some(ref local_var_str) = exp {
535        local_var_req_builder = local_var_req_builder.query(&[("exp", &local_var_str.to_string())]);
536    }
537    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
538        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
539    }
540    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
541        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
542    };
543
544    let local_var_req = local_var_req_builder.build()?;
545    let local_var_resp = local_var_client.execute(local_var_req).await?;
546
547    let local_var_status = local_var_resp.status();
548    let local_var_content = local_var_resp.text().await?;
549
550    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
551        Ok(())
552    } else {
553        let local_var_entity: Option<AppLoadParquetPreviewError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
554        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
555        Err(Error::ResponseError(local_var_error))
556    }
557}
558
559pub 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>> {
560    let local_var_configuration = configuration;
561
562    let local_var_client = &local_var_configuration.client;
563
564    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));
565    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
566
567    local_var_req_builder = local_var_req_builder.query(&[("file_key", &file_key.to_string())]);
568    if let Some(ref local_var_str) = search_col {
569        local_var_req_builder = local_var_req_builder.query(&[("search_col", &local_var_str.to_string())]);
570    }
571    if let Some(ref local_var_str) = search_term {
572        local_var_req_builder = local_var_req_builder.query(&[("search_term", &local_var_str.to_string())]);
573    }
574    if let Some(ref local_var_str) = storage {
575        local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
576    }
577    if let Some(ref local_var_str) = sig {
578        local_var_req_builder = local_var_req_builder.query(&[("sig", &local_var_str.to_string())]);
579    }
580    if let Some(ref local_var_str) = exp {
581        local_var_req_builder = local_var_req_builder.query(&[("exp", &local_var_str.to_string())]);
582    }
583    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
584        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
585    }
586    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
587        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
588    };
589
590    let local_var_req = local_var_req_builder.build()?;
591    let local_var_resp = local_var_client.execute(local_var_req).await?;
592
593    let local_var_status = local_var_resp.status();
594    let local_var_content = local_var_resp.text().await?;
595
596    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
597        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
598    } else {
599        let local_var_entity: Option<AppLoadTableCountError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
600        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
601        Err(Error::ResponseError(local_var_error))
602    }
603}
604
605pub async fn create_app(configuration: &configuration::Configuration, workspace: &str, create_app_request: models::CreateAppRequest) -> Result<String, Error<CreateAppError>> {
606    let local_var_configuration = configuration;
607
608    let local_var_client = &local_var_configuration.client;
609
610    let local_var_uri_str = format!("{}/w/{workspace}/apps/create", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
611    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
612
613    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
614        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
615    }
616    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
617        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
618    };
619    local_var_req_builder = local_var_req_builder.json(&create_app_request);
620
621    let local_var_req = local_var_req_builder.build()?;
622    let local_var_resp = local_var_client.execute(local_var_req).await?;
623
624    let local_var_status = local_var_resp.status();
625    let local_var_content = local_var_resp.text().await?;
626
627    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
628        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
629    } else {
630        let local_var_entity: Option<CreateAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
631        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
632        Err(Error::ResponseError(local_var_error))
633    }
634}
635
636pub async fn create_app_raw_source(configuration: &configuration::Configuration, workspace: &str, create_app_raw_source_request: models::CreateAppRawSourceRequest) -> Result<String, Error<CreateAppRawSourceError>> {
637    let local_var_configuration = configuration;
638
639    let local_var_client = &local_var_configuration.client;
640
641    let local_var_uri_str = format!("{}/w/{workspace}/apps/create_raw_source", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
642    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
643
644    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
645        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
646    }
647    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
648        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
649    };
650    local_var_req_builder = local_var_req_builder.json(&create_app_raw_source_request);
651
652    let local_var_req = local_var_req_builder.build()?;
653    let local_var_resp = local_var_client.execute(local_var_req).await?;
654
655    let local_var_status = local_var_resp.status();
656    let local_var_content = local_var_resp.text().await?;
657
658    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
659        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
660    } else {
661        let local_var_entity: Option<CreateAppRawSourceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
662        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
663        Err(Error::ResponseError(local_var_error))
664    }
665}
666
667pub async fn custom_path_exists(configuration: &configuration::Configuration, workspace: &str, custom_path: &str) -> Result<bool, Error<CustomPathExistsError>> {
668    let local_var_configuration = configuration;
669
670    let local_var_client = &local_var_configuration.client;
671
672    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));
673    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
674
675    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
676        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
677    }
678    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
679        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
680    };
681
682    let local_var_req = local_var_req_builder.build()?;
683    let local_var_resp = local_var_client.execute(local_var_req).await?;
684
685    let local_var_status = local_var_resp.status();
686    let local_var_content = local_var_resp.text().await?;
687
688    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
689        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
690    } else {
691        let local_var_entity: Option<CustomPathExistsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
692        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
693        Err(Error::ResponseError(local_var_error))
694    }
695}
696
697pub async fn delete_app(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<String, Error<DeleteAppError>> {
698    let local_var_configuration = configuration;
699
700    let local_var_client = &local_var_configuration.client;
701
702    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));
703    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
704
705    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
706        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
707    }
708    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
709        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
710    };
711
712    let local_var_req = local_var_req_builder.build()?;
713    let local_var_resp = local_var_client.execute(local_var_req).await?;
714
715    let local_var_status = local_var_resp.status();
716    let local_var_content = local_var_resp.text().await?;
717
718    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
719        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
720    } else {
721        let local_var_entity: Option<DeleteAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
722        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
723        Err(Error::ResponseError(local_var_error))
724    }
725}
726
727pub async fn delete_s3_file_from_app(configuration: &configuration::Configuration, workspace: &str, delete_token: &str) -> Result<String, Error<DeleteS3FileFromAppError>> {
728    let local_var_configuration = configuration;
729
730    let local_var_client = &local_var_configuration.client;
731
732    let local_var_uri_str = format!("{}/w/{workspace}/apps_u/delete_s3_file", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
733    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
734
735    local_var_req_builder = local_var_req_builder.query(&[("delete_token", &delete_token.to_string())]);
736    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
737        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
738    }
739    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
740        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
741    };
742
743    let local_var_req = local_var_req_builder.build()?;
744    let local_var_resp = local_var_client.execute(local_var_req).await?;
745
746    let local_var_status = local_var_resp.status();
747    let local_var_content = local_var_resp.text().await?;
748
749    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
750        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
751    } else {
752        let local_var_entity: Option<DeleteS3FileFromAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
753        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
754        Err(Error::ResponseError(local_var_error))
755    }
756}
757
758pub async fn execute_component(configuration: &configuration::Configuration, workspace: &str, path: &str, execute_component_request: models::ExecuteComponentRequest) -> Result<String, Error<ExecuteComponentError>> {
759    let local_var_configuration = configuration;
760
761    let local_var_client = &local_var_configuration.client;
762
763    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));
764    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
765
766    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
767        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
768    }
769    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
770        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
771    };
772    local_var_req_builder = local_var_req_builder.json(&execute_component_request);
773
774    let local_var_req = local_var_req_builder.build()?;
775    let local_var_resp = local_var_client.execute(local_var_req).await?;
776
777    let local_var_status = local_var_resp.status();
778    let local_var_content = local_var_resp.text().await?;
779
780    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
781        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
782    } else {
783        let local_var_entity: Option<ExecuteComponentError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
784        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
785        Err(Error::ResponseError(local_var_error))
786    }
787}
788
789pub async fn exists_app(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<bool, Error<ExistsAppError>> {
790    let local_var_configuration = configuration;
791
792    let local_var_client = &local_var_configuration.client;
793
794    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));
795    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
796
797    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
798        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
799    }
800    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
801        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
802    };
803
804    let local_var_req = local_var_req_builder.build()?;
805    let local_var_resp = local_var_client.execute(local_var_req).await?;
806
807    let local_var_status = local_var_resp.status();
808    let local_var_content = local_var_resp.text().await?;
809
810    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
811        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
812    } else {
813        let local_var_entity: Option<ExistsAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
814        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
815        Err(Error::ResponseError(local_var_error))
816    }
817}
818
819pub 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>> {
820    let local_var_configuration = configuration;
821
822    let local_var_client = &local_var_configuration.client;
823
824    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));
825    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
826
827    if let Some(ref local_var_str) = with_starred_info {
828        local_var_req_builder = local_var_req_builder.query(&[("with_starred_info", &local_var_str.to_string())]);
829    }
830    if let Some(ref local_var_str) = get_draft {
831        local_var_req_builder = local_var_req_builder.query(&[("get_draft", &local_var_str.to_string())]);
832    }
833    if let Some(ref local_var_str) = raw_app {
834        local_var_req_builder = local_var_req_builder.query(&[("raw_app", &local_var_str.to_string())]);
835    }
836    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
837        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
838    }
839    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
840        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
841    };
842
843    let local_var_req = local_var_req_builder.build()?;
844    let local_var_resp = local_var_client.execute(local_var_req).await?;
845
846    let local_var_status = local_var_resp.status();
847    let local_var_content = local_var_resp.text().await?;
848
849    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
850        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
851    } else {
852        let local_var_entity: Option<GetAppByPathError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
853        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
854        Err(Error::ResponseError(local_var_error))
855    }
856}
857
858pub async fn get_app_by_version(configuration: &configuration::Configuration, workspace: &str, id: i32) -> Result<models::AppWithLastVersion, Error<GetAppByVersionError>> {
859    let local_var_configuration = configuration;
860
861    let local_var_client = &local_var_configuration.client;
862
863    let local_var_uri_str = format!("{}/w/{workspace}/apps/get/v/{id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=id);
864    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
865
866    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
867        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
868    }
869    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
870        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
871    };
872
873    let local_var_req = local_var_req_builder.build()?;
874    let local_var_resp = local_var_client.execute(local_var_req).await?;
875
876    let local_var_status = local_var_resp.status();
877    let local_var_content = local_var_resp.text().await?;
878
879    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
880        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
881    } else {
882        let local_var_entity: Option<GetAppByVersionError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
883        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
884        Err(Error::ResponseError(local_var_error))
885    }
886}
887
888pub async fn get_app_embed_token_by_custom_path(configuration: &configuration::Configuration, custom_path: &str, sdk_consent: Option<bool>) -> Result<models::EmbedTokenResponse, Error<GetAppEmbedTokenByCustomPathError>> {
889    let local_var_configuration = configuration;
890
891    let local_var_client = &local_var_configuration.client;
892
893    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));
894    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
895
896    if let Some(ref local_var_str) = sdk_consent {
897        local_var_req_builder = local_var_req_builder.query(&[("sdk_consent", &local_var_str.to_string())]);
898    }
899    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
900        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
901    }
902    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
903        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
904    };
905
906    let local_var_req = local_var_req_builder.build()?;
907    let local_var_resp = local_var_client.execute(local_var_req).await?;
908
909    let local_var_status = local_var_resp.status();
910    let local_var_content = local_var_resp.text().await?;
911
912    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
913        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
914    } else {
915        let local_var_entity: Option<GetAppEmbedTokenByCustomPathError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
916        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
917        Err(Error::ResponseError(local_var_error))
918    }
919}
920
921pub async fn get_app_embed_token_by_path(configuration: &configuration::Configuration, workspace: &str, path: &str, sdk_consent: Option<bool>) -> Result<models::EmbedTokenResponse, Error<GetAppEmbedTokenByPathError>> {
922    let local_var_configuration = configuration;
923
924    let local_var_client = &local_var_configuration.client;
925
926    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));
927    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
928
929    if let Some(ref local_var_str) = sdk_consent {
930        local_var_req_builder = local_var_req_builder.query(&[("sdk_consent", &local_var_str.to_string())]);
931    }
932    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
933        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
934    }
935    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
936        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
937    };
938
939    let local_var_req = local_var_req_builder.build()?;
940    let local_var_resp = local_var_client.execute(local_var_req).await?;
941
942    let local_var_status = local_var_resp.status();
943    let local_var_content = local_var_resp.text().await?;
944
945    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
946        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
947    } else {
948        let local_var_entity: Option<GetAppEmbedTokenByPathError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
949        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
950        Err(Error::ResponseError(local_var_error))
951    }
952}
953
954pub async fn get_app_embed_token_by_secret(configuration: &configuration::Configuration, workspace: &str, secret: &str, sdk_consent: Option<bool>) -> Result<models::EmbedTokenResponse, Error<GetAppEmbedTokenBySecretError>> {
955    let local_var_configuration = configuration;
956
957    let local_var_client = &local_var_configuration.client;
958
959    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));
960    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
961
962    if let Some(ref local_var_str) = sdk_consent {
963        local_var_req_builder = local_var_req_builder.query(&[("sdk_consent", &local_var_str.to_string())]);
964    }
965    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
966        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
967    }
968    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
969        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
970    };
971
972    let local_var_req = local_var_req_builder.build()?;
973    let local_var_resp = local_var_client.execute(local_var_req).await?;
974
975    let local_var_status = local_var_resp.status();
976    let local_var_content = local_var_resp.text().await?;
977
978    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
979        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
980    } else {
981        let local_var_entity: Option<GetAppEmbedTokenBySecretError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
982        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
983        Err(Error::ResponseError(local_var_error))
984    }
985}
986
987pub async fn get_app_history_by_path(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<Vec<models::AppHistory>, Error<GetAppHistoryByPathError>> {
988    let local_var_configuration = configuration;
989
990    let local_var_client = &local_var_configuration.client;
991
992    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));
993    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
994
995    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
996        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
997    }
998    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
999        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1000    };
1001
1002    let local_var_req = local_var_req_builder.build()?;
1003    let local_var_resp = local_var_client.execute(local_var_req).await?;
1004
1005    let local_var_status = local_var_resp.status();
1006    let local_var_content = local_var_resp.text().await?;
1007
1008    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1009        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1010    } else {
1011        let local_var_entity: Option<GetAppHistoryByPathError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1012        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1013        Err(Error::ResponseError(local_var_error))
1014    }
1015}
1016
1017pub async fn get_app_latest_version(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<models::AppHistory, Error<GetAppLatestVersionError>> {
1018    let local_var_configuration = configuration;
1019
1020    let local_var_client = &local_var_configuration.client;
1021
1022    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));
1023    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1024
1025    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1026        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1027    }
1028    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1029        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1030    };
1031
1032    let local_var_req = local_var_req_builder.build()?;
1033    let local_var_resp = local_var_client.execute(local_var_req).await?;
1034
1035    let local_var_status = local_var_resp.status();
1036    let local_var_content = local_var_resp.text().await?;
1037
1038    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1039        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1040    } else {
1041        let local_var_entity: Option<GetAppLatestVersionError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1042        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1043        Err(Error::ResponseError(local_var_error))
1044    }
1045}
1046
1047pub async fn get_app_lite_by_path(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<models::AppWithLastVersion, Error<GetAppLiteByPathError>> {
1048    let local_var_configuration = configuration;
1049
1050    let local_var_client = &local_var_configuration.client;
1051
1052    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));
1053    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1054
1055    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1056        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1057    }
1058    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1059        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1060    };
1061
1062    let local_var_req = local_var_req_builder.build()?;
1063    let local_var_resp = local_var_client.execute(local_var_req).await?;
1064
1065    let local_var_status = local_var_resp.status();
1066    let local_var_content = local_var_resp.text().await?;
1067
1068    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1069        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1070    } else {
1071        let local_var_entity: Option<GetAppLiteByPathError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1072        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1073        Err(Error::ResponseError(local_var_error))
1074    }
1075}
1076
1077/// Unauthenticated: what a signed-out visitor reads to learn that signing in would let them in. 404 unless the app's execution mode is `guest` AND the workspace has `guest_access_enabled` AND the instance has not set the `guest_access_disabled` global setting, and never on a deployment where guests are unavailable (the shared cloud), so it says nothing about apps that are not open to guests. Discloses only the app path, to a caller already holding the share secret.
1078pub async fn get_guest_entry(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<models::GuestEntry, Error<GetGuestEntryError>> {
1079    let local_var_configuration = configuration;
1080
1081    let local_var_client = &local_var_configuration.client;
1082
1083    let local_var_uri_str = format!("{}/w/{workspace}/apps_u/guest_entry/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(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<GetGuestEntryError> = 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
1108/// The custom-path counterpart of `getGuestEntry`. Unauthenticated; 404 unless the app's execution mode is `guest` AND its workspace has `guest_access_enabled` AND the instance has not set `guest_access_disabled`, and never on a deployment where guests are unavailable (the shared cloud). Returns the workspace too, since a custom URL may not carry it.
1109pub async fn get_guest_entry_by_custom_path(configuration: &configuration::Configuration, custom_path: &str) -> Result<models::GuestEntry, Error<GetGuestEntryByCustomPathError>> {
1110    let local_var_configuration = configuration;
1111
1112    let local_var_client = &local_var_configuration.client;
1113
1114    let local_var_uri_str = format!("{}/apps_u/guest_entry_by_custom_path/{custom_path}", local_var_configuration.base_path, custom_path=crate::apis::urlencode(custom_path));
1115    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1116
1117    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1118        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1119    }
1120    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1121        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1122    };
1123
1124    let local_var_req = local_var_req_builder.build()?;
1125    let local_var_resp = local_var_client.execute(local_var_req).await?;
1126
1127    let local_var_status = local_var_resp.status();
1128    let local_var_content = local_var_resp.text().await?;
1129
1130    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1131        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1132    } else {
1133        let local_var_entity: Option<GetGuestEntryByCustomPathError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1134        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1135        Err(Error::ResponseError(local_var_error))
1136    }
1137}
1138
1139pub async fn get_hub_app_by_id(configuration: &configuration::Configuration, id: i32) -> Result<models::GetHubAppById200Response, Error<GetHubAppByIdError>> {
1140    let local_var_configuration = configuration;
1141
1142    let local_var_client = &local_var_configuration.client;
1143
1144    let local_var_uri_str = format!("{}/apps/hub/get/{id}", local_var_configuration.base_path, id=id);
1145    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1146
1147    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1148        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1149    }
1150    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1151        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1152    };
1153
1154    let local_var_req = local_var_req_builder.build()?;
1155    let local_var_resp = local_var_client.execute(local_var_req).await?;
1156
1157    let local_var_status = local_var_resp.status();
1158    let local_var_content = local_var_resp.text().await?;
1159
1160    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1161        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1162    } else {
1163        let local_var_entity: Option<GetHubAppByIdError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1164        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1165        Err(Error::ResponseError(local_var_error))
1166    }
1167}
1168
1169pub async fn get_hub_raw_app_by_id(configuration: &configuration::Configuration, id: i32) -> Result<models::GetHubAppById200Response, Error<GetHubRawAppByIdError>> {
1170    let local_var_configuration = configuration;
1171
1172    let local_var_client = &local_var_configuration.client;
1173
1174    let local_var_uri_str = format!("{}/apps/hub/get_raw/{id}", local_var_configuration.base_path, id=id);
1175    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1176
1177    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1178        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1179    }
1180    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1181        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1182    };
1183
1184    let local_var_req = local_var_req_builder.build()?;
1185    let local_var_resp = local_var_client.execute(local_var_req).await?;
1186
1187    let local_var_status = local_var_resp.status();
1188    let local_var_content = local_var_resp.text().await?;
1189
1190    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1191        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1192    } else {
1193        let local_var_entity: Option<GetHubRawAppByIdError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1194        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1195        Err(Error::ResponseError(local_var_error))
1196    }
1197}
1198
1199pub async fn get_public_app_by_custom_path(configuration: &configuration::Configuration, custom_path: &str) -> Result<models::GetPublicAppByCustomPath200Response, Error<GetPublicAppByCustomPathError>> {
1200    let local_var_configuration = configuration;
1201
1202    let local_var_client = &local_var_configuration.client;
1203
1204    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));
1205    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1206
1207    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1208        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1209    }
1210    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1211        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1212    };
1213
1214    let local_var_req = local_var_req_builder.build()?;
1215    let local_var_resp = local_var_client.execute(local_var_req).await?;
1216
1217    let local_var_status = local_var_resp.status();
1218    let local_var_content = local_var_resp.text().await?;
1219
1220    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1221        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1222    } else {
1223        let local_var_entity: Option<GetPublicAppByCustomPathError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1224        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1225        Err(Error::ResponseError(local_var_error))
1226    }
1227}
1228
1229pub async fn get_public_app_by_secret(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<models::AppWithLastVersion, Error<GetPublicAppBySecretError>> {
1230    let local_var_configuration = configuration;
1231
1232    let local_var_client = &local_var_configuration.client;
1233
1234    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));
1235    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1236
1237    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1238        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1239    }
1240    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1241        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1242    };
1243
1244    let local_var_req = local_var_req_builder.build()?;
1245    let local_var_resp = local_var_client.execute(local_var_req).await?;
1246
1247    let local_var_status = local_var_resp.status();
1248    let local_var_content = local_var_resp.text().await?;
1249
1250    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1251        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1252    } else {
1253        let local_var_entity: Option<GetPublicAppBySecretError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1254        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1255        Err(Error::ResponseError(local_var_error))
1256    }
1257}
1258
1259pub async fn get_public_resource(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<serde_json::Value, Error<GetPublicResourceError>> {
1260    let local_var_configuration = configuration;
1261
1262    let local_var_client = &local_var_configuration.client;
1263
1264    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));
1265    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1266
1267    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1268        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1269    }
1270    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1271        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1272    };
1273
1274    let local_var_req = local_var_req_builder.build()?;
1275    let local_var_resp = local_var_client.execute(local_var_req).await?;
1276
1277    let local_var_status = local_var_resp.status();
1278    let local_var_content = local_var_resp.text().await?;
1279
1280    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1281        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1282    } else {
1283        let local_var_entity: Option<GetPublicResourceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1284        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1285        Err(Error::ResponseError(local_var_error))
1286    }
1287}
1288
1289pub async fn get_public_secret_of_app(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<String, Error<GetPublicSecretOfAppError>> {
1290    let local_var_configuration = configuration;
1291
1292    let local_var_client = &local_var_configuration.client;
1293
1294    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));
1295    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1296
1297    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1298        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1299    }
1300    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1301        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1302    };
1303
1304    let local_var_req = local_var_req_builder.build()?;
1305    let local_var_resp = local_var_client.execute(local_var_req).await?;
1306
1307    let local_var_status = local_var_resp.status();
1308    let local_var_content = local_var_resp.text().await?;
1309
1310    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1311        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1312    } else {
1313        let local_var_entity: Option<GetPublicSecretOfAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1314        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1315        Err(Error::ResponseError(local_var_error))
1316    }
1317}
1318
1319pub async fn get_public_secret_of_latest_version_of_app(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<String, Error<GetPublicSecretOfLatestVersionOfAppError>> {
1320    let local_var_configuration = configuration;
1321
1322    let local_var_client = &local_var_configuration.client;
1323
1324    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));
1325    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1326
1327    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1328        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1329    }
1330    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1331        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1332    };
1333
1334    let local_var_req = local_var_req_builder.build()?;
1335    let local_var_resp = local_var_client.execute(local_var_req).await?;
1336
1337    let local_var_status = local_var_resp.status();
1338    let local_var_content = local_var_resp.text().await?;
1339
1340    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1341        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1342    } else {
1343        let local_var_entity: Option<GetPublicSecretOfLatestVersionOfAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1344        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1345        Err(Error::ResponseError(local_var_error))
1346    }
1347}
1348
1349pub async fn get_raw_app_data(configuration: &configuration::Configuration, workspace: &str, secret_with_extension: &str) -> Result<String, Error<GetRawAppDataError>> {
1350    let local_var_configuration = configuration;
1351
1352    let local_var_client = &local_var_configuration.client;
1353
1354    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));
1355    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1356
1357    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1358        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1359    }
1360    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1361        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1362    };
1363
1364    let local_var_req = local_var_req_builder.build()?;
1365    let local_var_resp = local_var_client.execute(local_var_req).await?;
1366
1367    let local_var_status = local_var_resp.status();
1368    let local_var_content = local_var_resp.text().await?;
1369
1370    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1371        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1372    } else {
1373        let local_var_entity: Option<GetRawAppDataError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1374        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1375        Err(Error::ResponseError(local_var_error))
1376    }
1377}
1378
1379pub async fn list_app_paths_from_workspace_runnable(configuration: &configuration::Configuration, workspace: &str, runnable_kind: &str, path: &str) -> Result<Vec<String>, Error<ListAppPathsFromWorkspaceRunnableError>> {
1380    let local_var_configuration = configuration;
1381
1382    let local_var_client = &local_var_configuration.client;
1383
1384    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));
1385    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1386
1387    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1388        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1389    }
1390    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1391        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1392    };
1393
1394    let local_var_req = local_var_req_builder.build()?;
1395    let local_var_resp = local_var_client.execute(local_var_req).await?;
1396
1397    let local_var_status = local_var_resp.status();
1398    let local_var_content = local_var_resp.text().await?;
1399
1400    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1401        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1402    } else {
1403        let local_var_entity: Option<ListAppPathsFromWorkspaceRunnableError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1404        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1405        Err(Error::ResponseError(local_var_error))
1406    }
1407}
1408
1409pub 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>> {
1410    let local_var_configuration = configuration;
1411
1412    let local_var_client = &local_var_configuration.client;
1413
1414    let local_var_uri_str = format!("{}/w/{workspace}/apps/list", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1415    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1416
1417    if let Some(ref local_var_str) = page {
1418        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1419    }
1420    if let Some(ref local_var_str) = per_page {
1421        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
1422    }
1423    if let Some(ref local_var_str) = order_desc {
1424        local_var_req_builder = local_var_req_builder.query(&[("order_desc", &local_var_str.to_string())]);
1425    }
1426    if let Some(ref local_var_str) = created_by {
1427        local_var_req_builder = local_var_req_builder.query(&[("created_by", &local_var_str.to_string())]);
1428    }
1429    if let Some(ref local_var_str) = path_start {
1430        local_var_req_builder = local_var_req_builder.query(&[("path_start", &local_var_str.to_string())]);
1431    }
1432    if let Some(ref local_var_str) = path_exact {
1433        local_var_req_builder = local_var_req_builder.query(&[("path_exact", &local_var_str.to_string())]);
1434    }
1435    if let Some(ref local_var_str) = starred_only {
1436        local_var_req_builder = local_var_req_builder.query(&[("starred_only", &local_var_str.to_string())]);
1437    }
1438    if let Some(ref local_var_str) = include_draft_only {
1439        local_var_req_builder = local_var_req_builder.query(&[("include_draft_only", &local_var_str.to_string())]);
1440    }
1441    if let Some(ref local_var_str) = with_deployment_msg {
1442        local_var_req_builder = local_var_req_builder.query(&[("with_deployment_msg", &local_var_str.to_string())]);
1443    }
1444    if let Some(ref local_var_str) = label {
1445        local_var_req_builder = local_var_req_builder.query(&[("label", &local_var_str.to_string())]);
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
1454    let local_var_req = local_var_req_builder.build()?;
1455    let local_var_resp = local_var_client.execute(local_var_req).await?;
1456
1457    let local_var_status = local_var_resp.status();
1458    let local_var_content = local_var_resp.text().await?;
1459
1460    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1461        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1462    } else {
1463        let local_var_entity: Option<ListAppsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1464        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1465        Err(Error::ResponseError(local_var_error))
1466    }
1467}
1468
1469pub async fn list_hub_apps(configuration: &configuration::Configuration, ) -> Result<models::ListHubApps200Response, Error<ListHubAppsError>> {
1470    let local_var_configuration = configuration;
1471
1472    let local_var_client = &local_var_configuration.client;
1473
1474    let local_var_uri_str = format!("{}/apps/hub/list", local_var_configuration.base_path);
1475    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1476
1477    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1478        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1479    }
1480    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1481        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1482    };
1483
1484    let local_var_req = local_var_req_builder.build()?;
1485    let local_var_resp = local_var_client.execute(local_var_req).await?;
1486
1487    let local_var_status = local_var_resp.status();
1488    let local_var_content = local_var_resp.text().await?;
1489
1490    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1491        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1492    } else {
1493        let local_var_entity: Option<ListHubAppsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1494        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1495        Err(Error::ResponseError(local_var_error))
1496    }
1497}
1498
1499pub async fn list_search_app(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::ListSearchFlow200ResponseInner>, Error<ListSearchAppError>> {
1500    let local_var_configuration = configuration;
1501
1502    let local_var_client = &local_var_configuration.client;
1503
1504    let local_var_uri_str = format!("{}/w/{workspace}/apps/list_search", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1505    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1506
1507    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1508        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1509    }
1510    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1511        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1512    };
1513
1514    let local_var_req = local_var_req_builder.build()?;
1515    let local_var_resp = local_var_client.execute(local_var_req).await?;
1516
1517    let local_var_status = local_var_resp.status();
1518    let local_var_content = local_var_resp.text().await?;
1519
1520    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1521        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1522    } else {
1523        let local_var_entity: Option<ListSearchAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1524        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1525        Err(Error::ResponseError(local_var_error))
1526    }
1527}
1528
1529pub async fn mint_preview_sdk_token(configuration: &configuration::Configuration, workspace: &str, mint_preview_sdk_token_request: models::MintPreviewSdkTokenRequest) -> Result<String, Error<MintPreviewSdkTokenError>> {
1530    let local_var_configuration = configuration;
1531
1532    let local_var_client = &local_var_configuration.client;
1533
1534    let local_var_uri_str = format!("{}/w/{workspace}/apps/preview_sdk_token", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1535    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1536
1537    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1538        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1539    }
1540    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1541        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1542    };
1543    local_var_req_builder = local_var_req_builder.json(&mint_preview_sdk_token_request);
1544
1545    let local_var_req = local_var_req_builder.build()?;
1546    let local_var_resp = local_var_client.execute(local_var_req).await?;
1547
1548    let local_var_status = local_var_resp.status();
1549    let local_var_content = local_var_resp.text().await?;
1550
1551    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1552        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1553    } else {
1554        let local_var_entity: Option<MintPreviewSdkTokenError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1555        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1556        Err(Error::ResponseError(local_var_error))
1557    }
1558}
1559
1560pub async fn sign_s3_objects(configuration: &configuration::Configuration, workspace: &str, sign_s3_objects_request: models::SignS3ObjectsRequest) -> Result<Vec<models::S3Object>, Error<SignS3ObjectsError>> {
1561    let local_var_configuration = configuration;
1562
1563    let local_var_client = &local_var_configuration.client;
1564
1565    let local_var_uri_str = format!("{}/w/{workspace}/apps/sign_s3_objects", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1566    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1567
1568    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1569        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1570    }
1571    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1572        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1573    };
1574    local_var_req_builder = local_var_req_builder.json(&sign_s3_objects_request);
1575
1576    let local_var_req = local_var_req_builder.build()?;
1577    let local_var_resp = local_var_client.execute(local_var_req).await?;
1578
1579    let local_var_status = local_var_resp.status();
1580    let local_var_content = local_var_resp.text().await?;
1581
1582    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1583        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1584    } else {
1585        let local_var_entity: Option<SignS3ObjectsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1586        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1587        Err(Error::ResponseError(local_var_error))
1588    }
1589}
1590
1591pub async fn update_app(configuration: &configuration::Configuration, workspace: &str, path: &str, update_app_request: models::UpdateAppRequest) -> Result<String, Error<UpdateAppError>> {
1592    let local_var_configuration = configuration;
1593
1594    let local_var_client = &local_var_configuration.client;
1595
1596    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));
1597    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1598
1599    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1600        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1601    }
1602    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1603        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1604    };
1605    local_var_req_builder = local_var_req_builder.json(&update_app_request);
1606
1607    let local_var_req = local_var_req_builder.build()?;
1608    let local_var_resp = local_var_client.execute(local_var_req).await?;
1609
1610    let local_var_status = local_var_resp.status();
1611    let local_var_content = local_var_resp.text().await?;
1612
1613    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1614        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1615    } else {
1616        let local_var_entity: Option<UpdateAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1617        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1618        Err(Error::ResponseError(local_var_error))
1619    }
1620}
1621
1622pub async fn update_app_history(configuration: &configuration::Configuration, workspace: &str, id: i32, version: i32, update_script_history_request: models::UpdateScriptHistoryRequest) -> Result<String, Error<UpdateAppHistoryError>> {
1623    let local_var_configuration = configuration;
1624
1625    let local_var_client = &local_var_configuration.client;
1626
1627    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);
1628    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1629
1630    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1631        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1632    }
1633    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1634        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1635    };
1636    local_var_req_builder = local_var_req_builder.json(&update_script_history_request);
1637
1638    let local_var_req = local_var_req_builder.build()?;
1639    let local_var_resp = local_var_client.execute(local_var_req).await?;
1640
1641    let local_var_status = local_var_resp.status();
1642    let local_var_content = local_var_resp.text().await?;
1643
1644    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1645        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1646    } else {
1647        let local_var_entity: Option<UpdateAppHistoryError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1648        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1649        Err(Error::ResponseError(local_var_error))
1650    }
1651}
1652
1653pub async fn update_app_raw_source(configuration: &configuration::Configuration, workspace: &str, path: &str, update_app_raw_source_request: models::UpdateAppRawSourceRequest) -> Result<String, Error<UpdateAppRawSourceError>> {
1654    let local_var_configuration = configuration;
1655
1656    let local_var_client = &local_var_configuration.client;
1657
1658    let local_var_uri_str = format!("{}/w/{workspace}/apps/update_raw_source/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
1659    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1660
1661    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1662        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1663    }
1664    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1665        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1666    };
1667    local_var_req_builder = local_var_req_builder.json(&update_app_raw_source_request);
1668
1669    let local_var_req = local_var_req_builder.build()?;
1670    let local_var_resp = local_var_client.execute(local_var_req).await?;
1671
1672    let local_var_status = local_var_resp.status();
1673    let local_var_content = local_var_resp.text().await?;
1674
1675    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1676        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1677    } else {
1678        let local_var_entity: Option<UpdateAppRawSourceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1679        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1680        Err(Error::ResponseError(local_var_error))
1681    }
1682}
1683
1684pub 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>> {
1685    let local_var_configuration = configuration;
1686
1687    let local_var_client = &local_var_configuration.client;
1688
1689    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));
1690    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1691
1692    if let Some(ref local_var_str) = file_key {
1693        local_var_req_builder = local_var_req_builder.query(&[("file_key", &local_var_str.to_string())]);
1694    }
1695    if let Some(ref local_var_str) = file_extension {
1696        local_var_req_builder = local_var_req_builder.query(&[("file_extension", &local_var_str.to_string())]);
1697    }
1698    if let Some(ref local_var_str) = s3_resource_path {
1699        local_var_req_builder = local_var_req_builder.query(&[("s3_resource_path", &local_var_str.to_string())]);
1700    }
1701    if let Some(ref local_var_str) = resource_type {
1702        local_var_req_builder = local_var_req_builder.query(&[("resource_type", &local_var_str.to_string())]);
1703    }
1704    if let Some(ref local_var_str) = storage {
1705        local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
1706    }
1707    if let Some(ref local_var_str) = content_type {
1708        local_var_req_builder = local_var_req_builder.query(&[("content_type", &local_var_str.to_string())]);
1709    }
1710    if let Some(ref local_var_str) = content_disposition {
1711        local_var_req_builder = local_var_req_builder.query(&[("content_disposition", &local_var_str.to_string())]);
1712    }
1713    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1714        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1715    }
1716    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1717        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1718    };
1719    local_var_req_builder = local_var_req_builder.json(&body);
1720
1721    let local_var_req = local_var_req_builder.build()?;
1722    let local_var_resp = local_var_client.execute(local_var_req).await?;
1723
1724    let local_var_status = local_var_resp.status();
1725    let local_var_content = local_var_resp.text().await?;
1726
1727    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1728        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1729    } else {
1730        let local_var_entity: Option<UploadS3FileFromAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1731        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1732        Err(Error::ResponseError(local_var_error))
1733    }
1734}
1735