use std::sync::Arc;
use std::borrow::Borrow;
use std::pin::Pin;
#[allow(unused_imports)]
use std::option::Option;
use hyper;
use hyper_util::client::legacy::connect::Connect;
use futures::Future;
use crate::models;
use super::{Error, configuration};
use super::request as __internal_request;
pub struct LiffApiClient<C: Connect>
where C: Clone + std::marker::Send + Sync + 'static {
configuration: Arc<configuration::Configuration<C>>,
}
impl<C: Connect> LiffApiClient<C>
where C: Clone + std::marker::Send + Sync {
pub fn new(configuration: Arc<configuration::Configuration<C>>) -> LiffApiClient<C> {
LiffApiClient {
configuration,
}
}
}
pub trait LiffApi: Send + Sync {
fn add_liff_app(&self, add_liff_app_request: models::AddLiffAppRequest) -> Pin<Box<dyn Future<Output = Result<models::AddLiffAppResponse, Error>> + Send>>;
fn delete_liff_app(&self, liff_id: &str) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send>>;
fn get_all_liff_apps(&self, ) -> Pin<Box<dyn Future<Output = Result<models::GetAllLiffAppsResponse, Error>> + Send>>;
fn update_liff_app(&self, liff_id: &str, update_liff_app_request: models::UpdateLiffAppRequest) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send>>;
}
impl<C: Connect>LiffApi for LiffApiClient<C>
where C: Clone + std::marker::Send + Sync {
#[allow(unused_mut)]
fn add_liff_app(&self, add_liff_app_request: models::AddLiffAppRequest) -> Pin<Box<dyn Future<Output = Result<models::AddLiffAppResponse, Error>> + Send>> {
let mut req = __internal_request::Request::new(hyper::Method::POST, "/liff/v1/apps".to_string())
;
req = req.with_body_param(add_liff_app_request);
req.execute(self.configuration.borrow())
}
#[allow(unused_mut)]
fn delete_liff_app(&self, liff_id: &str) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send>> {
let mut req = __internal_request::Request::new(hyper::Method::DELETE, "/liff/v1/apps/{liffId}".to_string())
;
req = req.with_path_param("liffId".to_string(), liff_id.to_string());
req = req.returns_nothing();
req.execute(self.configuration.borrow())
}
#[allow(unused_mut)]
fn get_all_liff_apps(&self, ) -> Pin<Box<dyn Future<Output = Result<models::GetAllLiffAppsResponse, Error>> + Send>> {
let mut req = __internal_request::Request::new(hyper::Method::GET, "/liff/v1/apps".to_string())
;
req.execute(self.configuration.borrow())
}
#[allow(unused_mut)]
fn update_liff_app(&self, liff_id: &str, update_liff_app_request: models::UpdateLiffAppRequest) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send>> {
let mut req = __internal_request::Request::new(hyper::Method::PUT, "/liff/v1/apps/{liffId}".to_string())
;
req = req.with_path_param("liffId".to_string(), liff_id.to_string());
req = req.with_body_param(update_liff_app_request);
req = req.returns_nothing();
req.execute(self.configuration.borrow())
}
}