pub struct LemmyClient { /* private fields */ }
Expand description
API wrapper for lemmy
Implementations§
Source§impl LemmyClient
impl LemmyClient
Sourcepub fn options(&self) -> &ClientOptions
pub fn options(&self) -> &ClientOptions
Get the options the client is using.
Source§impl LemmyClient
impl LemmyClient
Sourcepub fn new(options: ClientOptions) -> Self
pub fn new(options: ClientOptions) -> Self
Creates a new LemmyClient
.
§Examples
use lemmy_client::{LemmyClient, ClientOptions};
let client = LemmyClient::new(ClientOptions {
domain: String::from("lemmy.ml"),
secure: true
});
Sourcepub fn headers(&self) -> &HashMap<String, String>
pub fn headers(&self) -> &HashMap<String, String>
Map of headers that will be included with each request.
Sourcepub fn headers_mut(&mut self) -> &mut HashMap<String, String>
pub fn headers_mut(&mut self) -> &mut HashMap<String, String>
Mutable map of headers that will be included with each request. Use this method if you want to add headers other than the JWT.
Sourcepub async fn get_site<Request>(
&self,
request: Request,
) -> Result<GetSiteResponse, LemmyErrorType>
pub async fn get_site<Request>( &self, request: Request, ) -> Result<GetSiteResponse, LemmyErrorType>
Gets the site and, if you pass an authorized JWT, information about the logged in user.
HTTP GET /site
Sourcepub async fn create_site<Request>(
&self,
request: Request,
) -> Result<SiteResponse, LemmyErrorType>
pub async fn create_site<Request>( &self, request: Request, ) -> Result<SiteResponse, LemmyErrorType>
Creates site during initial setup.
HTTP POST /site
Sourcepub async fn edit_site<Request>(
&self,
request: Request,
) -> Result<SiteResponse, LemmyErrorType>
pub async fn edit_site<Request>( &self, request: Request, ) -> Result<SiteResponse, LemmyErrorType>
Edits your site.
HTTP PUT /site
Sourcepub async fn block_instance<Request>(
&self,
request: Request,
) -> Result<BlockInstanceResponse, LemmyErrorType>
pub async fn block_instance<Request>( &self, request: Request, ) -> Result<BlockInstanceResponse, LemmyErrorType>
Blocks an instance.
HTTP POST /site/block
Sourcepub async fn get_modlog<Request>(
&self,
request: Request,
) -> Result<GetModlogResponse, LemmyErrorType>
pub async fn get_modlog<Request>( &self, request: Request, ) -> Result<GetModlogResponse, LemmyErrorType>
Gets the modlog.
HTTP GET /modlog
Sourcepub async fn search<Request>(
&self,
request: Request,
) -> Result<SearchResponse, LemmyErrorType>
pub async fn search<Request>( &self, request: Request, ) -> Result<SearchResponse, LemmyErrorType>
Searches for content.
HTTP GET /search
Sourcepub async fn resolve_object<Request>(
&self,
request: Request,
) -> Result<ResolveObjectResponse, LemmyErrorType>
pub async fn resolve_object<Request>( &self, request: Request, ) -> Result<ResolveObjectResponse, LemmyErrorType>
Fetches an object from a non-local instance.
HTTP GET /resolve_object
Sourcepub async fn get_community<Request>(
&self,
request: Request,
) -> Result<GetCommunityResponse, LemmyErrorType>
pub async fn get_community<Request>( &self, request: Request, ) -> Result<GetCommunityResponse, LemmyErrorType>
Gets a community.
HTTP GET /community
Sourcepub async fn create_community<Request>(
&self,
request: Request,
) -> Result<CommunityResponse, LemmyErrorType>
pub async fn create_community<Request>( &self, request: Request, ) -> Result<CommunityResponse, LemmyErrorType>
Creates a new community.
HTTP POST /community
Sourcepub async fn edit_community<Request>(
&self,
request: Request,
) -> Result<CommunityResponse, LemmyErrorType>
pub async fn edit_community<Request>( &self, request: Request, ) -> Result<CommunityResponse, LemmyErrorType>
Edits a community.
HTTP PUT /community
Sourcepub async fn hide_community<Request>(
&self,
request: Request,
) -> Result<SuccessResponse, LemmyErrorType>
pub async fn hide_community<Request>( &self, request: Request, ) -> Result<SuccessResponse, LemmyErrorType>
Hides a community from public view.
HTTP PUT /community_hide
Sourcepub async fn list_communities<Request>(
&self,
request: Request,
) -> Result<ListCommunitiesResponse, LemmyErrorType>
pub async fn list_communities<Request>( &self, request: Request, ) -> Result<ListCommunitiesResponse, LemmyErrorType>
Lists communities.
HTTP GET /community/list
Sourcepub async fn follow_community<Request>(
&self,
request: Request,
) -> Result<CommunityResponse, LemmyErrorType>
pub async fn follow_community<Request>( &self, request: Request, ) -> Result<CommunityResponse, LemmyErrorType>
Subscribes to a community.
HTTP POST /community/follow
Sourcepub async fn block_community<Request>(
&self,
request: Request,
) -> Result<BlockCommunityResponse, LemmyErrorType>
pub async fn block_community<Request>( &self, request: Request, ) -> Result<BlockCommunityResponse, LemmyErrorType>
Blocks a community.
HTTP POST /community/block
Sourcepub async fn delete_community<Request>(
&self,
request: Request,
) -> Result<CommunityResponse, LemmyErrorType>
pub async fn delete_community<Request>( &self, request: Request, ) -> Result<CommunityResponse, LemmyErrorType>
Deletes a community.
HTTP POST /community/delete
Sourcepub async fn remove_community<Request>(
&self,
request: Request,
) -> Result<CommunityResponse, LemmyErrorType>
pub async fn remove_community<Request>( &self, request: Request, ) -> Result<CommunityResponse, LemmyErrorType>
Removes a community (moderation action).
HTTP POST /community/remove
Sourcepub async fn transfer_community<Request>(
&self,
request: Request,
) -> Result<GetCommunityResponse, LemmyErrorType>
pub async fn transfer_community<Request>( &self, request: Request, ) -> Result<GetCommunityResponse, LemmyErrorType>
Transfers a community you own to another user on that community’s moderation team.
HTTP POST community/transfer
Sourcepub async fn ban_from_community<Request>(
&self,
request: Request,
) -> Result<BanFromCommunityResponse, LemmyErrorType>
pub async fn ban_from_community<Request>( &self, request: Request, ) -> Result<BanFromCommunityResponse, LemmyErrorType>
Bans a user from a community.
HTTP POST /community/ban_user
Sourcepub async fn add_mod_to_community<Request>(
&self,
request: Request,
) -> Result<AddModToCommunityResponse, LemmyErrorType>
pub async fn add_mod_to_community<Request>( &self, request: Request, ) -> Result<AddModToCommunityResponse, LemmyErrorType>
Adds a moderator to your community.
HTTP POST /community/mod
Sourcepub async fn get_federated_instances<Request>(
&self,
request: Request,
) -> Result<GetFederatedInstancesResponse, LemmyErrorType>
pub async fn get_federated_instances<Request>( &self, request: Request, ) -> Result<GetFederatedInstancesResponse, LemmyErrorType>
Gets the instances that are federated with your instance.
HTTP GET /federated_instances
Sourcepub async fn get_post<Request>(
&self,
request: Request,
) -> Result<GetPostResponse, LemmyErrorType>
pub async fn get_post<Request>( &self, request: Request, ) -> Result<GetPostResponse, LemmyErrorType>
Gets post.
HTTP GET /post
Sourcepub async fn create_post<Request>(
&self,
request: Request,
) -> Result<PostResponse, LemmyErrorType>
pub async fn create_post<Request>( &self, request: Request, ) -> Result<PostResponse, LemmyErrorType>
Creates a post.
HTTP POST /post
Sourcepub async fn edit_post<Request>(
&self,
request: Request,
) -> Result<PostResponse, LemmyErrorType>
pub async fn edit_post<Request>( &self, request: Request, ) -> Result<PostResponse, LemmyErrorType>
Edits a post you have already created.
HTTP PUT /post
Sourcepub async fn delete_post<Request>(
&self,
request: Request,
) -> Result<PostResponse, LemmyErrorType>
pub async fn delete_post<Request>( &self, request: Request, ) -> Result<PostResponse, LemmyErrorType>
Deletes a post you have made.
HTTP POST /post/delete
Sourcepub async fn remove_post<Request>(
&self,
request: Request,
) -> Result<PostResponse, LemmyErrorType>
pub async fn remove_post<Request>( &self, request: Request, ) -> Result<PostResponse, LemmyErrorType>
Removes a post (moderator action).
HTTP POST /post/remove
Sourcepub async fn mark_post_as_read<Request>(
&self,
request: Request,
) -> Result<SuccessResponse, LemmyErrorType>
pub async fn mark_post_as_read<Request>( &self, request: Request, ) -> Result<SuccessResponse, LemmyErrorType>
Marks a post as read.
HTTP POST /post/mark_as_read
Sourcepub async fn lock_post<Request>(
&self,
request: Request,
) -> Result<PostResponse, LemmyErrorType>
pub async fn lock_post<Request>( &self, request: Request, ) -> Result<PostResponse, LemmyErrorType>
Prevents users from commenting on the post (moderator action).
HTTP POST /post/lock
Sourcepub async fn feature_post<Request>(
&self,
request: Request,
) -> Result<PostResponse, LemmyErrorType>
pub async fn feature_post<Request>( &self, request: Request, ) -> Result<PostResponse, LemmyErrorType>
Pins a post to the top of the community page (moderator action).
HTTP POST /post/feature
Sourcepub async fn list_posts<Request>(
&self,
request: Request,
) -> Result<GetPostsResponse, LemmyErrorType>
pub async fn list_posts<Request>( &self, request: Request, ) -> Result<GetPostsResponse, LemmyErrorType>
Gets posts with a variety of filters.
HTTP GET /post/list
Sourcepub async fn like_post<Request>(
&self,
request: Request,
) -> Result<PostResponse, LemmyErrorType>
pub async fn like_post<Request>( &self, request: Request, ) -> Result<PostResponse, LemmyErrorType>
Votes on a post.
HTTP POST /post/like
Sourcepub async fn list_post_likes<Request>(
&self,
request: Request,
) -> Result<ListPostLikesResponse, LemmyErrorType>
pub async fn list_post_likes<Request>( &self, request: Request, ) -> Result<ListPostLikesResponse, LemmyErrorType>
Lists the likes for a post.
HTTP GET /post/like/list
Sourcepub async fn save_post<Request>(
&self,
request: Request,
) -> Result<PostResponse, LemmyErrorType>
pub async fn save_post<Request>( &self, request: Request, ) -> Result<PostResponse, LemmyErrorType>
Saves a post to your favorites list.
HTTP PUT /post/save
Sourcepub async fn report_post<Request>(
&self,
request: Request,
) -> Result<PostReportResponse, LemmyErrorType>
pub async fn report_post<Request>( &self, request: Request, ) -> Result<PostReportResponse, LemmyErrorType>
Reports a post to the moderator team of the community the post is in, the admin team of your instance, and the admin team of the poster’s instance.
HTTP POST /post/report
Sourcepub async fn resolve_post_report<Request>(
&self,
request: Request,
) -> Result<PostReportResponse, LemmyErrorType>
pub async fn resolve_post_report<Request>( &self, request: Request, ) -> Result<PostReportResponse, LemmyErrorType>
Resolves a post report (moderator action).
HTTP PUT /post/report/resolve
Sourcepub async fn list_post_reports<Request>(
&self,
request: Request,
) -> Result<ListPostReportsResponse, LemmyErrorType>
pub async fn list_post_reports<Request>( &self, request: Request, ) -> Result<ListPostReportsResponse, LemmyErrorType>
Gets reports of posts that you are able to moderate.
HTTP GET /post/report/list
Sourcepub async fn get_post_url_metadata<Request>(
&self,
request: Request,
) -> Result<GetSiteMetadataResponse, LemmyErrorType>
pub async fn get_post_url_metadata<Request>( &self, request: Request, ) -> Result<GetSiteMetadataResponse, LemmyErrorType>
Gets the metadata of a given site.
HTTP POST /post/site_metadata
Sourcepub async fn hide_post<Request>(
&self,
request: Request,
) -> Result<SuccessResponse, LemmyErrorType>
pub async fn hide_post<Request>( &self, request: Request, ) -> Result<SuccessResponse, LemmyErrorType>
Hide a post from list views.
HTTP POST /post/hide
Sourcepub async fn get_comment<Request>(
&self,
request: Request,
) -> Result<CommentResponse, LemmyErrorType>
pub async fn get_comment<Request>( &self, request: Request, ) -> Result<CommentResponse, LemmyErrorType>
Gets a comment.
HTTP GET /comment
Sourcepub async fn create_comment<Request>(
&self,
request: Request,
) -> Result<CommentResponse, LemmyErrorType>
pub async fn create_comment<Request>( &self, request: Request, ) -> Result<CommentResponse, LemmyErrorType>
Creates a new comment.
HTTP POST /comment
Sourcepub async fn edit_comment<Request>(
&self,
request: Request,
) -> Result<CommentResponse, LemmyErrorType>
pub async fn edit_comment<Request>( &self, request: Request, ) -> Result<CommentResponse, LemmyErrorType>
Edits one of your already-created comments.
HTTP PUT /comment
Sourcepub async fn delete_comment<Request>(
&self,
request: Request,
) -> Result<CommentResponse, LemmyErrorType>
pub async fn delete_comment<Request>( &self, request: Request, ) -> Result<CommentResponse, LemmyErrorType>
Deletes one of your already-existing comments.
HTTP POST /comment/delete
Sourcepub async fn remove_comment<Request>(
&self,
request: Request,
) -> Result<CommentResponse, LemmyErrorType>
pub async fn remove_comment<Request>( &self, request: Request, ) -> Result<CommentResponse, LemmyErrorType>
Removes a post (moderator action).
HTTP POST /comment/remove
Sourcepub async fn mark_reply_as_read<Request>(
&self,
request: Request,
) -> Result<CommentReplyResponse, LemmyErrorType>
pub async fn mark_reply_as_read<Request>( &self, request: Request, ) -> Result<CommentReplyResponse, LemmyErrorType>
Marks a reply to one of your posts or comments as read.
HTTP POST /comment/mark_as_read
Sourcepub async fn distinguish_comment<Request>(
&self,
request: Request,
) -> Result<CommentResponse, LemmyErrorType>
pub async fn distinguish_comment<Request>( &self, request: Request, ) -> Result<CommentResponse, LemmyErrorType>
Pins a comment to the top of a post’s comment section (speak as moderator).
HTTP POST /comment/distinguish
Sourcepub async fn like_comment<Request>(
&self,
request: Request,
) -> Result<CommentResponse, LemmyErrorType>
pub async fn like_comment<Request>( &self, request: Request, ) -> Result<CommentResponse, LemmyErrorType>
Votes on a comment.
HTTP POST /comment/like
Sourcepub async fn list_comment_likes<Request>(
&self,
request: Request,
) -> Result<ListCommentLikesResponse, LemmyErrorType>
pub async fn list_comment_likes<Request>( &self, request: Request, ) -> Result<ListCommentLikesResponse, LemmyErrorType>
Gets the votes for a comment.
HTTP GET /comment/like/list
Sourcepub async fn save_comment<Request>(
&self,
request: Request,
) -> Result<CommentResponse, LemmyErrorType>
pub async fn save_comment<Request>( &self, request: Request, ) -> Result<CommentResponse, LemmyErrorType>
Saves a comment to your favorites list.
HTTP PUT /comment/save
Sourcepub async fn list_comments<Request>(
&self,
request: Request,
) -> Result<GetCommentsResponse, LemmyErrorType>
pub async fn list_comments<Request>( &self, request: Request, ) -> Result<GetCommentsResponse, LemmyErrorType>
Gets comments with various filters.
HTTP GET /comment/list
Sourcepub async fn create_comment_report<Request>(
&self,
request: Request,
) -> Result<CommentResponse, LemmyErrorType>
pub async fn create_comment_report<Request>( &self, request: Request, ) -> Result<CommentResponse, LemmyErrorType>
Reports a comment to the moderator team of the community the comment is in, your instance’s admin team, and the commentor’s instance’s admin team.
HTTP POST /comment/report
Sourcepub async fn resolve_comment_report<Request>(
&self,
request: Request,
) -> Result<CommentReportResponse, LemmyErrorType>
pub async fn resolve_comment_report<Request>( &self, request: Request, ) -> Result<CommentReportResponse, LemmyErrorType>
Resolves a report on a comment made in a community you moderate or instance you administrate.
HTTP PUT /comment/report/resolve
Sourcepub async fn list_comment_reports<Request>(
&self,
request: Request,
) -> Result<ListCommentReportsResponse, LemmyErrorType>
pub async fn list_comment_reports<Request>( &self, request: Request, ) -> Result<ListCommentReportsResponse, LemmyErrorType>
Lists reports for comments in communities you moderate or instances you adminstrate.
HTTP GET /comment/report/list
Sourcepub async fn create_private_message<Request>(
&self,
request: Request,
) -> Result<PrivateMessageResponse, LemmyErrorType>
pub async fn create_private_message<Request>( &self, request: Request, ) -> Result<PrivateMessageResponse, LemmyErrorType>
Creates and send a private message to another user.
HTTP POST /private_message
Sourcepub async fn edit_private_message<Request>(
&self,
request: Request,
) -> Result<PrivateMessageResponse, LemmyErrorType>
pub async fn edit_private_message<Request>( &self, request: Request, ) -> Result<PrivateMessageResponse, LemmyErrorType>
Edits a private message you have already sent.
HTTP PUT /private_message
Sourcepub async fn list_private_messages<Request>(
&self,
request: Request,
) -> Result<PrivateMessagesResponse, LemmyErrorType>
pub async fn list_private_messages<Request>( &self, request: Request, ) -> Result<PrivateMessagesResponse, LemmyErrorType>
Lists private messages that have been sent to you.
HTTP GET /private_message/list
Sourcepub async fn delete_private_message<Request>(
&self,
request: Request,
) -> Result<PrivateMessageResponse, LemmyErrorType>
pub async fn delete_private_message<Request>( &self, request: Request, ) -> Result<PrivateMessageResponse, LemmyErrorType>
Deletes a private that you have already sent.
HTTP POST /private_message/delete
Sourcepub async fn mark_private_message_as_read<Request>(
&self,
request: Request,
) -> Result<PrivateMessageResponse, LemmyErrorType>
pub async fn mark_private_message_as_read<Request>( &self, request: Request, ) -> Result<PrivateMessageResponse, LemmyErrorType>
Marks a private message that was sent to you as read.
HTTP POST /private_message/mark_as_read
Sourcepub async fn create_private_message_report<Request>(
&self,
request: Request,
) -> Result<PrivateMessageReportResponse, LemmyErrorType>
pub async fn create_private_message_report<Request>( &self, request: Request, ) -> Result<PrivateMessageReportResponse, LemmyErrorType>
Reports a private message that was sent to you to your instance’s admin team and the sender’s instance’s admin team.
HTTP POST /private_message/report
Sourcepub async fn resolve_private_message_report<Request>(
&self,
request: Request,
) -> Result<PrivateMessageReportResponse, LemmyErrorType>
pub async fn resolve_private_message_report<Request>( &self, request: Request, ) -> Result<PrivateMessageReportResponse, LemmyErrorType>
Resolves a report of a private message sent to a user on the instance you administrate.
HTTP PUT /private_message/report/resolve
Sourcepub async fn list_private_message_reports<Request>(
&self,
request: Request,
) -> Result<ListPrivateMessageReportsResponse, LemmyErrorType>
pub async fn list_private_message_reports<Request>( &self, request: Request, ) -> Result<ListPrivateMessageReportsResponse, LemmyErrorType>
Lists reports of private messages received on the isntance you administrate.
HTTP GET /private_message/report/list
Sourcepub async fn get_person<Request>(
&self,
request: Request,
) -> Result<GetPersonDetailsResponse, LemmyErrorType>
pub async fn get_person<Request>( &self, request: Request, ) -> Result<GetPersonDetailsResponse, LemmyErrorType>
Gets the publicly viewable details of a user’s account.
HTTP GET /user
Sourcepub async fn register_account<Request>(
&self,
request: Request,
) -> Result<RegistrationApplicationResponse, LemmyErrorType>
pub async fn register_account<Request>( &self, request: Request, ) -> Result<RegistrationApplicationResponse, LemmyErrorType>
Registers a new account on an instance.
HTTP POST /user/register
Sourcepub async fn get_captcha<Request>(
&self,
request: Request,
) -> Result<GetCaptchaResponse, LemmyErrorType>
pub async fn get_captcha<Request>( &self, request: Request, ) -> Result<GetCaptchaResponse, LemmyErrorType>
Gets a captcha.
HTTP GET /user/get_captcha
Sourcepub async fn export_settings<Request>(
&self,
request: Request,
) -> Result<String, LemmyErrorType>
pub async fn export_settings<Request>( &self, request: Request, ) -> Result<String, LemmyErrorType>
Exports a backup of your user settings - including your saved content, followed communities, and blocks - as JSON.
HTTP GET /user/export_settings
Sourcepub async fn import_settings<Request>(
&self,
request: Request,
) -> Result<SuccessResponse, LemmyErrorType>
pub async fn import_settings<Request>( &self, request: Request, ) -> Result<SuccessResponse, LemmyErrorType>
Imports a backup of your user settings.
HTTP POST /user/import_settings
Sourcepub async fn list_mentions<Request>(
&self,
request: Request,
) -> Result<GetPersonMentionsResponse, LemmyErrorType>
pub async fn list_mentions<Request>( &self, request: Request, ) -> Result<GetPersonMentionsResponse, LemmyErrorType>
Gets mentions of the authenticated user.
HTTP GET /user/mention
Sourcepub async fn mark_mention_as_read<Request>(
&self,
request: Request,
) -> Result<PersonMentionResponse, LemmyErrorType>
pub async fn mark_mention_as_read<Request>( &self, request: Request, ) -> Result<PersonMentionResponse, LemmyErrorType>
Marks a mention as read.
HTTP POST /user/mention/mark_as_read
Sourcepub async fn list_replies<Request>(
&self,
request: Request,
) -> Result<GetRepliesResponse, LemmyErrorType>
pub async fn list_replies<Request>( &self, request: Request, ) -> Result<GetRepliesResponse, LemmyErrorType>
Gets replies to your posts and comments.
HTTP GET /user/replies
Sourcepub async fn ban_from_site<Request>(
&self,
request: Request,
) -> Result<BanPersonResponse, LemmyErrorType>
pub async fn ban_from_site<Request>( &self, request: Request, ) -> Result<BanPersonResponse, LemmyErrorType>
Bans a person from your instance.
HTTP POST /user/ban
Sourcepub async fn list_banned_users<Request>(
&self,
request: Request,
) -> Result<BannedPersonsResponse, LemmyErrorType>
pub async fn list_banned_users<Request>( &self, request: Request, ) -> Result<BannedPersonsResponse, LemmyErrorType>
Gets users banned who are banned from your isntance.
HTTP GET /user/banned
Sourcepub async fn block_person<Request>(
&self,
request: Request,
) -> Result<BlockPersonResponse, LemmyErrorType>
pub async fn block_person<Request>( &self, request: Request, ) -> Result<BlockPersonResponse, LemmyErrorType>
Blocks a person.
HTTP POST /user/block
Sourcepub async fn login<Request>(
&self,
request: Request,
) -> Result<LoginResponse, LemmyErrorType>
pub async fn login<Request>( &self, request: Request, ) -> Result<LoginResponse, LemmyErrorType>
Logs into the instance, giving you a JWT to use to make authorized requests.
HTTP POST /user/login
Sourcepub async fn logout<Request>(
&self,
request: Request,
) -> Result<SuccessResponse, LemmyErrorType>
pub async fn logout<Request>( &self, request: Request, ) -> Result<SuccessResponse, LemmyErrorType>
Deletes the active session associated with the JWT.
HTTP POST /user/logout
Sourcepub async fn delete_account<Request>(
&self,
request: Request,
) -> Result<SuccessResponse, LemmyErrorType>
pub async fn delete_account<Request>( &self, request: Request, ) -> Result<SuccessResponse, LemmyErrorType>
Deletes your account.
HTTP POST /user/delete_account
Sourcepub async fn reset_password<Request>(
&self,
request: Request,
) -> Result<SuccessResponse, LemmyErrorType>
pub async fn reset_password<Request>( &self, request: Request, ) -> Result<SuccessResponse, LemmyErrorType>
Sends an email to your account (if you have one) with a one time link to change your password. Use this if you forgot your password.
HTTP POST /user/password_reset
Sourcepub async fn change_password_after_reset<Request>(
&self,
request: Request,
) -> Result<SuccessResponse, LemmyErrorType>
pub async fn change_password_after_reset<Request>( &self, request: Request, ) -> Result<SuccessResponse, LemmyErrorType>
Follows through with one time link password reset request.
HTTP POST /user/password_change
Sourcepub async fn mark_all_notifications_as_read<Request>(
&self,
request: Request,
) -> Result<GetRepliesResponse, LemmyErrorType>
pub async fn mark_all_notifications_as_read<Request>( &self, request: Request, ) -> Result<GetRepliesResponse, LemmyErrorType>
Marks all notifications (replies, mentions, private messages) as read.
HTTP POST /user/mark_all_as_read
Sourcepub async fn save_user_settings<Request>(
&self,
request: Request,
) -> Result<SuccessResponse, LemmyErrorType>
pub async fn save_user_settings<Request>( &self, request: Request, ) -> Result<SuccessResponse, LemmyErrorType>
Saves your account settings.
HTTP PUT /user/save_user_settings
Sourcepub async fn change_password<Request>(
&self,
request: Request,
) -> Result<LoginResponse, LemmyErrorType>
pub async fn change_password<Request>( &self, request: Request, ) -> Result<LoginResponse, LemmyErrorType>
Changes your password if you are already logged in.
HTTP PUT /user/change_password
Sourcepub async fn report_count<Request>(
&self,
request: Request,
) -> Result<GetReportCountResponse, LemmyErrorType>
pub async fn report_count<Request>( &self, request: Request, ) -> Result<GetReportCountResponse, LemmyErrorType>
Gets number of reports you can resolve.
HTTP GET /user/report_count
Sourcepub async fn unread_count<Request>(
&self,
request: Request,
) -> Result<GetUnreadCountResponse, LemmyErrorType>
pub async fn unread_count<Request>( &self, request: Request, ) -> Result<GetUnreadCountResponse, LemmyErrorType>
Gets the number of unread notifications.
HTTP GET /user/unread_count
Sourcepub async fn verify_email<Request>(
&self,
request: Request,
) -> Result<SuccessResponse, LemmyErrorType>
pub async fn verify_email<Request>( &self, request: Request, ) -> Result<SuccessResponse, LemmyErrorType>
Verifies your email. Used when the instance you are registering an account on requires email verification.
HTTP POST /user/verify_email
Sourcepub async fn leave_admin<Request>(
&self,
request: Request,
) -> Result<GetSiteResponse, LemmyErrorType>
pub async fn leave_admin<Request>( &self, request: Request, ) -> Result<GetSiteResponse, LemmyErrorType>
Leave your instance’s admin team.
HTTP POST /user/leave_admin
Sourcepub async fn generate_totp_secret<Request>(
&self,
request: Request,
) -> Result<GenerateTotpSecretResponse, LemmyErrorType>
pub async fn generate_totp_secret<Request>( &self, request: Request, ) -> Result<GenerateTotpSecretResponse, LemmyErrorType>
Generates a secret to enable time-based one time passwords for two-factor authentication.
After this, you will need to call /user/totp/update with a vaild token to enable it.
HTTP POST /user/totp/generate
Sourcepub async fn update_totp<Request>(
&self,
request: Request,
) -> Result<UpdateTotpResponse, LemmyErrorType>
pub async fn update_totp<Request>( &self, request: Request, ) -> Result<UpdateTotpResponse, LemmyErrorType>
Enables/disables two-factor authentivation.
To enable, you must first call /user/totp/generate to generate a token to pass to this.
You can only disable this if it is already enabled. Again, you must pass a valid TOTP.
HTTP POST /user/totp/update
Sourcepub async fn list_logins<Request>(
&self,
request: Request,
) -> Result<Vec<LoginToken>, LemmyErrorType>
pub async fn list_logins<Request>( &self, request: Request, ) -> Result<Vec<LoginToken>, LemmyErrorType>
Lists login tokens for your user’s active sessions.
HTTP GET /user/list_logins
Sourcepub async fn validate_auth<Request>(
&self,
request: Request,
) -> Result<SuccessResponse, LemmyErrorType>
pub async fn validate_auth<Request>( &self, request: Request, ) -> Result<SuccessResponse, LemmyErrorType>
Returns an error message if your auth token is invalid.
HTTP GET /user/validate_auth
Sourcepub async fn add_admin<Request>(
&self,
request: Request,
) -> Result<AddAdminResponse, LemmyErrorType>
pub async fn add_admin<Request>( &self, request: Request, ) -> Result<AddAdminResponse, LemmyErrorType>
Adds a user to your instance’s admin team.
HTTP POST admin/add
Sourcepub async fn unread_registration_application_count<Request>(
&self,
request: Request,
) -> Result<GetUnreadRegistrationApplicationCountResponse, LemmyErrorType>
pub async fn unread_registration_application_count<Request>( &self, request: Request, ) -> Result<GetUnreadRegistrationApplicationCountResponse, LemmyErrorType>
Gets the number of unread registration applications for the instance you administrate.
HTTP GET /admin/registration_application/count
Sourcepub async fn get_registration_aplication<Request>(
&self,
request: Request,
) -> Result<RegistrationApplicationResponse, LemmyErrorType>
pub async fn get_registration_aplication<Request>( &self, request: Request, ) -> Result<RegistrationApplicationResponse, LemmyErrorType>
Get the application a user submitted when they first registered their account
HTTP GET /admin/registration_application
Sourcepub async fn list_registration_applications<Request>(
&self,
request: Request,
) -> Result<ListRegistrationApplicationsResponse, LemmyErrorType>
pub async fn list_registration_applications<Request>( &self, request: Request, ) -> Result<ListRegistrationApplicationsResponse, LemmyErrorType>
Gets applications to register an account on the instance you administer.
HTTP GET /admin/registration_application/list
Sourcepub async fn approve_registration_application<Request>(
&self,
request: Request,
) -> Result<RegistrationApplicationResponse, LemmyErrorType>
pub async fn approve_registration_application<Request>( &self, request: Request, ) -> Result<RegistrationApplicationResponse, LemmyErrorType>
Approves a pending registration application.
HTTP PUT /admin/registration_application/approve
Sourcepub async fn purge_person<Request>(
&self,
request: Request,
) -> Result<SuccessResponse, LemmyErrorType>
pub async fn purge_person<Request>( &self, request: Request, ) -> Result<SuccessResponse, LemmyErrorType>
Purges a user from the database.
HTTP POST /admin/purge/person
Sourcepub async fn purge_community<Request>(
&self,
request: Request,
) -> Result<SuccessResponse, LemmyErrorType>
pub async fn purge_community<Request>( &self, request: Request, ) -> Result<SuccessResponse, LemmyErrorType>
Purges a community from the database.
HTTP POST /admin/purge/community
Sourcepub async fn purge_post<Request>(
&self,
request: Request,
) -> Result<SuccessResponse, LemmyErrorType>
pub async fn purge_post<Request>( &self, request: Request, ) -> Result<SuccessResponse, LemmyErrorType>
Purges a post from the datbase.
HTTP POST /admin/purge/post
Sourcepub async fn purge_comment<Request>(
&self,
request: Request,
) -> Result<SuccessResponse, LemmyErrorType>
pub async fn purge_comment<Request>( &self, request: Request, ) -> Result<SuccessResponse, LemmyErrorType>
Purges a comment from the database.
HTTP POST /admin/purge/comment
Sourcepub async fn create_custom_emoji<Request>(
&self,
request: Request,
) -> Result<CustomEmojiResponse, LemmyErrorType>
pub async fn create_custom_emoji<Request>( &self, request: Request, ) -> Result<CustomEmojiResponse, LemmyErrorType>
Creates a custom emoji.
HTTP POST /custom_emoji
Sourcepub async fn edit_custom_emoji<Request>(
&self,
request: Request,
) -> Result<CustomEmojiResponse, LemmyErrorType>
pub async fn edit_custom_emoji<Request>( &self, request: Request, ) -> Result<CustomEmojiResponse, LemmyErrorType>
Edits an existing custom emoji.
HTTP PUT /custom_emoji
Sourcepub async fn delete_custom_emoji<Request>(
&self,
request: Request,
) -> Result<CustomEmojiResponse, LemmyErrorType>
pub async fn delete_custom_emoji<Request>( &self, request: Request, ) -> Result<CustomEmojiResponse, LemmyErrorType>
Deletes an existing custom emoji.
HTTP POST /custom_emoji/delete
Sourcepub async fn list_media<Request>(
&self,
request: Request,
) -> Result<ListMediaResponse, LemmyErrorType>
pub async fn list_media<Request>( &self, request: Request, ) -> Result<ListMediaResponse, LemmyErrorType>
Gets all media posted by the logged in user.
HTTP GET /account/list_media
Sourcepub async fn list_all_media<Request>(
&self,
request: Request,
) -> Result<ListMediaResponse, LemmyErrorType>
pub async fn list_all_media<Request>( &self, request: Request, ) -> Result<ListMediaResponse, LemmyErrorType>
Gets all media posted on an instance. Only usable by the instance’s admins.
HTTP GET /admin/list_all_media