mangadex_api/v5/manga/
id.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
pub mod aggregate;
pub mod delete;
pub mod feed;
pub mod follow;
pub mod get;
pub mod list;
pub mod put;
pub mod read;
pub mod status;

use crate::HttpClientRef;

use uuid::Uuid;

use aggregate::AggregateEndpoint;
use delete::DeleteMangaBuilder;
use feed::FeedEndpoint;
use follow::FollowEndpoint;
use get::GetMangaBuilder;
use list::ListEndpoint;
use put::UpdateMangaBuilder;
use read::ReadEndpoint;
use status::StatusEndpoint;

#[derive(Debug)]
pub struct IdEndpoint {
    http_client: HttpClientRef,
    id: Uuid,
}

impl IdEndpoint {
    #[doc(hidden)]
    pub fn new(http_client: HttpClientRef, id: Uuid) -> Self {
        Self { http_client, id }
    }
    pub fn aggregate(&self) -> AggregateEndpoint {
        AggregateEndpoint::new(self.http_client.clone(), self.id)
    }
    pub fn delete(&self) -> DeleteMangaBuilder {
        DeleteMangaBuilder::default()
            .manga_id(self.id)
            .http_client(self.http_client.clone())
    }
    pub fn feed(&self) -> FeedEndpoint {
        FeedEndpoint::new(self.http_client.clone(), self.id)
    }
    pub fn follow(&self) -> FollowEndpoint {
        FollowEndpoint::new(self.http_client.clone(), self.id)
    }
    pub fn get(&self) -> GetMangaBuilder {
        GetMangaBuilder::default()
            .manga_id(self.id)
            .http_client(self.http_client.clone())
    }
    pub fn list(&self) -> ListEndpoint {
        ListEndpoint::new(self.http_client.clone(), self.id)
    }
    pub fn put(&self) -> UpdateMangaBuilder {
        UpdateMangaBuilder::default()
            .manga_id(self.id)
            .http_client(self.http_client.clone())
    }
    pub fn read(&self) -> ReadEndpoint {
        ReadEndpoint::new(self.http_client.clone(), self.id)
    }
    pub fn status(&self) -> StatusEndpoint {
        StatusEndpoint::new(self.http_client.clone(), self.id)
    }
}