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