mangadex_api/v5/
custom_list.rs

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