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