1 use lemmy_db_views_actor::{
2 community_follower_view::CommunityFollowerView,
3 community_moderator_view::CommunityModeratorView,
4 community_view::CommunityView,
5 user_view::UserViewSafe,
7 use serde::{Deserialize, Serialize};
10 pub struct GetCommunity {
12 pub name: Option<String>,
13 pub auth: Option<String>,
17 pub struct GetCommunityResponse {
18 pub community_view: CommunityView,
19 pub moderators: Vec<CommunityModeratorView>,
23 #[derive(Deserialize)]
24 pub struct CreateCommunity {
27 pub description: Option<String>,
28 pub icon: Option<String>,
29 pub banner: Option<String>,
35 #[derive(Serialize, Clone)]
36 pub struct CommunityResponse {
37 pub community_view: CommunityView,
40 #[derive(Deserialize, Debug)]
41 pub struct ListCommunities {
44 pub page: Option<i64>,
45 pub limit: Option<i64>,
46 pub auth: Option<String>,
49 #[derive(Serialize, Debug)]
50 pub struct ListCommunitiesResponse {
51 pub communities: Vec<CommunityView>,
54 #[derive(Deserialize, Clone)]
55 pub struct BanFromCommunity {
56 pub community_id: i32,
59 pub remove_data: bool,
60 pub reason: Option<String>,
61 pub expires: Option<i64>,
65 #[derive(Serialize, Clone)]
66 pub struct BanFromCommunityResponse {
67 pub user_view: UserViewSafe,
71 #[derive(Deserialize)]
72 pub struct AddModToCommunity {
73 pub community_id: i32,
79 #[derive(Serialize, Clone)]
80 pub struct AddModToCommunityResponse {
81 pub moderators: Vec<CommunityModeratorView>,
84 #[derive(Deserialize)]
85 pub struct EditCommunity {
86 pub community_id: i32,
88 pub description: Option<String>,
89 pub icon: Option<String>,
90 pub banner: Option<String>,
96 #[derive(Deserialize)]
97 pub struct DeleteCommunity {
98 pub community_id: i32,
103 #[derive(Deserialize)]
104 pub struct RemoveCommunity {
105 pub community_id: i32,
107 pub reason: Option<String>,
108 pub expires: Option<i64>,
112 #[derive(Deserialize)]
113 pub struct FollowCommunity {
114 pub community_id: i32,
119 #[derive(Deserialize)]
120 pub struct GetFollowedCommunities {
125 pub struct GetFollowedCommunitiesResponse {
126 pub communities: Vec<CommunityFollowerView>,
129 #[derive(Deserialize)]
130 pub struct TransferCommunity {
131 pub community_id: i32,