parent
d0e257df85
commit
fcf3a1bc29
@ -0,0 +1,14 @@ |
|||||||
|
use serde::{Deserialize, Serialize}; |
||||||
|
|
||||||
|
/// Represents a weekly bucket of instance activity.
|
||||||
|
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] |
||||||
|
pub struct Activity { |
||||||
|
/// Midnight at the first day of the week.
|
||||||
|
pub week: String, |
||||||
|
/// Statuses created since the week began.
|
||||||
|
pub statuses: String, |
||||||
|
/// User logins since the week began.
|
||||||
|
pub logins: String, |
||||||
|
/// User registrations since the week began.
|
||||||
|
pub registrations: String, |
||||||
|
} |
@ -0,0 +1,50 @@ |
|||||||
|
use serde::{Deserialize, Serialize}; |
||||||
|
|
||||||
|
/// Custom emoji fields for AnnouncementReaction
|
||||||
|
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] |
||||||
|
pub struct AnnouncementReactionCustomEmoji { |
||||||
|
/// A link to the custom emoji.
|
||||||
|
pub url: String, |
||||||
|
/// A link to a non-animated version of the custom emoji.
|
||||||
|
pub static_url: String, |
||||||
|
} |
||||||
|
|
||||||
|
/// Represents an emoji reaction to an Announcement.
|
||||||
|
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] |
||||||
|
pub struct AnnouncementReaction { |
||||||
|
/// The emoji used for the reaction. Either a unicode emoji, or a custom emoji's shortcode.
|
||||||
|
pub name: String, |
||||||
|
/// The total number of users who have added this reaction.
|
||||||
|
pub count: u64, |
||||||
|
/// Whether the authorized user has added this reaction to the announcement.
|
||||||
|
pub me: bool, |
||||||
|
#[serde(flatten)] |
||||||
|
pub emoji: Option<AnnouncementReactionCustomEmoji>, |
||||||
|
} |
||||||
|
|
||||||
|
/// Represents an announcement set by an administrator.
|
||||||
|
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] |
||||||
|
pub struct Announcement { |
||||||
|
/// The announcement id.
|
||||||
|
id: String, |
||||||
|
/// The content of the announcement.
|
||||||
|
text: String, |
||||||
|
/// Whether the announcement is currently active.
|
||||||
|
published: bool, |
||||||
|
/// Whether the announcement has a start/end time.
|
||||||
|
all_day: bool, |
||||||
|
/// When the announcement was created.
|
||||||
|
created_at: String, // Datetime
|
||||||
|
/// When the announcement was last updated.
|
||||||
|
updated_at: String, // Datetime
|
||||||
|
/// Whether the announcement has been read by the user.
|
||||||
|
read: bool, |
||||||
|
/// Emoji reactions attached to the announcement.
|
||||||
|
reactions: Vec<AnnouncementReaction>, |
||||||
|
/// When the future announcement was scheduled.
|
||||||
|
scheduled_at: Option<String>, // Datetime
|
||||||
|
/// When the future announcement will start.
|
||||||
|
starts_at: Option<String>, // Datetime
|
||||||
|
/// When the future announcement will end.
|
||||||
|
ends_at: Option<String>, // Datetime
|
||||||
|
} |
@ -0,0 +1,37 @@ |
|||||||
|
use crate::entities::status::Emoji; |
||||||
|
use serde::{Deserialize, Serialize}; |
||||||
|
|
||||||
|
/// Represents a poll attached to a status.
|
||||||
|
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] |
||||||
|
pub struct Poll { |
||||||
|
/// The ID of the poll in the database.
|
||||||
|
pub id: String, |
||||||
|
/// When the poll ends.
|
||||||
|
pub expires_at: String, // Datetime??
|
||||||
|
/// Is the poll currently expired?
|
||||||
|
pub expired: bool, |
||||||
|
/// Does the poll allow multiple-choice answers?
|
||||||
|
pub multiple: bool, |
||||||
|
/// How many votes have been received.
|
||||||
|
pub votes_count: u64, |
||||||
|
/// How many unique accounts have voted on a multiple-choice poll.
|
||||||
|
pub voters_count: Option<u64>, |
||||||
|
/// When called with a user token, has the authorized user voted?
|
||||||
|
pub voted: Option<bool>, |
||||||
|
/// When called with a user token, which options has the authorized user
|
||||||
|
/// chosen? Contains an array of index values for options
|
||||||
|
pub own_votes: Option<Vec<u64>>, |
||||||
|
/// Possible answers for the poll.
|
||||||
|
pub options: Vec<PollOption>, |
||||||
|
/// Custom emoji to be used for rendering poll options.
|
||||||
|
pub emojis: Vec<Emoji>, |
||||||
|
} |
||||||
|
|
||||||
|
/// Possible answers for the poll.
|
||||||
|
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] |
||||||
|
pub struct PollOption { |
||||||
|
/// The text value of the poll option.
|
||||||
|
pub title: String, |
||||||
|
/// The number of received votes for this option.
|
||||||
|
pub votes_count: Option<u64>, |
||||||
|
} |
Loading…
Reference in new issue