mastodon_api\models/announcement.rs
1use crate::models::{CustomEmoji, Mention, Status, Tag};
2use serde::{Deserialize, Serialize};
3
4/// Represents an announcement from the server.
5#[derive(Debug, Clone, Deserialize, Serialize)]
6pub struct Announcement {
7 /// The ID of the announcement in the database.
8 pub id: String,
9 /// The textual content of the announcement.
10 pub content: String,
11 /// When the announcement will start (ISO 8601).
12 pub starts_at: Option<String>,
13 /// When the announcement will end (ISO 8601).
14 pub ends_at: Option<String>,
15 /// Whether the announcement is a continuous event.
16 pub all_day: bool,
17 /// When the announcement was published (ISO 8601).
18 pub published_at: String,
19 /// When the announcement was last updated (ISO 8601).
20 pub updated_at: String,
21 /// Whether the announcement has been read by the current user.
22 pub read: bool,
23 /// Accounts mentioned in the announcement content.
24 pub mentions: Vec<Mention>,
25 /// Statuses linked in the announcement content.
26 pub statuses: Vec<Status>,
27 /// Tags linked in the announcement content.
28 pub tags: Vec<Tag>,
29 /// Custom emoji used in the announcement content.
30 pub emojis: Vec<CustomEmoji>,
31 /// Reactions to the announcement.
32 pub reactions: Vec<AnnouncementReaction>,
33}
34
35/// Represents a reaction to an announcement.
36#[derive(Debug, Clone, Deserialize, Serialize)]
37pub struct AnnouncementReaction {
38 /// The name of the reaction (emoji).
39 pub name: String,
40 /// The number of times this reaction has been used.
41 pub count: u64,
42 /// Whether the current user has added this reaction.
43 pub me: bool,
44 /// A static URL to the emoji.
45 pub static_url: Option<String>,
46 /// A URL to the emoji.
47 pub url: Option<String>,
48}