mastodon_api\methods\admin/
mod.rs

1pub mod accounts;
2pub mod domain_federation;
3pub mod ip_blocks;
4pub mod reports;
5
6use crate::MastodonClient;
7
8/// Handler for admin-related API endpoints.
9pub struct AdminHandler<'a> {
10    client: &'a MastodonClient,
11}
12
13impl<'a> AdminHandler<'a> {
14    /// Creates a new `AdminHandler` for the given client.
15    pub fn new(client: &'a MastodonClient) -> Self {
16        Self { client }
17    }
18
19    /// Access admin account moderation endpoints.
20    pub fn accounts(&self) -> accounts::AdminAccountsHandler<'_> {
21        accounts::AdminAccountsHandler::new(self.client)
22    }
23
24    /// Access admin report management endpoints.
25    pub fn reports(&self) -> reports::AdminReportsHandler<'_> {
26        reports::AdminReportsHandler::new(self.client)
27    }
28
29    /// Access admin domain federation endpoints.
30    pub fn domain_federation(&self) -> domain_federation::AdminDomainFederationHandler<'_> {
31        domain_federation::AdminDomainFederationHandler::new(self.client)
32    }
33
34    /// Access admin IP block management endpoints.
35    pub fn ip_blocks(&self) -> ip_blocks::AdminIpBlocksHandler<'_> {
36        ip_blocks::AdminIpBlocksHandler::new(self.client)
37    }
38}