mangadex_api/v5/author/
id.rs

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