1use reqwest;
13use serde::{Deserialize, Serialize, de::Error as _};
14use crate::{apis::ResponseContent, models};
15use super::{Error, configuration, ContentType};
16
17
18#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum DeletePlatformProjectsByProjectAppsByAppError {
22 UnknownValue(serde_json::Value),
23}
24
25#[derive(Debug, Clone, Serialize, Deserialize)]
27#[serde(untagged)]
28pub enum DeletePlatformProjectsByProjectAppsByAppDomainsByHostError {
29 UnknownValue(serde_json::Value),
30}
31
32#[derive(Debug, Clone, Serialize, Deserialize)]
34#[serde(untagged)]
35pub enum GetPlatformAppsError {
36 UnknownValue(serde_json::Value),
37}
38
39#[derive(Debug, Clone, Serialize, Deserialize)]
41#[serde(untagged)]
42pub enum GetPlatformAppsByAppError {
43 UnknownValue(serde_json::Value),
44}
45
46#[derive(Debug, Clone, Serialize, Deserialize)]
48#[serde(untagged)]
49pub enum GetPlatformAppsByAppCdError {
50 UnknownValue(serde_json::Value),
51}
52
53#[derive(Debug, Clone, Serialize, Deserialize)]
55#[serde(untagged)]
56pub enum GetPlatformBuildsError {
57 UnknownValue(serde_json::Value),
58}
59
60#[derive(Debug, Clone, Serialize, Deserialize)]
62#[serde(untagged)]
63pub enum GetPlatformCdError {
64 UnknownValue(serde_json::Value),
65}
66
67#[derive(Debug, Clone, Serialize, Deserialize)]
69#[serde(untagged)]
70pub enum GetPlatformCiError {
71 UnknownValue(serde_json::Value),
72}
73
74#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(untagged)]
77pub enum GetPlatformEnvironmentsError {
78 UnknownValue(serde_json::Value),
79}
80
81#[derive(Debug, Clone, Serialize, Deserialize)]
83#[serde(untagged)]
84pub enum GetPlatformFleetError {
85 UnknownValue(serde_json::Value),
86}
87
88#[derive(Debug, Clone, Serialize, Deserialize)]
90#[serde(untagged)]
91pub enum GetPlatformFleetByAppError {
92 UnknownValue(serde_json::Value),
93}
94
95#[derive(Debug, Clone, Serialize, Deserialize)]
97#[serde(untagged)]
98pub enum GetPlatformHealthError {
99 Status503(models::Readiness),
100 UnknownValue(serde_json::Value),
101}
102
103#[derive(Debug, Clone, Serialize, Deserialize)]
105#[serde(untagged)]
106pub enum GetPlatformPipelinesError {
107 UnknownValue(serde_json::Value),
108}
109
110#[derive(Debug, Clone, Serialize, Deserialize)]
112#[serde(untagged)]
113pub enum GetPlatformProjectsError {
114 UnknownValue(serde_json::Value),
115}
116
117#[derive(Debug, Clone, Serialize, Deserialize)]
119#[serde(untagged)]
120pub enum GetPlatformProjectsByProjectError {
121 UnknownValue(serde_json::Value),
122}
123
124#[derive(Debug, Clone, Serialize, Deserialize)]
126#[serde(untagged)]
127pub enum GetPlatformProjectsByProjectAppsError {
128 UnknownValue(serde_json::Value),
129}
130
131#[derive(Debug, Clone, Serialize, Deserialize)]
133#[serde(untagged)]
134pub enum GetPlatformProjectsByProjectAppsByAppError {
135 UnknownValue(serde_json::Value),
136}
137
138#[derive(Debug, Clone, Serialize, Deserialize)]
140#[serde(untagged)]
141pub enum GetPlatformProjectsByProjectAppsByAppDeploymentsError {
142 UnknownValue(serde_json::Value),
143}
144
145#[derive(Debug, Clone, Serialize, Deserialize)]
147#[serde(untagged)]
148pub enum GetPlatformProjectsByProjectAppsByAppDeploymentsByIdError {
149 UnknownValue(serde_json::Value),
150}
151
152#[derive(Debug, Clone, Serialize, Deserialize)]
154#[serde(untagged)]
155pub enum GetPlatformProjectsByProjectAppsByAppDeploymentsByIdLogsError {
156 UnknownValue(serde_json::Value),
157}
158
159#[derive(Debug, Clone, Serialize, Deserialize)]
161#[serde(untagged)]
162pub enum GetPlatformProjectsByProjectAppsByAppDomainsError {
163 UnknownValue(serde_json::Value),
164}
165
166#[derive(Debug, Clone, Serialize, Deserialize)]
168#[serde(untagged)]
169pub enum GetPlatformReleasesError {
170 UnknownValue(serde_json::Value),
171}
172
173#[derive(Debug, Clone, Serialize, Deserialize)]
175#[serde(untagged)]
176pub enum PostPlatformAppsError {
177 UnknownValue(serde_json::Value),
178}
179
180#[derive(Debug, Clone, Serialize, Deserialize)]
182#[serde(untagged)]
183pub enum PostPlatformFleetByAppDeployError {
184 UnknownValue(serde_json::Value),
185}
186
187#[derive(Debug, Clone, Serialize, Deserialize)]
189#[serde(untagged)]
190pub enum PostPlatformHookError {
191 UnknownValue(serde_json::Value),
192}
193
194#[derive(Debug, Clone, Serialize, Deserialize)]
196#[serde(untagged)]
197pub enum PostPlatformProjectsByProjectAppsError {
198 UnknownValue(serde_json::Value),
199}
200
201#[derive(Debug, Clone, Serialize, Deserialize)]
203#[serde(untagged)]
204pub enum PostPlatformProjectsByProjectAppsByAppDeployError {
205 UnknownValue(serde_json::Value),
206}
207
208#[derive(Debug, Clone, Serialize, Deserialize)]
210#[serde(untagged)]
211pub enum PostPlatformProjectsByProjectAppsByAppDomainsError {
212 UnknownValue(serde_json::Value),
213}
214
215#[derive(Debug, Clone, Serialize, Deserialize)]
217#[serde(untagged)]
218pub enum PostPlatformProjectsByProjectAppsByAppDomainsByHostVerifyError {
219 UnknownValue(serde_json::Value),
220}
221
222#[derive(Debug, Clone, Serialize, Deserialize)]
224#[serde(untagged)]
225pub enum PostPlatformProjectsByProjectAppsByAppPreviewError {
226 UnknownValue(serde_json::Value),
227}
228
229#[derive(Debug, Clone, Serialize, Deserialize)]
231#[serde(untagged)]
232pub enum PostPlatformProjectsByProjectAppsByAppPromoteError {
233 UnknownValue(serde_json::Value),
234}
235
236#[derive(Debug, Clone, Serialize, Deserialize)]
238#[serde(untagged)]
239pub enum PostPlatformProjectsByProjectAppsByAppRollbackError {
240 UnknownValue(serde_json::Value),
241}
242
243#[derive(Debug, Clone, Serialize, Deserialize)]
245#[serde(untagged)]
246pub enum PostPlatformProjectsByProjectAppsByAppStartError {
247 UnknownValue(serde_json::Value),
248}
249
250#[derive(Debug, Clone, Serialize, Deserialize)]
252#[serde(untagged)]
253pub enum PostPlatformProjectsByProjectAppsByAppStopError {
254 UnknownValue(serde_json::Value),
255}
256
257#[derive(Debug, Clone, Serialize, Deserialize)]
259#[serde(untagged)]
260pub enum PostPlatformRunError {
261 UnknownValue(serde_json::Value),
262}
263
264#[derive(Debug, Clone, Serialize, Deserialize)]
266#[serde(untagged)]
267pub enum PostPlatformRunnerError {
268 UnknownValue(serde_json::Value),
269}
270
271#[derive(Debug, Clone, Serialize, Deserialize)]
273#[serde(untagged)]
274pub enum PutPlatformProjectsByProjectAppsByAppEnvError {
275 UnknownValue(serde_json::Value),
276}
277
278
279pub async fn delete_platform_projects_by_project_apps_by_app(configuration: &configuration::Configuration, project: &str, app: &str) -> Result<(), Error<DeletePlatformProjectsByProjectAppsByAppError>> {
281 let p_project = project;
283 let p_app = app;
284
285 let uri_str = format!("{}/v1/platform/projects/{project}/apps/{app}", configuration.base_path, project=crate::apis::urlencode(p_project), app=crate::apis::urlencode(p_app));
286 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
287
288 if let Some(ref user_agent) = configuration.user_agent {
289 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
290 }
291 if let Some(ref token) = configuration.bearer_access_token {
292 req_builder = req_builder.bearer_auth(token.to_owned());
293 };
294
295 let req = req_builder.build()?;
296 let resp = configuration.client.execute(req).await?;
297
298 let status = resp.status();
299
300 if !status.is_client_error() && !status.is_server_error() {
301 Ok(())
302 } else {
303 let content = resp.text().await?;
304 let entity: Option<DeletePlatformProjectsByProjectAppsByAppError> = serde_json::from_str(&content).ok();
305 Err(Error::ResponseError(ResponseContent { status, content, entity }))
306 }
307}
308
309pub async fn delete_platform_projects_by_project_apps_by_app_domains_by_host(configuration: &configuration::Configuration, project: &str, app: &str, host: &str) -> Result<(), Error<DeletePlatformProjectsByProjectAppsByAppDomainsByHostError>> {
311 let p_project = project;
313 let p_app = app;
314 let p_host = host;
315
316 let uri_str = format!("{}/v1/platform/projects/{project}/apps/{app}/domains/{host}", configuration.base_path, project=crate::apis::urlencode(p_project), app=crate::apis::urlencode(p_app), host=crate::apis::urlencode(p_host));
317 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
318
319 if let Some(ref user_agent) = configuration.user_agent {
320 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
321 }
322 if let Some(ref token) = configuration.bearer_access_token {
323 req_builder = req_builder.bearer_auth(token.to_owned());
324 };
325
326 let req = req_builder.build()?;
327 let resp = configuration.client.execute(req).await?;
328
329 let status = resp.status();
330
331 if !status.is_client_error() && !status.is_server_error() {
332 Ok(())
333 } else {
334 let content = resp.text().await?;
335 let entity: Option<DeletePlatformProjectsByProjectAppsByAppDomainsByHostError> = serde_json::from_str(&content).ok();
336 Err(Error::ResponseError(ResponseContent { status, content, entity }))
337 }
338}
339
340pub async fn get_platform_apps(configuration: &configuration::Configuration, org: Option<&str>) -> Result<models::DeclaredResp, Error<GetPlatformAppsError>> {
342 let p_org = org;
344
345 let uri_str = format!("{}/v1/platform/apps", configuration.base_path);
346 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
347
348 if let Some(ref param_value) = p_org {
349 req_builder = req_builder.query(&[("org", ¶m_value.to_string())]);
350 }
351 if let Some(ref user_agent) = configuration.user_agent {
352 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
353 }
354 if let Some(ref token) = configuration.bearer_access_token {
355 req_builder = req_builder.bearer_auth(token.to_owned());
356 };
357
358 let req = req_builder.build()?;
359 let resp = configuration.client.execute(req).await?;
360
361 let status = resp.status();
362 let content_type = resp
363 .headers()
364 .get("content-type")
365 .and_then(|v| v.to_str().ok())
366 .unwrap_or("application/octet-stream");
367 let content_type = super::ContentType::from(content_type);
368
369 if !status.is_client_error() && !status.is_server_error() {
370 let content = resp.text().await?;
371 match content_type {
372 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
373 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DeclaredResp`"))),
374 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::DeclaredResp`")))),
375 }
376 } else {
377 let content = resp.text().await?;
378 let entity: Option<GetPlatformAppsError> = serde_json::from_str(&content).ok();
379 Err(Error::ResponseError(ResponseContent { status, content, entity }))
380 }
381}
382
383pub async fn get_platform_apps_by_app(configuration: &configuration::Configuration, app: &str, org: Option<&str>) -> Result<models::Declaration, Error<GetPlatformAppsByAppError>> {
385 let p_app = app;
387 let p_org = org;
388
389 let uri_str = format!("{}/v1/platform/apps/{app}", configuration.base_path, app=crate::apis::urlencode(p_app));
390 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
391
392 if let Some(ref param_value) = p_org {
393 req_builder = req_builder.query(&[("org", ¶m_value.to_string())]);
394 }
395 if let Some(ref user_agent) = configuration.user_agent {
396 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
397 }
398 if let Some(ref token) = configuration.bearer_access_token {
399 req_builder = req_builder.bearer_auth(token.to_owned());
400 };
401
402 let req = req_builder.build()?;
403 let resp = configuration.client.execute(req).await?;
404
405 let status = resp.status();
406 let content_type = resp
407 .headers()
408 .get("content-type")
409 .and_then(|v| v.to_str().ok())
410 .unwrap_or("application/octet-stream");
411 let content_type = super::ContentType::from(content_type);
412
413 if !status.is_client_error() && !status.is_server_error() {
414 let content = resp.text().await?;
415 match content_type {
416 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
417 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Declaration`"))),
418 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Declaration`")))),
419 }
420 } else {
421 let content = resp.text().await?;
422 let entity: Option<GetPlatformAppsByAppError> = serde_json::from_str(&content).ok();
423 Err(Error::ResponseError(ResponseContent { status, content, entity }))
424 }
425}
426
427pub async fn get_platform_apps_by_app_cd(configuration: &configuration::Configuration, app: &str, org: Option<&str>) -> Result<models::CdApp, Error<GetPlatformAppsByAppCdError>> {
429 let p_app = app;
431 let p_org = org;
432
433 let uri_str = format!("{}/v1/platform/apps/{app}/cd", configuration.base_path, app=crate::apis::urlencode(p_app));
434 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
435
436 if let Some(ref param_value) = p_org {
437 req_builder = req_builder.query(&[("org", ¶m_value.to_string())]);
438 }
439 if let Some(ref user_agent) = configuration.user_agent {
440 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
441 }
442 if let Some(ref token) = configuration.bearer_access_token {
443 req_builder = req_builder.bearer_auth(token.to_owned());
444 };
445
446 let req = req_builder.build()?;
447 let resp = configuration.client.execute(req).await?;
448
449 let status = resp.status();
450 let content_type = resp
451 .headers()
452 .get("content-type")
453 .and_then(|v| v.to_str().ok())
454 .unwrap_or("application/octet-stream");
455 let content_type = super::ContentType::from(content_type);
456
457 if !status.is_client_error() && !status.is_server_error() {
458 let content = resp.text().await?;
459 match content_type {
460 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
461 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CdApp`"))),
462 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CdApp`")))),
463 }
464 } else {
465 let content = resp.text().await?;
466 let entity: Option<GetPlatformAppsByAppCdError> = serde_json::from_str(&content).ok();
467 Err(Error::ResponseError(ResponseContent { status, content, entity }))
468 }
469}
470
471pub async fn get_platform_builds(configuration: &configuration::Configuration, ) -> Result<models::BuildBoard, Error<GetPlatformBuildsError>> {
473
474 let uri_str = format!("{}/v1/platform/builds", configuration.base_path);
475 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
476
477 if let Some(ref user_agent) = configuration.user_agent {
478 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
479 }
480 if let Some(ref token) = configuration.bearer_access_token {
481 req_builder = req_builder.bearer_auth(token.to_owned());
482 };
483
484 let req = req_builder.build()?;
485 let resp = configuration.client.execute(req).await?;
486
487 let status = resp.status();
488 let content_type = resp
489 .headers()
490 .get("content-type")
491 .and_then(|v| v.to_str().ok())
492 .unwrap_or("application/octet-stream");
493 let content_type = super::ContentType::from(content_type);
494
495 if !status.is_client_error() && !status.is_server_error() {
496 let content = resp.text().await?;
497 match content_type {
498 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
499 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BuildBoard`"))),
500 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::BuildBoard`")))),
501 }
502 } else {
503 let content = resp.text().await?;
504 let entity: Option<GetPlatformBuildsError> = serde_json::from_str(&content).ok();
505 Err(Error::ResponseError(ResponseContent { status, content, entity }))
506 }
507}
508
509pub async fn get_platform_cd(configuration: &configuration::Configuration, ) -> Result<models::CdResp, Error<GetPlatformCdError>> {
511
512 let uri_str = format!("{}/v1/platform/cd", configuration.base_path);
513 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
514
515 if let Some(ref user_agent) = configuration.user_agent {
516 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
517 }
518 if let Some(ref token) = configuration.bearer_access_token {
519 req_builder = req_builder.bearer_auth(token.to_owned());
520 };
521
522 let req = req_builder.build()?;
523 let resp = configuration.client.execute(req).await?;
524
525 let status = resp.status();
526 let content_type = resp
527 .headers()
528 .get("content-type")
529 .and_then(|v| v.to_str().ok())
530 .unwrap_or("application/octet-stream");
531 let content_type = super::ContentType::from(content_type);
532
533 if !status.is_client_error() && !status.is_server_error() {
534 let content = resp.text().await?;
535 match content_type {
536 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
537 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CdResp`"))),
538 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CdResp`")))),
539 }
540 } else {
541 let content = resp.text().await?;
542 let entity: Option<GetPlatformCdError> = serde_json::from_str(&content).ok();
543 Err(Error::ResponseError(ResponseContent { status, content, entity }))
544 }
545}
546
547pub async fn get_platform_ci(configuration: &configuration::Configuration, ) -> Result<(), Error<GetPlatformCiError>> {
549
550 let uri_str = format!("{}/v1/platform/ci", configuration.base_path);
551 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
552
553 if let Some(ref user_agent) = configuration.user_agent {
554 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
555 }
556 if let Some(ref token) = configuration.bearer_access_token {
557 req_builder = req_builder.bearer_auth(token.to_owned());
558 };
559
560 let req = req_builder.build()?;
561 let resp = configuration.client.execute(req).await?;
562
563 let status = resp.status();
564
565 if !status.is_client_error() && !status.is_server_error() {
566 Ok(())
567 } else {
568 let content = resp.text().await?;
569 let entity: Option<GetPlatformCiError> = serde_json::from_str(&content).ok();
570 Err(Error::ResponseError(ResponseContent { status, content, entity }))
571 }
572}
573
574pub async fn get_platform_environments(configuration: &configuration::Configuration, ) -> Result<models::EnvironmentBoard, Error<GetPlatformEnvironmentsError>> {
576
577 let uri_str = format!("{}/v1/platform/environments", configuration.base_path);
578 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
579
580 if let Some(ref user_agent) = configuration.user_agent {
581 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
582 }
583 if let Some(ref token) = configuration.bearer_access_token {
584 req_builder = req_builder.bearer_auth(token.to_owned());
585 };
586
587 let req = req_builder.build()?;
588 let resp = configuration.client.execute(req).await?;
589
590 let status = resp.status();
591 let content_type = resp
592 .headers()
593 .get("content-type")
594 .and_then(|v| v.to_str().ok())
595 .unwrap_or("application/octet-stream");
596 let content_type = super::ContentType::from(content_type);
597
598 if !status.is_client_error() && !status.is_server_error() {
599 let content = resp.text().await?;
600 match content_type {
601 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
602 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EnvironmentBoard`"))),
603 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::EnvironmentBoard`")))),
604 }
605 } else {
606 let content = resp.text().await?;
607 let entity: Option<GetPlatformEnvironmentsError> = serde_json::from_str(&content).ok();
608 Err(Error::ResponseError(ResponseContent { status, content, entity }))
609 }
610}
611
612pub async fn get_platform_fleet(configuration: &configuration::Configuration, env: Option<&str>, health: Option<&str>, org: Option<&str>, drift: Option<&str>) -> Result<models::DriftBoard, Error<GetPlatformFleetError>> {
614 let p_env = env;
616 let p_health = health;
617 let p_org = org;
618 let p_drift = drift;
619
620 let uri_str = format!("{}/v1/platform/fleet", configuration.base_path);
621 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
622
623 if let Some(ref param_value) = p_env {
624 req_builder = req_builder.query(&[("env", ¶m_value.to_string())]);
625 }
626 if let Some(ref param_value) = p_health {
627 req_builder = req_builder.query(&[("health", ¶m_value.to_string())]);
628 }
629 if let Some(ref param_value) = p_org {
630 req_builder = req_builder.query(&[("org", ¶m_value.to_string())]);
631 }
632 if let Some(ref param_value) = p_drift {
633 req_builder = req_builder.query(&[("drift", ¶m_value.to_string())]);
634 }
635 if let Some(ref user_agent) = configuration.user_agent {
636 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
637 }
638 if let Some(ref token) = configuration.bearer_access_token {
639 req_builder = req_builder.bearer_auth(token.to_owned());
640 };
641
642 let req = req_builder.build()?;
643 let resp = configuration.client.execute(req).await?;
644
645 let status = resp.status();
646 let content_type = resp
647 .headers()
648 .get("content-type")
649 .and_then(|v| v.to_str().ok())
650 .unwrap_or("application/octet-stream");
651 let content_type = super::ContentType::from(content_type);
652
653 if !status.is_client_error() && !status.is_server_error() {
654 let content = resp.text().await?;
655 match content_type {
656 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
657 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DriftBoard`"))),
658 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::DriftBoard`")))),
659 }
660 } else {
661 let content = resp.text().await?;
662 let entity: Option<GetPlatformFleetError> = serde_json::from_str(&content).ok();
663 Err(Error::ResponseError(ResponseContent { status, content, entity }))
664 }
665}
666
667pub async fn get_platform_fleet_by_app(configuration: &configuration::Configuration, app: &str, env: Option<&str>) -> Result<models::AppView, Error<GetPlatformFleetByAppError>> {
669 let p_app = app;
671 let p_env = env;
672
673 let uri_str = format!("{}/v1/platform/fleet/{app}", configuration.base_path, app=crate::apis::urlencode(p_app));
674 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
675
676 if let Some(ref param_value) = p_env {
677 req_builder = req_builder.query(&[("env", ¶m_value.to_string())]);
678 }
679 if let Some(ref user_agent) = configuration.user_agent {
680 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
681 }
682 if let Some(ref token) = configuration.bearer_access_token {
683 req_builder = req_builder.bearer_auth(token.to_owned());
684 };
685
686 let req = req_builder.build()?;
687 let resp = configuration.client.execute(req).await?;
688
689 let status = resp.status();
690 let content_type = resp
691 .headers()
692 .get("content-type")
693 .and_then(|v| v.to_str().ok())
694 .unwrap_or("application/octet-stream");
695 let content_type = super::ContentType::from(content_type);
696
697 if !status.is_client_error() && !status.is_server_error() {
698 let content = resp.text().await?;
699 match content_type {
700 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
701 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AppView`"))),
702 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AppView`")))),
703 }
704 } else {
705 let content = resp.text().await?;
706 let entity: Option<GetPlatformFleetByAppError> = serde_json::from_str(&content).ok();
707 Err(Error::ResponseError(ResponseContent { status, content, entity }))
708 }
709}
710
711pub async fn get_platform_health(configuration: &configuration::Configuration, ) -> Result<models::Readiness, Error<GetPlatformHealthError>> {
713
714 let uri_str = format!("{}/v1/platform/health", configuration.base_path);
715 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
716
717 if let Some(ref user_agent) = configuration.user_agent {
718 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
719 }
720 if let Some(ref token) = configuration.bearer_access_token {
721 req_builder = req_builder.bearer_auth(token.to_owned());
722 };
723
724 let req = req_builder.build()?;
725 let resp = configuration.client.execute(req).await?;
726
727 let status = resp.status();
728 let content_type = resp
729 .headers()
730 .get("content-type")
731 .and_then(|v| v.to_str().ok())
732 .unwrap_or("application/octet-stream");
733 let content_type = super::ContentType::from(content_type);
734
735 if !status.is_client_error() && !status.is_server_error() {
736 let content = resp.text().await?;
737 match content_type {
738 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
739 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Readiness`"))),
740 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Readiness`")))),
741 }
742 } else {
743 let content = resp.text().await?;
744 let entity: Option<GetPlatformHealthError> = serde_json::from_str(&content).ok();
745 Err(Error::ResponseError(ResponseContent { status, content, entity }))
746 }
747}
748
749pub async fn get_platform_pipelines(configuration: &configuration::Configuration, ) -> Result<models::PipelineBoard, Error<GetPlatformPipelinesError>> {
751
752 let uri_str = format!("{}/v1/platform/pipelines", configuration.base_path);
753 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
754
755 if let Some(ref user_agent) = configuration.user_agent {
756 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
757 }
758 if let Some(ref token) = configuration.bearer_access_token {
759 req_builder = req_builder.bearer_auth(token.to_owned());
760 };
761
762 let req = req_builder.build()?;
763 let resp = configuration.client.execute(req).await?;
764
765 let status = resp.status();
766 let content_type = resp
767 .headers()
768 .get("content-type")
769 .and_then(|v| v.to_str().ok())
770 .unwrap_or("application/octet-stream");
771 let content_type = super::ContentType::from(content_type);
772
773 if !status.is_client_error() && !status.is_server_error() {
774 let content = resp.text().await?;
775 match content_type {
776 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
777 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PipelineBoard`"))),
778 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PipelineBoard`")))),
779 }
780 } else {
781 let content = resp.text().await?;
782 let entity: Option<GetPlatformPipelinesError> = serde_json::from_str(&content).ok();
783 Err(Error::ResponseError(ResponseContent { status, content, entity }))
784 }
785}
786
787pub async fn get_platform_projects(configuration: &configuration::Configuration, ) -> Result<Vec<models::ProjectView>, Error<GetPlatformProjectsError>> {
789
790 let uri_str = format!("{}/v1/platform/projects", configuration.base_path);
791 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
792
793 if let Some(ref user_agent) = configuration.user_agent {
794 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
795 }
796 if let Some(ref token) = configuration.bearer_access_token {
797 req_builder = req_builder.bearer_auth(token.to_owned());
798 };
799
800 let req = req_builder.build()?;
801 let resp = configuration.client.execute(req).await?;
802
803 let status = resp.status();
804 let content_type = resp
805 .headers()
806 .get("content-type")
807 .and_then(|v| v.to_str().ok())
808 .unwrap_or("application/octet-stream");
809 let content_type = super::ContentType::from(content_type);
810
811 if !status.is_client_error() && !status.is_server_error() {
812 let content = resp.text().await?;
813 match content_type {
814 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
815 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::ProjectView>`"))),
816 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::ProjectView>`")))),
817 }
818 } else {
819 let content = resp.text().await?;
820 let entity: Option<GetPlatformProjectsError> = serde_json::from_str(&content).ok();
821 Err(Error::ResponseError(ResponseContent { status, content, entity }))
822 }
823}
824
825pub async fn get_platform_projects_by_project(configuration: &configuration::Configuration, project: &str) -> Result<models::ProjectView, Error<GetPlatformProjectsByProjectError>> {
827 let p_project = project;
829
830 let uri_str = format!("{}/v1/platform/projects/{project}", configuration.base_path, project=crate::apis::urlencode(p_project));
831 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
832
833 if let Some(ref user_agent) = configuration.user_agent {
834 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
835 }
836 if let Some(ref token) = configuration.bearer_access_token {
837 req_builder = req_builder.bearer_auth(token.to_owned());
838 };
839
840 let req = req_builder.build()?;
841 let resp = configuration.client.execute(req).await?;
842
843 let status = resp.status();
844 let content_type = resp
845 .headers()
846 .get("content-type")
847 .and_then(|v| v.to_str().ok())
848 .unwrap_or("application/octet-stream");
849 let content_type = super::ContentType::from(content_type);
850
851 if !status.is_client_error() && !status.is_server_error() {
852 let content = resp.text().await?;
853 match content_type {
854 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
855 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProjectView`"))),
856 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ProjectView`")))),
857 }
858 } else {
859 let content = resp.text().await?;
860 let entity: Option<GetPlatformProjectsByProjectError> = serde_json::from_str(&content).ok();
861 Err(Error::ResponseError(ResponseContent { status, content, entity }))
862 }
863}
864
865pub async fn get_platform_projects_by_project_apps(configuration: &configuration::Configuration, project: &str) -> Result<Vec<models::AppView>, Error<GetPlatformProjectsByProjectAppsError>> {
867 let p_project = project;
869
870 let uri_str = format!("{}/v1/platform/projects/{project}/apps", configuration.base_path, project=crate::apis::urlencode(p_project));
871 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
872
873 if let Some(ref user_agent) = configuration.user_agent {
874 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
875 }
876 if let Some(ref token) = configuration.bearer_access_token {
877 req_builder = req_builder.bearer_auth(token.to_owned());
878 };
879
880 let req = req_builder.build()?;
881 let resp = configuration.client.execute(req).await?;
882
883 let status = resp.status();
884 let content_type = resp
885 .headers()
886 .get("content-type")
887 .and_then(|v| v.to_str().ok())
888 .unwrap_or("application/octet-stream");
889 let content_type = super::ContentType::from(content_type);
890
891 if !status.is_client_error() && !status.is_server_error() {
892 let content = resp.text().await?;
893 match content_type {
894 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
895 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::AppView>`"))),
896 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::AppView>`")))),
897 }
898 } else {
899 let content = resp.text().await?;
900 let entity: Option<GetPlatformProjectsByProjectAppsError> = serde_json::from_str(&content).ok();
901 Err(Error::ResponseError(ResponseContent { status, content, entity }))
902 }
903}
904
905pub async fn get_platform_projects_by_project_apps_by_app(configuration: &configuration::Configuration, project: &str, app: &str) -> Result<models::AppView, Error<GetPlatformProjectsByProjectAppsByAppError>> {
907 let p_project = project;
909 let p_app = app;
910
911 let uri_str = format!("{}/v1/platform/projects/{project}/apps/{app}", configuration.base_path, project=crate::apis::urlencode(p_project), app=crate::apis::urlencode(p_app));
912 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
913
914 if let Some(ref user_agent) = configuration.user_agent {
915 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
916 }
917 if let Some(ref token) = configuration.bearer_access_token {
918 req_builder = req_builder.bearer_auth(token.to_owned());
919 };
920
921 let req = req_builder.build()?;
922 let resp = configuration.client.execute(req).await?;
923
924 let status = resp.status();
925 let content_type = resp
926 .headers()
927 .get("content-type")
928 .and_then(|v| v.to_str().ok())
929 .unwrap_or("application/octet-stream");
930 let content_type = super::ContentType::from(content_type);
931
932 if !status.is_client_error() && !status.is_server_error() {
933 let content = resp.text().await?;
934 match content_type {
935 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
936 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AppView`"))),
937 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AppView`")))),
938 }
939 } else {
940 let content = resp.text().await?;
941 let entity: Option<GetPlatformProjectsByProjectAppsByAppError> = serde_json::from_str(&content).ok();
942 Err(Error::ResponseError(ResponseContent { status, content, entity }))
943 }
944}
945
946pub async fn get_platform_projects_by_project_apps_by_app_deployments(configuration: &configuration::Configuration, project: &str, app: &str) -> Result<Vec<models::DeploymentView>, Error<GetPlatformProjectsByProjectAppsByAppDeploymentsError>> {
948 let p_project = project;
950 let p_app = app;
951
952 let uri_str = format!("{}/v1/platform/projects/{project}/apps/{app}/deployments", configuration.base_path, project=crate::apis::urlencode(p_project), app=crate::apis::urlencode(p_app));
953 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
954
955 if let Some(ref user_agent) = configuration.user_agent {
956 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
957 }
958 if let Some(ref token) = configuration.bearer_access_token {
959 req_builder = req_builder.bearer_auth(token.to_owned());
960 };
961
962 let req = req_builder.build()?;
963 let resp = configuration.client.execute(req).await?;
964
965 let status = resp.status();
966 let content_type = resp
967 .headers()
968 .get("content-type")
969 .and_then(|v| v.to_str().ok())
970 .unwrap_or("application/octet-stream");
971 let content_type = super::ContentType::from(content_type);
972
973 if !status.is_client_error() && !status.is_server_error() {
974 let content = resp.text().await?;
975 match content_type {
976 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
977 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::DeploymentView>`"))),
978 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::DeploymentView>`")))),
979 }
980 } else {
981 let content = resp.text().await?;
982 let entity: Option<GetPlatformProjectsByProjectAppsByAppDeploymentsError> = serde_json::from_str(&content).ok();
983 Err(Error::ResponseError(ResponseContent { status, content, entity }))
984 }
985}
986
987pub async fn get_platform_projects_by_project_apps_by_app_deployments_by_id(configuration: &configuration::Configuration, project: &str, app: &str, id: &str) -> Result<models::DeploymentView, Error<GetPlatformProjectsByProjectAppsByAppDeploymentsByIdError>> {
989 let p_project = project;
991 let p_app = app;
992 let p_id = id;
993
994 let uri_str = format!("{}/v1/platform/projects/{project}/apps/{app}/deployments/{id}", configuration.base_path, project=crate::apis::urlencode(p_project), app=crate::apis::urlencode(p_app), id=crate::apis::urlencode(p_id));
995 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
996
997 if let Some(ref user_agent) = configuration.user_agent {
998 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
999 }
1000 if let Some(ref token) = configuration.bearer_access_token {
1001 req_builder = req_builder.bearer_auth(token.to_owned());
1002 };
1003
1004 let req = req_builder.build()?;
1005 let resp = configuration.client.execute(req).await?;
1006
1007 let status = resp.status();
1008 let content_type = resp
1009 .headers()
1010 .get("content-type")
1011 .and_then(|v| v.to_str().ok())
1012 .unwrap_or("application/octet-stream");
1013 let content_type = super::ContentType::from(content_type);
1014
1015 if !status.is_client_error() && !status.is_server_error() {
1016 let content = resp.text().await?;
1017 match content_type {
1018 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1019 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DeploymentView`"))),
1020 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::DeploymentView`")))),
1021 }
1022 } else {
1023 let content = resp.text().await?;
1024 let entity: Option<GetPlatformProjectsByProjectAppsByAppDeploymentsByIdError> = serde_json::from_str(&content).ok();
1025 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1026 }
1027}
1028
1029pub async fn get_platform_projects_by_project_apps_by_app_deployments_by_id_logs(configuration: &configuration::Configuration, project: &str, app: &str, id: &str) -> Result<models::DeployLogs, Error<GetPlatformProjectsByProjectAppsByAppDeploymentsByIdLogsError>> {
1031 let p_project = project;
1033 let p_app = app;
1034 let p_id = id;
1035
1036 let uri_str = format!("{}/v1/platform/projects/{project}/apps/{app}/deployments/{id}/logs", configuration.base_path, project=crate::apis::urlencode(p_project), app=crate::apis::urlencode(p_app), id=crate::apis::urlencode(p_id));
1037 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1038
1039 if let Some(ref user_agent) = configuration.user_agent {
1040 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1041 }
1042 if let Some(ref token) = configuration.bearer_access_token {
1043 req_builder = req_builder.bearer_auth(token.to_owned());
1044 };
1045
1046 let req = req_builder.build()?;
1047 let resp = configuration.client.execute(req).await?;
1048
1049 let status = resp.status();
1050 let content_type = resp
1051 .headers()
1052 .get("content-type")
1053 .and_then(|v| v.to_str().ok())
1054 .unwrap_or("application/octet-stream");
1055 let content_type = super::ContentType::from(content_type);
1056
1057 if !status.is_client_error() && !status.is_server_error() {
1058 let content = resp.text().await?;
1059 match content_type {
1060 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1061 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DeployLogs`"))),
1062 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::DeployLogs`")))),
1063 }
1064 } else {
1065 let content = resp.text().await?;
1066 let entity: Option<GetPlatformProjectsByProjectAppsByAppDeploymentsByIdLogsError> = serde_json::from_str(&content).ok();
1067 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1068 }
1069}
1070
1071pub async fn get_platform_projects_by_project_apps_by_app_domains(configuration: &configuration::Configuration, project: &str, app: &str) -> Result<Vec<models::DomainView>, Error<GetPlatformProjectsByProjectAppsByAppDomainsError>> {
1073 let p_project = project;
1075 let p_app = app;
1076
1077 let uri_str = format!("{}/v1/platform/projects/{project}/apps/{app}/domains", configuration.base_path, project=crate::apis::urlencode(p_project), app=crate::apis::urlencode(p_app));
1078 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1079
1080 if let Some(ref user_agent) = configuration.user_agent {
1081 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1082 }
1083 if let Some(ref token) = configuration.bearer_access_token {
1084 req_builder = req_builder.bearer_auth(token.to_owned());
1085 };
1086
1087 let req = req_builder.build()?;
1088 let resp = configuration.client.execute(req).await?;
1089
1090 let status = resp.status();
1091 let content_type = resp
1092 .headers()
1093 .get("content-type")
1094 .and_then(|v| v.to_str().ok())
1095 .unwrap_or("application/octet-stream");
1096 let content_type = super::ContentType::from(content_type);
1097
1098 if !status.is_client_error() && !status.is_server_error() {
1099 let content = resp.text().await?;
1100 match content_type {
1101 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1102 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::DomainView>`"))),
1103 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::DomainView>`")))),
1104 }
1105 } else {
1106 let content = resp.text().await?;
1107 let entity: Option<GetPlatformProjectsByProjectAppsByAppDomainsError> = serde_json::from_str(&content).ok();
1108 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1109 }
1110}
1111
1112pub async fn get_platform_releases(configuration: &configuration::Configuration, ) -> Result<models::ReleaseBoard, Error<GetPlatformReleasesError>> {
1114
1115 let uri_str = format!("{}/v1/platform/releases", configuration.base_path);
1116 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1117
1118 if let Some(ref user_agent) = configuration.user_agent {
1119 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1120 }
1121 if let Some(ref token) = configuration.bearer_access_token {
1122 req_builder = req_builder.bearer_auth(token.to_owned());
1123 };
1124
1125 let req = req_builder.build()?;
1126 let resp = configuration.client.execute(req).await?;
1127
1128 let status = resp.status();
1129 let content_type = resp
1130 .headers()
1131 .get("content-type")
1132 .and_then(|v| v.to_str().ok())
1133 .unwrap_or("application/octet-stream");
1134 let content_type = super::ContentType::from(content_type);
1135
1136 if !status.is_client_error() && !status.is_server_error() {
1137 let content = resp.text().await?;
1138 match content_type {
1139 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1140 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ReleaseBoard`"))),
1141 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ReleaseBoard`")))),
1142 }
1143 } else {
1144 let content = resp.text().await?;
1145 let entity: Option<GetPlatformReleasesError> = serde_json::from_str(&content).ok();
1146 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1147 }
1148}
1149
1150pub async fn post_platform_apps(configuration: &configuration::Configuration, ) -> Result<(), Error<PostPlatformAppsError>> {
1152
1153 let uri_str = format!("{}/v1/platform/apps", configuration.base_path);
1154 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1155
1156 if let Some(ref user_agent) = configuration.user_agent {
1157 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1158 }
1159 if let Some(ref token) = configuration.bearer_access_token {
1160 req_builder = req_builder.bearer_auth(token.to_owned());
1161 };
1162
1163 let req = req_builder.build()?;
1164 let resp = configuration.client.execute(req).await?;
1165
1166 let status = resp.status();
1167
1168 if !status.is_client_error() && !status.is_server_error() {
1169 Ok(())
1170 } else {
1171 let content = resp.text().await?;
1172 let entity: Option<PostPlatformAppsError> = serde_json::from_str(&content).ok();
1173 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1174 }
1175}
1176
1177pub async fn post_platform_fleet_by_app_deploy(configuration: &configuration::Configuration, app: &str, restart_ref: models::RestartRef) -> Result<models::Restarted, Error<PostPlatformFleetByAppDeployError>> {
1179 let p_app = app;
1181 let p_restart_ref = restart_ref;
1182
1183 let uri_str = format!("{}/v1/platform/fleet/{app}/deploy", configuration.base_path, app=crate::apis::urlencode(p_app));
1184 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1185
1186 if let Some(ref user_agent) = configuration.user_agent {
1187 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1188 }
1189 if let Some(ref token) = configuration.bearer_access_token {
1190 req_builder = req_builder.bearer_auth(token.to_owned());
1191 };
1192 req_builder = req_builder.json(&p_restart_ref);
1193
1194 let req = req_builder.build()?;
1195 let resp = configuration.client.execute(req).await?;
1196
1197 let status = resp.status();
1198 let content_type = resp
1199 .headers()
1200 .get("content-type")
1201 .and_then(|v| v.to_str().ok())
1202 .unwrap_or("application/octet-stream");
1203 let content_type = super::ContentType::from(content_type);
1204
1205 if !status.is_client_error() && !status.is_server_error() {
1206 let content = resp.text().await?;
1207 match content_type {
1208 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1209 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Restarted`"))),
1210 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Restarted`")))),
1211 }
1212 } else {
1213 let content = resp.text().await?;
1214 let entity: Option<PostPlatformFleetByAppDeployError> = serde_json::from_str(&content).ok();
1215 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1216 }
1217}
1218
1219pub async fn post_platform_hook(configuration: &configuration::Configuration, push: Option<models::Push>) -> Result<models::Verdict, Error<PostPlatformHookError>> {
1221 let p_push = push;
1223
1224 let uri_str = format!("{}/v1/platform/hook", configuration.base_path);
1225 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1226
1227 if let Some(ref user_agent) = configuration.user_agent {
1228 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1229 }
1230 if let Some(ref token) = configuration.bearer_access_token {
1231 req_builder = req_builder.bearer_auth(token.to_owned());
1232 };
1233 req_builder = req_builder.json(&p_push);
1234
1235 let req = req_builder.build()?;
1236 let resp = configuration.client.execute(req).await?;
1237
1238 let status = resp.status();
1239 let content_type = resp
1240 .headers()
1241 .get("content-type")
1242 .and_then(|v| v.to_str().ok())
1243 .unwrap_or("application/octet-stream");
1244 let content_type = super::ContentType::from(content_type);
1245
1246 if !status.is_client_error() && !status.is_server_error() {
1247 let content = resp.text().await?;
1248 match content_type {
1249 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1250 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Verdict`"))),
1251 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Verdict`")))),
1252 }
1253 } else {
1254 let content = resp.text().await?;
1255 let entity: Option<PostPlatformHookError> = serde_json::from_str(&content).ok();
1256 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1257 }
1258}
1259
1260pub async fn post_platform_projects_by_project_apps(configuration: &configuration::Configuration, project: &str, create_app_req: models::CreateAppReq) -> Result<models::AppView, Error<PostPlatformProjectsByProjectAppsError>> {
1262 let p_project = project;
1264 let p_create_app_req = create_app_req;
1265
1266 let uri_str = format!("{}/v1/platform/projects/{project}/apps", configuration.base_path, project=crate::apis::urlencode(p_project));
1267 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1268
1269 if let Some(ref user_agent) = configuration.user_agent {
1270 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1271 }
1272 if let Some(ref token) = configuration.bearer_access_token {
1273 req_builder = req_builder.bearer_auth(token.to_owned());
1274 };
1275 req_builder = req_builder.json(&p_create_app_req);
1276
1277 let req = req_builder.build()?;
1278 let resp = configuration.client.execute(req).await?;
1279
1280 let status = resp.status();
1281 let content_type = resp
1282 .headers()
1283 .get("content-type")
1284 .and_then(|v| v.to_str().ok())
1285 .unwrap_or("application/octet-stream");
1286 let content_type = super::ContentType::from(content_type);
1287
1288 if !status.is_client_error() && !status.is_server_error() {
1289 let content = resp.text().await?;
1290 match content_type {
1291 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1292 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AppView`"))),
1293 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AppView`")))),
1294 }
1295 } else {
1296 let content = resp.text().await?;
1297 let entity: Option<PostPlatformProjectsByProjectAppsError> = serde_json::from_str(&content).ok();
1298 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1299 }
1300}
1301
1302pub async fn post_platform_projects_by_project_apps_by_app_deploy(configuration: &configuration::Configuration, project: &str, app: &str, deploy_req: models::DeployReq) -> Result<models::DeploymentView, Error<PostPlatformProjectsByProjectAppsByAppDeployError>> {
1304 let p_project = project;
1306 let p_app = app;
1307 let p_deploy_req = deploy_req;
1308
1309 let uri_str = format!("{}/v1/platform/projects/{project}/apps/{app}/deploy", configuration.base_path, project=crate::apis::urlencode(p_project), app=crate::apis::urlencode(p_app));
1310 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1311
1312 if let Some(ref user_agent) = configuration.user_agent {
1313 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1314 }
1315 if let Some(ref token) = configuration.bearer_access_token {
1316 req_builder = req_builder.bearer_auth(token.to_owned());
1317 };
1318 req_builder = req_builder.json(&p_deploy_req);
1319
1320 let req = req_builder.build()?;
1321 let resp = configuration.client.execute(req).await?;
1322
1323 let status = resp.status();
1324 let content_type = resp
1325 .headers()
1326 .get("content-type")
1327 .and_then(|v| v.to_str().ok())
1328 .unwrap_or("application/octet-stream");
1329 let content_type = super::ContentType::from(content_type);
1330
1331 if !status.is_client_error() && !status.is_server_error() {
1332 let content = resp.text().await?;
1333 match content_type {
1334 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1335 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DeploymentView`"))),
1336 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::DeploymentView`")))),
1337 }
1338 } else {
1339 let content = resp.text().await?;
1340 let entity: Option<PostPlatformProjectsByProjectAppsByAppDeployError> = serde_json::from_str(&content).ok();
1341 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1342 }
1343}
1344
1345pub async fn post_platform_projects_by_project_apps_by_app_domains(configuration: &configuration::Configuration, project: &str, app: &str, add_domain_req: models::AddDomainReq) -> Result<models::DomainView, Error<PostPlatformProjectsByProjectAppsByAppDomainsError>> {
1347 let p_project = project;
1349 let p_app = app;
1350 let p_add_domain_req = add_domain_req;
1351
1352 let uri_str = format!("{}/v1/platform/projects/{project}/apps/{app}/domains", configuration.base_path, project=crate::apis::urlencode(p_project), app=crate::apis::urlencode(p_app));
1353 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1354
1355 if let Some(ref user_agent) = configuration.user_agent {
1356 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1357 }
1358 if let Some(ref token) = configuration.bearer_access_token {
1359 req_builder = req_builder.bearer_auth(token.to_owned());
1360 };
1361 req_builder = req_builder.json(&p_add_domain_req);
1362
1363 let req = req_builder.build()?;
1364 let resp = configuration.client.execute(req).await?;
1365
1366 let status = resp.status();
1367 let content_type = resp
1368 .headers()
1369 .get("content-type")
1370 .and_then(|v| v.to_str().ok())
1371 .unwrap_or("application/octet-stream");
1372 let content_type = super::ContentType::from(content_type);
1373
1374 if !status.is_client_error() && !status.is_server_error() {
1375 let content = resp.text().await?;
1376 match content_type {
1377 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1378 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DomainView`"))),
1379 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::DomainView`")))),
1380 }
1381 } else {
1382 let content = resp.text().await?;
1383 let entity: Option<PostPlatformProjectsByProjectAppsByAppDomainsError> = serde_json::from_str(&content).ok();
1384 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1385 }
1386}
1387
1388pub async fn post_platform_projects_by_project_apps_by_app_domains_by_host_verify(configuration: &configuration::Configuration, project: &str, app: &str, host: &str) -> Result<models::DomainView, Error<PostPlatformProjectsByProjectAppsByAppDomainsByHostVerifyError>> {
1390 let p_project = project;
1392 let p_app = app;
1393 let p_host = host;
1394
1395 let uri_str = format!("{}/v1/platform/projects/{project}/apps/{app}/domains/{host}/verify", configuration.base_path, project=crate::apis::urlencode(p_project), app=crate::apis::urlencode(p_app), host=crate::apis::urlencode(p_host));
1396 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1397
1398 if let Some(ref user_agent) = configuration.user_agent {
1399 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1400 }
1401 if let Some(ref token) = configuration.bearer_access_token {
1402 req_builder = req_builder.bearer_auth(token.to_owned());
1403 };
1404
1405 let req = req_builder.build()?;
1406 let resp = configuration.client.execute(req).await?;
1407
1408 let status = resp.status();
1409 let content_type = resp
1410 .headers()
1411 .get("content-type")
1412 .and_then(|v| v.to_str().ok())
1413 .unwrap_or("application/octet-stream");
1414 let content_type = super::ContentType::from(content_type);
1415
1416 if !status.is_client_error() && !status.is_server_error() {
1417 let content = resp.text().await?;
1418 match content_type {
1419 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1420 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DomainView`"))),
1421 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::DomainView`")))),
1422 }
1423 } else {
1424 let content = resp.text().await?;
1425 let entity: Option<PostPlatformProjectsByProjectAppsByAppDomainsByHostVerifyError> = serde_json::from_str(&content).ok();
1426 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1427 }
1428}
1429
1430pub async fn post_platform_projects_by_project_apps_by_app_preview(configuration: &configuration::Configuration, project: &str, app: &str, preview_req: models::PreviewReq) -> Result<models::PreviewView, Error<PostPlatformProjectsByProjectAppsByAppPreviewError>> {
1432 let p_project = project;
1434 let p_app = app;
1435 let p_preview_req = preview_req;
1436
1437 let uri_str = format!("{}/v1/platform/projects/{project}/apps/{app}/preview", configuration.base_path, project=crate::apis::urlencode(p_project), app=crate::apis::urlencode(p_app));
1438 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1439
1440 if let Some(ref user_agent) = configuration.user_agent {
1441 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1442 }
1443 if let Some(ref token) = configuration.bearer_access_token {
1444 req_builder = req_builder.bearer_auth(token.to_owned());
1445 };
1446 req_builder = req_builder.json(&p_preview_req);
1447
1448 let req = req_builder.build()?;
1449 let resp = configuration.client.execute(req).await?;
1450
1451 let status = resp.status();
1452 let content_type = resp
1453 .headers()
1454 .get("content-type")
1455 .and_then(|v| v.to_str().ok())
1456 .unwrap_or("application/octet-stream");
1457 let content_type = super::ContentType::from(content_type);
1458
1459 if !status.is_client_error() && !status.is_server_error() {
1460 let content = resp.text().await?;
1461 match content_type {
1462 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1463 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PreviewView`"))),
1464 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PreviewView`")))),
1465 }
1466 } else {
1467 let content = resp.text().await?;
1468 let entity: Option<PostPlatformProjectsByProjectAppsByAppPreviewError> = serde_json::from_str(&content).ok();
1469 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1470 }
1471}
1472
1473pub async fn post_platform_projects_by_project_apps_by_app_promote(configuration: &configuration::Configuration, project: &str, app: &str, promote_req: models::PromoteReq) -> Result<models::DeploymentView, Error<PostPlatformProjectsByProjectAppsByAppPromoteError>> {
1475 let p_project = project;
1477 let p_app = app;
1478 let p_promote_req = promote_req;
1479
1480 let uri_str = format!("{}/v1/platform/projects/{project}/apps/{app}/promote", configuration.base_path, project=crate::apis::urlencode(p_project), app=crate::apis::urlencode(p_app));
1481 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1482
1483 if let Some(ref user_agent) = configuration.user_agent {
1484 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1485 }
1486 if let Some(ref token) = configuration.bearer_access_token {
1487 req_builder = req_builder.bearer_auth(token.to_owned());
1488 };
1489 req_builder = req_builder.json(&p_promote_req);
1490
1491 let req = req_builder.build()?;
1492 let resp = configuration.client.execute(req).await?;
1493
1494 let status = resp.status();
1495 let content_type = resp
1496 .headers()
1497 .get("content-type")
1498 .and_then(|v| v.to_str().ok())
1499 .unwrap_or("application/octet-stream");
1500 let content_type = super::ContentType::from(content_type);
1501
1502 if !status.is_client_error() && !status.is_server_error() {
1503 let content = resp.text().await?;
1504 match content_type {
1505 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1506 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DeploymentView`"))),
1507 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::DeploymentView`")))),
1508 }
1509 } else {
1510 let content = resp.text().await?;
1511 let entity: Option<PostPlatformProjectsByProjectAppsByAppPromoteError> = serde_json::from_str(&content).ok();
1512 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1513 }
1514}
1515
1516pub async fn post_platform_projects_by_project_apps_by_app_rollback(configuration: &configuration::Configuration, project: &str, app: &str, rollback_req: models::RollbackReq) -> Result<models::DeploymentView, Error<PostPlatformProjectsByProjectAppsByAppRollbackError>> {
1518 let p_project = project;
1520 let p_app = app;
1521 let p_rollback_req = rollback_req;
1522
1523 let uri_str = format!("{}/v1/platform/projects/{project}/apps/{app}/rollback", configuration.base_path, project=crate::apis::urlencode(p_project), app=crate::apis::urlencode(p_app));
1524 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1525
1526 if let Some(ref user_agent) = configuration.user_agent {
1527 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1528 }
1529 if let Some(ref token) = configuration.bearer_access_token {
1530 req_builder = req_builder.bearer_auth(token.to_owned());
1531 };
1532 req_builder = req_builder.json(&p_rollback_req);
1533
1534 let req = req_builder.build()?;
1535 let resp = configuration.client.execute(req).await?;
1536
1537 let status = resp.status();
1538 let content_type = resp
1539 .headers()
1540 .get("content-type")
1541 .and_then(|v| v.to_str().ok())
1542 .unwrap_or("application/octet-stream");
1543 let content_type = super::ContentType::from(content_type);
1544
1545 if !status.is_client_error() && !status.is_server_error() {
1546 let content = resp.text().await?;
1547 match content_type {
1548 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1549 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DeploymentView`"))),
1550 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::DeploymentView`")))),
1551 }
1552 } else {
1553 let content = resp.text().await?;
1554 let entity: Option<PostPlatformProjectsByProjectAppsByAppRollbackError> = serde_json::from_str(&content).ok();
1555 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1556 }
1557}
1558
1559pub async fn post_platform_projects_by_project_apps_by_app_start(configuration: &configuration::Configuration, project: &str, app: &str) -> Result<models::AppView, Error<PostPlatformProjectsByProjectAppsByAppStartError>> {
1561 let p_project = project;
1563 let p_app = app;
1564
1565 let uri_str = format!("{}/v1/platform/projects/{project}/apps/{app}/start", configuration.base_path, project=crate::apis::urlencode(p_project), app=crate::apis::urlencode(p_app));
1566 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1567
1568 if let Some(ref user_agent) = configuration.user_agent {
1569 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1570 }
1571 if let Some(ref token) = configuration.bearer_access_token {
1572 req_builder = req_builder.bearer_auth(token.to_owned());
1573 };
1574
1575 let req = req_builder.build()?;
1576 let resp = configuration.client.execute(req).await?;
1577
1578 let status = resp.status();
1579 let content_type = resp
1580 .headers()
1581 .get("content-type")
1582 .and_then(|v| v.to_str().ok())
1583 .unwrap_or("application/octet-stream");
1584 let content_type = super::ContentType::from(content_type);
1585
1586 if !status.is_client_error() && !status.is_server_error() {
1587 let content = resp.text().await?;
1588 match content_type {
1589 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1590 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AppView`"))),
1591 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AppView`")))),
1592 }
1593 } else {
1594 let content = resp.text().await?;
1595 let entity: Option<PostPlatformProjectsByProjectAppsByAppStartError> = serde_json::from_str(&content).ok();
1596 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1597 }
1598}
1599
1600pub async fn post_platform_projects_by_project_apps_by_app_stop(configuration: &configuration::Configuration, project: &str, app: &str) -> Result<models::AppView, Error<PostPlatformProjectsByProjectAppsByAppStopError>> {
1602 let p_project = project;
1604 let p_app = app;
1605
1606 let uri_str = format!("{}/v1/platform/projects/{project}/apps/{app}/stop", configuration.base_path, project=crate::apis::urlencode(p_project), app=crate::apis::urlencode(p_app));
1607 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1608
1609 if let Some(ref user_agent) = configuration.user_agent {
1610 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1611 }
1612 if let Some(ref token) = configuration.bearer_access_token {
1613 req_builder = req_builder.bearer_auth(token.to_owned());
1614 };
1615
1616 let req = req_builder.build()?;
1617 let resp = configuration.client.execute(req).await?;
1618
1619 let status = resp.status();
1620 let content_type = resp
1621 .headers()
1622 .get("content-type")
1623 .and_then(|v| v.to_str().ok())
1624 .unwrap_or("application/octet-stream");
1625 let content_type = super::ContentType::from(content_type);
1626
1627 if !status.is_client_error() && !status.is_server_error() {
1628 let content = resp.text().await?;
1629 match content_type {
1630 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1631 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AppView`"))),
1632 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AppView`")))),
1633 }
1634 } else {
1635 let content = resp.text().await?;
1636 let entity: Option<PostPlatformProjectsByProjectAppsByAppStopError> = serde_json::from_str(&content).ok();
1637 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1638 }
1639}
1640
1641pub async fn post_platform_run(configuration: &configuration::Configuration, run_req: models::RunReq) -> Result<models::RunView, Error<PostPlatformRunError>> {
1643 let p_run_req = run_req;
1645
1646 let uri_str = format!("{}/v1/platform/run", configuration.base_path);
1647 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1648
1649 if let Some(ref user_agent) = configuration.user_agent {
1650 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1651 }
1652 if let Some(ref token) = configuration.bearer_access_token {
1653 req_builder = req_builder.bearer_auth(token.to_owned());
1654 };
1655 req_builder = req_builder.json(&p_run_req);
1656
1657 let req = req_builder.build()?;
1658 let resp = configuration.client.execute(req).await?;
1659
1660 let status = resp.status();
1661 let content_type = resp
1662 .headers()
1663 .get("content-type")
1664 .and_then(|v| v.to_str().ok())
1665 .unwrap_or("application/octet-stream");
1666 let content_type = super::ContentType::from(content_type);
1667
1668 if !status.is_client_error() && !status.is_server_error() {
1669 let content = resp.text().await?;
1670 match content_type {
1671 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1672 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RunView`"))),
1673 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RunView`")))),
1674 }
1675 } else {
1676 let content = resp.text().await?;
1677 let entity: Option<PostPlatformRunError> = serde_json::from_str(&content).ok();
1678 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1679 }
1680}
1681
1682pub async fn post_platform_runner(configuration: &configuration::Configuration, runner_build_req: models::RunnerBuildReq) -> Result<models::RunnerBuildResp, Error<PostPlatformRunnerError>> {
1684 let p_runner_build_req = runner_build_req;
1686
1687 let uri_str = format!("{}/v1/platform/runner", configuration.base_path);
1688 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1689
1690 if let Some(ref user_agent) = configuration.user_agent {
1691 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1692 }
1693 if let Some(ref token) = configuration.bearer_access_token {
1694 req_builder = req_builder.bearer_auth(token.to_owned());
1695 };
1696 req_builder = req_builder.json(&p_runner_build_req);
1697
1698 let req = req_builder.build()?;
1699 let resp = configuration.client.execute(req).await?;
1700
1701 let status = resp.status();
1702 let content_type = resp
1703 .headers()
1704 .get("content-type")
1705 .and_then(|v| v.to_str().ok())
1706 .unwrap_or("application/octet-stream");
1707 let content_type = super::ContentType::from(content_type);
1708
1709 if !status.is_client_error() && !status.is_server_error() {
1710 let content = resp.text().await?;
1711 match content_type {
1712 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1713 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RunnerBuildResp`"))),
1714 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RunnerBuildResp`")))),
1715 }
1716 } else {
1717 let content = resp.text().await?;
1718 let entity: Option<PostPlatformRunnerError> = serde_json::from_str(&content).ok();
1719 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1720 }
1721}
1722
1723pub async fn put_platform_projects_by_project_apps_by_app_env(configuration: &configuration::Configuration, project: &str, app: &str, set_env_req: models::SetEnvReq) -> Result<models::AppView, Error<PutPlatformProjectsByProjectAppsByAppEnvError>> {
1725 let p_project = project;
1727 let p_app = app;
1728 let p_set_env_req = set_env_req;
1729
1730 let uri_str = format!("{}/v1/platform/projects/{project}/apps/{app}/env", configuration.base_path, project=crate::apis::urlencode(p_project), app=crate::apis::urlencode(p_app));
1731 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
1732
1733 if let Some(ref user_agent) = configuration.user_agent {
1734 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1735 }
1736 if let Some(ref token) = configuration.bearer_access_token {
1737 req_builder = req_builder.bearer_auth(token.to_owned());
1738 };
1739 req_builder = req_builder.json(&p_set_env_req);
1740
1741 let req = req_builder.build()?;
1742 let resp = configuration.client.execute(req).await?;
1743
1744 let status = resp.status();
1745 let content_type = resp
1746 .headers()
1747 .get("content-type")
1748 .and_then(|v| v.to_str().ok())
1749 .unwrap_or("application/octet-stream");
1750 let content_type = super::ContentType::from(content_type);
1751
1752 if !status.is_client_error() && !status.is_server_error() {
1753 let content = resp.text().await?;
1754 match content_type {
1755 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1756 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AppView`"))),
1757 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AppView`")))),
1758 }
1759 } else {
1760 let content = resp.text().await?;
1761 let entity: Option<PutPlatformProjectsByProjectAppsByAppEnvError> = serde_json::from_str(&content).ok();
1762 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1763 }
1764}
1765