mangadex_api/v5/
report.rs

1//! Report endpoint handler.
2//!
3//! <https://api.mangadex.org/docs/swagger.html#/Report>
4
5pub mod get;
6pub mod post;
7pub mod reasons;
8
9use crate::HttpClientRef;
10use get::ListReportsByUserBuilder;
11use post::CreateReportBuilder;
12use reasons::ReasonsEndpoint;
13
14/// Report endpoint handler builder.
15#[derive(Clone, Debug)]
16pub struct ReportBuilder {
17    http_client: HttpClientRef,
18}
19
20impl ReportBuilder {
21    #[doc(hidden)]
22    pub(crate) fn new(http_client: HttpClientRef) -> Self {
23        Self { http_client }
24    }
25
26    pub fn get(&self) -> ListReportsByUserBuilder {
27        ListReportsByUserBuilder::default().http_client(self.http_client.clone())
28    }
29    pub fn post(&self) -> CreateReportBuilder {
30        CreateReportBuilder::default().http_client(self.http_client.clone())
31    }
32    pub fn reasons(&self) -> ReasonsEndpoint {
33        ReasonsEndpoint::new(self.http_client.clone())
34    }
35}