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