mangadex_api/v5/report/reasons/
category.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
pub mod get;

use mangadex_api_types::ReportCategory;

use crate::HttpClientRef;
use get::ListReasonsBuilder;

/// Report endpoint handler builder.
#[derive(Clone, Debug)]
pub struct CategoryEndpoint {
    http_client: HttpClientRef,
    category: ReportCategory,
}

impl CategoryEndpoint {
    #[doc(hidden)]
    pub(crate) fn new(http_client: HttpClientRef, category: ReportCategory) -> Self {
        Self {
            http_client,
            category,
        }
    }
    pub fn get(&self) -> ListReasonsBuilder {
        ListReasonsBuilder::default()
            .category(self.category)
            .http_client(self.http_client.clone())
    }
}