#![allow(clippy::needless_return, clippy::into_iter_on_ref)]
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 CreateVaultError {
Status400(models::ErrorResponse2),
Status401(models::ErrorResponse2),
Status403(models::ErrorResponse2),
Status404(models::ErrorResponse2),
Status409(models::ErrorResponse2),
Status500(models::ErrorResponse2),
Status503(models::ErrorResponse2),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CreateVaultCredentialError {
Status400(models::ErrorResponse2),
Status401(models::ErrorResponse2),
Status403(models::ErrorResponse2),
Status404(models::ErrorResponse2),
Status409(models::ErrorResponse2),
Status500(models::ErrorResponse2),
Status503(models::ErrorResponse2),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteVaultError {
Status400(models::ErrorResponse2),
Status401(models::ErrorResponse2),
Status403(models::ErrorResponse2),
Status404(models::ErrorResponse2),
Status409(models::ErrorResponse2),
Status500(models::ErrorResponse2),
Status503(models::ErrorResponse2),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteVaultCredentialError {
Status400(models::ErrorResponse2),
Status401(models::ErrorResponse2),
Status403(models::ErrorResponse2),
Status404(models::ErrorResponse2),
Status409(models::ErrorResponse2),
Status500(models::ErrorResponse2),
Status503(models::ErrorResponse2),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ListVaultCredentialsError {
Status400(models::ErrorResponse2),
Status401(models::ErrorResponse2),
Status403(models::ErrorResponse2),
Status404(models::ErrorResponse2),
Status409(models::ErrorResponse2),
Status500(models::ErrorResponse2),
Status503(models::ErrorResponse2),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ListVaultsError {
Status400(models::ErrorResponse2),
Status401(models::ErrorResponse2),
Status403(models::ErrorResponse2),
Status404(models::ErrorResponse2),
Status409(models::ErrorResponse2),
Status500(models::ErrorResponse2),
Status503(models::ErrorResponse2),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum RetrieveVaultError {
Status400(models::ErrorResponse2),
Status401(models::ErrorResponse2),
Status403(models::ErrorResponse2),
Status404(models::ErrorResponse2),
Status409(models::ErrorResponse2),
Status500(models::ErrorResponse2),
Status503(models::ErrorResponse2),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum RetrieveVaultCredentialError {
Status400(models::ErrorResponse2),
Status401(models::ErrorResponse2),
Status403(models::ErrorResponse2),
Status404(models::ErrorResponse2),
Status409(models::ErrorResponse2),
Status500(models::ErrorResponse2),
Status503(models::ErrorResponse2),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum RotateVaultCredentialError {
Status400(models::ErrorResponse2),
Status401(models::ErrorResponse2),
Status403(models::ErrorResponse2),
Status404(models::ErrorResponse2),
Status409(models::ErrorResponse2),
Status500(models::ErrorResponse2),
Status503(models::ErrorResponse2),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpdateVaultError {
Status400(models::ErrorResponse2),
Status401(models::ErrorResponse2),
Status403(models::ErrorResponse2),
Status404(models::ErrorResponse2),
Status409(models::ErrorResponse2),
Status500(models::ErrorResponse2),
Status503(models::ErrorResponse2),
UnknownValue(serde_json::Value),
}
#[bon::builder]
pub async fn create_vault(
configuration: &configuration::Configuration,
create_vault_params: Option<models::CreateVaultParams>,
) -> Result<models::VaultResource, Error<CreateVaultError>> {
let p_body_create_vault_params = create_vault_params;
let uri_str = format!("{}/vaults", 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 token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_create_vault_params);
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::VaultResource`"))),
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::VaultResource`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<CreateVaultError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(Box::new(ResponseContent {
status,
content,
entity,
})))
}
}
#[bon::builder]
pub async fn create_vault_credential(
configuration: &configuration::Configuration,
vault_id: &str,
create_vault_credential_params: Option<models::CreateVaultCredentialParams>,
) -> Result<models::VaultCredentialResource, Error<CreateVaultCredentialError>> {
let p_path_vault_id = vault_id;
let p_body_create_vault_credential_params = create_vault_credential_params;
let uri_str = format!(
"{}/vaults/{vault_id}/credentials",
configuration.base_path,
vault_id = crate::apis::urlencode(p_path_vault_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 token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_create_vault_credential_params);
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::VaultCredentialResource`"))),
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::VaultCredentialResource`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<CreateVaultCredentialError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(Box::new(ResponseContent {
status,
content,
entity,
})))
}
}
#[bon::builder]
pub async fn delete_vault(
configuration: &configuration::Configuration,
vault_id: &str,
) -> Result<models::DeletedVaultResource, Error<DeleteVaultError>> {
let p_path_vault_id = vault_id;
let uri_str = format!(
"{}/vaults/{vault_id}",
configuration.base_path,
vault_id = crate::apis::urlencode(p_path_vault_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 token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.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::DeletedVaultResource`"))),
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::DeletedVaultResource`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<DeleteVaultError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(Box::new(ResponseContent {
status,
content,
entity,
})))
}
}
#[bon::builder]
pub async fn delete_vault_credential(
configuration: &configuration::Configuration,
vault_id: &str,
credential_id: &str,
) -> Result<models::DeletedVaultCredentialResource, Error<DeleteVaultCredentialError>> {
let p_path_vault_id = vault_id;
let p_path_credential_id = credential_id;
let uri_str = format!(
"{}/vaults/{vault_id}/credentials/{credential_id}",
configuration.base_path,
vault_id = crate::apis::urlencode(p_path_vault_id),
credential_id = crate::apis::urlencode(p_path_credential_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 token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.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::DeletedVaultCredentialResource`"))),
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::DeletedVaultCredentialResource`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<DeleteVaultCredentialError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(Box::new(ResponseContent {
status,
content,
entity,
})))
}
}
#[bon::builder]
pub async fn list_vault_credentials(
configuration: &configuration::Configuration,
vault_id: &str,
limit: Option<i64>,
order: Option<models::ListOrderParam>,
after: Option<&str>,
metadata: Option<&str>,
status: Option<&str>,
) -> Result<models::VaultCredentialListResource, Error<ListVaultCredentialsError>> {
let p_path_vault_id = vault_id;
let p_query_limit = limit;
let p_query_order = order;
let p_query_after = after;
let p_query_metadata = metadata;
let p_query_status = status;
let uri_str = format!(
"{}/vaults/{vault_id}/credentials",
configuration.base_path,
vault_id = crate::apis::urlencode(p_path_vault_id)
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
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_order {
req_builder = req_builder.query(&[("order", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_after {
req_builder = req_builder.query(&[("after", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_metadata {
req_builder = req_builder.query(&[("metadata", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_status {
req_builder = req_builder.query(&[("status", &serde_json::to_string(param_value)?)]);
}
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 token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.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::VaultCredentialListResource`"))),
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::VaultCredentialListResource`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ListVaultCredentialsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(Box::new(ResponseContent {
status,
content,
entity,
})))
}
}
#[bon::builder]
pub async fn list_vaults(
configuration: &configuration::Configuration,
limit: Option<i64>,
order: Option<models::ListOrderParam>,
after: Option<&str>,
metadata: Option<&str>,
status: Option<models::VaultStatusFilterParam>,
) -> Result<models::VaultListResource, Error<ListVaultsError>> {
let p_query_limit = limit;
let p_query_order = order;
let p_query_after = after;
let p_query_metadata = metadata;
let p_query_status = status;
let uri_str = format!("{}/vaults", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
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_order {
req_builder = req_builder.query(&[("order", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_after {
req_builder = req_builder.query(&[("after", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_metadata {
req_builder = req_builder.query(&[("metadata", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_status {
req_builder = req_builder.query(&[("status", &serde_json::to_string(param_value)?)]);
}
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 token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.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::VaultListResource`"))),
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::VaultListResource`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ListVaultsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(Box::new(ResponseContent {
status,
content,
entity,
})))
}
}
#[bon::builder]
pub async fn retrieve_vault(
configuration: &configuration::Configuration,
vault_id: &str,
) -> Result<models::VaultResource, Error<RetrieveVaultError>> {
let p_path_vault_id = vault_id;
let uri_str = format!(
"{}/vaults/{vault_id}",
configuration.base_path,
vault_id = crate::apis::urlencode(p_path_vault_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 token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.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::VaultResource`"))),
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::VaultResource`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<RetrieveVaultError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(Box::new(ResponseContent {
status,
content,
entity,
})))
}
}
#[bon::builder]
pub async fn retrieve_vault_credential(
configuration: &configuration::Configuration,
vault_id: &str,
credential_id: &str,
) -> Result<models::VaultCredentialResource, Error<RetrieveVaultCredentialError>> {
let p_path_vault_id = vault_id;
let p_path_credential_id = credential_id;
let uri_str = format!(
"{}/vaults/{vault_id}/credentials/{credential_id}",
configuration.base_path,
vault_id = crate::apis::urlencode(p_path_vault_id),
credential_id = crate::apis::urlencode(p_path_credential_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 token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.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::VaultCredentialResource`"))),
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::VaultCredentialResource`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<RetrieveVaultCredentialError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(Box::new(ResponseContent {
status,
content,
entity,
})))
}
}
#[bon::builder]
pub async fn rotate_vault_credential(
configuration: &configuration::Configuration,
vault_id: &str,
credential_id: &str,
rotate_vault_credential_params: models::RotateVaultCredentialParams,
) -> Result<models::VaultCredentialResource, Error<RotateVaultCredentialError>> {
let p_path_vault_id = vault_id;
let p_path_credential_id = credential_id;
let p_body_rotate_vault_credential_params = rotate_vault_credential_params;
let uri_str = format!(
"{}/vaults/{vault_id}/credentials/{credential_id}",
configuration.base_path,
vault_id = crate::apis::urlencode(p_path_vault_id),
credential_id = crate::apis::urlencode(p_path_credential_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 token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_rotate_vault_credential_params);
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::VaultCredentialResource`"))),
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::VaultCredentialResource`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<RotateVaultCredentialError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(Box::new(ResponseContent {
status,
content,
entity,
})))
}
}
#[bon::builder]
pub async fn update_vault(
configuration: &configuration::Configuration,
vault_id: &str,
update_vault_params: models::UpdateVaultParams,
) -> Result<models::VaultResource, Error<UpdateVaultError>> {
let p_path_vault_id = vault_id;
let p_body_update_vault_params = update_vault_params;
let uri_str = format!(
"{}/vaults/{vault_id}",
configuration.base_path,
vault_id = crate::apis::urlencode(p_path_vault_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 token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_update_vault_params);
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::VaultResource`"))),
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::VaultResource`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<UpdateVaultError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(Box::new(ResponseContent {
status,
content,
entity,
})))
}
}