2 source::{category::*, user::*},
4 comment_view::CommentView,
5 community::community_view::CommunityView,
7 mod_add_community_view::ModAddCommunityView,
8 mod_add_view::ModAddView,
9 mod_ban_from_community_view::ModBanFromCommunityView,
10 mod_ban_view::ModBanView,
11 mod_lock_post_view::ModLockPostView,
12 mod_remove_comment_view::ModRemoveCommentView,
13 mod_remove_community_view::ModRemoveCommunityView,
14 mod_remove_post_view::ModRemovePostView,
15 mod_sticky_post_view::ModStickyPostView,
19 user_view::UserViewSafe,
22 use serde::{Deserialize, Serialize};
24 #[derive(Deserialize)]
25 pub struct ListCategories {}
28 pub struct ListCategoriesResponse {
29 pub categories: Vec<Category>,
32 #[derive(Deserialize, Debug)]
36 pub community_id: Option<i32>,
37 pub community_name: Option<String>,
39 pub page: Option<i64>,
40 pub limit: Option<i64>,
41 pub auth: Option<String>,
44 #[derive(Serialize, Debug)]
45 pub struct SearchResponse {
47 pub comments: Vec<CommentView>,
48 pub posts: Vec<PostView>,
49 pub communities: Vec<CommunityView>,
50 pub users: Vec<UserViewSafe>,
53 #[derive(Deserialize)]
54 pub struct GetModlog {
55 pub mod_user_id: Option<i32>,
56 pub community_id: Option<i32>,
57 pub page: Option<i64>,
58 pub limit: Option<i64>,
62 pub struct GetModlogResponse {
63 pub removed_posts: Vec<ModRemovePostView>,
64 pub locked_posts: Vec<ModLockPostView>,
65 pub stickied_posts: Vec<ModStickyPostView>,
66 pub removed_comments: Vec<ModRemoveCommentView>,
67 pub removed_communities: Vec<ModRemoveCommunityView>,
68 pub banned_from_community: Vec<ModBanFromCommunityView>,
69 pub banned: Vec<ModBanView>,
70 pub added_to_community: Vec<ModAddCommunityView>,
71 pub added: Vec<ModAddView>,
74 #[derive(Deserialize)]
75 pub struct CreateSite {
77 pub description: Option<String>,
78 pub icon: Option<String>,
79 pub banner: Option<String>,
80 pub enable_downvotes: bool,
81 pub open_registration: bool,
82 pub enable_nsfw: bool,
86 #[derive(Deserialize)]
89 pub description: Option<String>,
90 pub icon: Option<String>,
91 pub banner: Option<String>,
92 pub enable_downvotes: bool,
93 pub open_registration: bool,
94 pub enable_nsfw: bool,
98 #[derive(Deserialize)]
100 pub auth: Option<String>,
103 #[derive(Serialize, Clone)]
104 pub struct SiteResponse {
105 pub site_view: SiteView,
109 pub struct GetSiteResponse {
110 pub site_view: Option<SiteView>, // Because the site might not be set up yet
111 pub admins: Vec<UserViewSafe>,
112 pub banned: Vec<UserViewSafe>,
115 pub my_user: Option<User_>,
116 pub federated_instances: Vec<String>,
119 #[derive(Deserialize)]
120 pub struct TransferSite {
125 #[derive(Deserialize)]
126 pub struct GetSiteConfig {
131 pub struct GetSiteConfigResponse {
132 pub config_hjson: String,
135 #[derive(Deserialize)]
136 pub struct SaveSiteConfig {
137 pub config_hjson: String,