2 community_view::{CommunityFollowerView, CommunityModeratorView, CommunityView},
5 use serde::{Deserialize, Serialize};
8 pub struct GetCommunity {
10 pub name: Option<String>,
11 pub auth: Option<String>,
15 pub struct GetCommunityResponse {
16 pub community: CommunityView,
17 pub moderators: Vec<CommunityModeratorView>,
21 #[derive(Deserialize)]
22 pub struct CreateCommunity {
25 pub description: Option<String>,
26 pub icon: Option<String>,
27 pub banner: Option<String>,
33 #[derive(Serialize, Clone)]
34 pub struct CommunityResponse {
35 pub community: CommunityView,
38 #[derive(Deserialize, Debug)]
39 pub struct ListCommunities {
41 pub page: Option<i64>,
42 pub limit: Option<i64>,
43 pub auth: Option<String>,
46 #[derive(Serialize, Debug)]
47 pub struct ListCommunitiesResponse {
48 pub communities: Vec<CommunityView>,
51 #[derive(Deserialize, Clone)]
52 pub struct BanFromCommunity {
53 pub community_id: i32,
56 pub remove_data: Option<bool>,
57 pub reason: Option<String>,
58 pub expires: Option<i64>,
62 #[derive(Serialize, Clone)]
63 pub struct BanFromCommunityResponse {
68 #[derive(Deserialize)]
69 pub struct AddModToCommunity {
70 pub community_id: i32,
76 #[derive(Serialize, Clone)]
77 pub struct AddModToCommunityResponse {
78 pub moderators: Vec<CommunityModeratorView>,
81 #[derive(Deserialize)]
82 pub struct EditCommunity {
85 pub description: Option<String>,
86 pub icon: Option<String>,
87 pub banner: Option<String>,
93 #[derive(Deserialize)]
94 pub struct DeleteCommunity {
100 #[derive(Deserialize)]
101 pub struct RemoveCommunity {
104 pub reason: Option<String>,
105 pub expires: Option<i64>,
109 #[derive(Deserialize)]
110 pub struct FollowCommunity {
111 pub community_id: i32,
116 #[derive(Deserialize)]
117 pub struct GetFollowedCommunities {
122 pub struct GetFollowedCommunitiesResponse {
123 pub communities: Vec<CommunityFollowerView>,
126 #[derive(Deserialize)]
127 pub struct TransferCommunity {
128 pub community_id: i32,