mangadex_api/v5/scanlation_group/
id.rs

1use crate::HttpClientRef;
2
3use uuid::Uuid;
4
5#[cfg(feature = "custom_list_v2")]
6pub mod bookmark;
7pub mod delete;
8pub mod follow;
9pub mod get;
10pub mod put;
11
12#[cfg(feature = "custom_list_v2")]
13use bookmark::BookMarkEndpoint;
14use delete::DeleteGroupBuilder;
15use follow::FollowEndpoint;
16use get::GetGroupBuilder;
17use put::UpdateGroupBuilder;
18
19#[derive(Debug)]
20pub struct IdEndpoint {
21    http_client: HttpClientRef,
22    id: Uuid,
23}
24
25impl IdEndpoint {
26    #[doc(hidden)]
27    pub fn new(http_client: HttpClientRef, id: Uuid) -> Self {
28        Self { http_client, id }
29    }
30    #[cfg(feature = "custom_list_v2")]
31    pub fn bookmark(&self) -> BookMarkEndpoint {
32        BookMarkEndpoint::new(self.http_client.clone(), self.id)
33    }
34    #[cfg_attr(
35        feature = "custom_list_v2",
36        deprecated(since = "3.0.0-alpha.1", note = "use .bookmark() instead")
37    )]
38    pub fn follow(&self) -> FollowEndpoint {
39        FollowEndpoint::new(self.http_client.clone(), self.id)
40    }
41    pub fn get(&self) -> GetGroupBuilder {
42        GetGroupBuilder::default()
43            .group_id(self.id)
44            .http_client(self.http_client.clone())
45    }
46    pub fn delete(&self) -> DeleteGroupBuilder {
47        DeleteGroupBuilder::default()
48            .group_id(self.id)
49            .http_client(self.http_client.clone())
50    }
51    pub fn put(&self) -> UpdateGroupBuilder {
52        UpdateGroupBuilder::default()
53            .group_id(self.id)
54            .http_client(self.http_client.clone())
55    }
56}