use serde::{Deserialize, Serialize}; use super::common::{Id, Permission, Timestamp, UnknownVariant}; use super::user::User; /// A collection: a top-level grouping of documents in Outline. #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] #[non_exhaustive] pub struct Collection { /// Unique identifier for the collection. pub id: Id, /// The relative URL path at which the collection can be accessed. #[serde(default)] pub url: Option, /// A short unique identifier that can be used in place of the UUID. #[serde(default)] pub url_id: Option, /// The name of the collection. pub name: String, /// A description of the collection, may contain markdown formatting. #[serde(default)] pub description: Option, /// The position of the collection in the sidebar. #[serde(default)] pub index: Option, /// A color representing the collection, in `#RRGGBB` format. #[serde(default)] pub color: Option, /// An icon name or emoji associated with the collection. #[serde(default)] pub icon: Option, /// The sharing permission level for this collection. #[serde(default)] pub permission: Option, /// Whether public document sharing is enabled in this collection. #[serde(default)] pub sharing: bool, /// Whether commenting is enabled in this collection. #[serde(default)] pub commenting: Option, /// The date and time this collection was created. #[serde(default)] pub created_at: Option, /// The date and time this collection was last changed. #[serde(default)] pub updated_at: Option, /// The date and time this collection was archived, if applicable. #[serde(default)] pub archived_at: Option, /// The user who archived this collection, if applicable. #[serde(default)] pub archived_by: Option, } /// The status a collection may be filtered by in `collections.list`. #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] #[non_exhaustive] pub enum CollectionStatus { /// The collection has been archived. Archived, /// A value not recognized by this version of the crate. #[serde(untagged)] Unknown(UnknownVariant), }