use super::types;
use crate::{
ByteStream, ClientHooks, ClientInfo, Error, OperationInfo, RequestBuilderExt,
ResponseValue, encode_path,
};
#[derive(Debug, Clone)]
pub struct DexFleetStatusDevices<'a> {
client: &'a crate::Client,
account_id: Result<types::DigitalExperienceMonitoringAccountIdentifier, String>,
colo: Result<types::DigitalExperienceMonitoringColo, String>,
device_id: Result<types::DigitalExperienceMonitoringDeviceId, String>,
from: Result<types::DigitalExperienceMonitoringTimestamp, String>,
mode: Result<types::DigitalExperienceMonitoringMode, String>,
page: Result<types::DigitalExperienceMonitoringPage, String>,
per_page: Result<types::DigitalExperienceMonitoringPerPage, String>,
platform: Result<types::DigitalExperienceMonitoringPlatform, String>,
sort_by: Result<types::DigitalExperienceMonitoringSortBy, String>,
source: Result<types::DigitalExperienceMonitoringSource, String>,
status: Result<types::DigitalExperienceMonitoringStatus, String>,
to: Result<types::DigitalExperienceMonitoringTimestamp, String>,
version: Result<types::DigitalExperienceMonitoringVersion, String>,
}
impl<'a> DexFleetStatusDevices<'a> {
pub fn new(client: &'a crate::Client) -> Self {
Self {
client: client,
account_id: Err("account_id was not initialized".to_string()),
colo: Err("colo was not initialized".to_string()),
device_id: Err("device_id was not initialized".to_string()),
from: Err("from was not initialized".to_string()),
mode: Err("mode was not initialized".to_string()),
page: Err("page was not initialized".to_string()),
per_page: Err("per_page was not initialized".to_string()),
platform: Err("platform was not initialized".to_string()),
sort_by: Err("sort_by was not initialized".to_string()),
source: Err("source was not initialized".to_string()),
status: Err("status was not initialized".to_string()),
to: Err("to was not initialized".to_string()),
version: Err("version was not initialized".to_string()),
}
}
pub fn account_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::DigitalExperienceMonitoringAccountIdentifier>,
{
self . account_id = value . try_into () . map_err (| _ | "conversion to `DigitalExperienceMonitoringAccountIdentifier` for account_id failed" . to_string ()) ;
self
}
pub fn colo<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::DigitalExperienceMonitoringColo>,
{
self.colo = value.try_into().map_err(|_| {
"conversion to `DigitalExperienceMonitoringColo` for colo failed".to_string()
});
self
}
pub fn device_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::DigitalExperienceMonitoringDeviceId>,
{
self.device_id = value.try_into().map_err(|_| {
"conversion to `DigitalExperienceMonitoringDeviceId` for device_id failed"
.to_string()
});
self
}
pub fn from<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::DigitalExperienceMonitoringTimestamp>,
{
self.from = value.try_into().map_err(|_| {
"conversion to `DigitalExperienceMonitoringTimestamp` for from failed".to_string()
});
self
}
pub fn mode<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::DigitalExperienceMonitoringMode>,
{
self.mode = value.try_into().map_err(|_| {
"conversion to `DigitalExperienceMonitoringMode` for mode failed".to_string()
});
self
}
pub fn page<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::DigitalExperienceMonitoringPage>,
{
self.page = value.try_into().map_err(|_| {
"conversion to `DigitalExperienceMonitoringPage` for page failed".to_string()
});
self
}
pub fn per_page<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::DigitalExperienceMonitoringPerPage>,
{
self.per_page = value.try_into().map_err(|_| {
"conversion to `DigitalExperienceMonitoringPerPage` for per_page failed".to_string()
});
self
}
pub fn platform<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::DigitalExperienceMonitoringPlatform>,
{
self.platform = value.try_into().map_err(|_| {
"conversion to `DigitalExperienceMonitoringPlatform` for platform failed"
.to_string()
});
self
}
pub fn sort_by<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::DigitalExperienceMonitoringSortBy>,
{
self.sort_by = value.try_into().map_err(|_| {
"conversion to `DigitalExperienceMonitoringSortBy` for sort_by failed".to_string()
});
self
}
pub fn source<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::DigitalExperienceMonitoringSource>,
{
self.source = value.try_into().map_err(|_| {
"conversion to `DigitalExperienceMonitoringSource` for source failed".to_string()
});
self
}
pub fn status<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::DigitalExperienceMonitoringStatus>,
{
self.status = value.try_into().map_err(|_| {
"conversion to `DigitalExperienceMonitoringStatus` for status failed".to_string()
});
self
}
pub fn to<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::DigitalExperienceMonitoringTimestamp>,
{
self.to = value.try_into().map_err(|_| {
"conversion to `DigitalExperienceMonitoringTimestamp` for to failed".to_string()
});
self
}
pub fn version<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::DigitalExperienceMonitoringVersion>,
{
self.version = value.try_into().map_err(|_| {
"conversion to `DigitalExperienceMonitoringVersion` for version 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,
colo,
device_id,
from,
mode,
page,
per_page,
platform,
sort_by,
source,
status,
to,
version,
} = self;
let account_id = account_id.map_err(Error::InvalidRequest)?;
let colo = colo.map_err(Error::InvalidRequest)?;
let device_id = device_id.map_err(Error::InvalidRequest)?;
let from = from.map_err(Error::InvalidRequest)?;
let mode = mode.map_err(Error::InvalidRequest)?;
let page = page.map_err(Error::InvalidRequest)?;
let per_page = per_page.map_err(Error::InvalidRequest)?;
let platform = platform.map_err(Error::InvalidRequest)?;
let sort_by = sort_by.map_err(Error::InvalidRequest)?;
let source = source.map_err(Error::InvalidRequest)?;
let status = status.map_err(Error::InvalidRequest)?;
let to = to.map_err(Error::InvalidRequest)?;
let version = version.map_err(Error::InvalidRequest)?;
let url = format!(
"{}/accounts/{}/dex/fleet-status/devices",
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("colo", &colo))
.query(&progenitor_client::QueryParam::new("device_id", &device_id))
.query(&progenitor_client::QueryParam::new("from", &from))
.query(&progenitor_client::QueryParam::new("mode", &mode))
.query(&progenitor_client::QueryParam::new("page", &page))
.query(&progenitor_client::QueryParam::new("per_page", &per_page))
.query(&progenitor_client::QueryParam::new("platform", &platform))
.query(&progenitor_client::QueryParam::new("sort_by", &sort_by))
.query(&progenitor_client::QueryParam::new("source", &source))
.query(&progenitor_client::QueryParam::new("status", &status))
.query(&progenitor_client::QueryParam::new("to", &to))
.query(&progenitor_client::QueryParam::new("version", &version))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "dex_fleet_status_devices",
};
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 DexFleetStatusLive<'a> {
client: &'a crate::Client,
account_id: Result<types::DigitalExperienceMonitoringAccountIdentifier, String>,
since_minutes: Result<types::DigitalExperienceMonitoringSinceMinutes, String>,
}
impl<'a> DexFleetStatusLive<'a> {
pub fn new(client: &'a crate::Client) -> Self {
Self {
client: client,
account_id: Err("account_id was not initialized".to_string()),
since_minutes: Err("since_minutes was not initialized".to_string()),
}
}
pub fn account_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::DigitalExperienceMonitoringAccountIdentifier>,
{
self . account_id = value . try_into () . map_err (| _ | "conversion to `DigitalExperienceMonitoringAccountIdentifier` for account_id failed" . to_string ()) ;
self
}
pub fn since_minutes<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::DigitalExperienceMonitoringSinceMinutes>,
{
self . since_minutes = value . try_into () . map_err (| _ | "conversion to `DigitalExperienceMonitoringSinceMinutes` for since_minutes 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,
since_minutes,
} = self;
let account_id = account_id.map_err(Error::InvalidRequest)?;
let since_minutes = since_minutes.map_err(Error::InvalidRequest)?;
let url = format!(
"{}/accounts/{}/dex/fleet-status/live",
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(
"since_minutes",
&since_minutes,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "dex_fleet_status_live",
};
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 DexFleetStatusOverTime<'a> {
client: &'a crate::Client,
account_id: Result<types::DigitalExperienceMonitoringAccountIdentifier, String>,
colo: Result<types::DigitalExperienceMonitoringColo, String>,
device_id: Result<types::DigitalExperienceMonitoringDeviceId, String>,
from: Result<types::DigitalExperienceMonitoringTimestamp, String>,
to: Result<types::DigitalExperienceMonitoringTimestamp, String>,
}
impl<'a> DexFleetStatusOverTime<'a> {
pub fn new(client: &'a crate::Client) -> Self {
Self {
client: client,
account_id: Err("account_id was not initialized".to_string()),
colo: Err("colo was not initialized".to_string()),
device_id: Err("device_id was not initialized".to_string()),
from: Err("from was not initialized".to_string()),
to: Err("to was not initialized".to_string()),
}
}
pub fn account_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::DigitalExperienceMonitoringAccountIdentifier>,
{
self . account_id = value . try_into () . map_err (| _ | "conversion to `DigitalExperienceMonitoringAccountIdentifier` for account_id failed" . to_string ()) ;
self
}
pub fn colo<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::DigitalExperienceMonitoringColo>,
{
self.colo = value.try_into().map_err(|_| {
"conversion to `DigitalExperienceMonitoringColo` for colo failed".to_string()
});
self
}
pub fn device_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::DigitalExperienceMonitoringDeviceId>,
{
self.device_id = value.try_into().map_err(|_| {
"conversion to `DigitalExperienceMonitoringDeviceId` for device_id failed"
.to_string()
});
self
}
pub fn from<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::DigitalExperienceMonitoringTimestamp>,
{
self.from = value.try_into().map_err(|_| {
"conversion to `DigitalExperienceMonitoringTimestamp` for from failed".to_string()
});
self
}
pub fn to<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::DigitalExperienceMonitoringTimestamp>,
{
self.to = value.try_into().map_err(|_| {
"conversion to `DigitalExperienceMonitoringTimestamp` for to 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,
colo,
device_id,
from,
to,
} = self;
let account_id = account_id.map_err(Error::InvalidRequest)?;
let colo = colo.map_err(Error::InvalidRequest)?;
let device_id = device_id.map_err(Error::InvalidRequest)?;
let from = from.map_err(Error::InvalidRequest)?;
let to = to.map_err(Error::InvalidRequest)?;
let url = format!(
"{}/accounts/{}/dex/fleet-status/over-time",
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("colo", &colo))
.query(&progenitor_client::QueryParam::new("device_id", &device_id))
.query(&progenitor_client::QueryParam::new("from", &from))
.query(&progenitor_client::QueryParam::new("to", &to))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "dex_fleet_status_over_time",
};
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 DexEndpointsHttpTestDetails<'a> {
client: &'a crate::Client,
account_id: Result<types::DigitalExperienceMonitoringAccountIdentifier, String>,
test_id: Result<types::DigitalExperienceMonitoringUuid, String>,
colo: Result<::std::string::String, String>,
device_id: Result<::std::vec::Vec<::std::string::String>, String>,
from: Result<::std::string::String, String>,
interval: Result<types::DexEndpointsHttpTestDetailsInterval, String>,
to: Result<::std::string::String, String>,
}
impl<'a> DexEndpointsHttpTestDetails<'a> {
pub fn new(client: &'a crate::Client) -> Self {
Self {
client: client,
account_id: Err("account_id was not initialized".to_string()),
test_id: Err("test_id was not initialized".to_string()),
colo: Err("colo was not initialized".to_string()),
device_id: Err("device_id was not initialized".to_string()),
from: Err("from was not initialized".to_string()),
interval: Err("interval was not initialized".to_string()),
to: Err("to was not initialized".to_string()),
}
}
pub fn account_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::DigitalExperienceMonitoringAccountIdentifier>,
{
self . account_id = value . try_into () . map_err (| _ | "conversion to `DigitalExperienceMonitoringAccountIdentifier` for account_id failed" . to_string ()) ;
self
}
pub fn test_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::DigitalExperienceMonitoringUuid>,
{
self.test_id = value.try_into().map_err(|_| {
"conversion to `DigitalExperienceMonitoringUuid` for test_id failed".to_string()
});
self
}
pub fn colo<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.colo = value.try_into().map_err(|_| {
"conversion to `:: std :: string :: String` for colo failed".to_string()
});
self
}
pub fn device_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::vec::Vec<::std::string::String>>,
{
self . device_id = value . try_into () . map_err (| _ | "conversion to `:: std :: vec :: Vec < :: std :: string :: String >` for device_id failed" . to_string ()) ;
self
}
pub fn from<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.from = value.try_into().map_err(|_| {
"conversion to `:: std :: string :: String` for from failed".to_string()
});
self
}
pub fn interval<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::DexEndpointsHttpTestDetailsInterval>,
{
self.interval = value.try_into().map_err(|_| {
"conversion to `DexEndpointsHttpTestDetailsInterval` for interval failed"
.to_string()
});
self
}
pub fn to<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.to = value.try_into().map_err(|_| {
"conversion to `:: std :: string :: String` for to 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,
test_id,
colo,
device_id,
from,
interval,
to,
} = self;
let account_id = account_id.map_err(Error::InvalidRequest)?;
let test_id = test_id.map_err(Error::InvalidRequest)?;
let colo = colo.map_err(Error::InvalidRequest)?;
let device_id = device_id.map_err(Error::InvalidRequest)?;
let from = from.map_err(Error::InvalidRequest)?;
let interval = interval.map_err(Error::InvalidRequest)?;
let to = to.map_err(Error::InvalidRequest)?;
let url = format!(
"{}/accounts/{}/dex/http-tests/{}",
client.baseurl,
encode_path(&account_id.to_string()),
encode_path(&test_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("colo", &colo))
.query(&progenitor_client::QueryParam::new("deviceId", &device_id))
.query(&progenitor_client::QueryParam::new("from", &from))
.query(&progenitor_client::QueryParam::new("interval", &interval))
.query(&progenitor_client::QueryParam::new("to", &to))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "dex_endpoints_http_test_details",
};
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 DexEndpointsHttpTestPercentiles<'a> {
client: &'a crate::Client,
account_id: Result<types::DigitalExperienceMonitoringAccountIdentifier, String>,
test_id: Result<types::DigitalExperienceMonitoringUuid, String>,
colo: Result<::std::string::String, String>,
device_id: Result<::std::vec::Vec<::std::string::String>, String>,
from: Result<::std::string::String, String>,
to: Result<::std::string::String, String>,
}
impl<'a> DexEndpointsHttpTestPercentiles<'a> {
pub fn new(client: &'a crate::Client) -> Self {
Self {
client: client,
account_id: Err("account_id was not initialized".to_string()),
test_id: Err("test_id was not initialized".to_string()),
colo: Err("colo was not initialized".to_string()),
device_id: Err("device_id was not initialized".to_string()),
from: Err("from was not initialized".to_string()),
to: Err("to was not initialized".to_string()),
}
}
pub fn account_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::DigitalExperienceMonitoringAccountIdentifier>,
{
self . account_id = value . try_into () . map_err (| _ | "conversion to `DigitalExperienceMonitoringAccountIdentifier` for account_id failed" . to_string ()) ;
self
}
pub fn test_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::DigitalExperienceMonitoringUuid>,
{
self.test_id = value.try_into().map_err(|_| {
"conversion to `DigitalExperienceMonitoringUuid` for test_id failed".to_string()
});
self
}
pub fn colo<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.colo = value.try_into().map_err(|_| {
"conversion to `:: std :: string :: String` for colo failed".to_string()
});
self
}
pub fn device_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::vec::Vec<::std::string::String>>,
{
self . device_id = value . try_into () . map_err (| _ | "conversion to `:: std :: vec :: Vec < :: std :: string :: String >` for device_id failed" . to_string ()) ;
self
}
pub fn from<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.from = value.try_into().map_err(|_| {
"conversion to `:: std :: string :: String` for from failed".to_string()
});
self
}
pub fn to<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.to = value.try_into().map_err(|_| {
"conversion to `:: std :: string :: String` for to 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,
test_id,
colo,
device_id,
from,
to,
} = self;
let account_id = account_id.map_err(Error::InvalidRequest)?;
let test_id = test_id.map_err(Error::InvalidRequest)?;
let colo = colo.map_err(Error::InvalidRequest)?;
let device_id = device_id.map_err(Error::InvalidRequest)?;
let from = from.map_err(Error::InvalidRequest)?;
let to = to.map_err(Error::InvalidRequest)?;
let url = format!(
"{}/accounts/{}/dex/http-tests/{}/percentiles",
client.baseurl,
encode_path(&account_id.to_string()),
encode_path(&test_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("colo", &colo))
.query(&progenitor_client::QueryParam::new("deviceId", &device_id))
.query(&progenitor_client::QueryParam::new("from", &from))
.query(&progenitor_client::QueryParam::new("to", &to))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "dex_endpoints_http_test_percentiles",
};
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 DexEndpointsTestsUniqueDevices<'a> {
client: &'a crate::Client,
account_id: Result<types::DigitalExperienceMonitoringAccountIdentifier, String>,
device_id: Result<::std::vec::Vec<::std::string::String>, String>,
test_name: Result<::std::string::String, String>,
}
impl<'a> DexEndpointsTestsUniqueDevices<'a> {
pub fn new(client: &'a crate::Client) -> Self {
Self {
client: client,
account_id: Err("account_id was not initialized".to_string()),
device_id: Err("device_id was not initialized".to_string()),
test_name: Err("test_name was not initialized".to_string()),
}
}
pub fn account_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::DigitalExperienceMonitoringAccountIdentifier>,
{
self . account_id = value . try_into () . map_err (| _ | "conversion to `DigitalExperienceMonitoringAccountIdentifier` for account_id failed" . to_string ()) ;
self
}
pub fn device_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::vec::Vec<::std::string::String>>,
{
self . device_id = value . try_into () . map_err (| _ | "conversion to `:: std :: vec :: Vec < :: std :: string :: String >` for device_id failed" . to_string ()) ;
self
}
pub fn test_name<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.test_name = value.try_into().map_err(|_| {
"conversion to `:: std :: string :: String` for test_name 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,
device_id,
test_name,
} = self;
let account_id = account_id.map_err(Error::InvalidRequest)?;
let device_id = device_id.map_err(Error::InvalidRequest)?;
let test_name = test_name.map_err(Error::InvalidRequest)?;
let url = format!(
"{}/accounts/{}/dex/tests/unique-devices",
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("deviceId", &device_id))
.query(&progenitor_client::QueryParam::new("testName", &test_name))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "dex_endpoints_tests_unique_devices",
};
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 DexEndpointsTracerouteTestDetails<'a> {
client: &'a crate::Client,
account_id: Result<types::DigitalExperienceMonitoringAccountIdentifier, String>,
test_id: Result<types::DigitalExperienceMonitoringUuid, String>,
colo: Result<::std::string::String, String>,
device_id: Result<::std::vec::Vec<::std::string::String>, String>,
from: Result<::std::string::String, String>,
interval: Result<types::DexEndpointsTracerouteTestDetailsInterval, String>,
to: Result<::std::string::String, String>,
}
impl<'a> DexEndpointsTracerouteTestDetails<'a> {
pub fn new(client: &'a crate::Client) -> Self {
Self {
client: client,
account_id: Err("account_id was not initialized".to_string()),
test_id: Err("test_id was not initialized".to_string()),
colo: Err("colo was not initialized".to_string()),
device_id: Err("device_id was not initialized".to_string()),
from: Err("from was not initialized".to_string()),
interval: Err("interval was not initialized".to_string()),
to: Err("to was not initialized".to_string()),
}
}
pub fn account_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::DigitalExperienceMonitoringAccountIdentifier>,
{
self . account_id = value . try_into () . map_err (| _ | "conversion to `DigitalExperienceMonitoringAccountIdentifier` for account_id failed" . to_string ()) ;
self
}
pub fn test_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::DigitalExperienceMonitoringUuid>,
{
self.test_id = value.try_into().map_err(|_| {
"conversion to `DigitalExperienceMonitoringUuid` for test_id failed".to_string()
});
self
}
pub fn colo<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.colo = value.try_into().map_err(|_| {
"conversion to `:: std :: string :: String` for colo failed".to_string()
});
self
}
pub fn device_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::vec::Vec<::std::string::String>>,
{
self . device_id = value . try_into () . map_err (| _ | "conversion to `:: std :: vec :: Vec < :: std :: string :: String >` for device_id failed" . to_string ()) ;
self
}
pub fn from<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.from = value.try_into().map_err(|_| {
"conversion to `:: std :: string :: String` for from failed".to_string()
});
self
}
pub fn interval<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::DexEndpointsTracerouteTestDetailsInterval>,
{
self.interval = value.try_into().map_err(|_| {
"conversion to `DexEndpointsTracerouteTestDetailsInterval` for interval failed"
.to_string()
});
self
}
pub fn to<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.to = value.try_into().map_err(|_| {
"conversion to `:: std :: string :: String` for to 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,
test_id,
colo,
device_id,
from,
interval,
to,
} = self;
let account_id = account_id.map_err(Error::InvalidRequest)?;
let test_id = test_id.map_err(Error::InvalidRequest)?;
let colo = colo.map_err(Error::InvalidRequest)?;
let device_id = device_id.map_err(Error::InvalidRequest)?;
let from = from.map_err(Error::InvalidRequest)?;
let interval = interval.map_err(Error::InvalidRequest)?;
let to = to.map_err(Error::InvalidRequest)?;
let url = format!(
"{}/accounts/{}/dex/traceroute-tests/{}",
client.baseurl,
encode_path(&account_id.to_string()),
encode_path(&test_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("colo", &colo))
.query(&progenitor_client::QueryParam::new("deviceId", &device_id))
.query(&progenitor_client::QueryParam::new("from", &from))
.query(&progenitor_client::QueryParam::new("interval", &interval))
.query(&progenitor_client::QueryParam::new("to", &to))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "dex_endpoints_traceroute_test_details",
};
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 DexEndpointsTracerouteTestNetworkPath<'a> {
client: &'a crate::Client,
account_id: Result<types::DigitalExperienceMonitoringAccountIdentifier, String>,
test_id: Result<types::DigitalExperienceMonitoringUuid, String>,
device_id: Result<::std::string::String, String>,
from: Result<::std::string::String, String>,
interval: Result<types::DexEndpointsTracerouteTestNetworkPathInterval, String>,
to: Result<::std::string::String, String>,
}
impl<'a> DexEndpointsTracerouteTestNetworkPath<'a> {
pub fn new(client: &'a crate::Client) -> Self {
Self {
client: client,
account_id: Err("account_id was not initialized".to_string()),
test_id: Err("test_id was not initialized".to_string()),
device_id: Err("device_id was not initialized".to_string()),
from: Err("from was not initialized".to_string()),
interval: Err("interval was not initialized".to_string()),
to: Err("to was not initialized".to_string()),
}
}
pub fn account_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::DigitalExperienceMonitoringAccountIdentifier>,
{
self . account_id = value . try_into () . map_err (| _ | "conversion to `DigitalExperienceMonitoringAccountIdentifier` for account_id failed" . to_string ()) ;
self
}
pub fn test_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::DigitalExperienceMonitoringUuid>,
{
self.test_id = value.try_into().map_err(|_| {
"conversion to `DigitalExperienceMonitoringUuid` for test_id failed".to_string()
});
self
}
pub fn device_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.device_id = value.try_into().map_err(|_| {
"conversion to `:: std :: string :: String` for device_id failed".to_string()
});
self
}
pub fn from<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.from = value.try_into().map_err(|_| {
"conversion to `:: std :: string :: String` for from failed".to_string()
});
self
}
pub fn interval<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::DexEndpointsTracerouteTestNetworkPathInterval>,
{
self . interval = value . try_into () . map_err (| _ | "conversion to `DexEndpointsTracerouteTestNetworkPathInterval` for interval failed" . to_string ()) ;
self
}
pub fn to<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.to = value.try_into().map_err(|_| {
"conversion to `:: std :: string :: String` for to 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,
test_id,
device_id,
from,
interval,
to,
} = self;
let account_id = account_id.map_err(Error::InvalidRequest)?;
let test_id = test_id.map_err(Error::InvalidRequest)?;
let device_id = device_id.map_err(Error::InvalidRequest)?;
let from = from.map_err(Error::InvalidRequest)?;
let interval = interval.map_err(Error::InvalidRequest)?;
let to = to.map_err(Error::InvalidRequest)?;
let url = format!(
"{}/accounts/{}/dex/traceroute-tests/{}/network-path",
client.baseurl,
encode_path(&account_id.to_string()),
encode_path(&test_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("deviceId", &device_id))
.query(&progenitor_client::QueryParam::new("from", &from))
.query(&progenitor_client::QueryParam::new("interval", &interval))
.query(&progenitor_client::QueryParam::new("to", &to))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "dex_endpoints_traceroute_test_network_path",
};
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 DexEndpointsTracerouteTestPercentiles<'a> {
client: &'a crate::Client,
account_id: Result<types::DigitalExperienceMonitoringAccountIdentifier, String>,
test_id: Result<types::DigitalExperienceMonitoringUuid, String>,
colo: Result<::std::string::String, String>,
device_id: Result<::std::vec::Vec<::std::string::String>, String>,
from: Result<::std::string::String, String>,
to: Result<::std::string::String, String>,
}
impl<'a> DexEndpointsTracerouteTestPercentiles<'a> {
pub fn new(client: &'a crate::Client) -> Self {
Self {
client: client,
account_id: Err("account_id was not initialized".to_string()),
test_id: Err("test_id was not initialized".to_string()),
colo: Err("colo was not initialized".to_string()),
device_id: Err("device_id was not initialized".to_string()),
from: Err("from was not initialized".to_string()),
to: Err("to was not initialized".to_string()),
}
}
pub fn account_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::DigitalExperienceMonitoringAccountIdentifier>,
{
self . account_id = value . try_into () . map_err (| _ | "conversion to `DigitalExperienceMonitoringAccountIdentifier` for account_id failed" . to_string ()) ;
self
}
pub fn test_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<types::DigitalExperienceMonitoringUuid>,
{
self.test_id = value.try_into().map_err(|_| {
"conversion to `DigitalExperienceMonitoringUuid` for test_id failed".to_string()
});
self
}
pub fn colo<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.colo = value.try_into().map_err(|_| {
"conversion to `:: std :: string :: String` for colo failed".to_string()
});
self
}
pub fn device_id<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::vec::Vec<::std::string::String>>,
{
self . device_id = value . try_into () . map_err (| _ | "conversion to `:: std :: vec :: Vec < :: std :: string :: String >` for device_id failed" . to_string ()) ;
self
}
pub fn from<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.from = value.try_into().map_err(|_| {
"conversion to `:: std :: string :: String` for from failed".to_string()
});
self
}
pub fn to<V>(mut self, value: V) -> Self
where
V: std::convert::TryInto<::std::string::String>,
{
self.to = value.try_into().map_err(|_| {
"conversion to `:: std :: string :: String` for to 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,
test_id,
colo,
device_id,
from,
to,
} = self;
let account_id = account_id.map_err(Error::InvalidRequest)?;
let test_id = test_id.map_err(Error::InvalidRequest)?;
let colo = colo.map_err(Error::InvalidRequest)?;
let device_id = device_id.map_err(Error::InvalidRequest)?;
let from = from.map_err(Error::InvalidRequest)?;
let to = to.map_err(Error::InvalidRequest)?;
let url = format!(
"{}/accounts/{}/dex/traceroute-tests/{}/percentiles",
client.baseurl,
encode_path(&account_id.to_string()),
encode_path(&test_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("colo", &colo))
.query(&progenitor_client::QueryParam::new("deviceId", &device_id))
.query(&progenitor_client::QueryParam::new("from", &from))
.query(&progenitor_client::QueryParam::new("to", &to))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "dex_endpoints_traceroute_test_percentiles",
};
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)),
}
}
}