2023-01-05 20:51:45 +00:00
|
|
|
package types
|
|
|
|
|
|
|
|
type Login struct {
|
2023-01-05 21:42:24 +00:00
|
|
|
UsernameOrEmail string `json:"username_or_email" url:"username_or_email,omitempty"`
|
|
|
|
Password string `json:"password" url:"password,omitempty"`
|
2023-01-05 20:51:45 +00:00
|
|
|
}
|
|
|
|
type Register struct {
|
2023-01-05 21:42:24 +00:00
|
|
|
Username string `json:"username" url:"username,omitempty"`
|
|
|
|
Password string `json:"password" url:"password,omitempty"`
|
|
|
|
PasswordVerify string `json:"password_verify" url:"password_verify,omitempty"`
|
|
|
|
ShowNSFW bool `json:"show_nsfw" url:"show_nsfw,omitempty"`
|
|
|
|
Email Optional[string] `json:"email" url:"email,omitempty"`
|
|
|
|
CaptchaUuid Optional[string] `json:"captcha_uuid" url:"captcha_uuid,omitempty"`
|
|
|
|
CaptchaAnswer Optional[string] `json:"captcha_answer" url:"captcha_answer,omitempty"`
|
|
|
|
Honeypot Optional[string] `json:"honeypot" url:"honeypot,omitempty"`
|
|
|
|
Answer Optional[string] `json:"answer" url:"answer,omitempty"`
|
2023-01-05 20:51:45 +00:00
|
|
|
}
|
|
|
|
type GetCaptcha struct{}
|
|
|
|
type GetCaptchaResponse struct {
|
2023-01-05 21:42:24 +00:00
|
|
|
Ok Optional[CaptchaResponse] `json:"ok" url:"ok,omitempty"`
|
2023-01-05 20:51:45 +00:00
|
|
|
LemmyResponse
|
|
|
|
}
|
|
|
|
type CaptchaResponse struct {
|
2023-01-05 21:42:24 +00:00
|
|
|
Png string `json:"png" url:"png,omitempty"`
|
|
|
|
Wav string `json:"wav" url:"wav,omitempty"`
|
|
|
|
Uuid string `json:"uuid" url:"uuid,omitempty"`
|
2023-01-05 20:51:45 +00:00
|
|
|
LemmyResponse
|
|
|
|
}
|
|
|
|
type SaveUserSettings struct {
|
2023-01-05 21:42:24 +00:00
|
|
|
ShowNSFW Optional[bool] `json:"show_nsfw" url:"show_nsfw,omitempty"`
|
|
|
|
ShowScores Optional[bool] `json:"show_scores" url:"show_scores,omitempty"`
|
|
|
|
Theme Optional[string] `json:"theme" url:"theme,omitempty"`
|
|
|
|
DefaultSortType Optional[int16] `json:"default_sort_type" url:"default_sort_type,omitempty"`
|
|
|
|
DefaultListingType Optional[int16] `json:"default_listing_type" url:"default_listing_type,omitempty"`
|
|
|
|
Lang Optional[string] `json:"lang" url:"lang,omitempty"`
|
|
|
|
Avatar Optional[string] `json:"avatar" url:"avatar,omitempty"`
|
|
|
|
Banner Optional[string] `json:"banner" url:"banner,omitempty"`
|
|
|
|
DisplayName Optional[string] `json:"display_name" url:"display_name,omitempty"`
|
|
|
|
Email Optional[string] `json:"email" url:"email,omitempty"`
|
|
|
|
Bio Optional[string] `json:"bio" url:"bio,omitempty"`
|
|
|
|
MatrixUserID Optional[string] `json:"matrix_user_id" url:"matrix_user_id,omitempty"`
|
|
|
|
ShowAvatars Optional[bool] `json:"show_avatars" url:"show_avatars,omitempty"`
|
|
|
|
SendNotificationsToEmail Optional[bool] `json:"send_notifications_to_email" url:"send_notifications_to_email,omitempty"`
|
|
|
|
BotAccount Optional[bool] `json:"bot_account" url:"bot_account,omitempty"`
|
|
|
|
ShowBotAccounts Optional[bool] `json:"show_bot_accounts" url:"show_bot_accounts,omitempty"`
|
|
|
|
ShowReadPosts Optional[bool] `json:"show_read_posts" url:"show_read_posts,omitempty"`
|
|
|
|
ShowNewPostNotifs Optional[bool] `json:"show_new_post_notifs" url:"show_new_post_notifs,omitempty"`
|
|
|
|
Auth string `json:"auth" url:"auth,omitempty"`
|
2023-01-05 20:51:45 +00:00
|
|
|
}
|
|
|
|
type ChangePassword struct {
|
2023-01-05 21:42:24 +00:00
|
|
|
NewPassword string `json:"new_password" url:"new_password,omitempty"`
|
|
|
|
NewPasswordVerify string `json:"new_password_verify" url:"new_password_verify,omitempty"`
|
|
|
|
OldPassword string `json:"old_password" url:"old_password,omitempty"`
|
|
|
|
Auth string `json:"auth" url:"auth,omitempty"`
|
2023-01-05 20:51:45 +00:00
|
|
|
}
|
|
|
|
type LoginResponse struct {
|
2023-01-05 21:42:24 +00:00
|
|
|
Jwt Optional[string] `json:"jwt" url:"jwt,omitempty"`
|
|
|
|
RegistrationCreated bool `json:"registration_created" url:"registration_created,omitempty"`
|
|
|
|
VerifyEmailSent bool `json:"verify_email_sent" url:"verify_email_sent,omitempty"`
|
2023-01-05 20:51:45 +00:00
|
|
|
LemmyResponse
|
|
|
|
}
|
|
|
|
type GetPersonDetails struct {
|
2023-01-05 21:42:24 +00:00
|
|
|
PersonID Optional[int] `json:"person_id" url:"person_id,omitempty"`
|
|
|
|
Username Optional[string] `json:"username" url:"username,omitempty"`
|
|
|
|
Sort Optional[SortType] `json:"sort" url:"sort,omitempty"`
|
|
|
|
Page Optional[int64] `json:"page" url:"page,omitempty"`
|
|
|
|
Limit Optional[int64] `json:"limit" url:"limit,omitempty"`
|
|
|
|
CommunityID Optional[int] `json:"community_id" url:"community_id,omitempty"`
|
|
|
|
SavedOnly Optional[bool] `json:"saved_only" url:"saved_only,omitempty"`
|
|
|
|
Auth Optional[string] `json:"auth" url:"auth,omitempty"`
|
2023-01-05 20:51:45 +00:00
|
|
|
}
|
|
|
|
type GetPersonDetailsResponse struct {
|
2023-01-05 21:42:24 +00:00
|
|
|
PersonView PersonViewSafe `json:"person_view" url:"person_view,omitempty"`
|
|
|
|
Comments []CommentView `json:"comments" url:"comments,omitempty"`
|
|
|
|
Posts []PostView `json:"posts" url:"posts,omitempty"`
|
|
|
|
Moderates []CommunityModeratorView `json:"moderates" url:"moderates,omitempty"`
|
2023-01-05 20:51:45 +00:00
|
|
|
LemmyResponse
|
|
|
|
}
|
|
|
|
type GetRepliesResponse struct {
|
2023-01-05 21:42:24 +00:00
|
|
|
Replies []CommentView `json:"replies" url:"replies,omitempty"`
|
2023-01-05 20:51:45 +00:00
|
|
|
LemmyResponse
|
|
|
|
}
|
|
|
|
type GetPersonMentionsResponse struct {
|
2023-01-05 21:42:24 +00:00
|
|
|
Mentions []PersonMentionView `json:"mentions" url:"mentions,omitempty"`
|
2023-01-05 20:51:45 +00:00
|
|
|
LemmyResponse
|
|
|
|
}
|
|
|
|
type MarkAllAsRead struct {
|
2023-01-05 21:42:24 +00:00
|
|
|
Auth string `json:"auth" url:"auth,omitempty"`
|
2023-01-05 20:51:45 +00:00
|
|
|
}
|
|
|
|
type AddAdmin struct {
|
2023-01-05 21:42:24 +00:00
|
|
|
PersonID int `json:"person_id" url:"person_id,omitempty"`
|
|
|
|
Added bool `json:"added" url:"added,omitempty"`
|
|
|
|
Auth string `json:"auth" url:"auth,omitempty"`
|
2023-01-05 20:51:45 +00:00
|
|
|
}
|
|
|
|
type AddAdminResponse struct {
|
2023-01-05 21:42:24 +00:00
|
|
|
Admins []PersonViewSafe `json:"admins" url:"admins,omitempty"`
|
2023-01-05 20:51:45 +00:00
|
|
|
LemmyResponse
|
|
|
|
}
|
|
|
|
type BanPerson struct {
|
2023-01-05 21:42:24 +00:00
|
|
|
PersonID int `json:"person_id" url:"person_id,omitempty"`
|
|
|
|
Ban bool `json:"ban" url:"ban,omitempty"`
|
|
|
|
RemoveData Optional[bool] `json:"remove_data" url:"remove_data,omitempty"`
|
|
|
|
Reason Optional[string] `json:"reason" url:"reason,omitempty"`
|
|
|
|
Expires Optional[int64] `json:"expires" url:"expires,omitempty"`
|
|
|
|
Auth string `json:"auth" url:"auth,omitempty"`
|
2023-01-05 20:51:45 +00:00
|
|
|
}
|
|
|
|
type GetBannedPersons struct {
|
2023-01-05 21:42:24 +00:00
|
|
|
Auth string `json:"auth" url:"auth,omitempty"`
|
2023-01-05 20:51:45 +00:00
|
|
|
}
|
|
|
|
type BannedPersonsResponse struct {
|
2023-01-05 21:42:24 +00:00
|
|
|
Banned []PersonViewSafe `json:"banned" url:"banned,omitempty"`
|
2023-01-05 20:51:45 +00:00
|
|
|
LemmyResponse
|
|
|
|
}
|
|
|
|
type BanPersonResponse struct {
|
2023-01-05 21:42:24 +00:00
|
|
|
PersonView PersonViewSafe `json:"person_view" url:"person_view,omitempty"`
|
|
|
|
Banned bool `json:"banned" url:"banned,omitempty"`
|
2023-01-05 20:51:45 +00:00
|
|
|
LemmyResponse
|
|
|
|
}
|
|
|
|
type BlockPerson struct {
|
2023-01-05 21:42:24 +00:00
|
|
|
PersonID int `json:"person_id" url:"person_id,omitempty"`
|
|
|
|
Block bool `json:"block" url:"block,omitempty"`
|
|
|
|
Auth string `json:"auth" url:"auth,omitempty"`
|
2023-01-05 20:51:45 +00:00
|
|
|
}
|
|
|
|
type BlockPersonResponse struct {
|
2023-01-05 21:42:24 +00:00
|
|
|
PersonView PersonViewSafe `json:"person_view" url:"person_view,omitempty"`
|
|
|
|
Blocked bool `json:"blocked" url:"blocked,omitempty"`
|
2023-01-05 20:51:45 +00:00
|
|
|
LemmyResponse
|
|
|
|
}
|
|
|
|
type GetReplies struct {
|
2023-01-05 21:42:24 +00:00
|
|
|
Sort Optional[SortType] `json:"sort" url:"sort,omitempty"`
|
|
|
|
Page Optional[int64] `json:"page" url:"page,omitempty"`
|
|
|
|
Limit Optional[int64] `json:"limit" url:"limit,omitempty"`
|
|
|
|
UnreadOnly Optional[bool] `json:"unread_only" url:"unread_only,omitempty"`
|
|
|
|
Auth string `json:"auth" url:"auth,omitempty"`
|
2023-01-05 20:51:45 +00:00
|
|
|
}
|
|
|
|
type GetPersonMentions struct {
|
2023-01-05 21:42:24 +00:00
|
|
|
Sort Optional[SortType] `json:"sort" url:"sort,omitempty"`
|
|
|
|
Page Optional[int64] `json:"page" url:"page,omitempty"`
|
|
|
|
Limit Optional[int64] `json:"limit" url:"limit,omitempty"`
|
|
|
|
UnreadOnly Optional[bool] `json:"unread_only" url:"unread_only,omitempty"`
|
|
|
|
Auth string `json:"auth" url:"auth,omitempty"`
|
2023-01-05 20:51:45 +00:00
|
|
|
}
|
|
|
|
type MarkPersonMentionAsRead struct {
|
2023-01-05 21:42:24 +00:00
|
|
|
PersonMentionID int `json:"person_mention_id" url:"person_mention_id,omitempty"`
|
|
|
|
Read bool `json:"read" url:"read,omitempty"`
|
|
|
|
Auth string `json:"auth" url:"auth,omitempty"`
|
2023-01-05 20:51:45 +00:00
|
|
|
}
|
|
|
|
type PersonMentionResponse struct {
|
2023-01-05 21:42:24 +00:00
|
|
|
PersonMentionView PersonMentionView `json:"person_mention_view" url:"person_mention_view,omitempty"`
|
2023-01-05 20:51:45 +00:00
|
|
|
LemmyResponse
|
|
|
|
}
|
|
|
|
type DeleteAccount struct {
|
2023-01-05 21:42:24 +00:00
|
|
|
Password string `json:"password" url:"password,omitempty"`
|
|
|
|
Auth string `json:"auth" url:"auth,omitempty"`
|
2023-01-05 20:51:45 +00:00
|
|
|
}
|
|
|
|
type DeleteAccountResponse struct {
|
|
|
|
LemmyResponse
|
|
|
|
}
|
|
|
|
type PasswordReset struct {
|
2023-01-05 21:42:24 +00:00
|
|
|
Email string `json:"email" url:"email,omitempty"`
|
2023-01-05 20:51:45 +00:00
|
|
|
}
|
|
|
|
type PasswordResetResponse struct {
|
|
|
|
LemmyResponse
|
|
|
|
}
|
|
|
|
type PasswordChangeAfterReset struct {
|
2023-01-05 21:42:24 +00:00
|
|
|
Token string `json:"token" url:"token,omitempty"`
|
|
|
|
Password string `json:"password" url:"password,omitempty"`
|
|
|
|
PasswordVerify string `json:"password_verify" url:"password_verify,omitempty"`
|
2023-01-05 20:51:45 +00:00
|
|
|
}
|
|
|
|
type CreatePrivateMessage struct {
|
2023-01-05 21:42:24 +00:00
|
|
|
Content string `json:"content" url:"content,omitempty"`
|
|
|
|
RecipientID int `json:"recipient_id" url:"recipient_id,omitempty"`
|
|
|
|
Auth string `json:"auth" url:"auth,omitempty"`
|
2023-01-05 20:51:45 +00:00
|
|
|
}
|
|
|
|
type EditPrivateMessage struct {
|
2023-01-05 21:42:24 +00:00
|
|
|
PrivateMessageID int `json:"private_message_id" url:"private_message_id,omitempty"`
|
|
|
|
Content string `json:"content" url:"content,omitempty"`
|
|
|
|
Auth string `json:"auth" url:"auth,omitempty"`
|
2023-01-05 20:51:45 +00:00
|
|
|
}
|
|
|
|
type DeletePrivateMessage struct {
|
2023-01-05 21:42:24 +00:00
|
|
|
PrivateMessageID int `json:"private_message_id" url:"private_message_id,omitempty"`
|
|
|
|
Deleted bool `json:"deleted" url:"deleted,omitempty"`
|
|
|
|
Auth string `json:"auth" url:"auth,omitempty"`
|
2023-01-05 20:51:45 +00:00
|
|
|
}
|
|
|
|
type MarkPrivateMessageAsRead struct {
|
2023-01-05 21:42:24 +00:00
|
|
|
PrivateMessageID int `json:"private_message_id" url:"private_message_id,omitempty"`
|
|
|
|
Read bool `json:"read" url:"read,omitempty"`
|
|
|
|
Auth string `json:"auth" url:"auth,omitempty"`
|
2023-01-05 20:51:45 +00:00
|
|
|
}
|
|
|
|
type GetPrivateMessages struct {
|
2023-01-05 21:42:24 +00:00
|
|
|
UnreadOnly Optional[bool] `json:"unread_only" url:"unread_only,omitempty"`
|
|
|
|
Page Optional[int64] `json:"page" url:"page,omitempty"`
|
|
|
|
Limit Optional[int64] `json:"limit" url:"limit,omitempty"`
|
|
|
|
Auth string `json:"auth" url:"auth,omitempty"`
|
2023-01-05 20:51:45 +00:00
|
|
|
}
|
|
|
|
type PrivateMessagesResponse struct {
|
2023-01-05 21:42:24 +00:00
|
|
|
PrivateMessages []PrivateMessageView `json:"private_messages" url:"private_messages,omitempty"`
|
2023-01-05 20:51:45 +00:00
|
|
|
LemmyResponse
|
|
|
|
}
|
|
|
|
type PrivateMessageResponse struct {
|
2023-01-05 21:42:24 +00:00
|
|
|
PrivateMessageView PrivateMessageView `json:"private_message_view" url:"private_message_view,omitempty"`
|
2023-01-05 20:51:45 +00:00
|
|
|
LemmyResponse
|
|
|
|
}
|
|
|
|
type GetReportCount struct {
|
2023-01-05 21:42:24 +00:00
|
|
|
CommunityID Optional[int] `json:"community_id" url:"community_id,omitempty"`
|
|
|
|
Auth string `json:"auth" url:"auth,omitempty"`
|
2023-01-05 20:51:45 +00:00
|
|
|
}
|
|
|
|
type GetReportCountResponse struct {
|
2023-01-05 21:42:24 +00:00
|
|
|
CommunityID Optional[int] `json:"community_id" url:"community_id,omitempty"`
|
|
|
|
CommentReports int64 `json:"comment_reports" url:"comment_reports,omitempty"`
|
|
|
|
PostReports int64 `json:"post_reports" url:"post_reports,omitempty"`
|
2023-01-05 20:51:45 +00:00
|
|
|
LemmyResponse
|
|
|
|
}
|
|
|
|
type GetUnreadCount struct {
|
2023-01-05 21:42:24 +00:00
|
|
|
Auth string `json:"auth" url:"auth,omitempty"`
|
2023-01-05 20:51:45 +00:00
|
|
|
}
|
|
|
|
type GetUnreadCountResponse struct {
|
2023-01-05 21:42:24 +00:00
|
|
|
Replies int64 `json:"replies" url:"replies,omitempty"`
|
|
|
|
Mentions int64 `json:"mentions" url:"mentions,omitempty"`
|
|
|
|
PrivateMessages int64 `json:"private_messages" url:"private_messages,omitempty"`
|
2023-01-05 20:51:45 +00:00
|
|
|
LemmyResponse
|
|
|
|
}
|
|
|
|
type VerifyEmail struct {
|
2023-01-05 21:42:24 +00:00
|
|
|
Token string `json:"token" url:"token,omitempty"`
|
2023-01-05 20:51:45 +00:00
|
|
|
}
|
|
|
|
type VerifyEmailResponse struct {
|
|
|
|
LemmyResponse
|
|
|
|
}
|