use std::borrow::Borrow;
#[allow(unused_imports)]
use std::option::Option;
use std::pin::Pin;
use std::sync::Arc;
use futures::Future;
use hyper;
use hyper_util::client::legacy::connect::Connect;
use super::request as __internal_request;
use super::{configuration, Error};
use crate::models;
pub struct SecretsCompatApiClient<C: Connect>
where
C: Clone + std::marker::Send + Sync + 'static,
{
configuration: Arc<configuration::Configuration<C>>,
}
impl<C: Connect> SecretsCompatApiClient<C>
where
C: Clone + std::marker::Send + Sync,
{
pub fn new(configuration: Arc<configuration::Configuration<C>>) -> SecretsCompatApiClient<C> {
SecretsCompatApiClient { configuration }
}
}
pub trait SecretsCompatApi: Send + Sync {
fn secret_create(
&self,
create: Option<models::SecretCreate>,
) -> Pin<Box<dyn Future<Output = Result<models::SecretCreateLibpod201Response, Error>> + Send>>;
fn secret_delete(&self, name: &str) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send>>;
fn secret_inspect(
&self,
name: &str,
) -> Pin<Box<dyn Future<Output = Result<models::SecretInfoReportCompat, Error>> + Send>>;
fn secret_list(
&self,
filters: Option<&str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<models::SecretInfoReportCompat>, Error>> + Send>>;
}
impl<C: Connect> SecretsCompatApi for SecretsCompatApiClient<C>
where
C: Clone + std::marker::Send + Sync,
{
#[allow(unused_mut)]
fn secret_create(
&self,
create: Option<models::SecretCreate>,
) -> Pin<Box<dyn Future<Output = Result<models::SecretCreateLibpod201Response, Error>> + Send>>
{
let mut req =
__internal_request::Request::new(hyper::Method::POST, "/secrets/create".to_string());
req = req.with_body_param(create);
req.execute(self.configuration.borrow())
}
#[allow(unused_mut)]
fn secret_delete(&self, name: &str) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send>> {
let mut req =
__internal_request::Request::new(hyper::Method::DELETE, "/secrets/{name}".to_string());
req = req.with_path_param("name".to_string(), name.to_string());
req = req.returns_nothing();
req.execute(self.configuration.borrow())
}
#[allow(unused_mut)]
fn secret_inspect(
&self,
name: &str,
) -> Pin<Box<dyn Future<Output = Result<models::SecretInfoReportCompat, Error>> + Send>> {
let mut req =
__internal_request::Request::new(hyper::Method::GET, "/secrets/{name}".to_string());
req = req.with_path_param("name".to_string(), name.to_string());
req.execute(self.configuration.borrow())
}
#[allow(unused_mut)]
fn secret_list(
&self,
filters: Option<&str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<models::SecretInfoReportCompat>, Error>> + Send>>
{
let mut req = __internal_request::Request::new(hyper::Method::GET, "/secrets".to_string());
if let Some(ref s) = filters {
let query_value = s.to_string();
req = req.with_query_param("filters".to_string(), query_value);
}
req.execute(self.configuration.borrow())
}
}