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