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