use std::borrow::Borrow;
use std::rc::Rc;
use futures;
use futures::Future;
use hyper;
use super::{configuration, query, Error};
pub struct AuthProvidersApiClient<C: hyper::client::connect::Connect> {
configuration: Rc<configuration::Configuration<C>>,
}
impl<C: hyper::client::connect::Connect> AuthProvidersApiClient<C> {
pub fn new(configuration: Rc<configuration::Configuration<C>>) -> AuthProvidersApiClient<C> {
AuthProvidersApiClient {
configuration: configuration,
}
}
}
pub trait AuthProvidersApi {
fn get_ads_provider_controllers(
&self,
id: &str,
groupnet: &str,
) -> Box<dyn Future<Item = crate::models::AdsProviderControllers, Error = Error>>;
fn get_ads_provider_domain(
&self,
ads_provider_domain_id: &str,
id: &str,
) -> Box<dyn Future<Item = crate::models::AdsProviderDomains, Error = Error>>;
fn get_ads_provider_domains(
&self,
id: &str,
scope: &str,
) -> Box<dyn Future<Item = crate::models::AdsProviderDomains, Error = Error>>;
fn get_ads_provider_search(
&self,
id: &str,
domain: &str,
description: &str,
resume: &str,
search_users: bool,
filter: &str,
limit: i32,
user: &str,
password: &str,
search_groups: bool,
) -> Box<dyn Future<Item = crate::models::AdsProviderSearch, Error = Error>>;
}
impl<C: hyper::client::connect::Connect + 'static> AuthProvidersApi for AuthProvidersApiClient<C> {
fn get_ads_provider_controllers(
&self,
id: &str,
groupnet: &str,
) -> Box<dyn Future<Item = crate::models::AdsProviderControllers, Error = Error>> {
let q = ::url::form_urlencoded::Serializer::new(String::new())
.append_pair("groupnet", &groupnet.to_string())
.finish();
let uri_str = format!(
"{}/platform/3/auth/providers/ads/{Id}/controllers?{}",
self.configuration.base_path,
q,
Id = id
);
query(
self.configuration.borrow(),
&uri_str,
&"",
hyper::Method::GET,
)
}
fn get_ads_provider_domain(
&self,
ads_provider_domain_id: &str,
id: &str,
) -> Box<dyn Future<Item = crate::models::AdsProviderDomains, Error = Error>> {
let uri_str = format!(
"{}/platform/3/auth/providers/ads/{Id}/domains/{AdsProviderDomainId}",
self.configuration.base_path,
AdsProviderDomainId = ads_provider_domain_id,
Id = id
);
query(
self.configuration.borrow(),
&uri_str,
&"",
hyper::Method::GET,
)
}
fn get_ads_provider_domains(
&self,
id: &str,
scope: &str,
) -> Box<dyn Future<Item = crate::models::AdsProviderDomains, Error = Error>> {
let q = ::url::form_urlencoded::Serializer::new(String::new())
.append_pair("scope", &scope.to_string())
.finish();
let uri_str = format!(
"{}/platform/3/auth/providers/ads/{Id}/domains?{}",
self.configuration.base_path,
q,
Id = id
);
query(
self.configuration.borrow(),
&uri_str,
&"",
hyper::Method::GET,
)
}
fn get_ads_provider_search(
&self,
id: &str,
domain: &str,
description: &str,
resume: &str,
search_users: bool,
filter: &str,
limit: i32,
user: &str,
password: &str,
search_groups: bool,
) -> Box<dyn Future<Item = crate::models::AdsProviderSearch, Error = Error>> {
let q = ::url::form_urlencoded::Serializer::new(String::new())
.append_pair("domain", &domain.to_string())
.append_pair("description", &description.to_string())
.append_pair("resume", &resume.to_string())
.append_pair("search_users", &search_users.to_string())
.append_pair("filter", &filter.to_string())
.append_pair("limit", &limit.to_string())
.append_pair("user", &user.to_string())
.append_pair("password", &password.to_string())
.append_pair("search_groups", &search_groups.to_string())
.finish();
let uri_str = format!(
"{}/platform/1/auth/providers/ads/{Id}/search?{}",
self.configuration.base_path,
q,
Id = id
);
query(
self.configuration.borrow(),
&uri_str,
&"",
hyper::Method::GET,
)
}
}