/*
* Mittwald API
*
* ## Introduction This OpenAPI spec documents the mittwald API. It follows the [OpenAPI 3.0.0 specification](https://spec.openapis.org/oas/v3.0.0.html). ## Authentication You will need an API token to access the API. You can obtain one by logging into the [mStudio](https://studio.mittwald.de) and navigating to the [\"API Tokens\" section in the user menu](https://studio.mittwald.de/app/profile/api-tokens). When making requests to the API, you can authenticate by passing your API token in the `X-Access-Token` header or as a bearer token. ## Rate Limiting Please note that usage of the API is rate-limited to prevent abuse. You can inspect the rate limiting for your current user by observing the `X-Ratelimit-*` headers included in each response. ## mStudio A main consumer of the mittwald API is the management interface for our customers, the [mStudio](https://studio.mittwald.de). ## Contact and support For support, please use the [mStudio support area](https://studio.mittwald.de/app/support/conversations) or drop us an email at [support@mittwald.de](mailto:support@mittwald.de). For security issues, please report to [security@mittwald.de](mailto:security@mittwald.de).
*
* The version of the OpenAPI document: 2.0
*
* 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 [`project_file_system_get_directories`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProjectFileSystemGetDirectoriesError {
Status403(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status404(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status429(models::AppExecuteAction429Response),
Status503(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`project_file_system_get_disk_usage`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProjectFileSystemGetDiskUsageError {
Status403(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status404(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status429(models::AppExecuteAction429Response),
Status503(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`project_file_system_get_file_content`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProjectFileSystemGetFileContentError {
Status403(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status404(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status429(models::AppExecuteAction429Response),
Status503(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`project_file_system_get_jwt`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProjectFileSystemGetJwtError {
Status403(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status404(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status429(models::AppExecuteAction429Response),
Status503(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`project_file_system_list_files`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProjectFileSystemListFilesError {
Status403(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status404(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status429(models::AppExecuteAction429Response),
Status503(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`v2_projects_project_id_filesystem_directories_get`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum V2ProjectsProjectIdFilesystemDirectoriesGetError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`v2_projects_project_id_filesystem_files_get`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum V2ProjectsProjectIdFilesystemFilesGetError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`v2_projects_project_id_filesystem_files_raw_get`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum V2ProjectsProjectIdFilesystemFilesRawGetError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`v2_projects_project_id_filesystem_usages_disk_get`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum V2ProjectsProjectIdFilesystemUsagesDiskGetError {
UnknownValue(serde_json::Value),
}
pub async fn project_file_system_get_directories(configuration: &configuration::Configuration, project_id: &str, directory: Option<&str>, name: Option<&str>, max_depth: Option<i32>, r#type: Option<Vec<String>>, executable: Option<bool>, hidden: Option<bool>) -> Result<models::DePeriodMittwaldPeriodV1PeriodProjectPeriodFilesystemDirectoryListing, Error<ProjectFileSystemGetDirectoriesError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/projects/{projectId}/filesystem-directories", local_var_configuration.base_path, projectId=crate::apis::urlencode(project_id));
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) = directory {
local_var_req_builder = local_var_req_builder.query(&[("directory", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = name {
local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = max_depth {
local_var_req_builder = local_var_req_builder.query(&[("max_depth", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = r#type {
local_var_req_builder = match "multi" {
"multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("type".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
_ => local_var_req_builder.query(&[("type", &local_var_str.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
};
}
if let Some(ref local_var_str) = executable {
local_var_req_builder = local_var_req_builder.query(&[("executable", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = hidden {
local_var_req_builder = local_var_req_builder.query(&[("hidden", &local_var_str.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());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
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<ProjectFileSystemGetDirectoriesError> = 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))
}
}
pub async fn project_file_system_get_disk_usage(configuration: &configuration::Configuration, project_id: &str, directory: Option<&str>) -> Result<models::DePeriodMittwaldPeriodV1PeriodProjectPeriodFilesystemUsagesDisk, Error<ProjectFileSystemGetDiskUsageError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/projects/{projectId}/filesystem-disk-usage", local_var_configuration.base_path, projectId=crate::apis::urlencode(project_id));
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) = directory {
local_var_req_builder = local_var_req_builder.query(&[("directory", &local_var_str.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());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
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<ProjectFileSystemGetDiskUsageError> = 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))
}
}
pub async fn project_file_system_get_file_content(configuration: &configuration::Configuration, project_id: &str, file: Option<&str>, inline: Option<bool>) -> Result<String, Error<ProjectFileSystemGetFileContentError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/projects/{projectId}/filesystem-file-content", local_var_configuration.base_path, projectId=crate::apis::urlencode(project_id));
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) = file {
local_var_req_builder = local_var_req_builder.query(&[("file", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = inline {
local_var_req_builder = local_var_req_builder.query(&[("inline", &local_var_str.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());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
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<ProjectFileSystemGetFileContentError> = 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))
}
}
pub async fn project_file_system_get_jwt(configuration: &configuration::Configuration, project_id: &str) -> Result<models::DePeriodMittwaldPeriodV1PeriodProjectPeriodFsApiJwt, Error<ProjectFileSystemGetJwtError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/projects/{projectId}/jwt", local_var_configuration.base_path, projectId=crate::apis::urlencode(project_id));
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());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
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<ProjectFileSystemGetJwtError> = 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))
}
}
pub async fn project_file_system_list_files(configuration: &configuration::Configuration, project_id: &str, file: Option<&str>) -> Result<models::DePeriodMittwaldPeriodV1PeriodProjectPeriodFilesystemDirectoryListing, Error<ProjectFileSystemListFilesError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/projects/{projectId}/filesystem-files", local_var_configuration.base_path, projectId=crate::apis::urlencode(project_id));
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) = file {
local_var_req_builder = local_var_req_builder.query(&[("file", &local_var_str.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());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
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<ProjectFileSystemListFilesError> = 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))
}
}
pub async fn v2_projects_project_id_filesystem_directories_get(configuration: &configuration::Configuration, project_id: &str, directory: Option<&str>, name: Option<&str>, max_depth: Option<i32>, r#type: Option<Vec<String>>, executable: Option<bool>, hidden: Option<bool>) -> Result<(), Error<V2ProjectsProjectIdFilesystemDirectoriesGetError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/projects/{projectId}/filesystem/directories", local_var_configuration.base_path, projectId=crate::apis::urlencode(project_id));
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) = directory {
local_var_req_builder = local_var_req_builder.query(&[("directory", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = name {
local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = max_depth {
local_var_req_builder = local_var_req_builder.query(&[("max_depth", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = r#type {
local_var_req_builder = match "multi" {
"multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("type".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
_ => local_var_req_builder.query(&[("type", &local_var_str.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
};
}
if let Some(ref local_var_str) = executable {
local_var_req_builder = local_var_req_builder.query(&[("executable", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = hidden {
local_var_req_builder = local_var_req_builder.query(&[("hidden", &local_var_str.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());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
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() {
Ok(())
} else {
let local_var_entity: Option<V2ProjectsProjectIdFilesystemDirectoriesGetError> = 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))
}
}
pub async fn v2_projects_project_id_filesystem_files_get(configuration: &configuration::Configuration, project_id: &str, file: Option<&str>) -> Result<(), Error<V2ProjectsProjectIdFilesystemFilesGetError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/projects/{projectId}/filesystem/files", local_var_configuration.base_path, projectId=crate::apis::urlencode(project_id));
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) = file {
local_var_req_builder = local_var_req_builder.query(&[("file", &local_var_str.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());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
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() {
Ok(())
} else {
let local_var_entity: Option<V2ProjectsProjectIdFilesystemFilesGetError> = 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))
}
}
pub async fn v2_projects_project_id_filesystem_files_raw_get(configuration: &configuration::Configuration, project_id: &str, file: Option<&str>, inline: Option<bool>) -> Result<(), Error<V2ProjectsProjectIdFilesystemFilesRawGetError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/projects/{projectId}/filesystem/files/raw", local_var_configuration.base_path, projectId=crate::apis::urlencode(project_id));
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) = file {
local_var_req_builder = local_var_req_builder.query(&[("file", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = inline {
local_var_req_builder = local_var_req_builder.query(&[("inline", &local_var_str.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());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
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() {
Ok(())
} else {
let local_var_entity: Option<V2ProjectsProjectIdFilesystemFilesRawGetError> = 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))
}
}
pub async fn v2_projects_project_id_filesystem_usages_disk_get(configuration: &configuration::Configuration, project_id: &str, directory: Option<&str>) -> Result<(), Error<V2ProjectsProjectIdFilesystemUsagesDiskGetError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/projects/{projectId}/filesystem/usages/disk", local_var_configuration.base_path, projectId=crate::apis::urlencode(project_id));
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) = directory {
local_var_req_builder = local_var_req_builder.query(&[("directory", &local_var_str.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());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
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() {
Ok(())
} else {
let local_var_entity: Option<V2ProjectsProjectIdFilesystemUsagesDiskGetError> = 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))
}
}