use super::{configuration, ContentType, Error};
use crate::{apis::ResponseContent, models};
use reqwest;
use serde::{de::Error as _, Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum AnnotationQueuesCreateQueueError {
Status400(serde_json::Value),
Status401(serde_json::Value),
Status403(serde_json::Value),
Status404(serde_json::Value),
Status405(serde_json::Value),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum AnnotationQueuesCreateQueueAssignmentError {
Status400(serde_json::Value),
Status401(serde_json::Value),
Status403(serde_json::Value),
Status404(serde_json::Value),
Status405(serde_json::Value),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum AnnotationQueuesCreateQueueItemError {
Status400(serde_json::Value),
Status401(serde_json::Value),
Status403(serde_json::Value),
Status404(serde_json::Value),
Status405(serde_json::Value),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum AnnotationQueuesDeleteQueueAssignmentError {
Status400(serde_json::Value),
Status401(serde_json::Value),
Status403(serde_json::Value),
Status404(serde_json::Value),
Status405(serde_json::Value),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum AnnotationQueuesDeleteQueueItemError {
Status400(serde_json::Value),
Status401(serde_json::Value),
Status403(serde_json::Value),
Status404(serde_json::Value),
Status405(serde_json::Value),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum AnnotationQueuesGetQueueError {
Status400(serde_json::Value),
Status401(serde_json::Value),
Status403(serde_json::Value),
Status404(serde_json::Value),
Status405(serde_json::Value),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum AnnotationQueuesGetQueueItemError {
Status400(serde_json::Value),
Status401(serde_json::Value),
Status403(serde_json::Value),
Status404(serde_json::Value),
Status405(serde_json::Value),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum AnnotationQueuesListQueueItemsError {
Status400(serde_json::Value),
Status401(serde_json::Value),
Status403(serde_json::Value),
Status404(serde_json::Value),
Status405(serde_json::Value),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum AnnotationQueuesListQueuesError {
Status400(serde_json::Value),
Status401(serde_json::Value),
Status403(serde_json::Value),
Status404(serde_json::Value),
Status405(serde_json::Value),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum AnnotationQueuesUpdateQueueItemError {
Status400(serde_json::Value),
Status401(serde_json::Value),
Status403(serde_json::Value),
Status404(serde_json::Value),
Status405(serde_json::Value),
UnknownValue(serde_json::Value),
}
#[bon::builder]
pub async fn annotation_queues_create_queue(
configuration: &configuration::Configuration,
create_annotation_queue_request: models::CreateAnnotationQueueRequest,
) -> Result<models::AnnotationQueue, Error<AnnotationQueuesCreateQueueError>> {
let p_body_create_annotation_queue_request = create_annotation_queue_request;
let uri_str = format!("{}/api/public/annotation-queues", 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 auth_conf) = configuration.basic_auth {
req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
};
req_builder = req_builder.json(&p_body_create_annotation_queue_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::AnnotationQueue`"))),
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::AnnotationQueue`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<AnnotationQueuesCreateQueueError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
#[bon::builder]
pub async fn annotation_queues_create_queue_assignment(
configuration: &configuration::Configuration,
queue_id: &str,
annotation_queue_assignment_request: models::AnnotationQueueAssignmentRequest,
) -> Result<
models::CreateAnnotationQueueAssignmentResponse,
Error<AnnotationQueuesCreateQueueAssignmentError>,
> {
let p_path_queue_id = queue_id;
let p_body_annotation_queue_assignment_request = annotation_queue_assignment_request;
let uri_str = format!(
"{}/api/public/annotation-queues/{queueId}/assignments",
configuration.base_path,
queueId = crate::apis::urlencode(p_path_queue_id)
);
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 auth_conf) = configuration.basic_auth {
req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
};
req_builder = req_builder.json(&p_body_annotation_queue_assignment_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::CreateAnnotationQueueAssignmentResponse`"))),
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::CreateAnnotationQueueAssignmentResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<AnnotationQueuesCreateQueueAssignmentError> =
serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
#[bon::builder]
pub async fn annotation_queues_create_queue_item(
configuration: &configuration::Configuration,
queue_id: &str,
create_annotation_queue_item_request: models::CreateAnnotationQueueItemRequest,
) -> Result<models::AnnotationQueueItem, Error<AnnotationQueuesCreateQueueItemError>> {
let p_path_queue_id = queue_id;
let p_body_create_annotation_queue_item_request = create_annotation_queue_item_request;
let uri_str = format!(
"{}/api/public/annotation-queues/{queueId}/items",
configuration.base_path,
queueId = crate::apis::urlencode(p_path_queue_id)
);
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 auth_conf) = configuration.basic_auth {
req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
};
req_builder = req_builder.json(&p_body_create_annotation_queue_item_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::AnnotationQueueItem`"))),
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::AnnotationQueueItem`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<AnnotationQueuesCreateQueueItemError> =
serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
#[bon::builder]
pub async fn annotation_queues_delete_queue_assignment(
configuration: &configuration::Configuration,
queue_id: &str,
annotation_queue_assignment_request: models::AnnotationQueueAssignmentRequest,
) -> Result<
models::DeleteAnnotationQueueAssignmentResponse,
Error<AnnotationQueuesDeleteQueueAssignmentError>,
> {
let p_path_queue_id = queue_id;
let p_body_annotation_queue_assignment_request = annotation_queue_assignment_request;
let uri_str = format!(
"{}/api/public/annotation-queues/{queueId}/assignments",
configuration.base_path,
queueId = crate::apis::urlencode(p_path_queue_id)
);
let mut req_builder = configuration
.client
.request(reqwest::Method::DELETE, &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 auth_conf) = configuration.basic_auth {
req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
};
req_builder = req_builder.json(&p_body_annotation_queue_assignment_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::DeleteAnnotationQueueAssignmentResponse`"))),
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::DeleteAnnotationQueueAssignmentResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<AnnotationQueuesDeleteQueueAssignmentError> =
serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
#[bon::builder]
pub async fn annotation_queues_delete_queue_item(
configuration: &configuration::Configuration,
queue_id: &str,
item_id: &str,
) -> Result<models::DeleteAnnotationQueueItemResponse, Error<AnnotationQueuesDeleteQueueItemError>>
{
let p_path_queue_id = queue_id;
let p_path_item_id = item_id;
let uri_str = format!(
"{}/api/public/annotation-queues/{queueId}/items/{itemId}",
configuration.base_path,
queueId = crate::apis::urlencode(p_path_queue_id),
itemId = crate::apis::urlencode(p_path_item_id)
);
let mut req_builder = configuration
.client
.request(reqwest::Method::DELETE, &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 auth_conf) = configuration.basic_auth {
req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
};
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::DeleteAnnotationQueueItemResponse`"))),
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::DeleteAnnotationQueueItemResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<AnnotationQueuesDeleteQueueItemError> =
serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
#[bon::builder]
pub async fn annotation_queues_get_queue(
configuration: &configuration::Configuration,
queue_id: &str,
) -> Result<models::AnnotationQueue, Error<AnnotationQueuesGetQueueError>> {
let p_path_queue_id = queue_id;
let uri_str = format!(
"{}/api/public/annotation-queues/{queueId}",
configuration.base_path,
queueId = crate::apis::urlencode(p_path_queue_id)
);
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 auth_conf) = configuration.basic_auth {
req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
};
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::AnnotationQueue`"))),
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::AnnotationQueue`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<AnnotationQueuesGetQueueError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
#[bon::builder]
pub async fn annotation_queues_get_queue_item(
configuration: &configuration::Configuration,
queue_id: &str,
item_id: &str,
) -> Result<models::AnnotationQueueItem, Error<AnnotationQueuesGetQueueItemError>> {
let p_path_queue_id = queue_id;
let p_path_item_id = item_id;
let uri_str = format!(
"{}/api/public/annotation-queues/{queueId}/items/{itemId}",
configuration.base_path,
queueId = crate::apis::urlencode(p_path_queue_id),
itemId = crate::apis::urlencode(p_path_item_id)
);
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 auth_conf) = configuration.basic_auth {
req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
};
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::AnnotationQueueItem`"))),
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::AnnotationQueueItem`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<AnnotationQueuesGetQueueItemError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
#[bon::builder]
pub async fn annotation_queues_list_queue_items(
configuration: &configuration::Configuration,
queue_id: &str,
status: Option<models::AnnotationQueueStatus>,
page: Option<i32>,
limit: Option<i32>,
) -> Result<models::PaginatedAnnotationQueueItems, Error<AnnotationQueuesListQueueItemsError>> {
let p_path_queue_id = queue_id;
let p_query_status = status;
let p_query_page = page;
let p_query_limit = limit;
let uri_str = format!(
"{}/api/public/annotation-queues/{queueId}/items",
configuration.base_path,
queueId = crate::apis::urlencode(p_path_queue_id)
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_status {
req_builder = req_builder.query(&[("status", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_page {
req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_limit {
req_builder = req_builder.query(&[("limit", ¶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 auth_conf) = configuration.basic_auth {
req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
};
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::PaginatedAnnotationQueueItems`"))),
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::PaginatedAnnotationQueueItems`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<AnnotationQueuesListQueueItemsError> =
serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
#[bon::builder]
pub async fn annotation_queues_list_queues(
configuration: &configuration::Configuration,
page: Option<i32>,
limit: Option<i32>,
) -> Result<models::PaginatedAnnotationQueues, Error<AnnotationQueuesListQueuesError>> {
let p_query_page = page;
let p_query_limit = limit;
let uri_str = format!("{}/api/public/annotation-queues", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_page {
req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_limit {
req_builder = req_builder.query(&[("limit", ¶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 auth_conf) = configuration.basic_auth {
req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
};
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::PaginatedAnnotationQueues`"))),
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::PaginatedAnnotationQueues`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<AnnotationQueuesListQueuesError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
#[bon::builder]
pub async fn annotation_queues_update_queue_item(
configuration: &configuration::Configuration,
queue_id: &str,
item_id: &str,
update_annotation_queue_item_request: models::UpdateAnnotationQueueItemRequest,
) -> Result<models::AnnotationQueueItem, Error<AnnotationQueuesUpdateQueueItemError>> {
let p_path_queue_id = queue_id;
let p_path_item_id = item_id;
let p_body_update_annotation_queue_item_request = update_annotation_queue_item_request;
let uri_str = format!(
"{}/api/public/annotation-queues/{queueId}/items/{itemId}",
configuration.base_path,
queueId = crate::apis::urlencode(p_path_queue_id),
itemId = crate::apis::urlencode(p_path_item_id)
);
let mut req_builder = configuration
.client
.request(reqwest::Method::PATCH, &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 auth_conf) = configuration.basic_auth {
req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
};
req_builder = req_builder.json(&p_body_update_annotation_queue_item_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::AnnotationQueueItem`"))),
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::AnnotationQueueItem`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<AnnotationQueuesUpdateQueueItemError> =
serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}