mangadex_api/v5/
custom_list.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
29
30
31
32
33
34
35
36
37
//! CustomList endpoint handler.
//!
//! <https://api.mangadex.org/docs/swagger.html#/CustomList>

pub mod id;
pub mod post;

use uuid::Uuid;

use crate::v5::custom_list::post::CreateCustomListBuilder;
use crate::HttpClientRef;
use id::IdEnpoint;

/// CustomList endpoint handler builder.
#[derive(Debug)]
pub struct CustomListBuilder {
    http_client: HttpClientRef,
}

impl CustomListBuilder {
    #[doc(hidden)]
    pub(crate) fn new(http_client: HttpClientRef) -> Self {
        Self { http_client }
    }

    /// Create a custom list.
    ///
    /// <https://api.mangadex.org/swagger.html#/CustomList/post-list>
    pub fn post(&self) -> CreateCustomListBuilder {
        CreateCustomListBuilder::default().http_client(self.http_client.clone())
    }

    /// Containing existing endpoint in <https://api.mangadex.org/list/>{id}
    pub fn id(&self, id: Uuid) -> IdEnpoint {
        IdEnpoint::new(self.http_client.clone(), id)
    }
}