meztide/api_models/
community.rs

1use serde::Deserialize;
2
3use crate::ids::CommunityId;
4
5use super::Content;
6
7#[derive(Debug, Deserialize)]
8pub struct YourFollowInfo {
9    /// Whether your follow request has been accepted by the community.
10    pub accepted: bool,
11}
12
13#[derive(Debug, Deserialize)]
14pub struct CommunityFeedsType {
15    pub new: Box<str>,
16}
17
18#[derive(Debug, Deserialize)]
19pub struct CommunityFeeds {
20    pub atom: CommunityFeedsType,
21}
22
23/// Full community info
24#[derive(Debug, Deserialize)]
25pub struct CommunityInfo {
26    #[serde(flatten)]
27    pub base: MinimalCommunityInfo,
28
29    pub description: Content,
30    pub feeds: CommunityFeeds,
31
32    pub you_are_moderator: Option<bool>,
33    pub your_follow: Option<YourFollowInfo>,
34
35    /// Number of pending flags sent to this community.
36    /// Present with include_your=true if you are a moderator
37    pub pending_moderation_actions: Option<u32>,
38}
39
40/// Community info contained in things like posts
41#[derive(Debug, Deserialize)]
42pub struct MinimalCommunityInfo {
43    pub id: CommunityId,
44    pub name: Box<str>,
45    pub local: bool,
46    pub host: Box<str>,
47    pub remote_url: Option<Box<str>>,
48    pub deleted: bool,
49}