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 {
43 pub page: Option<i64>,
44 pub limit: Option<i64>,
45 pub auth: Option<String>,
48 #[derive(Serialize, Debug)]
49 pub struct ListCommunitiesResponse {
50 pub communities: Vec<CommunityView>,
53 #[derive(Deserialize, Clone)]
54 pub struct BanFromCommunity {
55 pub community_id: i32,
58 pub remove_data: bool,
59 pub reason: Option<String>,
60 pub expires: Option<i64>,
64 #[derive(Serialize, Clone)]
65 pub struct BanFromCommunityResponse {
66 pub user_view: UserViewSafe,
70 #[derive(Deserialize)]
71 pub struct AddModToCommunity {
72 pub community_id: i32,
78 #[derive(Serialize, Clone)]
79 pub struct AddModToCommunityResponse {
80 pub moderators: Vec<CommunityModeratorView>,
83 #[derive(Deserialize)]
84 pub struct EditCommunity {
85 pub community_id: i32,
87 pub description: Option<String>,
88 pub icon: Option<String>,
89 pub banner: Option<String>,
95 #[derive(Deserialize)]
96 pub struct DeleteCommunity {
97 pub community_id: i32,
102 #[derive(Deserialize)]
103 pub struct RemoveCommunity {
104 pub community_id: i32,
106 pub reason: Option<String>,
107 pub expires: Option<i64>,
111 #[derive(Deserialize)]
112 pub struct FollowCommunity {
113 pub community_id: i32,
118 #[derive(Deserialize)]
119 pub struct GetFollowedCommunities {
124 pub struct GetFollowedCommunitiesResponse {
125 pub communities: Vec<CommunityFollowerView>,
128 #[derive(Deserialize)]
129 pub struct TransferCommunity {
130 pub community_id: i32,