use super::types;
use crate::{
ByteStream, ClientHooks, ClientInfo, Error, OperationInfo, RequestBuilderExt,
ResponseValue, encode_path,
};
#[derive(Debug, Clone)]
pub struct ProvidersList<'a> {
client: &'a crate::Client,
account_id: Result<types::McnAccountId, String>,
cloudflare: Result<bool, String>,
desc: Result<bool, String>,
order_by: Result<::std::string::String, String>,
status: Result<bool, String>,
}
impl<'a> ProvidersList<'a> {
pub fn new(client: &'a crate::Client) -> Self {
Self {
client: client,
account_id: Err("account_id was not initialized".to_string()),
cloudflare: Err("cloudflare was not initialized".to_string()),
desc: Err("desc was not initialized".to_string()),
order_by: Err("order_by was not initialized".to_string()),
status: Err("status was not initialized".to_string()),
}
}
pub fn account_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::McnAccountId>,
{
self.account_id = value
.try_into()
.map_err(|_| "conversion to `McnAccountId` for account_id failed".to_string());
self
}
pub fn cloudflare<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<bool>,
{
self.cloudflare = value
.try_into()
.map_err(|_| "conversion to `bool` for cloudflare failed".to_string());
self
}
pub fn desc<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<bool>,
{
self.desc = value
.try_into()
.map_err(|_| "conversion to `bool` for desc failed".to_string());
self
}
pub fn order_by<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.order_by = value.try_into().map_err(|_| {
"conversion to `:: std :: string :: String` for order_by failed".to_string()
});
self
}
pub fn status<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<bool>,
{
self.status = value
.try_into()
.map_err(|_| "conversion to `bool` for status failed".to_string());
self
}
pub async fn send(
self,
) -> Result<
ResponseValue<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
Error<()>,
> {
let Self {
client,
account_id,
cloudflare,
desc,
order_by,
status,
} = self;
let account_id = account_id.map_err(Error::InvalidRequest)?;
let cloudflare = cloudflare.map_err(Error::InvalidRequest)?;
let desc = desc.map_err(Error::InvalidRequest)?;
let order_by = order_by.map_err(Error::InvalidRequest)?;
let status = status.map_err(Error::InvalidRequest)?;
let url = format!(
"{}/accounts/{}/magic/cloud/providers",
client.baseurl,
encode_path(&account_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(crate::Client::api_version()),
);
#[allow(unused_mut)]
let mut request = client
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new(
"cloudflare",
&cloudflare,
))
.query(&progenitor_client::QueryParam::new("desc", &desc))
.query(&progenitor_client::QueryParam::new("order_by", &order_by))
.query(&progenitor_client::QueryParam::new("status", &status))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "providers_list",
};
client.pre(&mut request, &info).await?;
let result = client.exec(request, &info).await;
client.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
}
#[derive(Debug, Clone)]
pub struct ProvidersCreate<'a> {
client: &'a crate::Client,
account_id: Result<types::McnAccountId, String>,
forwarded: Result<::std::string::String, String>,
body: Result<types::builder::McnCreateProviderRequest, String>,
}
impl<'a> ProvidersCreate<'a> {
pub fn new(client: &'a crate::Client) -> Self {
Self {
client: client,
account_id: Err("account_id was not initialized".to_string()),
forwarded: Err("forwarded was not initialized".to_string()),
body: Ok(::std::default::Default::default()),
}
}
pub fn account_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::McnAccountId>,
{
self.account_id = value
.try_into()
.map_err(|_| "conversion to `McnAccountId` for account_id failed".to_string());
self
}
pub fn forwarded<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.forwarded = value.try_into().map_err(|_| {
"conversion to `:: std :: string :: String` for forwarded failed".to_string()
});
self
}
pub fn body<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::McnCreateProviderRequest>,
<V as std::convert::TryInto<types::McnCreateProviderRequest>>::Error: std::fmt::Display,
{
self.body = value.try_into().map(From::from).map_err(|s| {
format!(
"conversion to `McnCreateProviderRequest` for body failed: {}",
s
)
});
self
}
pub fn body<F>(mut self, f: F) -> Self
where
F: std::ops::FnOnce(
types::builder::McnCreateProviderRequest,
) -> types::builder::McnCreateProviderRequest,
{
self.body = self.body.map(f);
self
}
pub async fn send(
self,
) -> Result<
ResponseValue<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
Error<()>,
> {
let Self {
client,
account_id,
forwarded,
body,
} = self;
let account_id = account_id.map_err(Error::InvalidRequest)?;
let forwarded = forwarded.map_err(Error::InvalidRequest)?;
let body = body
.and_then(|v| {
types::McnCreateProviderRequest::try_from(v).map_err(|e| e.to_string())
})
.map_err(Error::InvalidRequest)?;
let url = format!(
"{}/accounts/{}/magic/cloud/providers",
client.baseurl,
encode_path(&account_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(crate::Client::api_version()),
);
header_map.append("forwarded", forwarded.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = client
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "providers_create",
};
client.pre(&mut request, &info).await?;
let result = client.exec(request, &info).await;
client.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
201u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
}
#[derive(Debug, Clone)]
pub struct ProvidersRead<'a> {
client: &'a crate::Client,
account_id: Result<types::McnAccountId, String>,
provider_id: Result<types::McnProviderId, String>,
status: Result<bool, String>,
}
impl<'a> ProvidersRead<'a> {
pub fn new(client: &'a crate::Client) -> Self {
Self {
client: client,
account_id: Err("account_id was not initialized".to_string()),
provider_id: Err("provider_id was not initialized".to_string()),
status: Err("status was not initialized".to_string()),
}
}
pub fn account_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::McnAccountId>,
{
self.account_id = value
.try_into()
.map_err(|_| "conversion to `McnAccountId` for account_id failed".to_string());
self
}
pub fn provider_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::McnProviderId>,
{
self.provider_id = value
.try_into()
.map_err(|_| "conversion to `McnProviderId` for provider_id failed".to_string());
self
}
pub fn status<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<bool>,
{
self.status = value
.try_into()
.map_err(|_| "conversion to `bool` for status failed".to_string());
self
}
pub async fn send(
self,
) -> Result<
ResponseValue<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
Error<()>,
> {
let Self {
client,
account_id,
provider_id,
status,
} = self;
let account_id = account_id.map_err(Error::InvalidRequest)?;
let provider_id = provider_id.map_err(Error::InvalidRequest)?;
let status = status.map_err(Error::InvalidRequest)?;
let url = format!(
"{}/accounts/{}/magic/cloud/providers/{}",
client.baseurl,
encode_path(&account_id.to_string()),
encode_path(&provider_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(crate::Client::api_version()),
);
#[allow(unused_mut)]
let mut request = client
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("status", &status))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "providers_read",
};
client.pre(&mut request, &info).await?;
let result = client.exec(request, &info).await;
client.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
}
#[derive(Debug, Clone)]
pub struct ProvidersUpdate<'a> {
client: &'a crate::Client,
account_id: Result<types::McnAccountId, String>,
provider_id: Result<types::McnProviderId, String>,
body: Result<types::builder::McnUpdateProviderRequest, String>,
}
impl<'a> ProvidersUpdate<'a> {
pub fn new(client: &'a crate::Client) -> Self {
Self {
client: client,
account_id: Err("account_id was not initialized".to_string()),
provider_id: Err("provider_id was not initialized".to_string()),
body: Ok(::std::default::Default::default()),
}
}
pub fn account_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::McnAccountId>,
{
self.account_id = value
.try_into()
.map_err(|_| "conversion to `McnAccountId` for account_id failed".to_string());
self
}
pub fn provider_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::McnProviderId>,
{
self.provider_id = value
.try_into()
.map_err(|_| "conversion to `McnProviderId` for provider_id failed".to_string());
self
}
pub fn body<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::McnUpdateProviderRequest>,
<V as std::convert::TryInto<types::McnUpdateProviderRequest>>::Error: std::fmt::Display,
{
self.body = value.try_into().map(From::from).map_err(|s| {
format!(
"conversion to `McnUpdateProviderRequest` for body failed: {}",
s
)
});
self
}
pub fn body<F>(mut self, f: F) -> Self
where
F: std::ops::FnOnce(
types::builder::McnUpdateProviderRequest,
) -> types::builder::McnUpdateProviderRequest,
{
self.body = self.body.map(f);
self
}
pub async fn send(
self,
) -> Result<
ResponseValue<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
Error<()>,
> {
let Self {
client,
account_id,
provider_id,
body,
} = self;
let account_id = account_id.map_err(Error::InvalidRequest)?;
let provider_id = provider_id.map_err(Error::InvalidRequest)?;
let body = body
.and_then(|v| {
types::McnUpdateProviderRequest::try_from(v).map_err(|e| e.to_string())
})
.map_err(Error::InvalidRequest)?;
let url = format!(
"{}/accounts/{}/magic/cloud/providers/{}",
client.baseurl,
encode_path(&account_id.to_string()),
encode_path(&provider_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(crate::Client::api_version()),
);
#[allow(unused_mut)]
let mut request = client
.client
.put(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "providers_update",
};
client.pre(&mut request, &info).await?;
let result = client.exec(request, &info).await;
client.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
}
#[derive(Debug, Clone)]
pub struct ProvidersDelete<'a> {
client: &'a crate::Client,
account_id: Result<types::McnAccountId, String>,
provider_id: Result<types::McnProviderId, String>,
}
impl<'a> ProvidersDelete<'a> {
pub fn new(client: &'a crate::Client) -> Self {
Self {
client: client,
account_id: Err("account_id was not initialized".to_string()),
provider_id: Err("provider_id was not initialized".to_string()),
}
}
pub fn account_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::McnAccountId>,
{
self.account_id = value
.try_into()
.map_err(|_| "conversion to `McnAccountId` for account_id failed".to_string());
self
}
pub fn provider_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::McnProviderId>,
{
self.provider_id = value
.try_into()
.map_err(|_| "conversion to `McnProviderId` for provider_id failed".to_string());
self
}
pub async fn send(
self,
) -> Result<
ResponseValue<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
Error<()>,
> {
let Self {
client,
account_id,
provider_id,
} = self;
let account_id = account_id.map_err(Error::InvalidRequest)?;
let provider_id = provider_id.map_err(Error::InvalidRequest)?;
let url = format!(
"{}/accounts/{}/magic/cloud/providers/{}",
client.baseurl,
encode_path(&account_id.to_string()),
encode_path(&provider_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(crate::Client::api_version()),
);
#[allow(unused_mut)]
let mut request = client
.client
.delete(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "providers_delete",
};
client.pre(&mut request, &info).await?;
let result = client.exec(request, &info).await;
client.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
}
#[derive(Debug, Clone)]
pub struct ProvidersPatch<'a> {
client: &'a crate::Client,
account_id: Result<types::McnAccountId, String>,
provider_id: Result<types::McnProviderId, String>,
body: Result<types::builder::McnUpdateProviderRequest, String>,
}
impl<'a> ProvidersPatch<'a> {
pub fn new(client: &'a crate::Client) -> Self {
Self {
client: client,
account_id: Err("account_id was not initialized".to_string()),
provider_id: Err("provider_id was not initialized".to_string()),
body: Ok(::std::default::Default::default()),
}
}
pub fn account_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::McnAccountId>,
{
self.account_id = value
.try_into()
.map_err(|_| "conversion to `McnAccountId` for account_id failed".to_string());
self
}
pub fn provider_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::McnProviderId>,
{
self.provider_id = value
.try_into()
.map_err(|_| "conversion to `McnProviderId` for provider_id failed".to_string());
self
}
pub fn body<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::McnUpdateProviderRequest>,
<V as std::convert::TryInto<types::McnUpdateProviderRequest>>::Error: std::fmt::Display,
{
self.body = value.try_into().map(From::from).map_err(|s| {
format!(
"conversion to `McnUpdateProviderRequest` for body failed: {}",
s
)
});
self
}
pub fn body<F>(mut self, f: F) -> Self
where
F: std::ops::FnOnce(
types::builder::McnUpdateProviderRequest,
) -> types::builder::McnUpdateProviderRequest,
{
self.body = self.body.map(f);
self
}
pub async fn send(
self,
) -> Result<
ResponseValue<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
Error<()>,
> {
let Self {
client,
account_id,
provider_id,
body,
} = self;
let account_id = account_id.map_err(Error::InvalidRequest)?;
let provider_id = provider_id.map_err(Error::InvalidRequest)?;
let body = body
.and_then(|v| {
types::McnUpdateProviderRequest::try_from(v).map_err(|e| e.to_string())
})
.map_err(Error::InvalidRequest)?;
let url = format!(
"{}/accounts/{}/magic/cloud/providers/{}",
client.baseurl,
encode_path(&account_id.to_string()),
encode_path(&provider_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(crate::Client::api_version()),
);
#[allow(unused_mut)]
let mut request = client
.client
.patch(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "providers_patch",
};
client.pre(&mut request, &info).await?;
let result = client.exec(request, &info).await;
client.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
}
#[derive(Debug, Clone)]
pub struct ProvidersDiscover<'a> {
client: &'a crate::Client,
account_id: Result<types::McnAccountId, String>,
provider_id: Result<types::McnProviderId, String>,
v2: Result<bool, String>,
}
impl<'a> ProvidersDiscover<'a> {
pub fn new(client: &'a crate::Client) -> Self {
Self {
client: client,
account_id: Err("account_id was not initialized".to_string()),
provider_id: Err("provider_id was not initialized".to_string()),
v2: Err("v2 was not initialized".to_string()),
}
}
pub fn account_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::McnAccountId>,
{
self.account_id = value
.try_into()
.map_err(|_| "conversion to `McnAccountId` for account_id failed".to_string());
self
}
pub fn provider_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::McnProviderId>,
{
self.provider_id = value
.try_into()
.map_err(|_| "conversion to `McnProviderId` for provider_id failed".to_string());
self
}
pub fn v2<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<bool>,
{
self.v2 = value
.try_into()
.map_err(|_| "conversion to `bool` for v2 failed".to_string());
self
}
pub async fn send(
self,
) -> Result<
ResponseValue<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
Error<()>,
> {
let Self {
client,
account_id,
provider_id,
v2,
} = self;
let account_id = account_id.map_err(Error::InvalidRequest)?;
let provider_id = provider_id.map_err(Error::InvalidRequest)?;
let v2 = v2.map_err(Error::InvalidRequest)?;
let url = format!(
"{}/accounts/{}/magic/cloud/providers/{}/discover",
client.baseurl,
encode_path(&account_id.to_string()),
encode_path(&provider_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(crate::Client::api_version()),
);
#[allow(unused_mut)]
let mut request = client
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("v2", &v2))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "providers_discover",
};
client.pre(&mut request, &info).await?;
let result = client.exec(request, &info).await;
client.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
202u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
}
#[derive(Debug, Clone)]
pub struct ProvidersInitialSetup<'a> {
client: &'a crate::Client,
account_id: Result<types::McnAccountId, String>,
provider_id: Result<types::McnProviderId, String>,
}
impl<'a> ProvidersInitialSetup<'a> {
pub fn new(client: &'a crate::Client) -> Self {
Self {
client: client,
account_id: Err("account_id was not initialized".to_string()),
provider_id: Err("provider_id was not initialized".to_string()),
}
}
pub fn account_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::McnAccountId>,
{
self.account_id = value
.try_into()
.map_err(|_| "conversion to `McnAccountId` for account_id failed".to_string());
self
}
pub fn provider_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::McnProviderId>,
{
self.provider_id = value
.try_into()
.map_err(|_| "conversion to `McnProviderId` for provider_id failed".to_string());
self
}
pub async fn send(
self,
) -> Result<
ResponseValue<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
Error<()>,
> {
let Self {
client,
account_id,
provider_id,
} = self;
let account_id = account_id.map_err(Error::InvalidRequest)?;
let provider_id = provider_id.map_err(Error::InvalidRequest)?;
let url = format!(
"{}/accounts/{}/magic/cloud/providers/{}/initial_setup",
client.baseurl,
encode_path(&account_id.to_string()),
encode_path(&provider_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(crate::Client::api_version()),
);
#[allow(unused_mut)]
let mut request = client
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "providers_initial_setup",
};
client.pre(&mut request, &info).await?;
let result = client.exec(request, &info).await;
client.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
}
#[derive(Debug, Clone)]
pub struct ProvidersDiscoverAll<'a> {
client: &'a crate::Client,
account_id: Result<types::McnAccountId, String>,
}
impl<'a> ProvidersDiscoverAll<'a> {
pub fn new(client: &'a crate::Client) -> Self {
Self {
client: client,
account_id: Err("account_id was not initialized".to_string()),
}
}
pub fn account_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::McnAccountId>,
{
self.account_id = value
.try_into()
.map_err(|_| "conversion to `McnAccountId` for account_id failed".to_string());
self
}
pub async fn send(
self,
) -> Result<
ResponseValue<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
Error<()>,
> {
let Self { client, account_id } = self;
let account_id = account_id.map_err(Error::InvalidRequest)?;
let url = format!(
"{}/accounts/{}/magic/cloud/providers/discover",
client.baseurl,
encode_path(&account_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(crate::Client::api_version()),
);
#[allow(unused_mut)]
let mut request = client
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "providers_discover_all",
};
client.pre(&mut request, &info).await?;
let result = client.exec(request, &info).await;
client.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
202u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
}