2 comment_view::{CommentView, ReplyView},
3 community_view::{CommunityFollowerView, CommunityModeratorView},
5 private_message_view::PrivateMessageView,
6 user_mention_view::UserMentionView,
9 use serde::{Deserialize, Serialize};
11 #[derive(Deserialize, Debug)]
13 pub username_or_email: String,
17 #[derive(Deserialize)]
20 pub email: Option<String>,
22 pub password_verify: String,
25 pub captcha_uuid: Option<String>,
26 pub captcha_answer: Option<String>,
29 #[derive(Deserialize)]
30 pub struct GetCaptcha {}
33 pub struct GetCaptchaResponse {
34 pub ok: Option<CaptchaResponse>,
38 pub struct CaptchaResponse {
39 pub png: String, // A Base64 encoded png
40 pub wav: Option<String>, // A Base64 encoded wav audio
44 #[derive(Deserialize)]
45 pub struct SaveUserSettings {
48 pub default_sort_type: i16,
49 pub default_listing_type: i16,
51 pub avatar: Option<String>,
52 pub banner: Option<String>,
53 pub preferred_username: Option<String>,
54 pub email: Option<String>,
55 pub bio: Option<String>,
56 pub matrix_user_id: Option<String>,
57 pub new_password: Option<String>,
58 pub new_password_verify: Option<String>,
59 pub old_password: Option<String>,
60 pub show_avatars: bool,
61 pub send_notifications_to_email: bool,
66 pub struct LoginResponse {
70 #[derive(Deserialize)]
71 pub struct GetUserDetails {
72 pub user_id: Option<i32>,
73 pub username: Option<String>,
75 pub page: Option<i64>,
76 pub limit: Option<i64>,
77 pub community_id: Option<i32>,
79 pub auth: Option<String>,
83 pub struct GetUserDetailsResponse {
85 pub follows: Vec<CommunityFollowerView>,
86 pub moderates: Vec<CommunityModeratorView>,
87 pub comments: Vec<CommentView>,
88 pub posts: Vec<PostView>,
92 pub struct GetRepliesResponse {
93 pub replies: Vec<ReplyView>,
97 pub struct GetUserMentionsResponse {
98 pub mentions: Vec<UserMentionView>,
101 #[derive(Deserialize)]
102 pub struct MarkAllAsRead {
106 #[derive(Deserialize)]
107 pub struct AddAdmin {
113 #[derive(Serialize, Clone)]
114 pub struct AddAdminResponse {
115 pub admins: Vec<UserView>,
118 #[derive(Deserialize)]
122 pub remove_data: Option<bool>,
123 pub reason: Option<String>,
124 pub expires: Option<i64>,
128 #[derive(Serialize, Clone)]
129 pub struct BanUserResponse {
134 #[derive(Deserialize)]
135 pub struct GetReplies {
137 pub page: Option<i64>,
138 pub limit: Option<i64>,
139 pub unread_only: bool,
143 #[derive(Deserialize)]
144 pub struct GetUserMentions {
146 pub page: Option<i64>,
147 pub limit: Option<i64>,
148 pub unread_only: bool,
152 #[derive(Deserialize)]
153 pub struct MarkUserMentionAsRead {
154 pub user_mention_id: i32,
159 #[derive(Serialize, Clone)]
160 pub struct UserMentionResponse {
161 pub mention: UserMentionView,
164 #[derive(Deserialize)]
165 pub struct DeleteAccount {
166 pub password: String,
170 #[derive(Deserialize)]
171 pub struct PasswordReset {
175 #[derive(Serialize, Clone)]
176 pub struct PasswordResetResponse {}
178 #[derive(Deserialize)]
179 pub struct PasswordChange {
181 pub password: String,
182 pub password_verify: String,
185 #[derive(Deserialize)]
186 pub struct CreatePrivateMessage {
188 pub recipient_id: i32,
192 #[derive(Deserialize)]
193 pub struct EditPrivateMessage {
199 #[derive(Deserialize)]
200 pub struct DeletePrivateMessage {
206 #[derive(Deserialize)]
207 pub struct MarkPrivateMessageAsRead {
213 #[derive(Deserialize)]
214 pub struct GetPrivateMessages {
215 pub unread_only: bool,
216 pub page: Option<i64>,
217 pub limit: Option<i64>,
221 #[derive(Serialize, Clone)]
222 pub struct PrivateMessagesResponse {
223 pub messages: Vec<PrivateMessageView>,
226 #[derive(Serialize, Clone)]
227 pub struct PrivateMessageResponse {
228 pub message: PrivateMessageView,
231 #[derive(Deserialize, Debug)]
232 pub struct UserJoin {
236 #[derive(Serialize, Clone)]
237 pub struct UserJoinResponse {