use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct ReactionTypeEmojiData {
pub emoji: String,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct ReactionTypeCustomEmojiData {
pub custom_emoji_id: String,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct ReactionTypePaidData {}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(tag = "type", rename_all = "snake_case")]
#[non_exhaustive]
pub enum ReactionType {
Emoji(ReactionTypeEmojiData),
CustomEmoji(ReactionTypeCustomEmojiData),
Paid(ReactionTypePaidData),
}
impl ReactionType {
pub fn emoji(emoji: impl Into<String>) -> Self {
Self::Emoji(ReactionTypeEmojiData {
emoji: emoji.into(),
})
}
pub fn custom_emoji(custom_emoji_id: impl Into<String>) -> Self {
Self::CustomEmoji(ReactionTypeCustomEmojiData {
custom_emoji_id: custom_emoji_id.into(),
})
}
pub fn paid() -> Self {
Self::Paid(ReactionTypePaidData {})
}
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct ReactionCount {
#[serde(rename = "type")]
pub reaction_type: ReactionType,
pub total_count: i64,
}