use {
super::{Error, configuration},
crate::{
apis::{ContentType, ResponseContent},
models,
},
async_trait::async_trait,
reqwest,
serde::{Deserialize, Serialize, de::Error as _},
std::sync::Arc,
};
#[async_trait]
pub trait KeyLinkApi: Send + Sync {
async fn create_signing_key(
&self,
params: CreateSigningKeyParams,
) -> Result<models::SigningKeyDto, Error<CreateSigningKeyError>>;
async fn create_validation_key(
&self,
params: CreateValidationKeyParams,
) -> Result<models::CreateValidationKeyResponseDto, Error<CreateValidationKeyError>>;
async fn disable_validation_key(
&self,
params: DisableValidationKeyParams,
) -> Result<models::ValidationKeyDto, Error<DisableValidationKeyError>>;
async fn get_signing_key(
&self,
params: GetSigningKeyParams,
) -> Result<models::SigningKeyDto, Error<GetSigningKeyError>>;
async fn get_signing_keys_list(
&self,
params: GetSigningKeysListParams,
) -> Result<models::GetSigningKeyResponseDto, Error<GetSigningKeysListError>>;
async fn get_validation_key(
&self,
params: GetValidationKeyParams,
) -> Result<models::ValidationKeyDto, Error<GetValidationKeyError>>;
async fn get_validation_keys_list(
&self,
params: GetValidationKeysListParams,
) -> Result<models::GetValidationKeyResponseDto, Error<GetValidationKeysListError>>;
async fn set_agent_id(&self, params: SetAgentIdParams) -> Result<(), Error<SetAgentIdError>>;
async fn update_signing_key(
&self,
params: UpdateSigningKeyParams,
) -> Result<models::SigningKeyDto, Error<UpdateSigningKeyError>>;
}
pub struct KeyLinkApiClient {
configuration: Arc<configuration::Configuration>,
}
impl KeyLinkApiClient {
pub fn new(configuration: Arc<configuration::Configuration>) -> Self {
Self { configuration }
}
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct CreateSigningKeyParams {
pub create_signing_key_dto: models::CreateSigningKeyDto,
pub idempotency_key: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct CreateValidationKeyParams {
pub create_validation_key_dto: models::CreateValidationKeyDto,
pub idempotency_key: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct DisableValidationKeyParams {
pub key_id: String,
pub modify_validation_key_dto: models::ModifyValidationKeyDto,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct GetSigningKeyParams {
pub key_id: String,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct GetSigningKeysListParams {
pub page_cursor: Option<String>,
pub page_size: Option<f64>,
pub sort_by: Option<String>,
pub order: Option<String>,
pub vault_account_id: Option<f64>,
pub agent_user_id: Option<String>,
pub algorithm: Option<String>,
pub enabled: Option<bool>,
pub available: Option<bool>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct GetValidationKeyParams {
pub key_id: String,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct GetValidationKeysListParams {
pub page_cursor: Option<String>,
pub page_size: Option<f64>,
pub sort_by: Option<String>,
pub order: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct SetAgentIdParams {
pub key_id: String,
pub modify_signing_key_agent_id_dto: models::ModifySigningKeyAgentIdDto,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct UpdateSigningKeyParams {
pub key_id: String,
pub modify_signing_key_dto: models::ModifySigningKeyDto,
}
#[async_trait]
impl KeyLinkApi for KeyLinkApiClient {
async fn create_signing_key(
&self,
params: CreateSigningKeyParams,
) -> Result<models::SigningKeyDto, Error<CreateSigningKeyError>> {
let CreateSigningKeyParams {
create_signing_key_dto,
idempotency_key,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}/key_link/signing_keys",
local_var_configuration.base_path
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder
.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(local_var_param_value) = idempotency_key {
local_var_req_builder =
local_var_req_builder.header("Idempotency-Key", local_var_param_value.to_string());
}
local_var_req_builder = local_var_req_builder.json(&create_signing_key_dto);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content_type = local_var_resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let local_var_content_type = super::ContentType::from(local_var_content_type);
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
match local_var_content_type {
ContentType::Json => {
crate::deserialize_wrapper(&local_var_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::SigningKeyDto`",
)));
}
ContentType::Unsupported(local_var_unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{local_var_unknown_type}` content type response that cannot be \
converted to `models::SigningKeyDto`"
))));
}
}
} else {
let local_var_entity: Option<CreateSigningKeyError> =
serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Err(Error::ResponseError(local_var_error))
}
}
async fn create_validation_key(
&self,
params: CreateValidationKeyParams,
) -> Result<models::CreateValidationKeyResponseDto, Error<CreateValidationKeyError>> {
let CreateValidationKeyParams {
create_validation_key_dto,
idempotency_key,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}/key_link/validation_keys",
local_var_configuration.base_path
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder
.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(local_var_param_value) = idempotency_key {
local_var_req_builder =
local_var_req_builder.header("Idempotency-Key", local_var_param_value.to_string());
}
local_var_req_builder = local_var_req_builder.json(&create_validation_key_dto);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content_type = local_var_resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let local_var_content_type = super::ContentType::from(local_var_content_type);
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
match local_var_content_type {
ContentType::Json => {
crate::deserialize_wrapper(&local_var_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::CreateValidationKeyResponseDto`",
)));
}
ContentType::Unsupported(local_var_unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{local_var_unknown_type}` content type response that cannot be \
converted to `models::CreateValidationKeyResponseDto`"
))));
}
}
} else {
let local_var_entity: Option<CreateValidationKeyError> =
serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Err(Error::ResponseError(local_var_error))
}
}
async fn disable_validation_key(
&self,
params: DisableValidationKeyParams,
) -> Result<models::ValidationKeyDto, Error<DisableValidationKeyError>> {
let DisableValidationKeyParams {
key_id,
modify_validation_key_dto,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}/key_link/validation_keys/{keyId}",
local_var_configuration.base_path,
keyId = crate::apis::urlencode(key_id)
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder
.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&modify_validation_key_dto);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content_type = local_var_resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let local_var_content_type = super::ContentType::from(local_var_content_type);
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
match local_var_content_type {
ContentType::Json => {
crate::deserialize_wrapper(&local_var_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::ValidationKeyDto`",
)));
}
ContentType::Unsupported(local_var_unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{local_var_unknown_type}` content type response that cannot be \
converted to `models::ValidationKeyDto`"
))));
}
}
} else {
let local_var_entity: Option<DisableValidationKeyError> =
serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Err(Error::ResponseError(local_var_error))
}
}
async fn get_signing_key(
&self,
params: GetSigningKeyParams,
) -> Result<models::SigningKeyDto, Error<GetSigningKeyError>> {
let GetSigningKeyParams { key_id } = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}/key_link/signing_keys/{keyId}",
local_var_configuration.base_path,
keyId = crate::apis::urlencode(key_id)
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder
.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content_type = local_var_resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let local_var_content_type = super::ContentType::from(local_var_content_type);
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
match local_var_content_type {
ContentType::Json => {
crate::deserialize_wrapper(&local_var_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::SigningKeyDto`",
)));
}
ContentType::Unsupported(local_var_unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{local_var_unknown_type}` content type response that cannot be \
converted to `models::SigningKeyDto`"
))));
}
}
} else {
let local_var_entity: Option<GetSigningKeyError> =
serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Err(Error::ResponseError(local_var_error))
}
}
async fn get_signing_keys_list(
&self,
params: GetSigningKeysListParams,
) -> Result<models::GetSigningKeyResponseDto, Error<GetSigningKeysListError>> {
let GetSigningKeysListParams {
page_cursor,
page_size,
sort_by,
order,
vault_account_id,
agent_user_id,
algorithm,
enabled,
available,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}/key_link/signing_keys",
local_var_configuration.base_path
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref param_value) = page_cursor {
local_var_req_builder =
local_var_req_builder.query(&[("pageCursor", ¶m_value.to_string())]);
}
if let Some(ref param_value) = page_size {
local_var_req_builder =
local_var_req_builder.query(&[("pageSize", ¶m_value.to_string())]);
}
if let Some(ref param_value) = sort_by {
local_var_req_builder =
local_var_req_builder.query(&[("sortBy", ¶m_value.to_string())]);
}
if let Some(ref param_value) = order {
local_var_req_builder =
local_var_req_builder.query(&[("order", ¶m_value.to_string())]);
}
if let Some(ref param_value) = vault_account_id {
local_var_req_builder =
local_var_req_builder.query(&[("vaultAccountId", ¶m_value.to_string())]);
}
if let Some(ref param_value) = agent_user_id {
local_var_req_builder =
local_var_req_builder.query(&[("agentUserId", ¶m_value.to_string())]);
}
if let Some(ref param_value) = algorithm {
local_var_req_builder =
local_var_req_builder.query(&[("algorithm", ¶m_value.to_string())]);
}
if let Some(ref param_value) = enabled {
local_var_req_builder =
local_var_req_builder.query(&[("enabled", ¶m_value.to_string())]);
}
if let Some(ref param_value) = available {
local_var_req_builder =
local_var_req_builder.query(&[("available", ¶m_value.to_string())]);
}
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder
.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content_type = local_var_resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let local_var_content_type = super::ContentType::from(local_var_content_type);
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
match local_var_content_type {
ContentType::Json => {
crate::deserialize_wrapper(&local_var_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::GetSigningKeyResponseDto`",
)));
}
ContentType::Unsupported(local_var_unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{local_var_unknown_type}` content type response that cannot be \
converted to `models::GetSigningKeyResponseDto`"
))));
}
}
} else {
let local_var_entity: Option<GetSigningKeysListError> =
serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Err(Error::ResponseError(local_var_error))
}
}
async fn get_validation_key(
&self,
params: GetValidationKeyParams,
) -> Result<models::ValidationKeyDto, Error<GetValidationKeyError>> {
let GetValidationKeyParams { key_id } = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}/key_link/validation_keys/{keyId}",
local_var_configuration.base_path,
keyId = crate::apis::urlencode(key_id)
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder
.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content_type = local_var_resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let local_var_content_type = super::ContentType::from(local_var_content_type);
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
match local_var_content_type {
ContentType::Json => {
crate::deserialize_wrapper(&local_var_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::ValidationKeyDto`",
)));
}
ContentType::Unsupported(local_var_unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{local_var_unknown_type}` content type response that cannot be \
converted to `models::ValidationKeyDto`"
))));
}
}
} else {
let local_var_entity: Option<GetValidationKeyError> =
serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Err(Error::ResponseError(local_var_error))
}
}
async fn get_validation_keys_list(
&self,
params: GetValidationKeysListParams,
) -> Result<models::GetValidationKeyResponseDto, Error<GetValidationKeysListError>> {
let GetValidationKeysListParams {
page_cursor,
page_size,
sort_by,
order,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}/key_link/validation_keys",
local_var_configuration.base_path
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref param_value) = page_cursor {
local_var_req_builder =
local_var_req_builder.query(&[("pageCursor", ¶m_value.to_string())]);
}
if let Some(ref param_value) = page_size {
local_var_req_builder =
local_var_req_builder.query(&[("pageSize", ¶m_value.to_string())]);
}
if let Some(ref param_value) = sort_by {
local_var_req_builder =
local_var_req_builder.query(&[("sortBy", ¶m_value.to_string())]);
}
if let Some(ref param_value) = order {
local_var_req_builder =
local_var_req_builder.query(&[("order", ¶m_value.to_string())]);
}
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder
.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content_type = local_var_resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let local_var_content_type = super::ContentType::from(local_var_content_type);
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
match local_var_content_type {
ContentType::Json => {
crate::deserialize_wrapper(&local_var_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::GetValidationKeyResponseDto`",
)));
}
ContentType::Unsupported(local_var_unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{local_var_unknown_type}` content type response that cannot be \
converted to `models::GetValidationKeyResponseDto`"
))));
}
}
} else {
let local_var_entity: Option<GetValidationKeysListError> =
serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Err(Error::ResponseError(local_var_error))
}
}
async fn set_agent_id(&self, params: SetAgentIdParams) -> Result<(), Error<SetAgentIdError>> {
let SetAgentIdParams {
key_id,
modify_signing_key_agent_id_dto,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}/key_link/signing_keys/{keyId}/agent_user_id",
local_var_configuration.base_path,
keyId = crate::apis::urlencode(key_id)
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder
.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&modify_signing_key_agent_id_dto);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<SetAgentIdError> =
serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Err(Error::ResponseError(local_var_error))
}
}
async fn update_signing_key(
&self,
params: UpdateSigningKeyParams,
) -> Result<models::SigningKeyDto, Error<UpdateSigningKeyError>> {
let UpdateSigningKeyParams {
key_id,
modify_signing_key_dto,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}/key_link/signing_keys/{keyId}",
local_var_configuration.base_path,
keyId = crate::apis::urlencode(key_id)
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder
.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&modify_signing_key_dto);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content_type = local_var_resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let local_var_content_type = super::ContentType::from(local_var_content_type);
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
match local_var_content_type {
ContentType::Json => {
crate::deserialize_wrapper(&local_var_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::SigningKeyDto`",
)));
}
ContentType::Unsupported(local_var_unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{local_var_unknown_type}` content type response that cannot be \
converted to `models::SigningKeyDto`"
))));
}
}
} else {
let local_var_entity: Option<UpdateSigningKeyError> =
serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Err(Error::ResponseError(local_var_error))
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CreateSigningKeyError {
DefaultResponse(models::ErrorSchema),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CreateValidationKeyError {
DefaultResponse(models::ErrorSchema),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DisableValidationKeyError {
DefaultResponse(models::ErrorSchema),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetSigningKeyError {
DefaultResponse(models::ErrorSchema),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetSigningKeysListError {
DefaultResponse(models::ErrorSchema),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetValidationKeyError {
DefaultResponse(models::ErrorSchema),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetValidationKeysListError {
DefaultResponse(models::ErrorSchema),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum SetAgentIdError {
DefaultResponse(models::ErrorSchema),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpdateSigningKeyError {
DefaultResponse(models::ErrorSchema),
UnknownValue(serde_json::Value),
}