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>,
34 #[derive(Serialize, Clone)]
35 pub struct CommunityResponse {
36 pub community_view: CommunityView,
39 #[derive(Deserialize, Debug)]
40 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>,
94 #[derive(Deserialize)]
95 pub struct DeleteCommunity {
96 pub community_id: i32,
101 #[derive(Deserialize)]
102 pub struct RemoveCommunity {
103 pub community_id: i32,
105 pub reason: Option<String>,
106 pub expires: Option<i64>,
110 #[derive(Deserialize)]
111 pub struct FollowCommunity {
112 pub community_id: i32,
117 #[derive(Deserialize)]
118 pub struct GetFollowedCommunities {
123 pub struct GetFollowedCommunitiesResponse {
124 pub communities: Vec<CommunityFollowerView>,
127 #[derive(Deserialize)]
128 pub struct TransferCommunity {
129 pub community_id: i32,