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 GetDeployApplicationsError {
22 UnknownValue(serde_json::Value),
23}
24
25#[derive(Debug, Clone, Serialize, Deserialize)]
27#[serde(untagged)]
28pub enum GetDeployApplicationsByNameError {
29 UnknownValue(serde_json::Value),
30}
31
32#[derive(Debug, Clone, Serialize, Deserialize)]
34#[serde(untagged)]
35pub enum GetDeployApplicationsByNameResourceTreeError {
36 UnknownValue(serde_json::Value),
37}
38
39#[derive(Debug, Clone, Serialize, Deserialize)]
41#[serde(untagged)]
42pub enum GetDeployApplicationsByNameRevisionsByRevisionMetadataError {
43 UnknownValue(serde_json::Value),
44}
45
46#[derive(Debug, Clone, Serialize, Deserialize)]
48#[serde(untagged)]
49pub enum GetDeployApplicationsByNameSyncwindowsError {
50 UnknownValue(serde_json::Value),
51}
52
53#[derive(Debug, Clone, Serialize, Deserialize)]
55#[serde(untagged)]
56pub enum GetDeployCallbackError {
57 UnknownValue(serde_json::Value),
58}
59
60#[derive(Debug, Clone, Serialize, Deserialize)]
62#[serde(untagged)]
63pub enum GetDeployClustersError {
64 UnknownValue(serde_json::Value),
65}
66
67#[derive(Debug, Clone, Serialize, Deserialize)]
69#[serde(untagged)]
70pub enum GetDeployGitopsError {
71 UnknownValue(serde_json::Value),
72}
73
74#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(untagged)]
77pub enum GetDeployHealthError {
78 Status503(models::DeployHealth),
79 UnknownValue(serde_json::Value),
80}
81
82#[derive(Debug, Clone, Serialize, Deserialize)]
84#[serde(untagged)]
85pub enum GetDeployLoginError {
86 UnknownValue(serde_json::Value),
87}
88
89#[derive(Debug, Clone, Serialize, Deserialize)]
91#[serde(untagged)]
92pub enum GetDeployProjectsError {
93 UnknownValue(serde_json::Value),
94}
95
96#[derive(Debug, Clone, Serialize, Deserialize)]
98#[serde(untagged)]
99pub enum GetDeploySessionUserinfoError {
100 UnknownValue(serde_json::Value),
101}
102
103#[derive(Debug, Clone, Serialize, Deserialize)]
105#[serde(untagged)]
106pub enum GetDeploySettingsError {
107 UnknownValue(serde_json::Value),
108}
109
110#[derive(Debug, Clone, Serialize, Deserialize)]
112#[serde(untagged)]
113pub enum GetDeployStreamApplicationsError {
114 UnknownValue(serde_json::Value),
115}
116
117#[derive(Debug, Clone, Serialize, Deserialize)]
119#[serde(untagged)]
120pub enum GetDeployStreamApplicationsByNameResourceTreeError {
121 UnknownValue(serde_json::Value),
122}
123
124#[derive(Debug, Clone, Serialize, Deserialize)]
126#[serde(untagged)]
127pub enum GetDeployVersionError {
128 UnknownValue(serde_json::Value),
129}
130
131#[derive(Debug, Clone, Serialize, Deserialize)]
133#[serde(untagged)]
134pub enum PostDeployApplicationsByNameRollbackError {
135 UnknownValue(serde_json::Value),
136}
137
138#[derive(Debug, Clone, Serialize, Deserialize)]
140#[serde(untagged)]
141pub enum PostDeployApplicationsByNameSyncError {
142 UnknownValue(serde_json::Value),
143}
144
145#[derive(Debug, Clone, Serialize, Deserialize)]
147#[serde(untagged)]
148pub enum PostDeployLogoutError {
149 UnknownValue(serde_json::Value),
150}
151
152#[derive(Debug, Clone, Serialize, Deserialize)]
154#[serde(untagged)]
155pub enum PostDeployReconcileError {
156 UnknownValue(serde_json::Value),
157}
158
159
160pub async fn get_deploy_applications(configuration: &configuration::Configuration, ) -> Result<models::ArgoAppList, Error<GetDeployApplicationsError>> {
162
163 let uri_str = format!("{}/v1/deploy/applications", configuration.base_path);
164 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
165
166 if let Some(ref user_agent) = configuration.user_agent {
167 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
168 }
169 if let Some(ref token) = configuration.bearer_access_token {
170 req_builder = req_builder.bearer_auth(token.to_owned());
171 };
172
173 let req = req_builder.build()?;
174 let resp = configuration.client.execute(req).await?;
175
176 let status = resp.status();
177 let content_type = resp
178 .headers()
179 .get("content-type")
180 .and_then(|v| v.to_str().ok())
181 .unwrap_or("application/octet-stream");
182 let content_type = super::ContentType::from(content_type);
183
184 if !status.is_client_error() && !status.is_server_error() {
185 let content = resp.text().await?;
186 match content_type {
187 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
188 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ArgoAppList`"))),
189 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::ArgoAppList`")))),
190 }
191 } else {
192 let content = resp.text().await?;
193 let entity: Option<GetDeployApplicationsError> = serde_json::from_str(&content).ok();
194 Err(Error::ResponseError(ResponseContent { status, content, entity }))
195 }
196}
197
198pub async fn get_deploy_applications_by_name(configuration: &configuration::Configuration, name: &str) -> Result<models::ArgoApp, Error<GetDeployApplicationsByNameError>> {
200 let p_name = name;
202
203 let uri_str = format!("{}/v1/deploy/applications/{name}", configuration.base_path, name=crate::apis::urlencode(p_name));
204 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
205
206 if let Some(ref user_agent) = configuration.user_agent {
207 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
208 }
209 if let Some(ref token) = configuration.bearer_access_token {
210 req_builder = req_builder.bearer_auth(token.to_owned());
211 };
212
213 let req = req_builder.build()?;
214 let resp = configuration.client.execute(req).await?;
215
216 let status = resp.status();
217 let content_type = resp
218 .headers()
219 .get("content-type")
220 .and_then(|v| v.to_str().ok())
221 .unwrap_or("application/octet-stream");
222 let content_type = super::ContentType::from(content_type);
223
224 if !status.is_client_error() && !status.is_server_error() {
225 let content = resp.text().await?;
226 match content_type {
227 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
228 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ArgoApp`"))),
229 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::ArgoApp`")))),
230 }
231 } else {
232 let content = resp.text().await?;
233 let entity: Option<GetDeployApplicationsByNameError> = serde_json::from_str(&content).ok();
234 Err(Error::ResponseError(ResponseContent { status, content, entity }))
235 }
236}
237
238pub async fn get_deploy_applications_by_name_resource_tree(configuration: &configuration::Configuration, name: &str) -> Result<models::ArgoTree, Error<GetDeployApplicationsByNameResourceTreeError>> {
240 let p_name = name;
242
243 let uri_str = format!("{}/v1/deploy/applications/{name}/resource-tree", configuration.base_path, name=crate::apis::urlencode(p_name));
244 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
245
246 if let Some(ref user_agent) = configuration.user_agent {
247 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
248 }
249 if let Some(ref token) = configuration.bearer_access_token {
250 req_builder = req_builder.bearer_auth(token.to_owned());
251 };
252
253 let req = req_builder.build()?;
254 let resp = configuration.client.execute(req).await?;
255
256 let status = resp.status();
257 let content_type = resp
258 .headers()
259 .get("content-type")
260 .and_then(|v| v.to_str().ok())
261 .unwrap_or("application/octet-stream");
262 let content_type = super::ContentType::from(content_type);
263
264 if !status.is_client_error() && !status.is_server_error() {
265 let content = resp.text().await?;
266 match content_type {
267 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
268 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ArgoTree`"))),
269 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::ArgoTree`")))),
270 }
271 } else {
272 let content = resp.text().await?;
273 let entity: Option<GetDeployApplicationsByNameResourceTreeError> = serde_json::from_str(&content).ok();
274 Err(Error::ResponseError(ResponseContent { status, content, entity }))
275 }
276}
277
278pub async fn get_deploy_applications_by_name_revisions_by_revision_metadata(configuration: &configuration::Configuration, name: &str, revision: &str) -> Result<models::ArgoRevisionMetadata, Error<GetDeployApplicationsByNameRevisionsByRevisionMetadataError>> {
280 let p_name = name;
282 let p_revision = revision;
283
284 let uri_str = format!("{}/v1/deploy/applications/{name}/revisions/{revision}/metadata", configuration.base_path, name=crate::apis::urlencode(p_name), revision=crate::apis::urlencode(p_revision));
285 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
286
287 if let Some(ref user_agent) = configuration.user_agent {
288 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
289 }
290 if let Some(ref token) = configuration.bearer_access_token {
291 req_builder = req_builder.bearer_auth(token.to_owned());
292 };
293
294 let req = req_builder.build()?;
295 let resp = configuration.client.execute(req).await?;
296
297 let status = resp.status();
298 let content_type = resp
299 .headers()
300 .get("content-type")
301 .and_then(|v| v.to_str().ok())
302 .unwrap_or("application/octet-stream");
303 let content_type = super::ContentType::from(content_type);
304
305 if !status.is_client_error() && !status.is_server_error() {
306 let content = resp.text().await?;
307 match content_type {
308 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
309 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ArgoRevisionMetadata`"))),
310 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::ArgoRevisionMetadata`")))),
311 }
312 } else {
313 let content = resp.text().await?;
314 let entity: Option<GetDeployApplicationsByNameRevisionsByRevisionMetadataError> = serde_json::from_str(&content).ok();
315 Err(Error::ResponseError(ResponseContent { status, content, entity }))
316 }
317}
318
319pub async fn get_deploy_applications_by_name_syncwindows(configuration: &configuration::Configuration, name: &str) -> Result<models::ArgoSyncWindows, Error<GetDeployApplicationsByNameSyncwindowsError>> {
321 let p_name = name;
323
324 let uri_str = format!("{}/v1/deploy/applications/{name}/syncwindows", configuration.base_path, name=crate::apis::urlencode(p_name));
325 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
326
327 if let Some(ref user_agent) = configuration.user_agent {
328 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
329 }
330 if let Some(ref token) = configuration.bearer_access_token {
331 req_builder = req_builder.bearer_auth(token.to_owned());
332 };
333
334 let req = req_builder.build()?;
335 let resp = configuration.client.execute(req).await?;
336
337 let status = resp.status();
338 let content_type = resp
339 .headers()
340 .get("content-type")
341 .and_then(|v| v.to_str().ok())
342 .unwrap_or("application/octet-stream");
343 let content_type = super::ContentType::from(content_type);
344
345 if !status.is_client_error() && !status.is_server_error() {
346 let content = resp.text().await?;
347 match content_type {
348 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
349 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ArgoSyncWindows`"))),
350 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::ArgoSyncWindows`")))),
351 }
352 } else {
353 let content = resp.text().await?;
354 let entity: Option<GetDeployApplicationsByNameSyncwindowsError> = serde_json::from_str(&content).ok();
355 Err(Error::ResponseError(ResponseContent { status, content, entity }))
356 }
357}
358
359pub async fn get_deploy_callback(configuration: &configuration::Configuration, ) -> Result<(), Error<GetDeployCallbackError>> {
361
362 let uri_str = format!("{}/v1/deploy/callback", configuration.base_path);
363 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
364
365 if let Some(ref user_agent) = configuration.user_agent {
366 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
367 }
368 if let Some(ref token) = configuration.bearer_access_token {
369 req_builder = req_builder.bearer_auth(token.to_owned());
370 };
371
372 let req = req_builder.build()?;
373 let resp = configuration.client.execute(req).await?;
374
375 let status = resp.status();
376
377 if !status.is_client_error() && !status.is_server_error() {
378 Ok(())
379 } else {
380 let content = resp.text().await?;
381 let entity: Option<GetDeployCallbackError> = serde_json::from_str(&content).ok();
382 Err(Error::ResponseError(ResponseContent { status, content, entity }))
383 }
384}
385
386pub async fn get_deploy_clusters(configuration: &configuration::Configuration, ) -> Result<models::ArgoClusterList, Error<GetDeployClustersError>> {
388
389 let uri_str = format!("{}/v1/deploy/clusters", configuration.base_path);
390 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
391
392 if let Some(ref user_agent) = configuration.user_agent {
393 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
394 }
395 if let Some(ref token) = configuration.bearer_access_token {
396 req_builder = req_builder.bearer_auth(token.to_owned());
397 };
398
399 let req = req_builder.build()?;
400 let resp = configuration.client.execute(req).await?;
401
402 let status = resp.status();
403 let content_type = resp
404 .headers()
405 .get("content-type")
406 .and_then(|v| v.to_str().ok())
407 .unwrap_or("application/octet-stream");
408 let content_type = super::ContentType::from(content_type);
409
410 if !status.is_client_error() && !status.is_server_error() {
411 let content = resp.text().await?;
412 match content_type {
413 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
414 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ArgoClusterList`"))),
415 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::ArgoClusterList`")))),
416 }
417 } else {
418 let content = resp.text().await?;
419 let entity: Option<GetDeployClustersError> = serde_json::from_str(&content).ok();
420 Err(Error::ResponseError(ResponseContent { status, content, entity }))
421 }
422}
423
424pub async fn get_deploy_gitops(configuration: &configuration::Configuration, ) -> Result<models::GitOpsPlane, Error<GetDeployGitopsError>> {
426
427 let uri_str = format!("{}/v1/deploy/gitops", configuration.base_path);
428 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
429
430 if let Some(ref user_agent) = configuration.user_agent {
431 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
432 }
433 if let Some(ref token) = configuration.bearer_access_token {
434 req_builder = req_builder.bearer_auth(token.to_owned());
435 };
436
437 let req = req_builder.build()?;
438 let resp = configuration.client.execute(req).await?;
439
440 let status = resp.status();
441 let content_type = resp
442 .headers()
443 .get("content-type")
444 .and_then(|v| v.to_str().ok())
445 .unwrap_or("application/octet-stream");
446 let content_type = super::ContentType::from(content_type);
447
448 if !status.is_client_error() && !status.is_server_error() {
449 let content = resp.text().await?;
450 match content_type {
451 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
452 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GitOpsPlane`"))),
453 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::GitOpsPlane`")))),
454 }
455 } else {
456 let content = resp.text().await?;
457 let entity: Option<GetDeployGitopsError> = serde_json::from_str(&content).ok();
458 Err(Error::ResponseError(ResponseContent { status, content, entity }))
459 }
460}
461
462pub async fn get_deploy_health(configuration: &configuration::Configuration, ) -> Result<models::DeployHealth, Error<GetDeployHealthError>> {
464
465 let uri_str = format!("{}/v1/deploy/health", configuration.base_path);
466 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
467
468 if let Some(ref user_agent) = configuration.user_agent {
469 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
470 }
471 if let Some(ref token) = configuration.bearer_access_token {
472 req_builder = req_builder.bearer_auth(token.to_owned());
473 };
474
475 let req = req_builder.build()?;
476 let resp = configuration.client.execute(req).await?;
477
478 let status = resp.status();
479 let content_type = resp
480 .headers()
481 .get("content-type")
482 .and_then(|v| v.to_str().ok())
483 .unwrap_or("application/octet-stream");
484 let content_type = super::ContentType::from(content_type);
485
486 if !status.is_client_error() && !status.is_server_error() {
487 let content = resp.text().await?;
488 match content_type {
489 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
490 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DeployHealth`"))),
491 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::DeployHealth`")))),
492 }
493 } else {
494 let content = resp.text().await?;
495 let entity: Option<GetDeployHealthError> = serde_json::from_str(&content).ok();
496 Err(Error::ResponseError(ResponseContent { status, content, entity }))
497 }
498}
499
500pub async fn get_deploy_login(configuration: &configuration::Configuration, ) -> Result<(), Error<GetDeployLoginError>> {
502
503 let uri_str = format!("{}/v1/deploy/login", configuration.base_path);
504 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
505
506 if let Some(ref user_agent) = configuration.user_agent {
507 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
508 }
509 if let Some(ref token) = configuration.bearer_access_token {
510 req_builder = req_builder.bearer_auth(token.to_owned());
511 };
512
513 let req = req_builder.build()?;
514 let resp = configuration.client.execute(req).await?;
515
516 let status = resp.status();
517
518 if !status.is_client_error() && !status.is_server_error() {
519 Ok(())
520 } else {
521 let content = resp.text().await?;
522 let entity: Option<GetDeployLoginError> = serde_json::from_str(&content).ok();
523 Err(Error::ResponseError(ResponseContent { status, content, entity }))
524 }
525}
526
527pub async fn get_deploy_projects(configuration: &configuration::Configuration, ) -> Result<models::ArgoProjectList, Error<GetDeployProjectsError>> {
529
530 let uri_str = format!("{}/v1/deploy/projects", configuration.base_path);
531 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
532
533 if let Some(ref user_agent) = configuration.user_agent {
534 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
535 }
536 if let Some(ref token) = configuration.bearer_access_token {
537 req_builder = req_builder.bearer_auth(token.to_owned());
538 };
539
540 let req = req_builder.build()?;
541 let resp = configuration.client.execute(req).await?;
542
543 let status = resp.status();
544 let content_type = resp
545 .headers()
546 .get("content-type")
547 .and_then(|v| v.to_str().ok())
548 .unwrap_or("application/octet-stream");
549 let content_type = super::ContentType::from(content_type);
550
551 if !status.is_client_error() && !status.is_server_error() {
552 let content = resp.text().await?;
553 match content_type {
554 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
555 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ArgoProjectList`"))),
556 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::ArgoProjectList`")))),
557 }
558 } else {
559 let content = resp.text().await?;
560 let entity: Option<GetDeployProjectsError> = serde_json::from_str(&content).ok();
561 Err(Error::ResponseError(ResponseContent { status, content, entity }))
562 }
563}
564
565pub async fn get_deploy_session_userinfo(configuration: &configuration::Configuration, ) -> Result<models::SessionUser, Error<GetDeploySessionUserinfoError>> {
567
568 let uri_str = format!("{}/v1/deploy/session/userinfo", configuration.base_path);
569 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
570
571 if let Some(ref user_agent) = configuration.user_agent {
572 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
573 }
574 if let Some(ref token) = configuration.bearer_access_token {
575 req_builder = req_builder.bearer_auth(token.to_owned());
576 };
577
578 let req = req_builder.build()?;
579 let resp = configuration.client.execute(req).await?;
580
581 let status = resp.status();
582 let content_type = resp
583 .headers()
584 .get("content-type")
585 .and_then(|v| v.to_str().ok())
586 .unwrap_or("application/octet-stream");
587 let content_type = super::ContentType::from(content_type);
588
589 if !status.is_client_error() && !status.is_server_error() {
590 let content = resp.text().await?;
591 match content_type {
592 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
593 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SessionUser`"))),
594 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::SessionUser`")))),
595 }
596 } else {
597 let content = resp.text().await?;
598 let entity: Option<GetDeploySessionUserinfoError> = serde_json::from_str(&content).ok();
599 Err(Error::ResponseError(ResponseContent { status, content, entity }))
600 }
601}
602
603pub async fn get_deploy_settings(configuration: &configuration::Configuration, ) -> Result<models::ConsoleSettings, Error<GetDeploySettingsError>> {
605
606 let uri_str = format!("{}/v1/deploy/settings", configuration.base_path);
607 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
608
609 if let Some(ref user_agent) = configuration.user_agent {
610 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
611 }
612 if let Some(ref token) = configuration.bearer_access_token {
613 req_builder = req_builder.bearer_auth(token.to_owned());
614 };
615
616 let req = req_builder.build()?;
617 let resp = configuration.client.execute(req).await?;
618
619 let status = resp.status();
620 let content_type = resp
621 .headers()
622 .get("content-type")
623 .and_then(|v| v.to_str().ok())
624 .unwrap_or("application/octet-stream");
625 let content_type = super::ContentType::from(content_type);
626
627 if !status.is_client_error() && !status.is_server_error() {
628 let content = resp.text().await?;
629 match content_type {
630 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
631 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConsoleSettings`"))),
632 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::ConsoleSettings`")))),
633 }
634 } else {
635 let content = resp.text().await?;
636 let entity: Option<GetDeploySettingsError> = serde_json::from_str(&content).ok();
637 Err(Error::ResponseError(ResponseContent { status, content, entity }))
638 }
639}
640
641pub async fn get_deploy_stream_applications(configuration: &configuration::Configuration, ) -> Result<(), Error<GetDeployStreamApplicationsError>> {
643
644 let uri_str = format!("{}/v1/deploy/stream/applications", configuration.base_path);
645 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
646
647 if let Some(ref user_agent) = configuration.user_agent {
648 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
649 }
650 if let Some(ref token) = configuration.bearer_access_token {
651 req_builder = req_builder.bearer_auth(token.to_owned());
652 };
653
654 let req = req_builder.build()?;
655 let resp = configuration.client.execute(req).await?;
656
657 let status = resp.status();
658
659 if !status.is_client_error() && !status.is_server_error() {
660 Ok(())
661 } else {
662 let content = resp.text().await?;
663 let entity: Option<GetDeployStreamApplicationsError> = serde_json::from_str(&content).ok();
664 Err(Error::ResponseError(ResponseContent { status, content, entity }))
665 }
666}
667
668pub async fn get_deploy_stream_applications_by_name_resource_tree(configuration: &configuration::Configuration, name: &str) -> Result<(), Error<GetDeployStreamApplicationsByNameResourceTreeError>> {
670 let p_name = name;
672
673 let uri_str = format!("{}/v1/deploy/stream/applications/{name}/resource-tree", configuration.base_path, name=crate::apis::urlencode(p_name));
674 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
675
676 if let Some(ref user_agent) = configuration.user_agent {
677 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
678 }
679 if let Some(ref token) = configuration.bearer_access_token {
680 req_builder = req_builder.bearer_auth(token.to_owned());
681 };
682
683 let req = req_builder.build()?;
684 let resp = configuration.client.execute(req).await?;
685
686 let status = resp.status();
687
688 if !status.is_client_error() && !status.is_server_error() {
689 Ok(())
690 } else {
691 let content = resp.text().await?;
692 let entity: Option<GetDeployStreamApplicationsByNameResourceTreeError> = serde_json::from_str(&content).ok();
693 Err(Error::ResponseError(ResponseContent { status, content, entity }))
694 }
695}
696
697pub async fn get_deploy_version(configuration: &configuration::Configuration, ) -> Result<models::VersionMessage, Error<GetDeployVersionError>> {
699
700 let uri_str = format!("{}/v1/deploy/version", configuration.base_path);
701 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
702
703 if let Some(ref user_agent) = configuration.user_agent {
704 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
705 }
706 if let Some(ref token) = configuration.bearer_access_token {
707 req_builder = req_builder.bearer_auth(token.to_owned());
708 };
709
710 let req = req_builder.build()?;
711 let resp = configuration.client.execute(req).await?;
712
713 let status = resp.status();
714 let content_type = resp
715 .headers()
716 .get("content-type")
717 .and_then(|v| v.to_str().ok())
718 .unwrap_or("application/octet-stream");
719 let content_type = super::ContentType::from(content_type);
720
721 if !status.is_client_error() && !status.is_server_error() {
722 let content = resp.text().await?;
723 match content_type {
724 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
725 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::VersionMessage`"))),
726 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::VersionMessage`")))),
727 }
728 } else {
729 let content = resp.text().await?;
730 let entity: Option<GetDeployVersionError> = serde_json::from_str(&content).ok();
731 Err(Error::ResponseError(ResponseContent { status, content, entity }))
732 }
733}
734
735pub async fn post_deploy_applications_by_name_rollback(configuration: &configuration::Configuration, name: &str) -> Result<models::ArgoApp, Error<PostDeployApplicationsByNameRollbackError>> {
737 let p_name = name;
739
740 let uri_str = format!("{}/v1/deploy/applications/{name}/rollback", configuration.base_path, name=crate::apis::urlencode(p_name));
741 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
742
743 if let Some(ref user_agent) = configuration.user_agent {
744 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
745 }
746 if let Some(ref token) = configuration.bearer_access_token {
747 req_builder = req_builder.bearer_auth(token.to_owned());
748 };
749
750 let req = req_builder.build()?;
751 let resp = configuration.client.execute(req).await?;
752
753 let status = resp.status();
754 let content_type = resp
755 .headers()
756 .get("content-type")
757 .and_then(|v| v.to_str().ok())
758 .unwrap_or("application/octet-stream");
759 let content_type = super::ContentType::from(content_type);
760
761 if !status.is_client_error() && !status.is_server_error() {
762 let content = resp.text().await?;
763 match content_type {
764 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
765 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ArgoApp`"))),
766 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::ArgoApp`")))),
767 }
768 } else {
769 let content = resp.text().await?;
770 let entity: Option<PostDeployApplicationsByNameRollbackError> = serde_json::from_str(&content).ok();
771 Err(Error::ResponseError(ResponseContent { status, content, entity }))
772 }
773}
774
775pub async fn post_deploy_applications_by_name_sync(configuration: &configuration::Configuration, name: &str) -> Result<models::ArgoApp, Error<PostDeployApplicationsByNameSyncError>> {
777 let p_name = name;
779
780 let uri_str = format!("{}/v1/deploy/applications/{name}/sync", configuration.base_path, name=crate::apis::urlencode(p_name));
781 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
782
783 if let Some(ref user_agent) = configuration.user_agent {
784 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
785 }
786 if let Some(ref token) = configuration.bearer_access_token {
787 req_builder = req_builder.bearer_auth(token.to_owned());
788 };
789
790 let req = req_builder.build()?;
791 let resp = configuration.client.execute(req).await?;
792
793 let status = resp.status();
794 let content_type = resp
795 .headers()
796 .get("content-type")
797 .and_then(|v| v.to_str().ok())
798 .unwrap_or("application/octet-stream");
799 let content_type = super::ContentType::from(content_type);
800
801 if !status.is_client_error() && !status.is_server_error() {
802 let content = resp.text().await?;
803 match content_type {
804 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
805 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ArgoApp`"))),
806 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::ArgoApp`")))),
807 }
808 } else {
809 let content = resp.text().await?;
810 let entity: Option<PostDeployApplicationsByNameSyncError> = serde_json::from_str(&content).ok();
811 Err(Error::ResponseError(ResponseContent { status, content, entity }))
812 }
813}
814
815pub async fn post_deploy_logout(configuration: &configuration::Configuration, ) -> Result<models::SessionEnded, Error<PostDeployLogoutError>> {
817
818 let uri_str = format!("{}/v1/deploy/logout", configuration.base_path);
819 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
820
821 if let Some(ref user_agent) = configuration.user_agent {
822 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
823 }
824 if let Some(ref token) = configuration.bearer_access_token {
825 req_builder = req_builder.bearer_auth(token.to_owned());
826 };
827
828 let req = req_builder.build()?;
829 let resp = configuration.client.execute(req).await?;
830
831 let status = resp.status();
832 let content_type = resp
833 .headers()
834 .get("content-type")
835 .and_then(|v| v.to_str().ok())
836 .unwrap_or("application/octet-stream");
837 let content_type = super::ContentType::from(content_type);
838
839 if !status.is_client_error() && !status.is_server_error() {
840 let content = resp.text().await?;
841 match content_type {
842 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
843 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SessionEnded`"))),
844 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::SessionEnded`")))),
845 }
846 } else {
847 let content = resp.text().await?;
848 let entity: Option<PostDeployLogoutError> = serde_json::from_str(&content).ok();
849 Err(Error::ResponseError(ResponseContent { status, content, entity }))
850 }
851}
852
853pub async fn post_deploy_reconcile(configuration: &configuration::Configuration, ) -> Result<models::ReconcileReport, Error<PostDeployReconcileError>> {
855
856 let uri_str = format!("{}/v1/deploy/reconcile", configuration.base_path);
857 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
858
859 if let Some(ref user_agent) = configuration.user_agent {
860 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
861 }
862 if let Some(ref token) = configuration.bearer_access_token {
863 req_builder = req_builder.bearer_auth(token.to_owned());
864 };
865
866 let req = req_builder.build()?;
867 let resp = configuration.client.execute(req).await?;
868
869 let status = resp.status();
870 let content_type = resp
871 .headers()
872 .get("content-type")
873 .and_then(|v| v.to_str().ok())
874 .unwrap_or("application/octet-stream");
875 let content_type = super::ContentType::from(content_type);
876
877 if !status.is_client_error() && !status.is_server_error() {
878 let content = resp.text().await?;
879 match content_type {
880 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
881 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ReconcileReport`"))),
882 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::ReconcileReport`")))),
883 }
884 } else {
885 let content = resp.text().await?;
886 let entity: Option<PostDeployReconcileError> = serde_json::from_str(&content).ok();
887 Err(Error::ResponseError(ResponseContent { status, content, entity }))
888 }
889}
890