mastodon_api\models/
poll.rs

1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Clone, Deserialize, Serialize)]
4pub struct Poll {
5    pub id: String,
6    pub expires_at: Option<String>,
7    pub expired: bool,
8    pub multiple: bool,
9    pub votes_count: u64,
10    pub voters_count: Option<u64>,
11    pub options: Vec<PollOption>,
12    pub emojis: Vec<CustomEmoji>,
13    pub voted: Option<bool>,
14    pub own_votes: Option<Vec<u32>>,
15}
16
17#[derive(Debug, Clone, Deserialize, Serialize)]
18pub struct PollOption {
19    pub title: String,
20    pub votes_count: Option<u64>,
21}
22
23#[derive(Debug, Clone, Deserialize, Serialize)]
24pub struct CustomEmoji {
25    pub shortcode: String,
26    pub url: String,
27    pub static_url: String,
28    pub visible_in_picker: bool,
29    pub category: Option<String>,
30}