diff --git a/entities/src/list.rs b/entities/src/list.rs index 825db14..f5639f4 100644 --- a/entities/src/list.rs +++ b/entities/src/list.rs @@ -3,6 +3,23 @@ use serde::{Deserialize, Serialize}; /// Used for ser/de of list resources #[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub struct List { - id: String, + id: ListId, title: String, } + +/// Wrapper type for a list ID string +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] +#[serde(transparent)] +pub struct ListId(String); + +impl AsRef for ListId { + fn as_ref(&self) -> &str { + &self.0 + } +} + +impl ListId { + pub fn new(value: impl Into) -> Self { + Self(value.into()) + } +}