use serde::{Deserialize, Serialize}; use super::common::{Id, Timestamp, UnknownVariant}; /// A member of an Outline workspace. #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] #[non_exhaustive] pub struct User { /// Unique identifier for the user. pub id: Id, /// The user's display name. pub name: String, /// The URL of the user's avatar image, if any. #[serde(default)] pub avatar_url: Option, /// A color representing the user, used for avatars without an image. #[serde(default)] pub color: Option, /// The user's email address. #[serde(default)] pub email: Option, /// The user's role within the workspace. #[serde(default)] pub role: Option, /// Whether the user has been suspended. #[serde(default)] pub is_suspended: bool, /// The last time this user made an API request. #[serde(default)] pub last_active_at: Option, /// The date and time this user first signed in or was invited. #[serde(default)] pub created_at: Option, /// The date and time this user was last updated. #[serde(default)] pub updated_at: Option, } /// A user's role within a workspace. #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] #[non_exhaustive] pub enum UserRole { /// Full administrative access. Admin, /// A regular workspace member. Member, /// Read-only access to shared content. Viewer, /// External guest access. Guest, /// A value not recognized by this version of the crate. #[serde(untagged)] Unknown(UnknownVariant), }