use prost::DecodeError;
pub mod command;
pub mod display;
#[derive(thiserror::Error, Debug)]
pub enum DisplayError {
#[error("Could not display content")]
DisplayContent(String),
#[error("Error while parsing response to JSON")]
Json(serde_json::Error),
#[error("got the wrong response content type: {0}")]
WrongResponseType(String),
#[error("Could not format the datetime to ISO 8601")]
DateTime,
#[error("unrecognized protobuf variant: {0}")]
DecodeError(DecodeError),
}
impl From<command::response_content::ContentType> for command::ResponseContent {
fn from(value: command::response_content::ContentType) -> Self {
Self {
content_type: Some(value),
}
}
}
impl From<command::request::RequestType> for command::Request {
fn from(value: command::request::RequestType) -> Self {
Self {
request_type: Some(value),
}
}
}