mangadex_api/v5/
chapter.rs

1//! Chapter endpoint handler.
2//!
3//! <https://api.mangadex.org/docs/swagger.html#/Chapter>
4
5pub mod get;
6pub mod id;
7
8use uuid::Uuid;
9
10use crate::v5::chapter::get::ListChapterBuilder;
11use crate::v5::chapter::id::IdEndpoint;
12use crate::HttpClientRef;
13
14/// Chapter endpoint handler builder.
15#[derive(Debug)]
16pub struct ChapterBuilder {
17    http_client: HttpClientRef,
18}
19
20impl ChapterBuilder {
21    #[doc(hidden)]
22    pub(crate) fn new(http_client: HttpClientRef) -> Self {
23        Self { http_client }
24    }
25
26    /// Search a list of chapters.
27    ///
28    /// <https://api.mangadex.org/swagger.html#/Chapter/get-chapter>
29    pub fn get(&self) -> ListChapterBuilder {
30        ListChapterBuilder::default().http_client(self.http_client.clone())
31    }
32
33    pub fn id(&self, id: Uuid) -> IdEndpoint {
34        IdEndpoint::new(self.http_client.clone(), id)
35    }
36}