2 comment_view::CommentView,
4 community_follower_view::CommunityFollowerView,
5 community_moderator_view::CommunityModeratorView,
8 private_message_view::PrivateMessageView,
9 user_mention_view::UserMentionView,
10 user_view::{UserViewDangerous, UserViewSafe},
12 use serde::{Deserialize, Serialize};
14 #[derive(Deserialize, Debug)]
16 pub username_or_email: String,
20 #[derive(Deserialize)]
23 pub email: Option<String>,
25 pub password_verify: String,
28 pub captcha_uuid: Option<String>,
29 pub captcha_answer: Option<String>,
32 #[derive(Deserialize)]
33 pub struct GetCaptcha {}
36 pub struct GetCaptchaResponse {
37 pub ok: Option<CaptchaResponse>,
41 pub struct CaptchaResponse {
42 pub png: String, // A Base64 encoded png
43 pub wav: Option<String>, // A Base64 encoded wav audio
47 #[derive(Deserialize)]
48 pub struct SaveUserSettings {
51 pub default_sort_type: String,
52 pub default_listing_type: String,
54 pub avatar: Option<String>,
55 pub banner: Option<String>,
56 pub preferred_username: Option<String>,
57 pub email: Option<String>,
58 pub bio: Option<String>,
59 pub matrix_user_id: Option<String>,
60 pub new_password: Option<String>,
61 pub new_password_verify: Option<String>,
62 pub old_password: Option<String>,
63 pub show_avatars: bool,
64 pub send_notifications_to_email: bool,
69 pub struct LoginResponse {
73 #[derive(Deserialize)]
74 pub struct GetUserDetails {
75 pub user_id: Option<i32>,
76 pub username: Option<String>,
78 pub page: Option<i64>,
79 pub limit: Option<i64>,
80 pub community_id: Option<i32>,
82 pub auth: Option<String>,
86 pub struct GetUserDetailsResponse {
87 pub user_view: Option<UserViewSafe>,
88 pub user_view_dangerous: Option<UserViewDangerous>,
89 pub follows: Vec<CommunityFollowerView>,
90 pub moderates: Vec<CommunityModeratorView>,
91 pub comments: Vec<CommentView>,
92 pub posts: Vec<PostView>,
96 pub struct GetRepliesResponse {
97 pub replies: Vec<CommentView>,
101 pub struct GetUserMentionsResponse {
102 pub mentions: Vec<UserMentionView>,
105 #[derive(Deserialize)]
106 pub struct MarkAllAsRead {
110 #[derive(Deserialize)]
111 pub struct AddAdmin {
117 #[derive(Serialize, Clone)]
118 pub struct AddAdminResponse {
119 pub admins: Vec<UserViewSafe>,
122 #[derive(Deserialize)]
126 pub remove_data: bool,
127 pub reason: Option<String>,
128 pub expires: Option<i64>,
132 #[derive(Serialize, Clone)]
133 pub struct BanUserResponse {
134 pub user_view: UserViewSafe,
138 #[derive(Deserialize)]
139 pub struct GetReplies {
141 pub page: Option<i64>,
142 pub limit: Option<i64>,
143 pub unread_only: bool,
147 #[derive(Deserialize)]
148 pub struct GetUserMentions {
150 pub page: Option<i64>,
151 pub limit: Option<i64>,
152 pub unread_only: bool,
156 #[derive(Deserialize)]
157 pub struct MarkUserMentionAsRead {
158 pub user_mention_id: i32,
163 #[derive(Serialize, Clone)]
164 pub struct UserMentionResponse {
165 pub user_mention_view: UserMentionView,
168 #[derive(Deserialize)]
169 pub struct DeleteAccount {
170 pub password: String,
174 #[derive(Deserialize)]
175 pub struct PasswordReset {
179 #[derive(Serialize, Clone)]
180 pub struct PasswordResetResponse {}
182 #[derive(Deserialize)]
183 pub struct PasswordChange {
185 pub password: String,
186 pub password_verify: String,
189 #[derive(Deserialize)]
190 pub struct CreatePrivateMessage {
192 pub recipient_id: i32,
196 #[derive(Deserialize)]
197 pub struct EditPrivateMessage {
203 #[derive(Deserialize)]
204 pub struct DeletePrivateMessage {
210 #[derive(Deserialize)]
211 pub struct MarkPrivateMessageAsRead {
217 #[derive(Deserialize)]
218 pub struct GetPrivateMessages {
219 pub unread_only: bool,
220 pub page: Option<i64>,
221 pub limit: Option<i64>,
225 #[derive(Serialize, Clone)]
226 pub struct PrivateMessagesResponse {
227 pub private_messages: Vec<PrivateMessageView>,
230 #[derive(Serialize, Clone)]
231 pub struct PrivateMessageResponse {
232 pub private_message_view: PrivateMessageView,
235 #[derive(Deserialize, Debug)]
236 pub struct UserJoin {
240 #[derive(Serialize, Clone)]
241 pub struct UserJoinResponse {
245 #[derive(Serialize, Deserialize, Debug)]
246 pub struct GetReportCount {
247 pub community: Option<i32>,
251 #[derive(Serialize, Deserialize, Clone, Debug)]
252 pub struct GetReportCountResponse {
253 pub community: Option<i32>,
254 pub comment_reports: i64,
255 pub post_reports: i64,