use serde::{Deserialize, Serialize};
#[cfg_attr(feature = "export", derive(tsify::Tsify))]
#[cfg_attr(feature = "export", tsify(into_wasm_abi, from_wasm_abi))]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct TopicListing {
pub topics: Vec<ForumTopic>,
pub cursor_string: String,
}
#[cfg_attr(feature = "export", derive(tsify::Tsify))]
#[cfg_attr(feature = "export", tsify(into_wasm_abi, from_wasm_abi))]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ForumTopic {
pub created_at: String,
pub deleted_at: Option<String>,
pub first_post_id: u64,
pub forum_id: u64,
pub id: u64,
pub is_locked: bool,
pub last_post_id: u64,
pub poll: Option<Poll>,
pub post_count: u64,
pub title: String,
#[serde(rename = "type")]
pub topic_type: String,
pub updated_at: String,
pub user_id: u64,
}
#[cfg_attr(feature = "export", derive(tsify::Tsify))]
#[cfg_attr(feature = "export", tsify(into_wasm_abi, from_wasm_abi))]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Poll {
pub allow_vote_change: bool,
pub ended_at: Option<String>,
pub hide_incomplete_results: bool,
pub last_vote_at: Option<String>,
pub max_votes: u64,
pub options: Vec<PollOption>,
pub started_at: String,
#[cfg_attr(feature = "export", tsify(type = "BodyInForumTopic"))]
pub title: Body,
pub total_vote_count: u64,
}
#[cfg_attr(feature = "export", derive(tsify::Tsify))]
#[cfg_attr(feature = "export", tsify(into_wasm_abi, from_wasm_abi))]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct PollOption {
pub id: u64,
#[cfg_attr(feature = "export", tsify(type = "BodyInForumTopic"))]
pub text: Body,
pub vote_count: Option<u64>,
}
#[cfg_attr(feature = "export", derive(tsify::Tsify))]
#[cfg_attr(
feature = "export",
tsify(into_wasm_abi, from_wasm_abi, type_suffix = "InForumTopic")
)]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Body {
pub bbcode: String,
pub html: String,
}