use std::rc::Rc;
use std::borrow::Borrow;
#[allow(unused_imports)]
use std::option::Option;
use hyper;
use serde_json;
use futures::Future;
use super::{Error, configuration};
use super::request as __internal_request;
pub struct BulkActionsControllerApiClient<C: hyper::client::Connect> {
configuration: Rc<configuration::Configuration<C>>,
}
impl<C: hyper::client::Connect> BulkActionsControllerApiClient<C> {
pub fn new(configuration: Rc<configuration::Configuration<C>>) -> BulkActionsControllerApiClient<C> {
BulkActionsControllerApiClient {
configuration,
}
}
}
pub trait BulkActionsControllerApi {
fn bulk_create_inboxes(&self, count: i32) -> Box<dyn Future<Item = Vec<crate::models::Inbox>, Error = Error<serde_json::Value>>>;
fn bulk_delete_inboxes(&self, ids: Vec<String>) -> Box<dyn Future<Item = (), Error = Error<serde_json::Value>>>;
fn bulk_send_emails(&self, bulk_send_email_options: crate::models::BulkSendEmailOptions) -> Box<dyn Future<Item = (), Error = Error<serde_json::Value>>>;
}
impl<C: hyper::client::Connect>BulkActionsControllerApi for BulkActionsControllerApiClient<C> {
fn bulk_create_inboxes(&self, count: i32) -> Box<dyn Future<Item = Vec<crate::models::Inbox>, Error = Error<serde_json::Value>>> {
let mut req = __internal_request::Request::new(hyper::Method::Post, "/bulk/inboxes".to_string())
.with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{
in_header: true,
in_query: false,
param_name: "x-api-key".to_owned(),
}))
;
req = req.with_query_param("count".to_string(), count.to_string());
req.execute(self.configuration.borrow())
}
fn bulk_delete_inboxes(&self, ids: Vec<String>) -> Box<dyn Future<Item = (), Error = Error<serde_json::Value>>> {
let mut req = __internal_request::Request::new(hyper::Method::Delete, "/bulk/inboxes".to_string())
.with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{
in_header: true,
in_query: false,
param_name: "x-api-key".to_owned(),
}))
;
req = req.with_body_param(ids);
req = req.returns_nothing();
req.execute(self.configuration.borrow())
}
fn bulk_send_emails(&self, bulk_send_email_options: crate::models::BulkSendEmailOptions) -> Box<dyn Future<Item = (), Error = Error<serde_json::Value>>> {
let mut req = __internal_request::Request::new(hyper::Method::Post, "/bulk/send".to_string())
.with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{
in_header: true,
in_query: false,
param_name: "x-api-key".to_owned(),
}))
;
req = req.with_body_param(bulk_send_email_options);
req = req.returns_nothing();
req.execute(self.configuration.borrow())
}
}