mangadex_api/v5/manga/manga_id/
relation.rs

1pub mod get;
2pub mod id;
3pub mod post;
4
5use crate::HttpClientRef;
6
7use uuid::Uuid;
8
9use get::ListMangaRelationsBuilder;
10use id::RelationIdEndpoint;
11use post::CreateMangaRelationBuilder;
12
13#[derive(Debug)]
14pub struct RelationEndpoint {
15    http_client: HttpClientRef,
16    manga_id: Uuid,
17}
18
19impl RelationEndpoint {
20    #[doc(hidden)]
21    pub fn new(http_client: HttpClientRef, manga_id: Uuid) -> Self {
22        Self {
23            http_client,
24            manga_id,
25        }
26    }
27    pub fn get(&self) -> ListMangaRelationsBuilder {
28        ListMangaRelationsBuilder::default()
29            .manga_id(self.manga_id)
30            .http_client(self.http_client.clone())
31    }
32    pub fn post(&self) -> CreateMangaRelationBuilder {
33        CreateMangaRelationBuilder::default()
34            .manga_id(self.manga_id)
35            .http_client(self.http_client.clone())
36    }
37    pub fn id(&self, id: Uuid) -> RelationIdEndpoint {
38        RelationIdEndpoint::new(self.http_client.clone(), self.manga_id, id)
39    }
40}