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.625.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 [`create_app`]
19#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum CreateAppError {
22    UnknownValue(serde_json::Value),
23}
24
25/// struct for typed errors of method [`custom_path_exists`]
26#[derive(Debug, Clone, Serialize, Deserialize)]
27#[serde(untagged)]
28pub enum CustomPathExistsError {
29    UnknownValue(serde_json::Value),
30}
31
32/// struct for typed errors of method [`delete_app`]
33#[derive(Debug, Clone, Serialize, Deserialize)]
34#[serde(untagged)]
35pub enum DeleteAppError {
36    UnknownValue(serde_json::Value),
37}
38
39/// struct for typed errors of method [`delete_s3_file_from_app`]
40#[derive(Debug, Clone, Serialize, Deserialize)]
41#[serde(untagged)]
42pub enum DeleteS3FileFromAppError {
43    UnknownValue(serde_json::Value),
44}
45
46/// struct for typed errors of method [`execute_component`]
47#[derive(Debug, Clone, Serialize, Deserialize)]
48#[serde(untagged)]
49pub enum ExecuteComponentError {
50    UnknownValue(serde_json::Value),
51}
52
53/// struct for typed errors of method [`exists_app`]
54#[derive(Debug, Clone, Serialize, Deserialize)]
55#[serde(untagged)]
56pub enum ExistsAppError {
57    UnknownValue(serde_json::Value),
58}
59
60/// struct for typed errors of method [`get_app_by_path`]
61#[derive(Debug, Clone, Serialize, Deserialize)]
62#[serde(untagged)]
63pub enum GetAppByPathError {
64    UnknownValue(serde_json::Value),
65}
66
67/// struct for typed errors of method [`get_app_by_path_with_draft`]
68#[derive(Debug, Clone, Serialize, Deserialize)]
69#[serde(untagged)]
70pub enum GetAppByPathWithDraftError {
71    UnknownValue(serde_json::Value),
72}
73
74/// struct for typed errors of method [`get_app_by_version`]
75#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(untagged)]
77pub enum GetAppByVersionError {
78    UnknownValue(serde_json::Value),
79}
80
81/// struct for typed errors of method [`get_app_history_by_path`]
82#[derive(Debug, Clone, Serialize, Deserialize)]
83#[serde(untagged)]
84pub enum GetAppHistoryByPathError {
85    UnknownValue(serde_json::Value),
86}
87
88/// struct for typed errors of method [`get_app_latest_version`]
89#[derive(Debug, Clone, Serialize, Deserialize)]
90#[serde(untagged)]
91pub enum GetAppLatestVersionError {
92    UnknownValue(serde_json::Value),
93}
94
95/// struct for typed errors of method [`get_app_lite_by_path`]
96#[derive(Debug, Clone, Serialize, Deserialize)]
97#[serde(untagged)]
98pub enum GetAppLiteByPathError {
99    UnknownValue(serde_json::Value),
100}
101
102/// struct for typed errors of method [`get_hub_app_by_id`]
103#[derive(Debug, Clone, Serialize, Deserialize)]
104#[serde(untagged)]
105pub enum GetHubAppByIdError {
106    UnknownValue(serde_json::Value),
107}
108
109/// struct for typed errors of method [`get_hub_raw_app_by_id`]
110#[derive(Debug, Clone, Serialize, Deserialize)]
111#[serde(untagged)]
112pub enum GetHubRawAppByIdError {
113    UnknownValue(serde_json::Value),
114}
115
116/// struct for typed errors of method [`get_public_app_by_custom_path`]
117#[derive(Debug, Clone, Serialize, Deserialize)]
118#[serde(untagged)]
119pub enum GetPublicAppByCustomPathError {
120    UnknownValue(serde_json::Value),
121}
122
123/// struct for typed errors of method [`get_public_app_by_secret`]
124#[derive(Debug, Clone, Serialize, Deserialize)]
125#[serde(untagged)]
126pub enum GetPublicAppBySecretError {
127    UnknownValue(serde_json::Value),
128}
129
130/// struct for typed errors of method [`get_public_resource`]
131#[derive(Debug, Clone, Serialize, Deserialize)]
132#[serde(untagged)]
133pub enum GetPublicResourceError {
134    UnknownValue(serde_json::Value),
135}
136
137/// struct for typed errors of method [`get_public_secret_of_app`]
138#[derive(Debug, Clone, Serialize, Deserialize)]
139#[serde(untagged)]
140pub enum GetPublicSecretOfAppError {
141    UnknownValue(serde_json::Value),
142}
143
144/// struct for typed errors of method [`get_public_secret_of_latest_version_of_app`]
145#[derive(Debug, Clone, Serialize, Deserialize)]
146#[serde(untagged)]
147pub enum GetPublicSecretOfLatestVersionOfAppError {
148    UnknownValue(serde_json::Value),
149}
150
151/// struct for typed errors of method [`get_raw_app_data`]
152#[derive(Debug, Clone, Serialize, Deserialize)]
153#[serde(untagged)]
154pub enum GetRawAppDataError {
155    UnknownValue(serde_json::Value),
156}
157
158/// struct for typed errors of method [`list_app_paths_from_workspace_runnable`]
159#[derive(Debug, Clone, Serialize, Deserialize)]
160#[serde(untagged)]
161pub enum ListAppPathsFromWorkspaceRunnableError {
162    UnknownValue(serde_json::Value),
163}
164
165/// struct for typed errors of method [`list_apps`]
166#[derive(Debug, Clone, Serialize, Deserialize)]
167#[serde(untagged)]
168pub enum ListAppsError {
169    UnknownValue(serde_json::Value),
170}
171
172/// struct for typed errors of method [`list_hub_apps`]
173#[derive(Debug, Clone, Serialize, Deserialize)]
174#[serde(untagged)]
175pub enum ListHubAppsError {
176    UnknownValue(serde_json::Value),
177}
178
179/// struct for typed errors of method [`list_search_app`]
180#[derive(Debug, Clone, Serialize, Deserialize)]
181#[serde(untagged)]
182pub enum ListSearchAppError {
183    UnknownValue(serde_json::Value),
184}
185
186/// struct for typed errors of method [`sign_s3_objects`]
187#[derive(Debug, Clone, Serialize, Deserialize)]
188#[serde(untagged)]
189pub enum SignS3ObjectsError {
190    UnknownValue(serde_json::Value),
191}
192
193/// struct for typed errors of method [`update_app`]
194#[derive(Debug, Clone, Serialize, Deserialize)]
195#[serde(untagged)]
196pub enum UpdateAppError {
197    UnknownValue(serde_json::Value),
198}
199
200/// struct for typed errors of method [`update_app_history`]
201#[derive(Debug, Clone, Serialize, Deserialize)]
202#[serde(untagged)]
203pub enum UpdateAppHistoryError {
204    UnknownValue(serde_json::Value),
205}
206
207/// struct for typed errors of method [`upload_s3_file_from_app`]
208#[derive(Debug, Clone, Serialize, Deserialize)]
209#[serde(untagged)]
210pub enum UploadS3FileFromAppError {
211    UnknownValue(serde_json::Value),
212}
213
214
215pub async fn create_app(configuration: &configuration::Configuration, workspace: &str, create_app_request: models::CreateAppRequest) -> Result<String, Error<CreateAppError>> {
216    let local_var_configuration = configuration;
217
218    let local_var_client = &local_var_configuration.client;
219
220    let local_var_uri_str = format!("{}/w/{workspace}/apps/create", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
221    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
222
223    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
224        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
225    }
226    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
227        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
228    };
229    local_var_req_builder = local_var_req_builder.json(&create_app_request);
230
231    let local_var_req = local_var_req_builder.build()?;
232    let local_var_resp = local_var_client.execute(local_var_req).await?;
233
234    let local_var_status = local_var_resp.status();
235    let local_var_content = local_var_resp.text().await?;
236
237    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
238        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
239    } else {
240        let local_var_entity: Option<CreateAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
241        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
242        Err(Error::ResponseError(local_var_error))
243    }
244}
245
246pub async fn custom_path_exists(configuration: &configuration::Configuration, workspace: &str, custom_path: &str) -> Result<bool, Error<CustomPathExistsError>> {
247    let local_var_configuration = configuration;
248
249    let local_var_client = &local_var_configuration.client;
250
251    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));
252    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
253
254    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
255        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
256    }
257    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
258        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
259    };
260
261    let local_var_req = local_var_req_builder.build()?;
262    let local_var_resp = local_var_client.execute(local_var_req).await?;
263
264    let local_var_status = local_var_resp.status();
265    let local_var_content = local_var_resp.text().await?;
266
267    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
268        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
269    } else {
270        let local_var_entity: Option<CustomPathExistsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
271        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
272        Err(Error::ResponseError(local_var_error))
273    }
274}
275
276pub async fn delete_app(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<String, Error<DeleteAppError>> {
277    let local_var_configuration = configuration;
278
279    let local_var_client = &local_var_configuration.client;
280
281    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));
282    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
283
284    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
285        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
286    }
287    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
288        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
289    };
290
291    let local_var_req = local_var_req_builder.build()?;
292    let local_var_resp = local_var_client.execute(local_var_req).await?;
293
294    let local_var_status = local_var_resp.status();
295    let local_var_content = local_var_resp.text().await?;
296
297    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
298        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
299    } else {
300        let local_var_entity: Option<DeleteAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
301        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
302        Err(Error::ResponseError(local_var_error))
303    }
304}
305
306pub async fn delete_s3_file_from_app(configuration: &configuration::Configuration, workspace: &str, delete_token: &str) -> Result<String, Error<DeleteS3FileFromAppError>> {
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/delete_s3_file", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
312    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
313
314    local_var_req_builder = local_var_req_builder.query(&[("delete_token", &delete_token.to_string())]);
315    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
316        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
317    }
318    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
319        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
320    };
321
322    let local_var_req = local_var_req_builder.build()?;
323    let local_var_resp = local_var_client.execute(local_var_req).await?;
324
325    let local_var_status = local_var_resp.status();
326    let local_var_content = local_var_resp.text().await?;
327
328    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
329        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
330    } else {
331        let local_var_entity: Option<DeleteS3FileFromAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
332        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
333        Err(Error::ResponseError(local_var_error))
334    }
335}
336
337pub async fn execute_component(configuration: &configuration::Configuration, workspace: &str, path: &str, execute_component_request: models::ExecuteComponentRequest) -> Result<String, Error<ExecuteComponentError>> {
338    let local_var_configuration = configuration;
339
340    let local_var_client = &local_var_configuration.client;
341
342    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));
343    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
344
345    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
346        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
347    }
348    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
349        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
350    };
351    local_var_req_builder = local_var_req_builder.json(&execute_component_request);
352
353    let local_var_req = local_var_req_builder.build()?;
354    let local_var_resp = local_var_client.execute(local_var_req).await?;
355
356    let local_var_status = local_var_resp.status();
357    let local_var_content = local_var_resp.text().await?;
358
359    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
360        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
361    } else {
362        let local_var_entity: Option<ExecuteComponentError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
363        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
364        Err(Error::ResponseError(local_var_error))
365    }
366}
367
368pub async fn exists_app(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<bool, Error<ExistsAppError>> {
369    let local_var_configuration = configuration;
370
371    let local_var_client = &local_var_configuration.client;
372
373    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));
374    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
375
376    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
377        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
378    }
379    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
380        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
381    };
382
383    let local_var_req = local_var_req_builder.build()?;
384    let local_var_resp = local_var_client.execute(local_var_req).await?;
385
386    let local_var_status = local_var_resp.status();
387    let local_var_content = local_var_resp.text().await?;
388
389    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
390        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
391    } else {
392        let local_var_entity: Option<ExistsAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
393        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
394        Err(Error::ResponseError(local_var_error))
395    }
396}
397
398pub async fn get_app_by_path(configuration: &configuration::Configuration, workspace: &str, path: &str, with_starred_info: Option<bool>) -> Result<models::AppWithLastVersion, Error<GetAppByPathError>> {
399    let local_var_configuration = configuration;
400
401    let local_var_client = &local_var_configuration.client;
402
403    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));
404    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
405
406    if let Some(ref local_var_str) = with_starred_info {
407        local_var_req_builder = local_var_req_builder.query(&[("with_starred_info", &local_var_str.to_string())]);
408    }
409    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
410        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
411    }
412    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
413        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
414    };
415
416    let local_var_req = local_var_req_builder.build()?;
417    let local_var_resp = local_var_client.execute(local_var_req).await?;
418
419    let local_var_status = local_var_resp.status();
420    let local_var_content = local_var_resp.text().await?;
421
422    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
423        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
424    } else {
425        let local_var_entity: Option<GetAppByPathError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
426        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
427        Err(Error::ResponseError(local_var_error))
428    }
429}
430
431pub async fn get_app_by_path_with_draft(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<models::AppWithLastVersionWDraft, Error<GetAppByPathWithDraftError>> {
432    let local_var_configuration = configuration;
433
434    let local_var_client = &local_var_configuration.client;
435
436    let local_var_uri_str = format!("{}/w/{workspace}/apps/get/draft/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
437    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
438
439    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
440        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
441    }
442    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
443        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
444    };
445
446    let local_var_req = local_var_req_builder.build()?;
447    let local_var_resp = local_var_client.execute(local_var_req).await?;
448
449    let local_var_status = local_var_resp.status();
450    let local_var_content = local_var_resp.text().await?;
451
452    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
453        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
454    } else {
455        let local_var_entity: Option<GetAppByPathWithDraftError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
456        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
457        Err(Error::ResponseError(local_var_error))
458    }
459}
460
461pub async fn get_app_by_version(configuration: &configuration::Configuration, workspace: &str, id: i32) -> Result<models::AppWithLastVersion, Error<GetAppByVersionError>> {
462    let local_var_configuration = configuration;
463
464    let local_var_client = &local_var_configuration.client;
465
466    let local_var_uri_str = format!("{}/w/{workspace}/apps/get/v/{id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=id);
467    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
468
469    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
470        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
471    }
472    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
473        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
474    };
475
476    let local_var_req = local_var_req_builder.build()?;
477    let local_var_resp = local_var_client.execute(local_var_req).await?;
478
479    let local_var_status = local_var_resp.status();
480    let local_var_content = local_var_resp.text().await?;
481
482    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
483        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
484    } else {
485        let local_var_entity: Option<GetAppByVersionError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
486        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
487        Err(Error::ResponseError(local_var_error))
488    }
489}
490
491pub async fn get_app_history_by_path(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<Vec<models::AppHistory>, Error<GetAppHistoryByPathError>> {
492    let local_var_configuration = configuration;
493
494    let local_var_client = &local_var_configuration.client;
495
496    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));
497    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
498
499    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
500        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
501    }
502    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
503        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
504    };
505
506    let local_var_req = local_var_req_builder.build()?;
507    let local_var_resp = local_var_client.execute(local_var_req).await?;
508
509    let local_var_status = local_var_resp.status();
510    let local_var_content = local_var_resp.text().await?;
511
512    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
513        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
514    } else {
515        let local_var_entity: Option<GetAppHistoryByPathError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
516        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
517        Err(Error::ResponseError(local_var_error))
518    }
519}
520
521pub async fn get_app_latest_version(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<models::AppHistory, Error<GetAppLatestVersionError>> {
522    let local_var_configuration = configuration;
523
524    let local_var_client = &local_var_configuration.client;
525
526    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));
527    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
528
529    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
530        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
531    }
532    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
533        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
534    };
535
536    let local_var_req = local_var_req_builder.build()?;
537    let local_var_resp = local_var_client.execute(local_var_req).await?;
538
539    let local_var_status = local_var_resp.status();
540    let local_var_content = local_var_resp.text().await?;
541
542    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
543        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
544    } else {
545        let local_var_entity: Option<GetAppLatestVersionError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
546        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
547        Err(Error::ResponseError(local_var_error))
548    }
549}
550
551pub async fn get_app_lite_by_path(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<models::AppWithLastVersion, Error<GetAppLiteByPathError>> {
552    let local_var_configuration = configuration;
553
554    let local_var_client = &local_var_configuration.client;
555
556    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));
557    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
558
559    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
560        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
561    }
562    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
563        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
564    };
565
566    let local_var_req = local_var_req_builder.build()?;
567    let local_var_resp = local_var_client.execute(local_var_req).await?;
568
569    let local_var_status = local_var_resp.status();
570    let local_var_content = local_var_resp.text().await?;
571
572    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
573        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
574    } else {
575        let local_var_entity: Option<GetAppLiteByPathError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
576        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
577        Err(Error::ResponseError(local_var_error))
578    }
579}
580
581pub async fn get_hub_app_by_id(configuration: &configuration::Configuration, id: i32) -> Result<models::GetHubAppById200Response, Error<GetHubAppByIdError>> {
582    let local_var_configuration = configuration;
583
584    let local_var_client = &local_var_configuration.client;
585
586    let local_var_uri_str = format!("{}/apps/hub/get/{id}", local_var_configuration.base_path, id=id);
587    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
588
589    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
590        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
591    }
592    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
593        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
594    };
595
596    let local_var_req = local_var_req_builder.build()?;
597    let local_var_resp = local_var_client.execute(local_var_req).await?;
598
599    let local_var_status = local_var_resp.status();
600    let local_var_content = local_var_resp.text().await?;
601
602    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
603        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
604    } else {
605        let local_var_entity: Option<GetHubAppByIdError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
606        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
607        Err(Error::ResponseError(local_var_error))
608    }
609}
610
611pub async fn get_hub_raw_app_by_id(configuration: &configuration::Configuration, id: i32) -> Result<models::GetHubAppById200Response, Error<GetHubRawAppByIdError>> {
612    let local_var_configuration = configuration;
613
614    let local_var_client = &local_var_configuration.client;
615
616    let local_var_uri_str = format!("{}/apps/hub/get_raw/{id}", local_var_configuration.base_path, id=id);
617    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
618
619    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
620        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
621    }
622    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
623        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
624    };
625
626    let local_var_req = local_var_req_builder.build()?;
627    let local_var_resp = local_var_client.execute(local_var_req).await?;
628
629    let local_var_status = local_var_resp.status();
630    let local_var_content = local_var_resp.text().await?;
631
632    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
633        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
634    } else {
635        let local_var_entity: Option<GetHubRawAppByIdError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
636        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
637        Err(Error::ResponseError(local_var_error))
638    }
639}
640
641pub async fn get_public_app_by_custom_path(configuration: &configuration::Configuration, custom_path: &str) -> Result<models::GetPublicAppByCustomPath200Response, Error<GetPublicAppByCustomPathError>> {
642    let local_var_configuration = configuration;
643
644    let local_var_client = &local_var_configuration.client;
645
646    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));
647    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
648
649    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
650        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
651    }
652    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
653        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
654    };
655
656    let local_var_req = local_var_req_builder.build()?;
657    let local_var_resp = local_var_client.execute(local_var_req).await?;
658
659    let local_var_status = local_var_resp.status();
660    let local_var_content = local_var_resp.text().await?;
661
662    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
663        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
664    } else {
665        let local_var_entity: Option<GetPublicAppByCustomPathError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
666        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
667        Err(Error::ResponseError(local_var_error))
668    }
669}
670
671pub async fn get_public_app_by_secret(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<models::AppWithLastVersion, Error<GetPublicAppBySecretError>> {
672    let local_var_configuration = configuration;
673
674    let local_var_client = &local_var_configuration.client;
675
676    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));
677    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
678
679    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
680        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
681    }
682    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
683        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
684    };
685
686    let local_var_req = local_var_req_builder.build()?;
687    let local_var_resp = local_var_client.execute(local_var_req).await?;
688
689    let local_var_status = local_var_resp.status();
690    let local_var_content = local_var_resp.text().await?;
691
692    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
693        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
694    } else {
695        let local_var_entity: Option<GetPublicAppBySecretError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
696        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
697        Err(Error::ResponseError(local_var_error))
698    }
699}
700
701pub async fn get_public_resource(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<serde_json::Value, Error<GetPublicResourceError>> {
702    let local_var_configuration = configuration;
703
704    let local_var_client = &local_var_configuration.client;
705
706    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));
707    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
708
709    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
710        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
711    }
712    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
713        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
714    };
715
716    let local_var_req = local_var_req_builder.build()?;
717    let local_var_resp = local_var_client.execute(local_var_req).await?;
718
719    let local_var_status = local_var_resp.status();
720    let local_var_content = local_var_resp.text().await?;
721
722    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
723        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
724    } else {
725        let local_var_entity: Option<GetPublicResourceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
726        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
727        Err(Error::ResponseError(local_var_error))
728    }
729}
730
731pub async fn get_public_secret_of_app(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<String, Error<GetPublicSecretOfAppError>> {
732    let local_var_configuration = configuration;
733
734    let local_var_client = &local_var_configuration.client;
735
736    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));
737    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
738
739    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
740        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
741    }
742    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
743        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
744    };
745
746    let local_var_req = local_var_req_builder.build()?;
747    let local_var_resp = local_var_client.execute(local_var_req).await?;
748
749    let local_var_status = local_var_resp.status();
750    let local_var_content = local_var_resp.text().await?;
751
752    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
753        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
754    } else {
755        let local_var_entity: Option<GetPublicSecretOfAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
756        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
757        Err(Error::ResponseError(local_var_error))
758    }
759}
760
761pub async fn get_public_secret_of_latest_version_of_app(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<String, Error<GetPublicSecretOfLatestVersionOfAppError>> {
762    let local_var_configuration = configuration;
763
764    let local_var_client = &local_var_configuration.client;
765
766    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));
767    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
768
769    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
770        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
771    }
772    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
773        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
774    };
775
776    let local_var_req = local_var_req_builder.build()?;
777    let local_var_resp = local_var_client.execute(local_var_req).await?;
778
779    let local_var_status = local_var_resp.status();
780    let local_var_content = local_var_resp.text().await?;
781
782    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
783        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
784    } else {
785        let local_var_entity: Option<GetPublicSecretOfLatestVersionOfAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
786        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
787        Err(Error::ResponseError(local_var_error))
788    }
789}
790
791pub async fn get_raw_app_data(configuration: &configuration::Configuration, workspace: &str, secret_with_extension: &str) -> Result<String, Error<GetRawAppDataError>> {
792    let local_var_configuration = configuration;
793
794    let local_var_client = &local_var_configuration.client;
795
796    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));
797    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
798
799    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
800        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
801    }
802    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
803        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
804    };
805
806    let local_var_req = local_var_req_builder.build()?;
807    let local_var_resp = local_var_client.execute(local_var_req).await?;
808
809    let local_var_status = local_var_resp.status();
810    let local_var_content = local_var_resp.text().await?;
811
812    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
813        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
814    } else {
815        let local_var_entity: Option<GetRawAppDataError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
816        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
817        Err(Error::ResponseError(local_var_error))
818    }
819}
820
821pub async fn list_app_paths_from_workspace_runnable(configuration: &configuration::Configuration, workspace: &str, runnable_kind: &str, path: &str) -> Result<Vec<String>, Error<ListAppPathsFromWorkspaceRunnableError>> {
822    let local_var_configuration = configuration;
823
824    let local_var_client = &local_var_configuration.client;
825
826    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));
827    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
828
829    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
830        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
831    }
832    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
833        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
834    };
835
836    let local_var_req = local_var_req_builder.build()?;
837    let local_var_resp = local_var_client.execute(local_var_req).await?;
838
839    let local_var_status = local_var_resp.status();
840    let local_var_content = local_var_resp.text().await?;
841
842    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
843        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
844    } else {
845        let local_var_entity: Option<ListAppPathsFromWorkspaceRunnableError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
846        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
847        Err(Error::ResponseError(local_var_error))
848    }
849}
850
851pub 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>) -> Result<Vec<models::ListableApp>, Error<ListAppsError>> {
852    let local_var_configuration = configuration;
853
854    let local_var_client = &local_var_configuration.client;
855
856    let local_var_uri_str = format!("{}/w/{workspace}/apps/list", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
857    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
858
859    if let Some(ref local_var_str) = page {
860        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
861    }
862    if let Some(ref local_var_str) = per_page {
863        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
864    }
865    if let Some(ref local_var_str) = order_desc {
866        local_var_req_builder = local_var_req_builder.query(&[("order_desc", &local_var_str.to_string())]);
867    }
868    if let Some(ref local_var_str) = created_by {
869        local_var_req_builder = local_var_req_builder.query(&[("created_by", &local_var_str.to_string())]);
870    }
871    if let Some(ref local_var_str) = path_start {
872        local_var_req_builder = local_var_req_builder.query(&[("path_start", &local_var_str.to_string())]);
873    }
874    if let Some(ref local_var_str) = path_exact {
875        local_var_req_builder = local_var_req_builder.query(&[("path_exact", &local_var_str.to_string())]);
876    }
877    if let Some(ref local_var_str) = starred_only {
878        local_var_req_builder = local_var_req_builder.query(&[("starred_only", &local_var_str.to_string())]);
879    }
880    if let Some(ref local_var_str) = include_draft_only {
881        local_var_req_builder = local_var_req_builder.query(&[("include_draft_only", &local_var_str.to_string())]);
882    }
883    if let Some(ref local_var_str) = with_deployment_msg {
884        local_var_req_builder = local_var_req_builder.query(&[("with_deployment_msg", &local_var_str.to_string())]);
885    }
886    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
887        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
888    }
889    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
890        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
891    };
892
893    let local_var_req = local_var_req_builder.build()?;
894    let local_var_resp = local_var_client.execute(local_var_req).await?;
895
896    let local_var_status = local_var_resp.status();
897    let local_var_content = local_var_resp.text().await?;
898
899    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
900        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
901    } else {
902        let local_var_entity: Option<ListAppsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
903        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
904        Err(Error::ResponseError(local_var_error))
905    }
906}
907
908pub async fn list_hub_apps(configuration: &configuration::Configuration, ) -> Result<models::ListHubApps200Response, Error<ListHubAppsError>> {
909    let local_var_configuration = configuration;
910
911    let local_var_client = &local_var_configuration.client;
912
913    let local_var_uri_str = format!("{}/apps/hub/list", local_var_configuration.base_path);
914    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
915
916    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
917        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
918    }
919    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
920        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
921    };
922
923    let local_var_req = local_var_req_builder.build()?;
924    let local_var_resp = local_var_client.execute(local_var_req).await?;
925
926    let local_var_status = local_var_resp.status();
927    let local_var_content = local_var_resp.text().await?;
928
929    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
930        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
931    } else {
932        let local_var_entity: Option<ListHubAppsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
933        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
934        Err(Error::ResponseError(local_var_error))
935    }
936}
937
938pub async fn list_search_app(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::ListSearchResource200ResponseInner>, Error<ListSearchAppError>> {
939    let local_var_configuration = configuration;
940
941    let local_var_client = &local_var_configuration.client;
942
943    let local_var_uri_str = format!("{}/w/{workspace}/apps/list_search", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
944    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
945
946    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
947        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
948    }
949    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
950        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
951    };
952
953    let local_var_req = local_var_req_builder.build()?;
954    let local_var_resp = local_var_client.execute(local_var_req).await?;
955
956    let local_var_status = local_var_resp.status();
957    let local_var_content = local_var_resp.text().await?;
958
959    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
960        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
961    } else {
962        let local_var_entity: Option<ListSearchAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
963        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
964        Err(Error::ResponseError(local_var_error))
965    }
966}
967
968pub async fn sign_s3_objects(configuration: &configuration::Configuration, workspace: &str, sign_s3_objects_request: models::SignS3ObjectsRequest) -> Result<Vec<models::S3Object>, Error<SignS3ObjectsError>> {
969    let local_var_configuration = configuration;
970
971    let local_var_client = &local_var_configuration.client;
972
973    let local_var_uri_str = format!("{}/w/{workspace}/apps/sign_s3_objects", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
974    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
975
976    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
977        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
978    }
979    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
980        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
981    };
982    local_var_req_builder = local_var_req_builder.json(&sign_s3_objects_request);
983
984    let local_var_req = local_var_req_builder.build()?;
985    let local_var_resp = local_var_client.execute(local_var_req).await?;
986
987    let local_var_status = local_var_resp.status();
988    let local_var_content = local_var_resp.text().await?;
989
990    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
991        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
992    } else {
993        let local_var_entity: Option<SignS3ObjectsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
994        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
995        Err(Error::ResponseError(local_var_error))
996    }
997}
998
999pub async fn update_app(configuration: &configuration::Configuration, workspace: &str, path: &str, update_app_request: models::UpdateAppRequest) -> Result<String, Error<UpdateAppError>> {
1000    let local_var_configuration = configuration;
1001
1002    let local_var_client = &local_var_configuration.client;
1003
1004    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));
1005    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1006
1007    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1008        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1009    }
1010    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1011        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1012    };
1013    local_var_req_builder = local_var_req_builder.json(&update_app_request);
1014
1015    let local_var_req = local_var_req_builder.build()?;
1016    let local_var_resp = local_var_client.execute(local_var_req).await?;
1017
1018    let local_var_status = local_var_resp.status();
1019    let local_var_content = local_var_resp.text().await?;
1020
1021    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1022        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1023    } else {
1024        let local_var_entity: Option<UpdateAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1025        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1026        Err(Error::ResponseError(local_var_error))
1027    }
1028}
1029
1030pub async fn update_app_history(configuration: &configuration::Configuration, workspace: &str, id: i32, version: i32, update_script_history_request: models::UpdateScriptHistoryRequest) -> Result<String, Error<UpdateAppHistoryError>> {
1031    let local_var_configuration = configuration;
1032
1033    let local_var_client = &local_var_configuration.client;
1034
1035    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);
1036    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1037
1038    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1039        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1040    }
1041    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1042        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1043    };
1044    local_var_req_builder = local_var_req_builder.json(&update_script_history_request);
1045
1046    let local_var_req = local_var_req_builder.build()?;
1047    let local_var_resp = local_var_client.execute(local_var_req).await?;
1048
1049    let local_var_status = local_var_resp.status();
1050    let local_var_content = local_var_resp.text().await?;
1051
1052    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1053        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1054    } else {
1055        let local_var_entity: Option<UpdateAppHistoryError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1056        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1057        Err(Error::ResponseError(local_var_error))
1058    }
1059}
1060
1061pub 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>> {
1062    let local_var_configuration = configuration;
1063
1064    let local_var_client = &local_var_configuration.client;
1065
1066    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));
1067    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1068
1069    if let Some(ref local_var_str) = file_key {
1070        local_var_req_builder = local_var_req_builder.query(&[("file_key", &local_var_str.to_string())]);
1071    }
1072    if let Some(ref local_var_str) = file_extension {
1073        local_var_req_builder = local_var_req_builder.query(&[("file_extension", &local_var_str.to_string())]);
1074    }
1075    if let Some(ref local_var_str) = s3_resource_path {
1076        local_var_req_builder = local_var_req_builder.query(&[("s3_resource_path", &local_var_str.to_string())]);
1077    }
1078    if let Some(ref local_var_str) = resource_type {
1079        local_var_req_builder = local_var_req_builder.query(&[("resource_type", &local_var_str.to_string())]);
1080    }
1081    if let Some(ref local_var_str) = storage {
1082        local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
1083    }
1084    if let Some(ref local_var_str) = content_type {
1085        local_var_req_builder = local_var_req_builder.query(&[("content_type", &local_var_str.to_string())]);
1086    }
1087    if let Some(ref local_var_str) = content_disposition {
1088        local_var_req_builder = local_var_req_builder.query(&[("content_disposition", &local_var_str.to_string())]);
1089    }
1090    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1091        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1092    }
1093    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1094        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1095    };
1096    local_var_req_builder = local_var_req_builder.json(&body);
1097
1098    let local_var_req = local_var_req_builder.build()?;
1099    let local_var_resp = local_var_client.execute(local_var_req).await?;
1100
1101    let local_var_status = local_var_resp.status();
1102    let local_var_content = local_var_resp.text().await?;
1103
1104    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1105        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1106    } else {
1107        let local_var_entity: Option<UploadS3FileFromAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1108        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1109        Err(Error::ResponseError(local_var_error))
1110    }
1111}
1112