diff --git a/entities/src/relationship.rs b/entities/src/relationship.rs index 44f89b3..b0357e5 100644 --- a/entities/src/relationship.rs +++ b/entities/src/relationship.rs @@ -7,7 +7,7 @@ use serde::{Deserialize, Serialize}; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] pub struct Relationship { /// Target account id - pub id: String, + pub id: RelationshipId, /// Whether the application client follows the account. pub following: bool, /// Whether the account follows the application client. @@ -31,3 +31,14 @@ pub struct Relationship { /// making calls to pleroma or mastodon<2.5.0 instances pub endorsed: Option, } + +/// Wrapper type for a relationship ID string +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] +#[serde(transparent)] +pub struct RelationshipId(String); + +impl AsRef for RelationshipId { + fn as_ref(&self) -> &str { + &self.0 + } +}