#![allow(deprecated)]
/*
* server
*
* ## Real-time data The only real-time path to get tracing data is to ingest via OpenTelemetry (`POST /api/public/otel/v1/traces`) and retrieve via Observations API v2 (`GET /api/public/v2/observations`) and Metrics API v2 (`GET /api/public/v2/metrics`). Other public API write and read endpoints can delay data by about 10 minutes. Direct OpenTelemetry exporters must send the `x-langfuse-ingestion-version: 4` header; current Python and JS SDKs already do. See the [Public API docs](https://langfuse.com/docs/api-and-data-platform/features/public-api) and [real-time ingestion](https://langfuse.com/integrations/native/opentelemetry.md#real-time-ingestion). ## Authentication Authenticate with the API using [Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication), get API keys in the project settings: - username: Langfuse Public Key - password: Langfuse Secret Key ## Exports - OpenAPI spec: https://cloud.langfuse.com/generated/api/openapi.yml - Self-hosted deployments: interactive API reference at `/api/docs` and OpenAPI spec at `/api/openapi.yaml`
*
* The version of the OpenAPI document:
*
* Generated by: https://openapi-generator.tech
*/
use super::{configuration, ContentType, Error};
use crate::{apis::ResponseContent, models};
use serde::{de::Error as _, Deserialize, Serialize};
use timvw_rust_runtime;
/// struct for typed errors of method [`skills_create_version`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum SkillsCreateVersionError {
Status400(serde_json::Value),
Status401(serde_json::Value),
Status403(serde_json::Value),
Status404(serde_json::Value),
Status405(serde_json::Value),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`skills_delete_version`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum SkillsDeleteVersionError {
Status400(serde_json::Value),
Status401(serde_json::Value),
Status403(serde_json::Value),
Status404(serde_json::Value),
Status405(serde_json::Value),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`skills_get`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum SkillsGetError {
Status400(serde_json::Value),
Status401(serde_json::Value),
Status403(serde_json::Value),
Status404(serde_json::Value),
Status405(serde_json::Value),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`skills_get_file_contents`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum SkillsGetFileContentsError {
Status400(serde_json::Value),
Status401(serde_json::Value),
Status403(serde_json::Value),
Status404(serde_json::Value),
Status405(serde_json::Value),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`skills_list`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum SkillsListError {
Status400(serde_json::Value),
Status401(serde_json::Value),
Status403(serde_json::Value),
Status404(serde_json::Value),
Status405(serde_json::Value),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`skills_set_labels`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum SkillsSetLabelsError {
Status400(serde_json::Value),
Status401(serde_json::Value),
Status403(serde_json::Value),
Status404(serde_json::Value),
Status405(serde_json::Value),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`skills_update`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum SkillsUpdateError {
Status400(serde_json::Value),
Status401(serde_json::Value),
Status403(serde_json::Value),
Status404(serde_json::Value),
Status405(serde_json::Value),
UnknownValue(serde_json::Value),
}
/// Create skill version
#[bon::builder]
pub async fn skills_create_version(
configuration: &configuration::Configuration,
create_skill_version_request: &models::CreateSkillVersionRequest,
) -> Result<models::SkillVersion, Error<SkillsCreateVersionError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_body_create_skill_version_request = create_skill_version_request;
let uri_str = format!("{}/api/public/skills", configuration.base_path);
let mut req_builder = configuration
.client
.request(timvw_rust_runtime::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder =
req_builder.header(timvw_rust_runtime::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_skill_version_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 => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SkillVersion`"))),
ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SkillVersion`")))),
}
} else {
let headers = resp.headers().clone();
let content = resp.text().await?;
let entity: Option<SkillsCreateVersionError> = match status.as_u16() {
400 => serde_json::from_str(&content)
.ok()
.map(SkillsCreateVersionError::Status400),
401 => serde_json::from_str(&content)
.ok()
.map(SkillsCreateVersionError::Status401),
403 => serde_json::from_str(&content)
.ok()
.map(SkillsCreateVersionError::Status403),
404 => serde_json::from_str(&content)
.ok()
.map(SkillsCreateVersionError::Status404),
405 => serde_json::from_str(&content)
.ok()
.map(SkillsCreateVersionError::Status405),
_ => None,
}
.or_else(|| {
serde_json::from_str(&content)
.ok()
.map(SkillsCreateVersionError::UnknownValue)
});
Err(Error::ResponseError(Box::new(ResponseContent {
status,
content,
entity,
headers,
})))
}
}
/// Delete one immutable skill version. Unreferenced blobs are retained for asynchronous cleanup.
#[bon::builder]
pub async fn skills_delete_version(
configuration: &configuration::Configuration,
skill_name: &str,
skill_version: i64,
) -> Result<models::DeleteSkillVersionResponse, Error<SkillsDeleteVersionError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_path_skill_name = skill_name;
let p_path_skill_version = skill_version;
let uri_str = format!(
"{}/api/public/skills/{skillName}/versions/{skillVersion}",
configuration.base_path,
skillName = crate::apis::urlencode(p_path_skill_name),
skillVersion = p_path_skill_version
);
let mut req_builder = configuration
.client
.request(timvw_rust_runtime::Method::DELETE, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder =
req_builder.header(timvw_rust_runtime::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 => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DeleteSkillVersionResponse`"))),
ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::DeleteSkillVersionResponse`")))),
}
} else {
let headers = resp.headers().clone();
let content = resp.text().await?;
let entity: Option<SkillsDeleteVersionError> = match status.as_u16() {
400 => serde_json::from_str(&content)
.ok()
.map(SkillsDeleteVersionError::Status400),
401 => serde_json::from_str(&content)
.ok()
.map(SkillsDeleteVersionError::Status401),
403 => serde_json::from_str(&content)
.ok()
.map(SkillsDeleteVersionError::Status403),
404 => serde_json::from_str(&content)
.ok()
.map(SkillsDeleteVersionError::Status404),
405 => serde_json::from_str(&content)
.ok()
.map(SkillsDeleteVersionError::Status405),
_ => None,
}
.or_else(|| {
serde_json::from_str(&content)
.ok()
.map(SkillsDeleteVersionError::UnknownValue)
});
Err(Error::ResponseError(Box::new(ResponseContent {
status,
content,
entity,
headers,
})))
}
}
/// Resolve a skill's metadata and file manifest by version or label. Defaults to the production label. Set includeContent to return file contents inline, or use each file's sha256Hash with getFileContents.
#[bon::builder]
pub async fn skills_get(
configuration: &configuration::Configuration,
skill_name: &str,
version: Option<i64>,
label: Option<&str>,
include_content: Option<bool>,
) -> Result<models::SkillVersion, Error<SkillsGetError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_path_skill_name = skill_name;
let p_query_version = version;
let p_query_label = label;
let p_query_include_content = include_content;
let uri_str = format!(
"{}/api/public/skills/{skillName}",
configuration.base_path,
skillName = crate::apis::urlencode(p_path_skill_name)
);
let mut req_builder = configuration
.client
.request(timvw_rust_runtime::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_version {
req_builder = req_builder.query(&[("version", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_label {
req_builder = req_builder.query(&[("label", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_include_content {
req_builder = req_builder.query(&[("includeContent", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder =
req_builder.header(timvw_rust_runtime::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 => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SkillVersion`"))),
ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SkillVersion`")))),
}
} else {
let headers = resp.headers().clone();
let content = resp.text().await?;
let entity: Option<SkillsGetError> = match status.as_u16() {
400 => serde_json::from_str(&content)
.ok()
.map(SkillsGetError::Status400),
401 => serde_json::from_str(&content)
.ok()
.map(SkillsGetError::Status401),
403 => serde_json::from_str(&content)
.ok()
.map(SkillsGetError::Status403),
404 => serde_json::from_str(&content)
.ok()
.map(SkillsGetError::Status404),
405 => serde_json::from_str(&content)
.ok()
.map(SkillsGetError::Status405),
_ => None,
}
.or_else(|| {
serde_json::from_str(&content)
.ok()
.map(SkillsGetError::UnknownValue)
});
Err(Error::ResponseError(Box::new(ResponseContent {
status,
content,
entity,
headers,
})))
}
}
/// Read a batch of text contents by canonical base64-encoded SHA-256 hashes.
#[bon::builder]
pub async fn skills_get_file_contents(
configuration: &configuration::Configuration,
sha256_hashes: &str,
) -> Result<models::SkillFileContentsResponse, Error<SkillsGetFileContentsError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_query_sha256_hashes = sha256_hashes;
let uri_str = format!(
"{}/api/public/skills/files/content",
configuration.base_path
);
let mut req_builder = configuration
.client
.request(timvw_rust_runtime::Method::GET, &uri_str);
req_builder = req_builder.query(&[("sha256Hashes", &p_query_sha256_hashes.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder =
req_builder.header(timvw_rust_runtime::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 => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SkillFileContentsResponse`"))),
ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SkillFileContentsResponse`")))),
}
} else {
let headers = resp.headers().clone();
let content = resp.text().await?;
let entity: Option<SkillsGetFileContentsError> = match status.as_u16() {
400 => serde_json::from_str(&content)
.ok()
.map(SkillsGetFileContentsError::Status400),
401 => serde_json::from_str(&content)
.ok()
.map(SkillsGetFileContentsError::Status401),
403 => serde_json::from_str(&content)
.ok()
.map(SkillsGetFileContentsError::Status403),
404 => serde_json::from_str(&content)
.ok()
.map(SkillsGetFileContentsError::Status404),
405 => serde_json::from_str(&content)
.ok()
.map(SkillsGetFileContentsError::Status405),
_ => None,
}
.or_else(|| {
serde_json::from_str(&content)
.ok()
.map(SkillsGetFileContentsError::UnknownValue)
});
Err(Error::ResponseError(Box::new(ResponseContent {
status,
content,
entity,
headers,
})))
}
}
/// List skills with metadata and timestamps from their latest version, shared tags, and the version assigned to production when present.
#[bon::builder]
pub async fn skills_list(
configuration: &configuration::Configuration,
name: Option<&str>,
search: Option<&str>,
tag: Option<&str>,
page: Option<i64>,
limit: Option<i64>,
from_updated_at: Option<chrono::DateTime<chrono::FixedOffset>>,
to_updated_at: Option<chrono::DateTime<chrono::FixedOffset>>,
) -> Result<models::SkillMetaListResponse, Error<SkillsListError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_query_name = name;
let p_query_search = search;
let p_query_tag = tag;
let p_query_page = page;
let p_query_limit = limit;
let p_query_from_updated_at = from_updated_at;
let p_query_to_updated_at = to_updated_at;
let uri_str = format!("{}/api/public/skills", configuration.base_path);
let mut req_builder = configuration
.client
.request(timvw_rust_runtime::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_name {
req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_search {
req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_tag {
req_builder = req_builder.query(&[("tag", ¶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 param_value) = p_query_from_updated_at {
req_builder = req_builder.query(&[("fromUpdatedAt", ¶m_value.to_rfc3339())]);
}
if let Some(ref param_value) = p_query_to_updated_at {
req_builder = req_builder.query(&[("toUpdatedAt", ¶m_value.to_rfc3339())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder =
req_builder.header(timvw_rust_runtime::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 => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SkillMetaListResponse`"))),
ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SkillMetaListResponse`")))),
}
} else {
let headers = resp.headers().clone();
let content = resp.text().await?;
let entity: Option<SkillsListError> = match status.as_u16() {
400 => serde_json::from_str(&content)
.ok()
.map(SkillsListError::Status400),
401 => serde_json::from_str(&content)
.ok()
.map(SkillsListError::Status401),
403 => serde_json::from_str(&content)
.ok()
.map(SkillsListError::Status403),
404 => serde_json::from_str(&content)
.ok()
.map(SkillsListError::Status404),
405 => serde_json::from_str(&content)
.ok()
.map(SkillsListError::Status405),
_ => None,
}
.or_else(|| {
serde_json::from_str(&content)
.ok()
.map(SkillsListError::UnknownValue)
});
Err(Error::ResponseError(Box::new(ResponseContent {
status,
content,
entity,
headers,
})))
}
}
/// Replace the labels on a skill version and atomically move them from other versions.
#[bon::builder]
pub async fn skills_set_labels(
configuration: &configuration::Configuration,
skill_name: &str,
skill_version: i64,
update_skill_labels_request: &models::UpdateSkillLabelsRequest,
) -> Result<models::SkillVersion, Error<SkillsSetLabelsError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_path_skill_name = skill_name;
let p_path_skill_version = skill_version;
let p_body_update_skill_labels_request = update_skill_labels_request;
let uri_str = format!(
"{}/api/public/skills/{skillName}/versions/{skillVersion}",
configuration.base_path,
skillName = crate::apis::urlencode(p_path_skill_name),
skillVersion = p_path_skill_version
);
let mut req_builder = configuration
.client
.request(timvw_rust_runtime::Method::PATCH, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder =
req_builder.header(timvw_rust_runtime::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_skill_labels_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 => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SkillVersion`"))),
ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SkillVersion`")))),
}
} else {
let headers = resp.headers().clone();
let content = resp.text().await?;
let entity: Option<SkillsSetLabelsError> = match status.as_u16() {
400 => serde_json::from_str(&content)
.ok()
.map(SkillsSetLabelsError::Status400),
401 => serde_json::from_str(&content)
.ok()
.map(SkillsSetLabelsError::Status401),
403 => serde_json::from_str(&content)
.ok()
.map(SkillsSetLabelsError::Status403),
404 => serde_json::from_str(&content)
.ok()
.map(SkillsSetLabelsError::Status404),
405 => serde_json::from_str(&content)
.ok()
.map(SkillsSetLabelsError::Status405),
_ => None,
}
.or_else(|| {
serde_json::from_str(&content)
.ok()
.map(SkillsSetLabelsError::UnknownValue)
});
Err(Error::ResponseError(Box::new(ResponseContent {
status,
content,
entity,
headers,
})))
}
}
/// Replace the shared tags across all versions of a skill. An empty tags list clears all tags. Returns the latest skill version with the updated tags.
#[bon::builder]
pub async fn skills_update(
configuration: &configuration::Configuration,
skill_name: &str,
update_skill_request: &models::UpdateSkillRequest,
) -> Result<models::SkillVersion, Error<SkillsUpdateError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_path_skill_name = skill_name;
let p_body_update_skill_request = update_skill_request;
let uri_str = format!(
"{}/api/public/skills/{skillName}",
configuration.base_path,
skillName = crate::apis::urlencode(p_path_skill_name)
);
let mut req_builder = configuration
.client
.request(timvw_rust_runtime::Method::PATCH, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder =
req_builder.header(timvw_rust_runtime::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_skill_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 => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SkillVersion`"))),
ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SkillVersion`")))),
}
} else {
let headers = resp.headers().clone();
let content = resp.text().await?;
let entity: Option<SkillsUpdateError> = match status.as_u16() {
400 => serde_json::from_str(&content)
.ok()
.map(SkillsUpdateError::Status400),
401 => serde_json::from_str(&content)
.ok()
.map(SkillsUpdateError::Status401),
403 => serde_json::from_str(&content)
.ok()
.map(SkillsUpdateError::Status403),
404 => serde_json::from_str(&content)
.ok()
.map(SkillsUpdateError::Status404),
405 => serde_json::from_str(&content)
.ok()
.map(SkillsUpdateError::Status405),
_ => None,
}
.or_else(|| {
serde_json::from_str(&content)
.ok()
.map(SkillsUpdateError::UnknownValue)
});
Err(Error::ResponseError(Box::new(ResponseContent {
status,
content,
entity,
headers,
})))
}
}