use smol_str::SmolStr; #[non_exhaustive] #[derive(Debug, Clone, Default, Eq, PartialEq)] pub enum ClusterLocationStatus { #[doc(alias = "red")] Dead, #[doc(alias = "orange")] Damaged, #[doc(alias = "good")] #[default] Ok, } #[derive(Debug, Clone, Default)] pub enum Relation { CloseFriend, Friend, Pooled, Me, Focus, #[default] None, } #[derive(Debug, Clone, Default)] pub enum ClusterLocationData { User { login: smol_str::SmolStr, image: Option, relation: Relation, }, Normal { status: ClusterLocationStatus, }, #[default] Empty, } #[derive(Debug, Clone)] pub struct ClusterLocation { pub location: smol_str::SmolStr, pub data: ClusterLocationData, } #[derive(Debug, Clone)] pub struct CluserInformation { pub cluster_name: smol_str::SmolStr, pub locations: Vec, } #[derive(Debug, Clone)] pub struct Friend { pub login: SmolStr, pub image: Option, pub position: Option, pub last_active: Option, } #[derive(Debug, Clone)] pub struct Friends { pub friends: Vec, } #[derive(Debug, Clone, serde::Deserialize, serde::Serialize)] #[serde(untagged)] pub(crate) enum IsFriend { U32(u32), Bool(bool), } #[derive(Debug, Clone, serde::Deserialize, serde::Serialize)] pub(crate) struct ProfileRaw { pub(crate) admin: bool, pub(crate) active: Option, pub(crate) campus: u64, pub(crate) id: u64, pub(crate) userid: Option, pub(crate) image: String, pub(crate) image_medium: String, pub(crate) is_friend: IsFriend, pub(crate) lang: SmolStr, pub(crate) name: SmolStr, pub(crate) pool: Option, pub(crate) position: Option, pub(crate) recit: Option, pub(crate) website: Option, pub(crate) discord: Option, pub(crate) github: Option, } #[derive(Debug, Clone, serde::Deserialize, serde::Serialize)] pub struct Profile { pub admin: bool, pub campus: u64, pub id: u64, pub userid: Option, pub pool: Option, pub image: String, pub image_medium: String, pub is_friend: bool, pub lang: SmolStr, pub name: SmolStr, pub position: Option, pub active: Option, pub website: Option, pub recit: Option, pub discord: Option, pub github: Option, }