podman_autogen_api/apis/
secrets_api.rs1use std::borrow::Borrow;
12#[allow(unused_imports)]
13use std::option::Option;
14use std::pin::Pin;
15use std::sync::Arc;
16
17use futures::Future;
18use hyper;
19use hyper_util::client::legacy::connect::Connect;
20
21use super::request as __internal_request;
22use super::{configuration, Error};
23use crate::models;
24
25pub struct SecretsApiClient<C: Connect>
26where
27 C: Clone + std::marker::Send + Sync + 'static,
28{
29 configuration: Arc<configuration::Configuration<C>>,
30}
31
32impl<C: Connect> SecretsApiClient<C>
33where
34 C: Clone + std::marker::Send + Sync,
35{
36 pub fn new(configuration: Arc<configuration::Configuration<C>>) -> SecretsApiClient<C> {
37 SecretsApiClient { configuration }
38 }
39}
40
41pub trait SecretsApi: Send + Sync {
42 fn secret_create_libpod(
43 &self,
44 name: &str,
45 driver: Option<&str>,
46 driveropts: Option<&str>,
47 labels: Option<&str>,
48 request: Option<&str>,
49 ) -> Pin<Box<dyn Future<Output = Result<models::SecretCreateLibpod201Response, Error>> + Send>>;
50 fn secret_delete_libpod(
51 &self,
52 name: &str,
53 all: Option<bool>,
54 ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send>>;
55 fn secret_exists_libpod(
56 &self,
57 name: &str,
58 ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send>>;
59 fn secret_inspect_libpod(
60 &self,
61 name: &str,
62 showsecret: Option<bool>,
63 ) -> Pin<Box<dyn Future<Output = Result<models::SecretInfoReport, Error>> + Send>>;
64 fn secret_list_libpod(
65 &self,
66 filters: Option<&str>,
67 ) -> Pin<Box<dyn Future<Output = Result<Vec<models::SecretInfoReport>, Error>> + Send>>;
68}
69
70impl<C: Connect> SecretsApi for SecretsApiClient<C>
71where
72 C: Clone + std::marker::Send + Sync,
73{
74 #[allow(unused_mut)]
75 fn secret_create_libpod(
76 &self,
77 name: &str,
78 driver: Option<&str>,
79 driveropts: Option<&str>,
80 labels: Option<&str>,
81 request: Option<&str>,
82 ) -> Pin<Box<dyn Future<Output = Result<models::SecretCreateLibpod201Response, Error>> + Send>>
83 {
84 let mut req = __internal_request::Request::new(
85 hyper::Method::POST,
86 "/libpod/secrets/create".to_string(),
87 );
88 req = req.with_query_param("name".to_string(), name.to_string());
89 if let Some(ref s) = driver {
90 let query_value = s.to_string();
91 req = req.with_query_param("driver".to_string(), query_value);
92 }
93 if let Some(ref s) = driveropts {
94 let query_value = s.to_string();
95 req = req.with_query_param("driveropts".to_string(), query_value);
96 }
97 if let Some(ref s) = labels {
98 let query_value = s.to_string();
99 req = req.with_query_param("labels".to_string(), query_value);
100 }
101 req = req.with_body_param(request);
102
103 req.execute(self.configuration.borrow())
104 }
105
106 #[allow(unused_mut)]
107 fn secret_delete_libpod(
108 &self,
109 name: &str,
110 all: Option<bool>,
111 ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send>> {
112 let mut req = __internal_request::Request::new(
113 hyper::Method::DELETE,
114 "/libpod/secrets/{name}".to_string(),
115 );
116 if let Some(ref s) = all {
117 let query_value = s.to_string();
118 req = req.with_query_param("all".to_string(), query_value);
119 }
120 req = req.with_path_param("name".to_string(), name.to_string());
121 req = req.returns_nothing();
122
123 req.execute(self.configuration.borrow())
124 }
125
126 #[allow(unused_mut)]
127 fn secret_exists_libpod(
128 &self,
129 name: &str,
130 ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send>> {
131 let mut req = __internal_request::Request::new(
132 hyper::Method::GET,
133 "/libpod/secrets/{name}/exists".to_string(),
134 );
135 req = req.with_path_param("name".to_string(), name.to_string());
136 req = req.returns_nothing();
137
138 req.execute(self.configuration.borrow())
139 }
140
141 #[allow(unused_mut)]
142 fn secret_inspect_libpod(
143 &self,
144 name: &str,
145 showsecret: Option<bool>,
146 ) -> Pin<Box<dyn Future<Output = Result<models::SecretInfoReport, Error>> + Send>> {
147 let mut req = __internal_request::Request::new(
148 hyper::Method::GET,
149 "/libpod/secrets/{name}/json".to_string(),
150 );
151 if let Some(ref s) = showsecret {
152 let query_value = s.to_string();
153 req = req.with_query_param("showsecret".to_string(), query_value);
154 }
155 req = req.with_path_param("name".to_string(), name.to_string());
156
157 req.execute(self.configuration.borrow())
158 }
159
160 #[allow(unused_mut)]
161 fn secret_list_libpod(
162 &self,
163 filters: Option<&str>,
164 ) -> Pin<Box<dyn Future<Output = Result<Vec<models::SecretInfoReport>, Error>> + Send>> {
165 let mut req = __internal_request::Request::new(
166 hyper::Method::GET,
167 "/libpod/secrets/json".to_string(),
168 );
169 if let Some(ref s) = filters {
170 let query_value = s.to_string();
171 req = req.with_query_param("filters".to_string(), query_value);
172 }
173
174 req.execute(self.configuration.borrow())
175 }
176}