use reqwest;
use serde::{Deserialize, Serialize, de::Error as _};
use crate::{apis::ResponseContent, models};
use super::{Error, configuration, ContentType};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum TapeMediaCreateMoveError {
Status400(models::PbsError),
Status401(models::PbsError),
Status403(models::PbsError),
Status404(models::PbsError),
Status500(models::PbsError),
Status501(models::PbsError),
Status503(models::PbsError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum TapeMediaCreateStatusError {
Status400(models::PbsError),
Status401(models::PbsError),
Status403(models::PbsError),
Status404(models::PbsError),
Status500(models::PbsError),
Status501(models::PbsError),
Status503(models::PbsError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum TapeMediaGetContentError {
Status400(models::PbsError),
Status401(models::PbsError),
Status403(models::PbsError),
Status404(models::PbsError),
Status500(models::PbsError),
Status501(models::PbsError),
Status503(models::PbsError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum TapeMediaGetDestroyError {
Status400(models::PbsError),
Status401(models::PbsError),
Status403(models::PbsError),
Status404(models::PbsError),
Status500(models::PbsError),
Status501(models::PbsError),
Status503(models::PbsError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum TapeMediaGetListError {
Status400(models::PbsError),
Status401(models::PbsError),
Status403(models::PbsError),
Status404(models::PbsError),
Status500(models::PbsError),
Status501(models::PbsError),
Status503(models::PbsError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum TapeMediaGetMediaError {
Status400(models::PbsError),
Status401(models::PbsError),
Status403(models::PbsError),
Status404(models::PbsError),
Status500(models::PbsError),
Status501(models::PbsError),
Status503(models::PbsError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum TapeMediaGetMediaSetsError {
Status400(models::PbsError),
Status401(models::PbsError),
Status403(models::PbsError),
Status404(models::PbsError),
Status500(models::PbsError),
Status501(models::PbsError),
Status503(models::PbsError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum TapeMediaGetStatusError {
Status400(models::PbsError),
Status401(models::PbsError),
Status403(models::PbsError),
Status404(models::PbsError),
Status500(models::PbsError),
Status501(models::PbsError),
Status503(models::PbsError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum TapeMediaGetTapeMediaListByUuidError {
Status400(models::PbsError),
Status401(models::PbsError),
Status403(models::PbsError),
Status404(models::PbsError),
Status500(models::PbsError),
Status501(models::PbsError),
Status503(models::PbsError),
UnknownValue(serde_json::Value),
}
pub async fn tape_media_create_move(configuration: &configuration::Configuration, tape_media_create_move_request: Option<models::TapeMediaCreateMoveRequest>) -> Result<models::TapeMediaCreateMoveResponse, Error<TapeMediaCreateMoveError>> {
let p_body_tape_media_create_move_request = tape_media_create_move_request;
let uri_str = format!("{}/tape/media/move", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("Authorization", value);
};
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("CSRFPreventionToken", value);
};
req_builder = req_builder.json(&p_body_tape_media_create_move_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TapeMediaCreateMoveResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TapeMediaCreateMoveResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<TapeMediaCreateMoveError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn tape_media_create_status(configuration: &configuration::Configuration, uuid: &str, tape_media_create_status_request: Option<models::TapeMediaCreateStatusRequest>) -> Result<models::TapeMediaCreateStatusResponse, Error<TapeMediaCreateStatusError>> {
let p_path_uuid = uuid;
let p_body_tape_media_create_status_request = tape_media_create_status_request;
let uri_str = format!("{}/tape/media/list/{uuid}/status", configuration.base_path, uuid=crate::apis::urlencode(p_path_uuid));
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("Authorization", value);
};
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("CSRFPreventionToken", value);
};
req_builder = req_builder.json(&p_body_tape_media_create_status_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TapeMediaCreateStatusResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TapeMediaCreateStatusResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<TapeMediaCreateStatusError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn tape_media_get_content(configuration: &configuration::Configuration, backup_id: Option<&str>, backup_type: Option<models::PbsBackupTypeEnum>, label_text: Option<&str>, media: Option<&str>, media_set: Option<&str>, pool: Option<&str>) -> Result<models::TapeMediaGetContentResponse, Error<TapeMediaGetContentError>> {
let p_query_backup_id = backup_id;
let p_query_backup_type = backup_type;
let p_query_label_text = label_text;
let p_query_media = media;
let p_query_media_set = media_set;
let p_query_pool = pool;
let uri_str = format!("{}/tape/media/content", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_backup_id {
req_builder = req_builder.query(&[("backup-id", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_backup_type {
req_builder = req_builder.query(&[("backup-type", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_label_text {
req_builder = req_builder.query(&[("label-text", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_media {
req_builder = req_builder.query(&[("media", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_media_set {
req_builder = req_builder.query(&[("media-set", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_pool {
req_builder = req_builder.query(&[("pool", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("Authorization", value);
};
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("CSRFPreventionToken", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TapeMediaGetContentResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TapeMediaGetContentResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<TapeMediaGetContentError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn tape_media_get_destroy(configuration: &configuration::Configuration, force: Option<bool>, label_text: Option<&str>, uuid: Option<&str>) -> Result<models::TapeMediaGetDestroyResponse, Error<TapeMediaGetDestroyError>> {
let p_query_force = force;
let p_query_label_text = label_text;
let p_query_uuid = uuid;
let uri_str = format!("{}/tape/media/destroy", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_force {
req_builder = req_builder.query(&[("force", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_label_text {
req_builder = req_builder.query(&[("label-text", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_uuid {
req_builder = req_builder.query(&[("uuid", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("Authorization", value);
};
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("CSRFPreventionToken", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TapeMediaGetDestroyResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TapeMediaGetDestroyResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<TapeMediaGetDestroyError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn tape_media_get_list(configuration: &configuration::Configuration, pool: Option<&str>, update_status: Option<bool>, update_status_changer: Option<&str>) -> Result<models::TapeMediaGetListResponse, Error<TapeMediaGetListError>> {
let p_query_pool = pool;
let p_query_update_status = update_status;
let p_query_update_status_changer = update_status_changer;
let uri_str = format!("{}/tape/media/list", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_pool {
req_builder = req_builder.query(&[("pool", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_update_status {
req_builder = req_builder.query(&[("update-status", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_update_status_changer {
req_builder = req_builder.query(&[("update-status-changer", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("Authorization", value);
};
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("CSRFPreventionToken", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TapeMediaGetListResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TapeMediaGetListResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<TapeMediaGetListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn tape_media_get_media(configuration: &configuration::Configuration, ) -> Result<models::TapeMediaGetMediaResponse, Error<TapeMediaGetMediaError>> {
let uri_str = format!("{}/tape/media", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("Authorization", value);
};
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("CSRFPreventionToken", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TapeMediaGetMediaResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TapeMediaGetMediaResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<TapeMediaGetMediaError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn tape_media_get_media_sets(configuration: &configuration::Configuration, ) -> Result<models::TapeMediaGetMediaSetsResponse, Error<TapeMediaGetMediaSetsError>> {
let uri_str = format!("{}/tape/media/media-sets", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("Authorization", value);
};
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("CSRFPreventionToken", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TapeMediaGetMediaSetsResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TapeMediaGetMediaSetsResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<TapeMediaGetMediaSetsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn tape_media_get_status(configuration: &configuration::Configuration, uuid: &str) -> Result<models::TapeMediaGetStatusResponse, Error<TapeMediaGetStatusError>> {
let p_path_uuid = uuid;
let uri_str = format!("{}/tape/media/list/{uuid}/status", configuration.base_path, uuid=crate::apis::urlencode(p_path_uuid));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("Authorization", value);
};
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("CSRFPreventionToken", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TapeMediaGetStatusResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TapeMediaGetStatusResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<TapeMediaGetStatusError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn tape_media_get_tape_media_list_by_uuid(configuration: &configuration::Configuration, uuid: &str) -> Result<models::TapeMediaGetTapeMediaListByUuidResponse, Error<TapeMediaGetTapeMediaListByUuidError>> {
let p_path_uuid = uuid;
let uri_str = format!("{}/tape/media/list/{uuid}", configuration.base_path, uuid=crate::apis::urlencode(p_path_uuid));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("Authorization", value);
};
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("CSRFPreventionToken", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TapeMediaGetTapeMediaListByUuidResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TapeMediaGetTapeMediaListByUuidResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<TapeMediaGetTapeMediaListByUuidError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}