/*
* BOAVIZTAPI - DEMO
*
*
π― Retrieving the impacts of digital elements.
This is a quick demo, to see full documentation click here
Features
Bellow a list of all available features.
π Verbose
Verbose is an HTTP parameter. If set at true :
- Shows the impacts of each component
- Shows the value used for each attribute
\"attribute\": {\"value\": \"value\", \"unit\": \"unit\", \"status\": \"Status\", \"source\": \"Source\", \"min\":\"min\", \"max\":\"max\", \"significant_figures\":\"significant_figures\"}
π¨ Embedded
- Embedded impacts are the impacts occurring during raw material extraction, manufacture, distribution and end of life
- When end of life is not taken into account, we specified it in the
warnings
π Usage
Usage impacts are assessed by multiplying :
β² Duration
Usage impacts can be given as a router parameter, in hours.
If no duration is given, the impact is assess for the all life duration of the asset.
βοΈ Impact factors
β‘ Electrical consumption
βΊοΈ Given
- Electrical consumption can be given for one hour (average) \"usage\":{\"avg_power\": 1}.
π Modeled
- Electrical consumption can be retrieved from consumption profile using usage:{time_workload: 50}.
π Archetype
- In some cases, default electrical consumption can be taken from the archetype
π Auto-complete & π Archetype
The API will complete the missing attributes in a request with a completion function or with values taken from the archetype
specified in the route parameter.
β¬ Allocation
- Usage impacts are assessed on the duration given in route parameter
- Embedded impacts are allocated linearly on the duration given in parameter
embedded_impact = impact * (duration/life_duration)
If no duration is given, the life_duration (`hours_life_time
) of the asset is used.
*
* The version of the OpenAPI document: 1.3
*
* Generated by: https://openapi-generator.tech
*/
use reqwest;
use serde::{Deserialize, Serialize};
use crate::{apis::ResponseContent, models};
use super::{Error, configuration};
/// struct for typed errors of method [`external_hdd_get_all_archetype_name_v1_peripheral_external_hdd_archetypes_get`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ExternalHddGetAllArchetypeNameV1PeripheralExternalHddArchetypesGetError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`external_hdd_get_archetype_config_v1_peripheral_external_hdd_archetype_config_get`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ExternalHddGetArchetypeConfigV1PeripheralExternalHddArchetypeConfigGetError {
Status422(models::HttpValidationError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`external_hdd_impact_v1_peripheral_external_hdd_get`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ExternalHddImpactV1PeripheralExternalHddGetError {
Status422(models::HttpValidationError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`external_hdd_impact_v1_peripheral_external_hdd_post`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ExternalHddImpactV1PeripheralExternalHddPostError {
Status422(models::HttpValidationError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`external_ssd_get_all_archetype_name_v1_peripheral_external_ssd_archetypes_get`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ExternalSsdGetAllArchetypeNameV1PeripheralExternalSsdArchetypesGetError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`external_ssd_get_archetype_config_v1_peripheral_external_ssd_archetype_config_get`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ExternalSsdGetArchetypeConfigV1PeripheralExternalSsdArchetypeConfigGetError {
Status422(models::HttpValidationError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`external_ssd_impact_v1_peripheral_external_ssd_get`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ExternalSsdImpactV1PeripheralExternalSsdGetError {
Status422(models::HttpValidationError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`external_ssd_impact_v1_peripheral_external_ssd_post`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ExternalSsdImpactV1PeripheralExternalSsdPostError {
Status422(models::HttpValidationError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`monitor_get_all_archetype_name_v1_peripheral_monitor_archetypes_get`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum MonitorGetAllArchetypeNameV1PeripheralMonitorArchetypesGetError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`monitor_get_archetype_config_v1_peripheral_monitor_archetype_config_get`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum MonitorGetArchetypeConfigV1PeripheralMonitorArchetypeConfigGetError {
Status422(models::HttpValidationError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`monitor_impact_v1_peripheral_monitor_get`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum MonitorImpactV1PeripheralMonitorGetError {
Status422(models::HttpValidationError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`monitor_impact_v1_peripheral_monitor_post`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum MonitorImpactV1PeripheralMonitorPostError {
Status422(models::HttpValidationError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`peripheral_get_all_categories_v1_peripheral_all_get`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PeripheralGetAllCategoriesV1PeripheralAllGetError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`usb_stick_get_all_archetype_name_v1_peripheral_usb_stick_archetypes_get`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UsbStickGetAllArchetypeNameV1PeripheralUsbStickArchetypesGetError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`usb_stick_get_archetype_config_v1_peripheral_usb_stick_archetype_config_get`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UsbStickGetArchetypeConfigV1PeripheralUsbStickArchetypeConfigGetError {
Status422(models::HttpValidationError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`usb_stick_impact_v1_peripheral_usb_stick_get`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UsbStickImpactV1PeripheralUsbStickGetError {
Status422(models::HttpValidationError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`usb_stick_impact_v1_peripheral_usb_stick_post`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UsbStickImpactV1PeripheralUsbStickPostError {
Status422(models::HttpValidationError),
UnknownValue(serde_json::Value),
}
/// # βοΈ Get all the available user terminal archetype for a given user terminal name
pub async fn external_hdd_get_all_archetype_name_v1_peripheral_external_hdd_archetypes_get(configuration: &configuration::Configuration, ) -> Result> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v1/peripheral/external_hdd/archetypes", local_var_configuration.base_path);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// # βοΈ Get the configuration of a given archetype
pub async fn external_hdd_get_archetype_config_v1_peripheral_external_hdd_archetype_config_get(configuration: &configuration::Configuration, archetype: &str) -> Result> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v1/peripheral/external_hdd/archetype_config", local_var_configuration.base_path);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
local_var_req_builder = local_var_req_builder.query(&[("archetype", &archetype.to_string())]);
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// # β Peripheral impacts ### Features π Verbose π Auto-complete π¨ Embedded The impacts values are fixπ Usage * βΊοΈ Given * π Archetype β¬ Allocation
pub async fn external_hdd_impact_v1_peripheral_external_hdd_get(configuration: &configuration::Configuration, archetype: Option<&str>, verbose: Option, duration: Option, criteria: Option>) -> Result> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v1/peripheral/external_hdd", local_var_configuration.base_path);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = archetype {
local_var_req_builder = local_var_req_builder.query(&[("archetype", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = verbose {
local_var_req_builder = local_var_req_builder.query(&[("verbose", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = duration {
local_var_req_builder = local_var_req_builder.query(&[("duration", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = criteria {
local_var_req_builder = match "multi" {
"multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("criteria".to_owned(), p.to_string())).collect::>()),
_ => local_var_req_builder.query(&[("criteria", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]),
};
}
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// # β Peripheral impacts ### Features π Verbose π Auto-complete π¨ Embedded The impacts values are fixπ Usage * βΊοΈ Given * π Archetype β¬ Allocation
pub async fn external_hdd_impact_v1_peripheral_external_hdd_post(configuration: &configuration::Configuration, verbose: Option, duration: Option, archetype: Option<&str>, criteria: Option>, external_hdd: Option) -> Result> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v1/peripheral/external_hdd", local_var_configuration.base_path);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_str) = verbose {
local_var_req_builder = local_var_req_builder.query(&[("verbose", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = duration {
local_var_req_builder = local_var_req_builder.query(&[("duration", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = archetype {
local_var_req_builder = local_var_req_builder.query(&[("archetype", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = criteria {
local_var_req_builder = match "multi" {
"multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("criteria".to_owned(), p.to_string())).collect::>()),
_ => local_var_req_builder.query(&[("criteria", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]),
};
}
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&external_hdd);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// # βοΈ Get all the available user terminal archetype for a given user terminal name
pub async fn external_ssd_get_all_archetype_name_v1_peripheral_external_ssd_archetypes_get(configuration: &configuration::Configuration, ) -> Result> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v1/peripheral/external_ssd/archetypes", local_var_configuration.base_path);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// # βοΈ Get the configuration of a given archetype
pub async fn external_ssd_get_archetype_config_v1_peripheral_external_ssd_archetype_config_get(configuration: &configuration::Configuration, archetype: &str) -> Result> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v1/peripheral/external_ssd/archetype_config", local_var_configuration.base_path);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
local_var_req_builder = local_var_req_builder.query(&[("archetype", &archetype.to_string())]);
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// # β Peripheral impacts ### Features π Verbose π Auto-complete π¨ Embedded The impacts values are fixπ Usage * βΊοΈ Given * π Archetype β¬ Allocation
pub async fn external_ssd_impact_v1_peripheral_external_ssd_get(configuration: &configuration::Configuration, archetype: Option<&str>, verbose: Option, duration: Option, criteria: Option>) -> Result> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v1/peripheral/external_ssd", local_var_configuration.base_path);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = archetype {
local_var_req_builder = local_var_req_builder.query(&[("archetype", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = verbose {
local_var_req_builder = local_var_req_builder.query(&[("verbose", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = duration {
local_var_req_builder = local_var_req_builder.query(&[("duration", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = criteria {
local_var_req_builder = match "multi" {
"multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("criteria".to_owned(), p.to_string())).collect::>()),
_ => local_var_req_builder.query(&[("criteria", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]),
};
}
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// # β Peripheral impacts ### Features π Verbose π Auto-complete π¨ Embedded The impacts values are fixπ Usage * βΊοΈ Given * π Archetype β¬ Allocation
pub async fn external_ssd_impact_v1_peripheral_external_ssd_post(configuration: &configuration::Configuration, verbose: Option, duration: Option, archetype: Option<&str>, criteria: Option>, external_ssd: Option) -> Result> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v1/peripheral/external_ssd", local_var_configuration.base_path);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_str) = verbose {
local_var_req_builder = local_var_req_builder.query(&[("verbose", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = duration {
local_var_req_builder = local_var_req_builder.query(&[("duration", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = archetype {
local_var_req_builder = local_var_req_builder.query(&[("archetype", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = criteria {
local_var_req_builder = match "multi" {
"multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("criteria".to_owned(), p.to_string())).collect::>()),
_ => local_var_req_builder.query(&[("criteria", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]),
};
}
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&external_ssd);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// # βοΈ Get all the available user terminal archetype for a given user terminal name
pub async fn monitor_get_all_archetype_name_v1_peripheral_monitor_archetypes_get(configuration: &configuration::Configuration, ) -> Result> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v1/peripheral/monitor/archetypes", local_var_configuration.base_path);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// # βοΈ Get the configuration of a given archetype
pub async fn monitor_get_archetype_config_v1_peripheral_monitor_archetype_config_get(configuration: &configuration::Configuration, archetype: &str) -> Result> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v1/peripheral/monitor/archetype_config", local_var_configuration.base_path);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
local_var_req_builder = local_var_req_builder.query(&[("archetype", &archetype.to_string())]);
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// # β Peripheral impacts ### Features π Verbose π Auto-complete π¨ Embedded The impacts values are fixπ Usage * βΊοΈ Given * π Archetype β¬ Allocation
pub async fn monitor_impact_v1_peripheral_monitor_get(configuration: &configuration::Configuration, archetype: Option<&str>, verbose: Option, duration: Option, criteria: Option>) -> Result> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v1/peripheral/monitor", local_var_configuration.base_path);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = archetype {
local_var_req_builder = local_var_req_builder.query(&[("archetype", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = verbose {
local_var_req_builder = local_var_req_builder.query(&[("verbose", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = duration {
local_var_req_builder = local_var_req_builder.query(&[("duration", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = criteria {
local_var_req_builder = match "multi" {
"multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("criteria".to_owned(), p.to_string())).collect::>()),
_ => local_var_req_builder.query(&[("criteria", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]),
};
}
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// # β Peripheral impacts ### Features π Verbose π Auto-complete π¨ Embedded The impacts values are fixπ Usage * βΊοΈ Given * π Archetype β¬ Allocation
pub async fn monitor_impact_v1_peripheral_monitor_post(configuration: &configuration::Configuration, verbose: Option, duration: Option, archetype: Option<&str>, criteria: Option>, monitor: Option) -> Result> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v1/peripheral/monitor", local_var_configuration.base_path);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_str) = verbose {
local_var_req_builder = local_var_req_builder.query(&[("verbose", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = duration {
local_var_req_builder = local_var_req_builder.query(&[("duration", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = archetype {
local_var_req_builder = local_var_req_builder.query(&[("archetype", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = criteria {
local_var_req_builder = match "multi" {
"multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("criteria".to_owned(), p.to_string())).collect::>()),
_ => local_var_req_builder.query(&[("criteria", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]),
};
}
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&monitor);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// # βοΈ Get all the available user peripheral router
pub async fn peripheral_get_all_categories_v1_peripheral_all_get(configuration: &configuration::Configuration, ) -> Result> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v1/peripheral/all", local_var_configuration.base_path);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// # βοΈ Get all the available user terminal archetype for a given user terminal name
pub async fn usb_stick_get_all_archetype_name_v1_peripheral_usb_stick_archetypes_get(configuration: &configuration::Configuration, ) -> Result> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v1/peripheral/usb_stick/archetypes", local_var_configuration.base_path);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// # βοΈ Get the configuration of a given archetype
pub async fn usb_stick_get_archetype_config_v1_peripheral_usb_stick_archetype_config_get(configuration: &configuration::Configuration, archetype: &str) -> Result> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v1/peripheral/usb_stick/archetype_config", local_var_configuration.base_path);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
local_var_req_builder = local_var_req_builder.query(&[("archetype", &archetype.to_string())]);
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// # β Peripheral impacts ### Features π Verbose π Auto-complete π¨ Embedded The impacts values are fixπ Usage * βΊοΈ Given * π Archetype β¬ Allocation
pub async fn usb_stick_impact_v1_peripheral_usb_stick_get(configuration: &configuration::Configuration, archetype: Option<&str>, verbose: Option, duration: Option, criteria: Option>) -> Result> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v1/peripheral/usb_stick", local_var_configuration.base_path);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = archetype {
local_var_req_builder = local_var_req_builder.query(&[("archetype", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = verbose {
local_var_req_builder = local_var_req_builder.query(&[("verbose", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = duration {
local_var_req_builder = local_var_req_builder.query(&[("duration", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = criteria {
local_var_req_builder = match "multi" {
"multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("criteria".to_owned(), p.to_string())).collect::>()),
_ => local_var_req_builder.query(&[("criteria", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]),
};
}
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// # β Peripheral impacts ### Features π Verbose π Auto-complete π¨ Embedded The impacts values are fixπ Usage * βΊοΈ Given * π Archetype β¬ Allocation
pub async fn usb_stick_impact_v1_peripheral_usb_stick_post(configuration: &configuration::Configuration, verbose: Option, duration: Option, archetype: Option<&str>, criteria: Option>, usb_stick: Option) -> Result> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v1/peripheral/usb_stick", local_var_configuration.base_path);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_str) = verbose {
local_var_req_builder = local_var_req_builder.query(&[("verbose", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = duration {
local_var_req_builder = local_var_req_builder.query(&[("duration", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = archetype {
local_var_req_builder = local_var_req_builder.query(&[("archetype", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = criteria {
local_var_req_builder = match "multi" {
"multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("criteria".to_owned(), p.to_string())).collect::>()),
_ => local_var_req_builder.query(&[("criteria", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]),
};
}
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&usb_stick);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}