use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EnumSchema {
pub name: String,
pub description: Option<String>,
pub options: Vec<String>,
}
impl EnumSchema {
pub fn new(
name: impl Into<String>,
options: impl IntoIterator<Item = impl Into<String>>,
) -> Self {
Self {
name: name.into(),
description: None,
options: options.into_iter().map(Into::into).collect(),
}
}
pub fn with_description(mut self, description: impl Into<String>) -> Self {
self.description = Some(description.into());
self
}
}