use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[cfg_attr(feature = "poem", derive(poem_openapi::Object))]
#[cfg_attr(feature = "poem", oai(rename_all = "camelCase"))]
pub struct ErrorsBody {
pub errors: Vec<String>,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[cfg_attr(feature = "poem", derive(poem_openapi::Object))]
#[cfg_attr(feature = "poem", oai(rename_all = "camelCase"))]
pub struct ErrorBody {
pub error: String,
}
#[cfg(feature = "protobuf")]
mod protobuf {
use crate::model::error::{ErrorBody, ErrorsBody};
impl From<golem_api_grpc::proto::golem::common::ErrorBody> for ErrorBody {
fn from(value: golem_api_grpc::proto::golem::common::ErrorBody) -> Self {
Self { error: value.error }
}
}
impl From<golem_api_grpc::proto::golem::common::ErrorsBody> for ErrorsBody {
fn from(value: golem_api_grpc::proto::golem::common::ErrorsBody) -> Self {
Self {
errors: value.errors,
}
}
}
}