mangadex_api/v5/chapter/
id.rs

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