1use super::{configuration, ContentType, Error};
12use crate::{apis::ResponseContent, models};
13use reqwest;
14use serde::{de::Error as _, Deserialize, Serialize};
15
16#[derive(Debug, Clone, Serialize, Deserialize)]
18#[serde(untagged)]
19pub enum OutpostsInstancesCreateError {
20 Status400(models::ValidationError),
21 Status403(models::GenericError),
22 UnknownValue(serde_json::Value),
23}
24
25#[derive(Debug, Clone, Serialize, Deserialize)]
27#[serde(untagged)]
28pub enum OutpostsInstancesDefaultSettingsRetrieveError {
29 Status400(models::ValidationError),
30 Status403(models::GenericError),
31 UnknownValue(serde_json::Value),
32}
33
34#[derive(Debug, Clone, Serialize, Deserialize)]
36#[serde(untagged)]
37pub enum OutpostsInstancesDestroyError {
38 Status400(models::ValidationError),
39 Status403(models::GenericError),
40 UnknownValue(serde_json::Value),
41}
42
43#[derive(Debug, Clone, Serialize, Deserialize)]
45#[serde(untagged)]
46pub enum OutpostsInstancesHealthListError {
47 Status400(models::ValidationError),
48 Status403(models::GenericError),
49 UnknownValue(serde_json::Value),
50}
51
52#[derive(Debug, Clone, Serialize, Deserialize)]
54#[serde(untagged)]
55pub enum OutpostsInstancesListError {
56 Status400(models::ValidationError),
57 Status403(models::GenericError),
58 UnknownValue(serde_json::Value),
59}
60
61#[derive(Debug, Clone, Serialize, Deserialize)]
63#[serde(untagged)]
64pub enum OutpostsInstancesPartialUpdateError {
65 Status400(models::ValidationError),
66 Status403(models::GenericError),
67 UnknownValue(serde_json::Value),
68}
69
70#[derive(Debug, Clone, Serialize, Deserialize)]
72#[serde(untagged)]
73pub enum OutpostsInstancesRetrieveError {
74 Status400(models::ValidationError),
75 Status403(models::GenericError),
76 UnknownValue(serde_json::Value),
77}
78
79#[derive(Debug, Clone, Serialize, Deserialize)]
81#[serde(untagged)]
82pub enum OutpostsInstancesUpdateError {
83 Status400(models::ValidationError),
84 Status403(models::GenericError),
85 UnknownValue(serde_json::Value),
86}
87
88#[derive(Debug, Clone, Serialize, Deserialize)]
90#[serde(untagged)]
91pub enum OutpostsInstancesUsedByListError {
92 Status400(models::ValidationError),
93 Status403(models::GenericError),
94 UnknownValue(serde_json::Value),
95}
96
97#[derive(Debug, Clone, Serialize, Deserialize)]
99#[serde(untagged)]
100pub enum OutpostsLdapAccessCheckError {
101 Status400(models::ValidationError),
102 Status403(models::GenericError),
103 UnknownValue(serde_json::Value),
104}
105
106#[derive(Debug, Clone, Serialize, Deserialize)]
108#[serde(untagged)]
109pub enum OutpostsLdapListError {
110 Status400(models::ValidationError),
111 Status403(models::GenericError),
112 UnknownValue(serde_json::Value),
113}
114
115#[derive(Debug, Clone, Serialize, Deserialize)]
117#[serde(untagged)]
118pub enum OutpostsProxyListError {
119 Status400(models::ValidationError),
120 Status403(models::GenericError),
121 UnknownValue(serde_json::Value),
122}
123
124#[derive(Debug, Clone, Serialize, Deserialize)]
126#[serde(untagged)]
127pub enum OutpostsRadiusAccessCheckError {
128 Status400(models::ValidationError),
129 Status403(models::GenericError),
130 UnknownValue(serde_json::Value),
131}
132
133#[derive(Debug, Clone, Serialize, Deserialize)]
135#[serde(untagged)]
136pub enum OutpostsRadiusListError {
137 Status400(models::ValidationError),
138 Status403(models::GenericError),
139 UnknownValue(serde_json::Value),
140}
141
142#[derive(Debug, Clone, Serialize, Deserialize)]
144#[serde(untagged)]
145pub enum OutpostsServiceConnectionsAllDestroyError {
146 Status400(models::ValidationError),
147 Status403(models::GenericError),
148 UnknownValue(serde_json::Value),
149}
150
151#[derive(Debug, Clone, Serialize, Deserialize)]
153#[serde(untagged)]
154pub enum OutpostsServiceConnectionsAllListError {
155 Status400(models::ValidationError),
156 Status403(models::GenericError),
157 UnknownValue(serde_json::Value),
158}
159
160#[derive(Debug, Clone, Serialize, Deserialize)]
162#[serde(untagged)]
163pub enum OutpostsServiceConnectionsAllRetrieveError {
164 Status400(models::ValidationError),
165 Status403(models::GenericError),
166 UnknownValue(serde_json::Value),
167}
168
169#[derive(Debug, Clone, Serialize, Deserialize)]
171#[serde(untagged)]
172pub enum OutpostsServiceConnectionsAllStateRetrieveError {
173 Status400(models::ValidationError),
174 Status403(models::GenericError),
175 UnknownValue(serde_json::Value),
176}
177
178#[derive(Debug, Clone, Serialize, Deserialize)]
180#[serde(untagged)]
181pub enum OutpostsServiceConnectionsAllTypesListError {
182 Status400(models::ValidationError),
183 Status403(models::GenericError),
184 UnknownValue(serde_json::Value),
185}
186
187#[derive(Debug, Clone, Serialize, Deserialize)]
189#[serde(untagged)]
190pub enum OutpostsServiceConnectionsAllUsedByListError {
191 Status400(models::ValidationError),
192 Status403(models::GenericError),
193 UnknownValue(serde_json::Value),
194}
195
196#[derive(Debug, Clone, Serialize, Deserialize)]
198#[serde(untagged)]
199pub enum OutpostsServiceConnectionsDockerCreateError {
200 Status400(models::ValidationError),
201 Status403(models::GenericError),
202 UnknownValue(serde_json::Value),
203}
204
205#[derive(Debug, Clone, Serialize, Deserialize)]
207#[serde(untagged)]
208pub enum OutpostsServiceConnectionsDockerDestroyError {
209 Status400(models::ValidationError),
210 Status403(models::GenericError),
211 UnknownValue(serde_json::Value),
212}
213
214#[derive(Debug, Clone, Serialize, Deserialize)]
216#[serde(untagged)]
217pub enum OutpostsServiceConnectionsDockerListError {
218 Status400(models::ValidationError),
219 Status403(models::GenericError),
220 UnknownValue(serde_json::Value),
221}
222
223#[derive(Debug, Clone, Serialize, Deserialize)]
225#[serde(untagged)]
226pub enum OutpostsServiceConnectionsDockerPartialUpdateError {
227 Status400(models::ValidationError),
228 Status403(models::GenericError),
229 UnknownValue(serde_json::Value),
230}
231
232#[derive(Debug, Clone, Serialize, Deserialize)]
234#[serde(untagged)]
235pub enum OutpostsServiceConnectionsDockerRetrieveError {
236 Status400(models::ValidationError),
237 Status403(models::GenericError),
238 UnknownValue(serde_json::Value),
239}
240
241#[derive(Debug, Clone, Serialize, Deserialize)]
243#[serde(untagged)]
244pub enum OutpostsServiceConnectionsDockerUpdateError {
245 Status400(models::ValidationError),
246 Status403(models::GenericError),
247 UnknownValue(serde_json::Value),
248}
249
250#[derive(Debug, Clone, Serialize, Deserialize)]
252#[serde(untagged)]
253pub enum OutpostsServiceConnectionsDockerUsedByListError {
254 Status400(models::ValidationError),
255 Status403(models::GenericError),
256 UnknownValue(serde_json::Value),
257}
258
259#[derive(Debug, Clone, Serialize, Deserialize)]
261#[serde(untagged)]
262pub enum OutpostsServiceConnectionsKubernetesCreateError {
263 Status400(models::ValidationError),
264 Status403(models::GenericError),
265 UnknownValue(serde_json::Value),
266}
267
268#[derive(Debug, Clone, Serialize, Deserialize)]
270#[serde(untagged)]
271pub enum OutpostsServiceConnectionsKubernetesDestroyError {
272 Status400(models::ValidationError),
273 Status403(models::GenericError),
274 UnknownValue(serde_json::Value),
275}
276
277#[derive(Debug, Clone, Serialize, Deserialize)]
279#[serde(untagged)]
280pub enum OutpostsServiceConnectionsKubernetesListError {
281 Status400(models::ValidationError),
282 Status403(models::GenericError),
283 UnknownValue(serde_json::Value),
284}
285
286#[derive(Debug, Clone, Serialize, Deserialize)]
288#[serde(untagged)]
289pub enum OutpostsServiceConnectionsKubernetesPartialUpdateError {
290 Status400(models::ValidationError),
291 Status403(models::GenericError),
292 UnknownValue(serde_json::Value),
293}
294
295#[derive(Debug, Clone, Serialize, Deserialize)]
297#[serde(untagged)]
298pub enum OutpostsServiceConnectionsKubernetesRetrieveError {
299 Status400(models::ValidationError),
300 Status403(models::GenericError),
301 UnknownValue(serde_json::Value),
302}
303
304#[derive(Debug, Clone, Serialize, Deserialize)]
306#[serde(untagged)]
307pub enum OutpostsServiceConnectionsKubernetesUpdateError {
308 Status400(models::ValidationError),
309 Status403(models::GenericError),
310 UnknownValue(serde_json::Value),
311}
312
313#[derive(Debug, Clone, Serialize, Deserialize)]
315#[serde(untagged)]
316pub enum OutpostsServiceConnectionsKubernetesUsedByListError {
317 Status400(models::ValidationError),
318 Status403(models::GenericError),
319 UnknownValue(serde_json::Value),
320}
321
322pub async fn outposts_instances_create(
324 configuration: &configuration::Configuration,
325 outpost_request: models::OutpostRequest,
326) -> Result<models::Outpost, Error<OutpostsInstancesCreateError>> {
327 let p_body_outpost_request = outpost_request;
329
330 let uri_str = format!("{}/outposts/instances/", configuration.base_path);
331 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
332
333 if let Some(ref user_agent) = configuration.user_agent {
334 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
335 }
336 if let Some(ref token) = configuration.bearer_access_token {
337 req_builder = req_builder.bearer_auth(token.to_owned());
338 };
339 req_builder = req_builder.json(&p_body_outpost_request);
340
341 let req = req_builder.build()?;
342 let resp = configuration.client.execute(req).await?;
343
344 let status = resp.status();
345 let content_type = resp
346 .headers()
347 .get("content-type")
348 .and_then(|v| v.to_str().ok())
349 .unwrap_or("application/octet-stream");
350 let content_type = super::ContentType::from(content_type);
351
352 if !status.is_client_error() && !status.is_server_error() {
353 let content = resp.text().await?;
354 match content_type {
355 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
356 ContentType::Text => {
357 return Err(Error::from(serde_json::Error::custom(
358 "Received `text/plain` content type response that cannot be converted to `models::Outpost`",
359 )))
360 }
361 ContentType::Unsupported(unknown_type) => {
362 return Err(Error::from(serde_json::Error::custom(format!(
363 "Received `{unknown_type}` content type response that cannot be converted to `models::Outpost`"
364 ))))
365 }
366 }
367 } else {
368 let content = resp.text().await?;
369 let entity: Option<OutpostsInstancesCreateError> = serde_json::from_str(&content).ok();
370 Err(Error::ResponseError(ResponseContent {
371 status,
372 content,
373 entity,
374 }))
375 }
376}
377
378pub async fn outposts_instances_default_settings_retrieve(
380 configuration: &configuration::Configuration,
381) -> Result<models::OutpostDefaultConfig, Error<OutpostsInstancesDefaultSettingsRetrieveError>> {
382 let uri_str = format!("{}/outposts/instances/default_settings/", configuration.base_path);
383 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
384
385 if let Some(ref user_agent) = configuration.user_agent {
386 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
387 }
388 if let Some(ref token) = configuration.bearer_access_token {
389 req_builder = req_builder.bearer_auth(token.to_owned());
390 };
391
392 let req = req_builder.build()?;
393 let resp = configuration.client.execute(req).await?;
394
395 let status = resp.status();
396 let content_type = resp
397 .headers()
398 .get("content-type")
399 .and_then(|v| v.to_str().ok())
400 .unwrap_or("application/octet-stream");
401 let content_type = super::ContentType::from(content_type);
402
403 if !status.is_client_error() && !status.is_server_error() {
404 let content = resp.text().await?;
405 match content_type {
406 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
407 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OutpostDefaultConfig`"))),
408 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::OutpostDefaultConfig`")))),
409 }
410 } else {
411 let content = resp.text().await?;
412 let entity: Option<OutpostsInstancesDefaultSettingsRetrieveError> = serde_json::from_str(&content).ok();
413 Err(Error::ResponseError(ResponseContent {
414 status,
415 content,
416 entity,
417 }))
418 }
419}
420
421pub async fn outposts_instances_destroy(
423 configuration: &configuration::Configuration,
424 uuid: &str,
425) -> Result<(), Error<OutpostsInstancesDestroyError>> {
426 let p_path_uuid = uuid;
428
429 let uri_str = format!(
430 "{}/outposts/instances/{uuid}/",
431 configuration.base_path,
432 uuid = crate::apis::urlencode(p_path_uuid)
433 );
434 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
435
436 if let Some(ref user_agent) = configuration.user_agent {
437 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
438 }
439 if let Some(ref token) = configuration.bearer_access_token {
440 req_builder = req_builder.bearer_auth(token.to_owned());
441 };
442
443 let req = req_builder.build()?;
444 let resp = configuration.client.execute(req).await?;
445
446 let status = resp.status();
447
448 if !status.is_client_error() && !status.is_server_error() {
449 Ok(())
450 } else {
451 let content = resp.text().await?;
452 let entity: Option<OutpostsInstancesDestroyError> = serde_json::from_str(&content).ok();
453 Err(Error::ResponseError(ResponseContent {
454 status,
455 content,
456 entity,
457 }))
458 }
459}
460
461pub async fn outposts_instances_health_list(
463 configuration: &configuration::Configuration,
464 uuid: &str,
465 managed__icontains: Option<&str>,
466 managed__iexact: Option<&str>,
467 name__icontains: Option<&str>,
468 name__iexact: Option<&str>,
469 ordering: Option<&str>,
470 providers__isnull: Option<bool>,
471 providers_by_pk: Option<Vec<i32>>,
472 search: Option<&str>,
473 service_connection__name__icontains: Option<&str>,
474 service_connection__name__iexact: Option<&str>,
475) -> Result<Vec<models::OutpostHealth>, Error<OutpostsInstancesHealthListError>> {
476 let p_path_uuid = uuid;
478 let p_query_managed__icontains = managed__icontains;
479 let p_query_managed__iexact = managed__iexact;
480 let p_query_name__icontains = name__icontains;
481 let p_query_name__iexact = name__iexact;
482 let p_query_ordering = ordering;
483 let p_query_providers__isnull = providers__isnull;
484 let p_query_providers_by_pk = providers_by_pk;
485 let p_query_search = search;
486 let p_query_service_connection__name__icontains = service_connection__name__icontains;
487 let p_query_service_connection__name__iexact = service_connection__name__iexact;
488
489 let uri_str = format!(
490 "{}/outposts/instances/{uuid}/health/",
491 configuration.base_path,
492 uuid = crate::apis::urlencode(p_path_uuid)
493 );
494 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
495
496 if let Some(ref param_value) = p_query_managed__icontains {
497 req_builder = req_builder.query(&[("managed__icontains", ¶m_value.to_string())]);
498 }
499 if let Some(ref param_value) = p_query_managed__iexact {
500 req_builder = req_builder.query(&[("managed__iexact", ¶m_value.to_string())]);
501 }
502 if let Some(ref param_value) = p_query_name__icontains {
503 req_builder = req_builder.query(&[("name__icontains", ¶m_value.to_string())]);
504 }
505 if let Some(ref param_value) = p_query_name__iexact {
506 req_builder = req_builder.query(&[("name__iexact", ¶m_value.to_string())]);
507 }
508 if let Some(ref param_value) = p_query_ordering {
509 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
510 }
511 if let Some(ref param_value) = p_query_providers__isnull {
512 req_builder = req_builder.query(&[("providers__isnull", ¶m_value.to_string())]);
513 }
514 if let Some(ref param_value) = p_query_providers_by_pk {
515 req_builder = match "multi" {
516 "multi" => req_builder.query(
517 ¶m_value
518 .into_iter()
519 .map(|p| ("providers_by_pk".to_owned(), p.to_string()))
520 .collect::<Vec<(std::string::String, std::string::String)>>(),
521 ),
522 _ => req_builder.query(&[(
523 "providers_by_pk",
524 ¶m_value
525 .into_iter()
526 .map(|p| p.to_string())
527 .collect::<Vec<String>>()
528 .join(",")
529 .to_string(),
530 )]),
531 };
532 }
533 if let Some(ref param_value) = p_query_search {
534 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
535 }
536 if let Some(ref param_value) = p_query_service_connection__name__icontains {
537 req_builder = req_builder.query(&[("service_connection__name__icontains", ¶m_value.to_string())]);
538 }
539 if let Some(ref param_value) = p_query_service_connection__name__iexact {
540 req_builder = req_builder.query(&[("service_connection__name__iexact", ¶m_value.to_string())]);
541 }
542 if let Some(ref user_agent) = configuration.user_agent {
543 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
544 }
545 if let Some(ref token) = configuration.bearer_access_token {
546 req_builder = req_builder.bearer_auth(token.to_owned());
547 };
548
549 let req = req_builder.build()?;
550 let resp = configuration.client.execute(req).await?;
551
552 let status = resp.status();
553 let content_type = resp
554 .headers()
555 .get("content-type")
556 .and_then(|v| v.to_str().ok())
557 .unwrap_or("application/octet-stream");
558 let content_type = super::ContentType::from(content_type);
559
560 if !status.is_client_error() && !status.is_server_error() {
561 let content = resp.text().await?;
562 match content_type {
563 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
564 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::OutpostHealth>`"))),
565 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::OutpostHealth>`")))),
566 }
567 } else {
568 let content = resp.text().await?;
569 let entity: Option<OutpostsInstancesHealthListError> = serde_json::from_str(&content).ok();
570 Err(Error::ResponseError(ResponseContent {
571 status,
572 content,
573 entity,
574 }))
575 }
576}
577
578pub async fn outposts_instances_list(
580 configuration: &configuration::Configuration,
581 managed__icontains: Option<&str>,
582 managed__iexact: Option<&str>,
583 name__icontains: Option<&str>,
584 name__iexact: Option<&str>,
585 ordering: Option<&str>,
586 page: Option<i32>,
587 page_size: Option<i32>,
588 providers__isnull: Option<bool>,
589 providers_by_pk: Option<Vec<i32>>,
590 search: Option<&str>,
591 service_connection__name__icontains: Option<&str>,
592 service_connection__name__iexact: Option<&str>,
593) -> Result<models::PaginatedOutpostList, Error<OutpostsInstancesListError>> {
594 let p_query_managed__icontains = managed__icontains;
596 let p_query_managed__iexact = managed__iexact;
597 let p_query_name__icontains = name__icontains;
598 let p_query_name__iexact = name__iexact;
599 let p_query_ordering = ordering;
600 let p_query_page = page;
601 let p_query_page_size = page_size;
602 let p_query_providers__isnull = providers__isnull;
603 let p_query_providers_by_pk = providers_by_pk;
604 let p_query_search = search;
605 let p_query_service_connection__name__icontains = service_connection__name__icontains;
606 let p_query_service_connection__name__iexact = service_connection__name__iexact;
607
608 let uri_str = format!("{}/outposts/instances/", configuration.base_path);
609 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
610
611 if let Some(ref param_value) = p_query_managed__icontains {
612 req_builder = req_builder.query(&[("managed__icontains", ¶m_value.to_string())]);
613 }
614 if let Some(ref param_value) = p_query_managed__iexact {
615 req_builder = req_builder.query(&[("managed__iexact", ¶m_value.to_string())]);
616 }
617 if let Some(ref param_value) = p_query_name__icontains {
618 req_builder = req_builder.query(&[("name__icontains", ¶m_value.to_string())]);
619 }
620 if let Some(ref param_value) = p_query_name__iexact {
621 req_builder = req_builder.query(&[("name__iexact", ¶m_value.to_string())]);
622 }
623 if let Some(ref param_value) = p_query_ordering {
624 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
625 }
626 if let Some(ref param_value) = p_query_page {
627 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
628 }
629 if let Some(ref param_value) = p_query_page_size {
630 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
631 }
632 if let Some(ref param_value) = p_query_providers__isnull {
633 req_builder = req_builder.query(&[("providers__isnull", ¶m_value.to_string())]);
634 }
635 if let Some(ref param_value) = p_query_providers_by_pk {
636 req_builder = match "multi" {
637 "multi" => req_builder.query(
638 ¶m_value
639 .into_iter()
640 .map(|p| ("providers_by_pk".to_owned(), p.to_string()))
641 .collect::<Vec<(std::string::String, std::string::String)>>(),
642 ),
643 _ => req_builder.query(&[(
644 "providers_by_pk",
645 ¶m_value
646 .into_iter()
647 .map(|p| p.to_string())
648 .collect::<Vec<String>>()
649 .join(",")
650 .to_string(),
651 )]),
652 };
653 }
654 if let Some(ref param_value) = p_query_search {
655 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
656 }
657 if let Some(ref param_value) = p_query_service_connection__name__icontains {
658 req_builder = req_builder.query(&[("service_connection__name__icontains", ¶m_value.to_string())]);
659 }
660 if let Some(ref param_value) = p_query_service_connection__name__iexact {
661 req_builder = req_builder.query(&[("service_connection__name__iexact", ¶m_value.to_string())]);
662 }
663 if let Some(ref user_agent) = configuration.user_agent {
664 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
665 }
666 if let Some(ref token) = configuration.bearer_access_token {
667 req_builder = req_builder.bearer_auth(token.to_owned());
668 };
669
670 let req = req_builder.build()?;
671 let resp = configuration.client.execute(req).await?;
672
673 let status = resp.status();
674 let content_type = resp
675 .headers()
676 .get("content-type")
677 .and_then(|v| v.to_str().ok())
678 .unwrap_or("application/octet-stream");
679 let content_type = super::ContentType::from(content_type);
680
681 if !status.is_client_error() && !status.is_server_error() {
682 let content = resp.text().await?;
683 match content_type {
684 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
685 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedOutpostList`"))),
686 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::PaginatedOutpostList`")))),
687 }
688 } else {
689 let content = resp.text().await?;
690 let entity: Option<OutpostsInstancesListError> = serde_json::from_str(&content).ok();
691 Err(Error::ResponseError(ResponseContent {
692 status,
693 content,
694 entity,
695 }))
696 }
697}
698
699pub async fn outposts_instances_partial_update(
701 configuration: &configuration::Configuration,
702 uuid: &str,
703 patched_outpost_request: Option<models::PatchedOutpostRequest>,
704) -> Result<models::Outpost, Error<OutpostsInstancesPartialUpdateError>> {
705 let p_path_uuid = uuid;
707 let p_body_patched_outpost_request = patched_outpost_request;
708
709 let uri_str = format!(
710 "{}/outposts/instances/{uuid}/",
711 configuration.base_path,
712 uuid = crate::apis::urlencode(p_path_uuid)
713 );
714 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
715
716 if let Some(ref user_agent) = configuration.user_agent {
717 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
718 }
719 if let Some(ref token) = configuration.bearer_access_token {
720 req_builder = req_builder.bearer_auth(token.to_owned());
721 };
722 req_builder = req_builder.json(&p_body_patched_outpost_request);
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 => {
740 return Err(Error::from(serde_json::Error::custom(
741 "Received `text/plain` content type response that cannot be converted to `models::Outpost`",
742 )))
743 }
744 ContentType::Unsupported(unknown_type) => {
745 return Err(Error::from(serde_json::Error::custom(format!(
746 "Received `{unknown_type}` content type response that cannot be converted to `models::Outpost`"
747 ))))
748 }
749 }
750 } else {
751 let content = resp.text().await?;
752 let entity: Option<OutpostsInstancesPartialUpdateError> = serde_json::from_str(&content).ok();
753 Err(Error::ResponseError(ResponseContent {
754 status,
755 content,
756 entity,
757 }))
758 }
759}
760
761pub async fn outposts_instances_retrieve(
763 configuration: &configuration::Configuration,
764 uuid: &str,
765) -> Result<models::Outpost, Error<OutpostsInstancesRetrieveError>> {
766 let p_path_uuid = uuid;
768
769 let uri_str = format!(
770 "{}/outposts/instances/{uuid}/",
771 configuration.base_path,
772 uuid = crate::apis::urlencode(p_path_uuid)
773 );
774 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
775
776 if let Some(ref user_agent) = configuration.user_agent {
777 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
778 }
779 if let Some(ref token) = configuration.bearer_access_token {
780 req_builder = req_builder.bearer_auth(token.to_owned());
781 };
782
783 let req = req_builder.build()?;
784 let resp = configuration.client.execute(req).await?;
785
786 let status = resp.status();
787 let content_type = resp
788 .headers()
789 .get("content-type")
790 .and_then(|v| v.to_str().ok())
791 .unwrap_or("application/octet-stream");
792 let content_type = super::ContentType::from(content_type);
793
794 if !status.is_client_error() && !status.is_server_error() {
795 let content = resp.text().await?;
796 match content_type {
797 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
798 ContentType::Text => {
799 return Err(Error::from(serde_json::Error::custom(
800 "Received `text/plain` content type response that cannot be converted to `models::Outpost`",
801 )))
802 }
803 ContentType::Unsupported(unknown_type) => {
804 return Err(Error::from(serde_json::Error::custom(format!(
805 "Received `{unknown_type}` content type response that cannot be converted to `models::Outpost`"
806 ))))
807 }
808 }
809 } else {
810 let content = resp.text().await?;
811 let entity: Option<OutpostsInstancesRetrieveError> = serde_json::from_str(&content).ok();
812 Err(Error::ResponseError(ResponseContent {
813 status,
814 content,
815 entity,
816 }))
817 }
818}
819
820pub async fn outposts_instances_update(
822 configuration: &configuration::Configuration,
823 uuid: &str,
824 outpost_request: models::OutpostRequest,
825) -> Result<models::Outpost, Error<OutpostsInstancesUpdateError>> {
826 let p_path_uuid = uuid;
828 let p_body_outpost_request = outpost_request;
829
830 let uri_str = format!(
831 "{}/outposts/instances/{uuid}/",
832 configuration.base_path,
833 uuid = crate::apis::urlencode(p_path_uuid)
834 );
835 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
836
837 if let Some(ref user_agent) = configuration.user_agent {
838 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
839 }
840 if let Some(ref token) = configuration.bearer_access_token {
841 req_builder = req_builder.bearer_auth(token.to_owned());
842 };
843 req_builder = req_builder.json(&p_body_outpost_request);
844
845 let req = req_builder.build()?;
846 let resp = configuration.client.execute(req).await?;
847
848 let status = resp.status();
849 let content_type = resp
850 .headers()
851 .get("content-type")
852 .and_then(|v| v.to_str().ok())
853 .unwrap_or("application/octet-stream");
854 let content_type = super::ContentType::from(content_type);
855
856 if !status.is_client_error() && !status.is_server_error() {
857 let content = resp.text().await?;
858 match content_type {
859 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
860 ContentType::Text => {
861 return Err(Error::from(serde_json::Error::custom(
862 "Received `text/plain` content type response that cannot be converted to `models::Outpost`",
863 )))
864 }
865 ContentType::Unsupported(unknown_type) => {
866 return Err(Error::from(serde_json::Error::custom(format!(
867 "Received `{unknown_type}` content type response that cannot be converted to `models::Outpost`"
868 ))))
869 }
870 }
871 } else {
872 let content = resp.text().await?;
873 let entity: Option<OutpostsInstancesUpdateError> = serde_json::from_str(&content).ok();
874 Err(Error::ResponseError(ResponseContent {
875 status,
876 content,
877 entity,
878 }))
879 }
880}
881
882pub async fn outposts_instances_used_by_list(
884 configuration: &configuration::Configuration,
885 uuid: &str,
886) -> Result<Vec<models::UsedBy>, Error<OutpostsInstancesUsedByListError>> {
887 let p_path_uuid = uuid;
889
890 let uri_str = format!(
891 "{}/outposts/instances/{uuid}/used_by/",
892 configuration.base_path,
893 uuid = crate::apis::urlencode(p_path_uuid)
894 );
895 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
896
897 if let Some(ref user_agent) = configuration.user_agent {
898 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
899 }
900 if let Some(ref token) = configuration.bearer_access_token {
901 req_builder = req_builder.bearer_auth(token.to_owned());
902 };
903
904 let req = req_builder.build()?;
905 let resp = configuration.client.execute(req).await?;
906
907 let status = resp.status();
908 let content_type = resp
909 .headers()
910 .get("content-type")
911 .and_then(|v| v.to_str().ok())
912 .unwrap_or("application/octet-stream");
913 let content_type = super::ContentType::from(content_type);
914
915 if !status.is_client_error() && !status.is_server_error() {
916 let content = resp.text().await?;
917 match content_type {
918 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
919 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
920 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::UsedBy>`")))),
921 }
922 } else {
923 let content = resp.text().await?;
924 let entity: Option<OutpostsInstancesUsedByListError> = serde_json::from_str(&content).ok();
925 Err(Error::ResponseError(ResponseContent {
926 status,
927 content,
928 entity,
929 }))
930 }
931}
932
933pub async fn outposts_ldap_access_check(
935 configuration: &configuration::Configuration,
936 id: i32,
937 app_slug: Option<&str>,
938) -> Result<models::LdapCheckAccess, Error<OutpostsLdapAccessCheckError>> {
939 let p_path_id = id;
941 let p_query_app_slug = app_slug;
942
943 let uri_str = format!(
944 "{}/outposts/ldap/{id}/check_access/",
945 configuration.base_path,
946 id = p_path_id
947 );
948 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
949
950 if let Some(ref param_value) = p_query_app_slug {
951 req_builder = req_builder.query(&[("app_slug", ¶m_value.to_string())]);
952 }
953 if let Some(ref user_agent) = configuration.user_agent {
954 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
955 }
956 if let Some(ref token) = configuration.bearer_access_token {
957 req_builder = req_builder.bearer_auth(token.to_owned());
958 };
959
960 let req = req_builder.build()?;
961 let resp = configuration.client.execute(req).await?;
962
963 let status = resp.status();
964 let content_type = resp
965 .headers()
966 .get("content-type")
967 .and_then(|v| v.to_str().ok())
968 .unwrap_or("application/octet-stream");
969 let content_type = super::ContentType::from(content_type);
970
971 if !status.is_client_error() && !status.is_server_error() {
972 let content = resp.text().await?;
973 match content_type {
974 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
975 ContentType::Text => {
976 return Err(Error::from(serde_json::Error::custom(
977 "Received `text/plain` content type response that cannot be converted to `models::LdapCheckAccess`",
978 )))
979 }
980 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
981 "Received `{unknown_type}` content type response that cannot be converted to `models::LdapCheckAccess`"
982 )))),
983 }
984 } else {
985 let content = resp.text().await?;
986 let entity: Option<OutpostsLdapAccessCheckError> = serde_json::from_str(&content).ok();
987 Err(Error::ResponseError(ResponseContent {
988 status,
989 content,
990 entity,
991 }))
992 }
993}
994
995pub async fn outposts_ldap_list(
997 configuration: &configuration::Configuration,
998 name: Option<&str>,
999 ordering: Option<&str>,
1000 page: Option<i32>,
1001 page_size: Option<i32>,
1002 search: Option<&str>,
1003) -> Result<models::PaginatedLdapOutpostConfigList, Error<OutpostsLdapListError>> {
1004 let p_query_name = name;
1006 let p_query_ordering = ordering;
1007 let p_query_page = page;
1008 let p_query_page_size = page_size;
1009 let p_query_search = search;
1010
1011 let uri_str = format!("{}/outposts/ldap/", configuration.base_path);
1012 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1013
1014 if let Some(ref param_value) = p_query_name {
1015 req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
1016 }
1017 if let Some(ref param_value) = p_query_ordering {
1018 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
1019 }
1020 if let Some(ref param_value) = p_query_page {
1021 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
1022 }
1023 if let Some(ref param_value) = p_query_page_size {
1024 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
1025 }
1026 if let Some(ref param_value) = p_query_search {
1027 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
1028 }
1029 if let Some(ref user_agent) = configuration.user_agent {
1030 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1031 }
1032 if let Some(ref token) = configuration.bearer_access_token {
1033 req_builder = req_builder.bearer_auth(token.to_owned());
1034 };
1035
1036 let req = req_builder.build()?;
1037 let resp = configuration.client.execute(req).await?;
1038
1039 let status = resp.status();
1040 let content_type = resp
1041 .headers()
1042 .get("content-type")
1043 .and_then(|v| v.to_str().ok())
1044 .unwrap_or("application/octet-stream");
1045 let content_type = super::ContentType::from(content_type);
1046
1047 if !status.is_client_error() && !status.is_server_error() {
1048 let content = resp.text().await?;
1049 match content_type {
1050 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1051 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedLdapOutpostConfigList`"))),
1052 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::PaginatedLdapOutpostConfigList`")))),
1053 }
1054 } else {
1055 let content = resp.text().await?;
1056 let entity: Option<OutpostsLdapListError> = serde_json::from_str(&content).ok();
1057 Err(Error::ResponseError(ResponseContent {
1058 status,
1059 content,
1060 entity,
1061 }))
1062 }
1063}
1064
1065pub async fn outposts_proxy_list(
1067 configuration: &configuration::Configuration,
1068 name: Option<&str>,
1069 ordering: Option<&str>,
1070 page: Option<i32>,
1071 page_size: Option<i32>,
1072 search: Option<&str>,
1073) -> Result<models::PaginatedProxyOutpostConfigList, Error<OutpostsProxyListError>> {
1074 let p_query_name = name;
1076 let p_query_ordering = ordering;
1077 let p_query_page = page;
1078 let p_query_page_size = page_size;
1079 let p_query_search = search;
1080
1081 let uri_str = format!("{}/outposts/proxy/", configuration.base_path);
1082 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1083
1084 if let Some(ref param_value) = p_query_name {
1085 req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
1086 }
1087 if let Some(ref param_value) = p_query_ordering {
1088 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
1089 }
1090 if let Some(ref param_value) = p_query_page {
1091 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
1092 }
1093 if let Some(ref param_value) = p_query_page_size {
1094 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
1095 }
1096 if let Some(ref param_value) = p_query_search {
1097 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
1098 }
1099 if let Some(ref user_agent) = configuration.user_agent {
1100 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1101 }
1102 if let Some(ref token) = configuration.bearer_access_token {
1103 req_builder = req_builder.bearer_auth(token.to_owned());
1104 };
1105
1106 let req = req_builder.build()?;
1107 let resp = configuration.client.execute(req).await?;
1108
1109 let status = resp.status();
1110 let content_type = resp
1111 .headers()
1112 .get("content-type")
1113 .and_then(|v| v.to_str().ok())
1114 .unwrap_or("application/octet-stream");
1115 let content_type = super::ContentType::from(content_type);
1116
1117 if !status.is_client_error() && !status.is_server_error() {
1118 let content = resp.text().await?;
1119 match content_type {
1120 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1121 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedProxyOutpostConfigList`"))),
1122 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::PaginatedProxyOutpostConfigList`")))),
1123 }
1124 } else {
1125 let content = resp.text().await?;
1126 let entity: Option<OutpostsProxyListError> = serde_json::from_str(&content).ok();
1127 Err(Error::ResponseError(ResponseContent {
1128 status,
1129 content,
1130 entity,
1131 }))
1132 }
1133}
1134
1135pub async fn outposts_radius_access_check(
1137 configuration: &configuration::Configuration,
1138 id: i32,
1139 app_slug: Option<&str>,
1140) -> Result<models::RadiusCheckAccess, Error<OutpostsRadiusAccessCheckError>> {
1141 let p_path_id = id;
1143 let p_query_app_slug = app_slug;
1144
1145 let uri_str = format!(
1146 "{}/outposts/radius/{id}/check_access/",
1147 configuration.base_path,
1148 id = p_path_id
1149 );
1150 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1151
1152 if let Some(ref param_value) = p_query_app_slug {
1153 req_builder = req_builder.query(&[("app_slug", ¶m_value.to_string())]);
1154 }
1155 if let Some(ref user_agent) = configuration.user_agent {
1156 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1157 }
1158 if let Some(ref token) = configuration.bearer_access_token {
1159 req_builder = req_builder.bearer_auth(token.to_owned());
1160 };
1161
1162 let req = req_builder.build()?;
1163 let resp = configuration.client.execute(req).await?;
1164
1165 let status = resp.status();
1166 let content_type = resp
1167 .headers()
1168 .get("content-type")
1169 .and_then(|v| v.to_str().ok())
1170 .unwrap_or("application/octet-stream");
1171 let content_type = super::ContentType::from(content_type);
1172
1173 if !status.is_client_error() && !status.is_server_error() {
1174 let content = resp.text().await?;
1175 match content_type {
1176 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1177 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RadiusCheckAccess`"))),
1178 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::RadiusCheckAccess`")))),
1179 }
1180 } else {
1181 let content = resp.text().await?;
1182 let entity: Option<OutpostsRadiusAccessCheckError> = serde_json::from_str(&content).ok();
1183 Err(Error::ResponseError(ResponseContent {
1184 status,
1185 content,
1186 entity,
1187 }))
1188 }
1189}
1190
1191pub async fn outposts_radius_list(
1193 configuration: &configuration::Configuration,
1194 name: Option<&str>,
1195 ordering: Option<&str>,
1196 page: Option<i32>,
1197 page_size: Option<i32>,
1198 search: Option<&str>,
1199) -> Result<models::PaginatedRadiusOutpostConfigList, Error<OutpostsRadiusListError>> {
1200 let p_query_name = name;
1202 let p_query_ordering = ordering;
1203 let p_query_page = page;
1204 let p_query_page_size = page_size;
1205 let p_query_search = search;
1206
1207 let uri_str = format!("{}/outposts/radius/", configuration.base_path);
1208 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1209
1210 if let Some(ref param_value) = p_query_name {
1211 req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
1212 }
1213 if let Some(ref param_value) = p_query_ordering {
1214 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
1215 }
1216 if let Some(ref param_value) = p_query_page {
1217 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
1218 }
1219 if let Some(ref param_value) = p_query_page_size {
1220 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
1221 }
1222 if let Some(ref param_value) = p_query_search {
1223 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
1224 }
1225 if let Some(ref user_agent) = configuration.user_agent {
1226 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1227 }
1228 if let Some(ref token) = configuration.bearer_access_token {
1229 req_builder = req_builder.bearer_auth(token.to_owned());
1230 };
1231
1232 let req = req_builder.build()?;
1233 let resp = configuration.client.execute(req).await?;
1234
1235 let status = resp.status();
1236 let content_type = resp
1237 .headers()
1238 .get("content-type")
1239 .and_then(|v| v.to_str().ok())
1240 .unwrap_or("application/octet-stream");
1241 let content_type = super::ContentType::from(content_type);
1242
1243 if !status.is_client_error() && !status.is_server_error() {
1244 let content = resp.text().await?;
1245 match content_type {
1246 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1247 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedRadiusOutpostConfigList`"))),
1248 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::PaginatedRadiusOutpostConfigList`")))),
1249 }
1250 } else {
1251 let content = resp.text().await?;
1252 let entity: Option<OutpostsRadiusListError> = serde_json::from_str(&content).ok();
1253 Err(Error::ResponseError(ResponseContent {
1254 status,
1255 content,
1256 entity,
1257 }))
1258 }
1259}
1260
1261pub async fn outposts_service_connections_all_destroy(
1263 configuration: &configuration::Configuration,
1264 uuid: &str,
1265) -> Result<(), Error<OutpostsServiceConnectionsAllDestroyError>> {
1266 let p_path_uuid = uuid;
1268
1269 let uri_str = format!(
1270 "{}/outposts/service_connections/all/{uuid}/",
1271 configuration.base_path,
1272 uuid = crate::apis::urlencode(p_path_uuid)
1273 );
1274 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1275
1276 if let Some(ref user_agent) = configuration.user_agent {
1277 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1278 }
1279 if let Some(ref token) = configuration.bearer_access_token {
1280 req_builder = req_builder.bearer_auth(token.to_owned());
1281 };
1282
1283 let req = req_builder.build()?;
1284 let resp = configuration.client.execute(req).await?;
1285
1286 let status = resp.status();
1287
1288 if !status.is_client_error() && !status.is_server_error() {
1289 Ok(())
1290 } else {
1291 let content = resp.text().await?;
1292 let entity: Option<OutpostsServiceConnectionsAllDestroyError> = serde_json::from_str(&content).ok();
1293 Err(Error::ResponseError(ResponseContent {
1294 status,
1295 content,
1296 entity,
1297 }))
1298 }
1299}
1300
1301pub async fn outposts_service_connections_all_list(
1303 configuration: &configuration::Configuration,
1304 name: Option<&str>,
1305 ordering: Option<&str>,
1306 page: Option<i32>,
1307 page_size: Option<i32>,
1308 search: Option<&str>,
1309) -> Result<models::PaginatedServiceConnectionList, Error<OutpostsServiceConnectionsAllListError>> {
1310 let p_query_name = name;
1312 let p_query_ordering = ordering;
1313 let p_query_page = page;
1314 let p_query_page_size = page_size;
1315 let p_query_search = search;
1316
1317 let uri_str = format!("{}/outposts/service_connections/all/", configuration.base_path);
1318 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1319
1320 if let Some(ref param_value) = p_query_name {
1321 req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
1322 }
1323 if let Some(ref param_value) = p_query_ordering {
1324 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
1325 }
1326 if let Some(ref param_value) = p_query_page {
1327 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
1328 }
1329 if let Some(ref param_value) = p_query_page_size {
1330 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
1331 }
1332 if let Some(ref param_value) = p_query_search {
1333 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
1334 }
1335 if let Some(ref user_agent) = configuration.user_agent {
1336 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1337 }
1338 if let Some(ref token) = configuration.bearer_access_token {
1339 req_builder = req_builder.bearer_auth(token.to_owned());
1340 };
1341
1342 let req = req_builder.build()?;
1343 let resp = configuration.client.execute(req).await?;
1344
1345 let status = resp.status();
1346 let content_type = resp
1347 .headers()
1348 .get("content-type")
1349 .and_then(|v| v.to_str().ok())
1350 .unwrap_or("application/octet-stream");
1351 let content_type = super::ContentType::from(content_type);
1352
1353 if !status.is_client_error() && !status.is_server_error() {
1354 let content = resp.text().await?;
1355 match content_type {
1356 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1357 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedServiceConnectionList`"))),
1358 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::PaginatedServiceConnectionList`")))),
1359 }
1360 } else {
1361 let content = resp.text().await?;
1362 let entity: Option<OutpostsServiceConnectionsAllListError> = serde_json::from_str(&content).ok();
1363 Err(Error::ResponseError(ResponseContent {
1364 status,
1365 content,
1366 entity,
1367 }))
1368 }
1369}
1370
1371pub async fn outposts_service_connections_all_retrieve(
1373 configuration: &configuration::Configuration,
1374 uuid: &str,
1375) -> Result<models::ServiceConnection, Error<OutpostsServiceConnectionsAllRetrieveError>> {
1376 let p_path_uuid = uuid;
1378
1379 let uri_str = format!(
1380 "{}/outposts/service_connections/all/{uuid}/",
1381 configuration.base_path,
1382 uuid = crate::apis::urlencode(p_path_uuid)
1383 );
1384 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1385
1386 if let Some(ref user_agent) = configuration.user_agent {
1387 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1388 }
1389 if let Some(ref token) = configuration.bearer_access_token {
1390 req_builder = req_builder.bearer_auth(token.to_owned());
1391 };
1392
1393 let req = req_builder.build()?;
1394 let resp = configuration.client.execute(req).await?;
1395
1396 let status = resp.status();
1397 let content_type = resp
1398 .headers()
1399 .get("content-type")
1400 .and_then(|v| v.to_str().ok())
1401 .unwrap_or("application/octet-stream");
1402 let content_type = super::ContentType::from(content_type);
1403
1404 if !status.is_client_error() && !status.is_server_error() {
1405 let content = resp.text().await?;
1406 match content_type {
1407 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1408 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ServiceConnection`"))),
1409 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::ServiceConnection`")))),
1410 }
1411 } else {
1412 let content = resp.text().await?;
1413 let entity: Option<OutpostsServiceConnectionsAllRetrieveError> = serde_json::from_str(&content).ok();
1414 Err(Error::ResponseError(ResponseContent {
1415 status,
1416 content,
1417 entity,
1418 }))
1419 }
1420}
1421
1422pub async fn outposts_service_connections_all_state_retrieve(
1424 configuration: &configuration::Configuration,
1425 uuid: &str,
1426) -> Result<models::ServiceConnectionState, Error<OutpostsServiceConnectionsAllStateRetrieveError>> {
1427 let p_path_uuid = uuid;
1429
1430 let uri_str = format!(
1431 "{}/outposts/service_connections/all/{uuid}/state/",
1432 configuration.base_path,
1433 uuid = crate::apis::urlencode(p_path_uuid)
1434 );
1435 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1436
1437 if let Some(ref user_agent) = configuration.user_agent {
1438 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1439 }
1440 if let Some(ref token) = configuration.bearer_access_token {
1441 req_builder = req_builder.bearer_auth(token.to_owned());
1442 };
1443
1444 let req = req_builder.build()?;
1445 let resp = configuration.client.execute(req).await?;
1446
1447 let status = resp.status();
1448 let content_type = resp
1449 .headers()
1450 .get("content-type")
1451 .and_then(|v| v.to_str().ok())
1452 .unwrap_or("application/octet-stream");
1453 let content_type = super::ContentType::from(content_type);
1454
1455 if !status.is_client_error() && !status.is_server_error() {
1456 let content = resp.text().await?;
1457 match content_type {
1458 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1459 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ServiceConnectionState`"))),
1460 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::ServiceConnectionState`")))),
1461 }
1462 } else {
1463 let content = resp.text().await?;
1464 let entity: Option<OutpostsServiceConnectionsAllStateRetrieveError> = serde_json::from_str(&content).ok();
1465 Err(Error::ResponseError(ResponseContent {
1466 status,
1467 content,
1468 entity,
1469 }))
1470 }
1471}
1472
1473pub async fn outposts_service_connections_all_types_list(
1475 configuration: &configuration::Configuration,
1476) -> Result<Vec<models::TypeCreate>, Error<OutpostsServiceConnectionsAllTypesListError>> {
1477 let uri_str = format!("{}/outposts/service_connections/all/types/", configuration.base_path);
1478 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1479
1480 if let Some(ref user_agent) = configuration.user_agent {
1481 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1482 }
1483 if let Some(ref token) = configuration.bearer_access_token {
1484 req_builder = req_builder.bearer_auth(token.to_owned());
1485 };
1486
1487 let req = req_builder.build()?;
1488 let resp = configuration.client.execute(req).await?;
1489
1490 let status = resp.status();
1491 let content_type = resp
1492 .headers()
1493 .get("content-type")
1494 .and_then(|v| v.to_str().ok())
1495 .unwrap_or("application/octet-stream");
1496 let content_type = super::ContentType::from(content_type);
1497
1498 if !status.is_client_error() && !status.is_server_error() {
1499 let content = resp.text().await?;
1500 match content_type {
1501 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1502 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::TypeCreate>`"))),
1503 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::TypeCreate>`")))),
1504 }
1505 } else {
1506 let content = resp.text().await?;
1507 let entity: Option<OutpostsServiceConnectionsAllTypesListError> = serde_json::from_str(&content).ok();
1508 Err(Error::ResponseError(ResponseContent {
1509 status,
1510 content,
1511 entity,
1512 }))
1513 }
1514}
1515
1516pub async fn outposts_service_connections_all_used_by_list(
1518 configuration: &configuration::Configuration,
1519 uuid: &str,
1520) -> Result<Vec<models::UsedBy>, Error<OutpostsServiceConnectionsAllUsedByListError>> {
1521 let p_path_uuid = uuid;
1523
1524 let uri_str = format!(
1525 "{}/outposts/service_connections/all/{uuid}/used_by/",
1526 configuration.base_path,
1527 uuid = crate::apis::urlencode(p_path_uuid)
1528 );
1529 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1530
1531 if let Some(ref user_agent) = configuration.user_agent {
1532 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1533 }
1534 if let Some(ref token) = configuration.bearer_access_token {
1535 req_builder = req_builder.bearer_auth(token.to_owned());
1536 };
1537
1538 let req = req_builder.build()?;
1539 let resp = configuration.client.execute(req).await?;
1540
1541 let status = resp.status();
1542 let content_type = resp
1543 .headers()
1544 .get("content-type")
1545 .and_then(|v| v.to_str().ok())
1546 .unwrap_or("application/octet-stream");
1547 let content_type = super::ContentType::from(content_type);
1548
1549 if !status.is_client_error() && !status.is_server_error() {
1550 let content = resp.text().await?;
1551 match content_type {
1552 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1553 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
1554 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::UsedBy>`")))),
1555 }
1556 } else {
1557 let content = resp.text().await?;
1558 let entity: Option<OutpostsServiceConnectionsAllUsedByListError> = serde_json::from_str(&content).ok();
1559 Err(Error::ResponseError(ResponseContent {
1560 status,
1561 content,
1562 entity,
1563 }))
1564 }
1565}
1566
1567pub async fn outposts_service_connections_docker_create(
1569 configuration: &configuration::Configuration,
1570 docker_service_connection_request: models::DockerServiceConnectionRequest,
1571) -> Result<models::DockerServiceConnection, Error<OutpostsServiceConnectionsDockerCreateError>> {
1572 let p_body_docker_service_connection_request = docker_service_connection_request;
1574
1575 let uri_str = format!("{}/outposts/service_connections/docker/", configuration.base_path);
1576 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1577
1578 if let Some(ref user_agent) = configuration.user_agent {
1579 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1580 }
1581 if let Some(ref token) = configuration.bearer_access_token {
1582 req_builder = req_builder.bearer_auth(token.to_owned());
1583 };
1584 req_builder = req_builder.json(&p_body_docker_service_connection_request);
1585
1586 let req = req_builder.build()?;
1587 let resp = configuration.client.execute(req).await?;
1588
1589 let status = resp.status();
1590 let content_type = resp
1591 .headers()
1592 .get("content-type")
1593 .and_then(|v| v.to_str().ok())
1594 .unwrap_or("application/octet-stream");
1595 let content_type = super::ContentType::from(content_type);
1596
1597 if !status.is_client_error() && !status.is_server_error() {
1598 let content = resp.text().await?;
1599 match content_type {
1600 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1601 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DockerServiceConnection`"))),
1602 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::DockerServiceConnection`")))),
1603 }
1604 } else {
1605 let content = resp.text().await?;
1606 let entity: Option<OutpostsServiceConnectionsDockerCreateError> = serde_json::from_str(&content).ok();
1607 Err(Error::ResponseError(ResponseContent {
1608 status,
1609 content,
1610 entity,
1611 }))
1612 }
1613}
1614
1615pub async fn outposts_service_connections_docker_destroy(
1617 configuration: &configuration::Configuration,
1618 uuid: &str,
1619) -> Result<(), Error<OutpostsServiceConnectionsDockerDestroyError>> {
1620 let p_path_uuid = uuid;
1622
1623 let uri_str = format!(
1624 "{}/outposts/service_connections/docker/{uuid}/",
1625 configuration.base_path,
1626 uuid = crate::apis::urlencode(p_path_uuid)
1627 );
1628 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1629
1630 if let Some(ref user_agent) = configuration.user_agent {
1631 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1632 }
1633 if let Some(ref token) = configuration.bearer_access_token {
1634 req_builder = req_builder.bearer_auth(token.to_owned());
1635 };
1636
1637 let req = req_builder.build()?;
1638 let resp = configuration.client.execute(req).await?;
1639
1640 let status = resp.status();
1641
1642 if !status.is_client_error() && !status.is_server_error() {
1643 Ok(())
1644 } else {
1645 let content = resp.text().await?;
1646 let entity: Option<OutpostsServiceConnectionsDockerDestroyError> = serde_json::from_str(&content).ok();
1647 Err(Error::ResponseError(ResponseContent {
1648 status,
1649 content,
1650 entity,
1651 }))
1652 }
1653}
1654
1655pub async fn outposts_service_connections_docker_list(
1657 configuration: &configuration::Configuration,
1658 local: Option<bool>,
1659 name: Option<&str>,
1660 ordering: Option<&str>,
1661 page: Option<i32>,
1662 page_size: Option<i32>,
1663 search: Option<&str>,
1664 tls_authentication: Option<&str>,
1665 tls_verification: Option<&str>,
1666 url: Option<&str>,
1667) -> Result<models::PaginatedDockerServiceConnectionList, Error<OutpostsServiceConnectionsDockerListError>> {
1668 let p_query_local = local;
1670 let p_query_name = name;
1671 let p_query_ordering = ordering;
1672 let p_query_page = page;
1673 let p_query_page_size = page_size;
1674 let p_query_search = search;
1675 let p_query_tls_authentication = tls_authentication;
1676 let p_query_tls_verification = tls_verification;
1677 let p_query_url = url;
1678
1679 let uri_str = format!("{}/outposts/service_connections/docker/", configuration.base_path);
1680 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1681
1682 if let Some(ref param_value) = p_query_local {
1683 req_builder = req_builder.query(&[("local", ¶m_value.to_string())]);
1684 }
1685 if let Some(ref param_value) = p_query_name {
1686 req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
1687 }
1688 if let Some(ref param_value) = p_query_ordering {
1689 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
1690 }
1691 if let Some(ref param_value) = p_query_page {
1692 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
1693 }
1694 if let Some(ref param_value) = p_query_page_size {
1695 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
1696 }
1697 if let Some(ref param_value) = p_query_search {
1698 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
1699 }
1700 if let Some(ref param_value) = p_query_tls_authentication {
1701 req_builder = req_builder.query(&[("tls_authentication", ¶m_value.to_string())]);
1702 }
1703 if let Some(ref param_value) = p_query_tls_verification {
1704 req_builder = req_builder.query(&[("tls_verification", ¶m_value.to_string())]);
1705 }
1706 if let Some(ref param_value) = p_query_url {
1707 req_builder = req_builder.query(&[("url", ¶m_value.to_string())]);
1708 }
1709 if let Some(ref user_agent) = configuration.user_agent {
1710 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1711 }
1712 if let Some(ref token) = configuration.bearer_access_token {
1713 req_builder = req_builder.bearer_auth(token.to_owned());
1714 };
1715
1716 let req = req_builder.build()?;
1717 let resp = configuration.client.execute(req).await?;
1718
1719 let status = resp.status();
1720 let content_type = resp
1721 .headers()
1722 .get("content-type")
1723 .and_then(|v| v.to_str().ok())
1724 .unwrap_or("application/octet-stream");
1725 let content_type = super::ContentType::from(content_type);
1726
1727 if !status.is_client_error() && !status.is_server_error() {
1728 let content = resp.text().await?;
1729 match content_type {
1730 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1731 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedDockerServiceConnectionList`"))),
1732 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::PaginatedDockerServiceConnectionList`")))),
1733 }
1734 } else {
1735 let content = resp.text().await?;
1736 let entity: Option<OutpostsServiceConnectionsDockerListError> = serde_json::from_str(&content).ok();
1737 Err(Error::ResponseError(ResponseContent {
1738 status,
1739 content,
1740 entity,
1741 }))
1742 }
1743}
1744
1745pub async fn outposts_service_connections_docker_partial_update(
1747 configuration: &configuration::Configuration,
1748 uuid: &str,
1749 patched_docker_service_connection_request: Option<models::PatchedDockerServiceConnectionRequest>,
1750) -> Result<models::DockerServiceConnection, Error<OutpostsServiceConnectionsDockerPartialUpdateError>> {
1751 let p_path_uuid = uuid;
1753 let p_body_patched_docker_service_connection_request = patched_docker_service_connection_request;
1754
1755 let uri_str = format!(
1756 "{}/outposts/service_connections/docker/{uuid}/",
1757 configuration.base_path,
1758 uuid = crate::apis::urlencode(p_path_uuid)
1759 );
1760 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
1761
1762 if let Some(ref user_agent) = configuration.user_agent {
1763 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1764 }
1765 if let Some(ref token) = configuration.bearer_access_token {
1766 req_builder = req_builder.bearer_auth(token.to_owned());
1767 };
1768 req_builder = req_builder.json(&p_body_patched_docker_service_connection_request);
1769
1770 let req = req_builder.build()?;
1771 let resp = configuration.client.execute(req).await?;
1772
1773 let status = resp.status();
1774 let content_type = resp
1775 .headers()
1776 .get("content-type")
1777 .and_then(|v| v.to_str().ok())
1778 .unwrap_or("application/octet-stream");
1779 let content_type = super::ContentType::from(content_type);
1780
1781 if !status.is_client_error() && !status.is_server_error() {
1782 let content = resp.text().await?;
1783 match content_type {
1784 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1785 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DockerServiceConnection`"))),
1786 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::DockerServiceConnection`")))),
1787 }
1788 } else {
1789 let content = resp.text().await?;
1790 let entity: Option<OutpostsServiceConnectionsDockerPartialUpdateError> = serde_json::from_str(&content).ok();
1791 Err(Error::ResponseError(ResponseContent {
1792 status,
1793 content,
1794 entity,
1795 }))
1796 }
1797}
1798
1799pub async fn outposts_service_connections_docker_retrieve(
1801 configuration: &configuration::Configuration,
1802 uuid: &str,
1803) -> Result<models::DockerServiceConnection, Error<OutpostsServiceConnectionsDockerRetrieveError>> {
1804 let p_path_uuid = uuid;
1806
1807 let uri_str = format!(
1808 "{}/outposts/service_connections/docker/{uuid}/",
1809 configuration.base_path,
1810 uuid = crate::apis::urlencode(p_path_uuid)
1811 );
1812 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1813
1814 if let Some(ref user_agent) = configuration.user_agent {
1815 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1816 }
1817 if let Some(ref token) = configuration.bearer_access_token {
1818 req_builder = req_builder.bearer_auth(token.to_owned());
1819 };
1820
1821 let req = req_builder.build()?;
1822 let resp = configuration.client.execute(req).await?;
1823
1824 let status = resp.status();
1825 let content_type = resp
1826 .headers()
1827 .get("content-type")
1828 .and_then(|v| v.to_str().ok())
1829 .unwrap_or("application/octet-stream");
1830 let content_type = super::ContentType::from(content_type);
1831
1832 if !status.is_client_error() && !status.is_server_error() {
1833 let content = resp.text().await?;
1834 match content_type {
1835 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1836 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DockerServiceConnection`"))),
1837 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::DockerServiceConnection`")))),
1838 }
1839 } else {
1840 let content = resp.text().await?;
1841 let entity: Option<OutpostsServiceConnectionsDockerRetrieveError> = serde_json::from_str(&content).ok();
1842 Err(Error::ResponseError(ResponseContent {
1843 status,
1844 content,
1845 entity,
1846 }))
1847 }
1848}
1849
1850pub async fn outposts_service_connections_docker_update(
1852 configuration: &configuration::Configuration,
1853 uuid: &str,
1854 docker_service_connection_request: models::DockerServiceConnectionRequest,
1855) -> Result<models::DockerServiceConnection, Error<OutpostsServiceConnectionsDockerUpdateError>> {
1856 let p_path_uuid = uuid;
1858 let p_body_docker_service_connection_request = docker_service_connection_request;
1859
1860 let uri_str = format!(
1861 "{}/outposts/service_connections/docker/{uuid}/",
1862 configuration.base_path,
1863 uuid = crate::apis::urlencode(p_path_uuid)
1864 );
1865 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
1866
1867 if let Some(ref user_agent) = configuration.user_agent {
1868 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1869 }
1870 if let Some(ref token) = configuration.bearer_access_token {
1871 req_builder = req_builder.bearer_auth(token.to_owned());
1872 };
1873 req_builder = req_builder.json(&p_body_docker_service_connection_request);
1874
1875 let req = req_builder.build()?;
1876 let resp = configuration.client.execute(req).await?;
1877
1878 let status = resp.status();
1879 let content_type = resp
1880 .headers()
1881 .get("content-type")
1882 .and_then(|v| v.to_str().ok())
1883 .unwrap_or("application/octet-stream");
1884 let content_type = super::ContentType::from(content_type);
1885
1886 if !status.is_client_error() && !status.is_server_error() {
1887 let content = resp.text().await?;
1888 match content_type {
1889 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1890 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DockerServiceConnection`"))),
1891 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::DockerServiceConnection`")))),
1892 }
1893 } else {
1894 let content = resp.text().await?;
1895 let entity: Option<OutpostsServiceConnectionsDockerUpdateError> = serde_json::from_str(&content).ok();
1896 Err(Error::ResponseError(ResponseContent {
1897 status,
1898 content,
1899 entity,
1900 }))
1901 }
1902}
1903
1904pub async fn outposts_service_connections_docker_used_by_list(
1906 configuration: &configuration::Configuration,
1907 uuid: &str,
1908) -> Result<Vec<models::UsedBy>, Error<OutpostsServiceConnectionsDockerUsedByListError>> {
1909 let p_path_uuid = uuid;
1911
1912 let uri_str = format!(
1913 "{}/outposts/service_connections/docker/{uuid}/used_by/",
1914 configuration.base_path,
1915 uuid = crate::apis::urlencode(p_path_uuid)
1916 );
1917 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1918
1919 if let Some(ref user_agent) = configuration.user_agent {
1920 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1921 }
1922 if let Some(ref token) = configuration.bearer_access_token {
1923 req_builder = req_builder.bearer_auth(token.to_owned());
1924 };
1925
1926 let req = req_builder.build()?;
1927 let resp = configuration.client.execute(req).await?;
1928
1929 let status = resp.status();
1930 let content_type = resp
1931 .headers()
1932 .get("content-type")
1933 .and_then(|v| v.to_str().ok())
1934 .unwrap_or("application/octet-stream");
1935 let content_type = super::ContentType::from(content_type);
1936
1937 if !status.is_client_error() && !status.is_server_error() {
1938 let content = resp.text().await?;
1939 match content_type {
1940 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1941 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
1942 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::UsedBy>`")))),
1943 }
1944 } else {
1945 let content = resp.text().await?;
1946 let entity: Option<OutpostsServiceConnectionsDockerUsedByListError> = serde_json::from_str(&content).ok();
1947 Err(Error::ResponseError(ResponseContent {
1948 status,
1949 content,
1950 entity,
1951 }))
1952 }
1953}
1954
1955pub async fn outposts_service_connections_kubernetes_create(
1957 configuration: &configuration::Configuration,
1958 kubernetes_service_connection_request: models::KubernetesServiceConnectionRequest,
1959) -> Result<models::KubernetesServiceConnection, Error<OutpostsServiceConnectionsKubernetesCreateError>> {
1960 let p_body_kubernetes_service_connection_request = kubernetes_service_connection_request;
1962
1963 let uri_str = format!("{}/outposts/service_connections/kubernetes/", configuration.base_path);
1964 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1965
1966 if let Some(ref user_agent) = configuration.user_agent {
1967 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1968 }
1969 if let Some(ref token) = configuration.bearer_access_token {
1970 req_builder = req_builder.bearer_auth(token.to_owned());
1971 };
1972 req_builder = req_builder.json(&p_body_kubernetes_service_connection_request);
1973
1974 let req = req_builder.build()?;
1975 let resp = configuration.client.execute(req).await?;
1976
1977 let status = resp.status();
1978 let content_type = resp
1979 .headers()
1980 .get("content-type")
1981 .and_then(|v| v.to_str().ok())
1982 .unwrap_or("application/octet-stream");
1983 let content_type = super::ContentType::from(content_type);
1984
1985 if !status.is_client_error() && !status.is_server_error() {
1986 let content = resp.text().await?;
1987 match content_type {
1988 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1989 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::KubernetesServiceConnection`"))),
1990 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::KubernetesServiceConnection`")))),
1991 }
1992 } else {
1993 let content = resp.text().await?;
1994 let entity: Option<OutpostsServiceConnectionsKubernetesCreateError> = serde_json::from_str(&content).ok();
1995 Err(Error::ResponseError(ResponseContent {
1996 status,
1997 content,
1998 entity,
1999 }))
2000 }
2001}
2002
2003pub async fn outposts_service_connections_kubernetes_destroy(
2005 configuration: &configuration::Configuration,
2006 uuid: &str,
2007) -> Result<(), Error<OutpostsServiceConnectionsKubernetesDestroyError>> {
2008 let p_path_uuid = uuid;
2010
2011 let uri_str = format!(
2012 "{}/outposts/service_connections/kubernetes/{uuid}/",
2013 configuration.base_path,
2014 uuid = crate::apis::urlencode(p_path_uuid)
2015 );
2016 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
2017
2018 if let Some(ref user_agent) = configuration.user_agent {
2019 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2020 }
2021 if let Some(ref token) = configuration.bearer_access_token {
2022 req_builder = req_builder.bearer_auth(token.to_owned());
2023 };
2024
2025 let req = req_builder.build()?;
2026 let resp = configuration.client.execute(req).await?;
2027
2028 let status = resp.status();
2029
2030 if !status.is_client_error() && !status.is_server_error() {
2031 Ok(())
2032 } else {
2033 let content = resp.text().await?;
2034 let entity: Option<OutpostsServiceConnectionsKubernetesDestroyError> = serde_json::from_str(&content).ok();
2035 Err(Error::ResponseError(ResponseContent {
2036 status,
2037 content,
2038 entity,
2039 }))
2040 }
2041}
2042
2043pub async fn outposts_service_connections_kubernetes_list(
2045 configuration: &configuration::Configuration,
2046 local: Option<bool>,
2047 name: Option<&str>,
2048 ordering: Option<&str>,
2049 page: Option<i32>,
2050 page_size: Option<i32>,
2051 search: Option<&str>,
2052) -> Result<models::PaginatedKubernetesServiceConnectionList, Error<OutpostsServiceConnectionsKubernetesListError>> {
2053 let p_query_local = local;
2055 let p_query_name = name;
2056 let p_query_ordering = ordering;
2057 let p_query_page = page;
2058 let p_query_page_size = page_size;
2059 let p_query_search = search;
2060
2061 let uri_str = format!("{}/outposts/service_connections/kubernetes/", configuration.base_path);
2062 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2063
2064 if let Some(ref param_value) = p_query_local {
2065 req_builder = req_builder.query(&[("local", ¶m_value.to_string())]);
2066 }
2067 if let Some(ref param_value) = p_query_name {
2068 req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
2069 }
2070 if let Some(ref param_value) = p_query_ordering {
2071 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
2072 }
2073 if let Some(ref param_value) = p_query_page {
2074 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
2075 }
2076 if let Some(ref param_value) = p_query_page_size {
2077 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
2078 }
2079 if let Some(ref param_value) = p_query_search {
2080 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
2081 }
2082 if let Some(ref user_agent) = configuration.user_agent {
2083 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2084 }
2085 if let Some(ref token) = configuration.bearer_access_token {
2086 req_builder = req_builder.bearer_auth(token.to_owned());
2087 };
2088
2089 let req = req_builder.build()?;
2090 let resp = configuration.client.execute(req).await?;
2091
2092 let status = resp.status();
2093 let content_type = resp
2094 .headers()
2095 .get("content-type")
2096 .and_then(|v| v.to_str().ok())
2097 .unwrap_or("application/octet-stream");
2098 let content_type = super::ContentType::from(content_type);
2099
2100 if !status.is_client_error() && !status.is_server_error() {
2101 let content = resp.text().await?;
2102 match content_type {
2103 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2104 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedKubernetesServiceConnectionList`"))),
2105 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::PaginatedKubernetesServiceConnectionList`")))),
2106 }
2107 } else {
2108 let content = resp.text().await?;
2109 let entity: Option<OutpostsServiceConnectionsKubernetesListError> = serde_json::from_str(&content).ok();
2110 Err(Error::ResponseError(ResponseContent {
2111 status,
2112 content,
2113 entity,
2114 }))
2115 }
2116}
2117
2118pub async fn outposts_service_connections_kubernetes_partial_update(
2120 configuration: &configuration::Configuration,
2121 uuid: &str,
2122 patched_kubernetes_service_connection_request: Option<models::PatchedKubernetesServiceConnectionRequest>,
2123) -> Result<models::KubernetesServiceConnection, Error<OutpostsServiceConnectionsKubernetesPartialUpdateError>> {
2124 let p_path_uuid = uuid;
2126 let p_body_patched_kubernetes_service_connection_request = patched_kubernetes_service_connection_request;
2127
2128 let uri_str = format!(
2129 "{}/outposts/service_connections/kubernetes/{uuid}/",
2130 configuration.base_path,
2131 uuid = crate::apis::urlencode(p_path_uuid)
2132 );
2133 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
2134
2135 if let Some(ref user_agent) = configuration.user_agent {
2136 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2137 }
2138 if let Some(ref token) = configuration.bearer_access_token {
2139 req_builder = req_builder.bearer_auth(token.to_owned());
2140 };
2141 req_builder = req_builder.json(&p_body_patched_kubernetes_service_connection_request);
2142
2143 let req = req_builder.build()?;
2144 let resp = configuration.client.execute(req).await?;
2145
2146 let status = resp.status();
2147 let content_type = resp
2148 .headers()
2149 .get("content-type")
2150 .and_then(|v| v.to_str().ok())
2151 .unwrap_or("application/octet-stream");
2152 let content_type = super::ContentType::from(content_type);
2153
2154 if !status.is_client_error() && !status.is_server_error() {
2155 let content = resp.text().await?;
2156 match content_type {
2157 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2158 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::KubernetesServiceConnection`"))),
2159 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::KubernetesServiceConnection`")))),
2160 }
2161 } else {
2162 let content = resp.text().await?;
2163 let entity: Option<OutpostsServiceConnectionsKubernetesPartialUpdateError> =
2164 serde_json::from_str(&content).ok();
2165 Err(Error::ResponseError(ResponseContent {
2166 status,
2167 content,
2168 entity,
2169 }))
2170 }
2171}
2172
2173pub async fn outposts_service_connections_kubernetes_retrieve(
2175 configuration: &configuration::Configuration,
2176 uuid: &str,
2177) -> Result<models::KubernetesServiceConnection, Error<OutpostsServiceConnectionsKubernetesRetrieveError>> {
2178 let p_path_uuid = uuid;
2180
2181 let uri_str = format!(
2182 "{}/outposts/service_connections/kubernetes/{uuid}/",
2183 configuration.base_path,
2184 uuid = crate::apis::urlencode(p_path_uuid)
2185 );
2186 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2187
2188 if let Some(ref user_agent) = configuration.user_agent {
2189 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2190 }
2191 if let Some(ref token) = configuration.bearer_access_token {
2192 req_builder = req_builder.bearer_auth(token.to_owned());
2193 };
2194
2195 let req = req_builder.build()?;
2196 let resp = configuration.client.execute(req).await?;
2197
2198 let status = resp.status();
2199 let content_type = resp
2200 .headers()
2201 .get("content-type")
2202 .and_then(|v| v.to_str().ok())
2203 .unwrap_or("application/octet-stream");
2204 let content_type = super::ContentType::from(content_type);
2205
2206 if !status.is_client_error() && !status.is_server_error() {
2207 let content = resp.text().await?;
2208 match content_type {
2209 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2210 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::KubernetesServiceConnection`"))),
2211 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::KubernetesServiceConnection`")))),
2212 }
2213 } else {
2214 let content = resp.text().await?;
2215 let entity: Option<OutpostsServiceConnectionsKubernetesRetrieveError> = serde_json::from_str(&content).ok();
2216 Err(Error::ResponseError(ResponseContent {
2217 status,
2218 content,
2219 entity,
2220 }))
2221 }
2222}
2223
2224pub async fn outposts_service_connections_kubernetes_update(
2226 configuration: &configuration::Configuration,
2227 uuid: &str,
2228 kubernetes_service_connection_request: models::KubernetesServiceConnectionRequest,
2229) -> Result<models::KubernetesServiceConnection, Error<OutpostsServiceConnectionsKubernetesUpdateError>> {
2230 let p_path_uuid = uuid;
2232 let p_body_kubernetes_service_connection_request = kubernetes_service_connection_request;
2233
2234 let uri_str = format!(
2235 "{}/outposts/service_connections/kubernetes/{uuid}/",
2236 configuration.base_path,
2237 uuid = crate::apis::urlencode(p_path_uuid)
2238 );
2239 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
2240
2241 if let Some(ref user_agent) = configuration.user_agent {
2242 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2243 }
2244 if let Some(ref token) = configuration.bearer_access_token {
2245 req_builder = req_builder.bearer_auth(token.to_owned());
2246 };
2247 req_builder = req_builder.json(&p_body_kubernetes_service_connection_request);
2248
2249 let req = req_builder.build()?;
2250 let resp = configuration.client.execute(req).await?;
2251
2252 let status = resp.status();
2253 let content_type = resp
2254 .headers()
2255 .get("content-type")
2256 .and_then(|v| v.to_str().ok())
2257 .unwrap_or("application/octet-stream");
2258 let content_type = super::ContentType::from(content_type);
2259
2260 if !status.is_client_error() && !status.is_server_error() {
2261 let content = resp.text().await?;
2262 match content_type {
2263 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2264 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::KubernetesServiceConnection`"))),
2265 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::KubernetesServiceConnection`")))),
2266 }
2267 } else {
2268 let content = resp.text().await?;
2269 let entity: Option<OutpostsServiceConnectionsKubernetesUpdateError> = serde_json::from_str(&content).ok();
2270 Err(Error::ResponseError(ResponseContent {
2271 status,
2272 content,
2273 entity,
2274 }))
2275 }
2276}
2277
2278pub async fn outposts_service_connections_kubernetes_used_by_list(
2280 configuration: &configuration::Configuration,
2281 uuid: &str,
2282) -> Result<Vec<models::UsedBy>, Error<OutpostsServiceConnectionsKubernetesUsedByListError>> {
2283 let p_path_uuid = uuid;
2285
2286 let uri_str = format!(
2287 "{}/outposts/service_connections/kubernetes/{uuid}/used_by/",
2288 configuration.base_path,
2289 uuid = crate::apis::urlencode(p_path_uuid)
2290 );
2291 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2292
2293 if let Some(ref user_agent) = configuration.user_agent {
2294 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2295 }
2296 if let Some(ref token) = configuration.bearer_access_token {
2297 req_builder = req_builder.bearer_auth(token.to_owned());
2298 };
2299
2300 let req = req_builder.build()?;
2301 let resp = configuration.client.execute(req).await?;
2302
2303 let status = resp.status();
2304 let content_type = resp
2305 .headers()
2306 .get("content-type")
2307 .and_then(|v| v.to_str().ok())
2308 .unwrap_or("application/octet-stream");
2309 let content_type = super::ContentType::from(content_type);
2310
2311 if !status.is_client_error() && !status.is_server_error() {
2312 let content = resp.text().await?;
2313 match content_type {
2314 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2315 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
2316 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::UsedBy>`")))),
2317 }
2318 } else {
2319 let content = resp.text().await?;
2320 let entity: Option<OutpostsServiceConnectionsKubernetesUsedByListError> = serde_json::from_str(&content).ok();
2321 Err(Error::ResponseError(ResponseContent {
2322 status,
2323 content,
2324 entity,
2325 }))
2326 }
2327}