mangadex_api/v5/scanlation_group/
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
use crate::HttpClientRef;

use uuid::Uuid;

#[cfg(feature = "custom_list_v2")]
pub mod bookmark;
pub mod delete;
pub mod follow;
pub mod get;
pub mod put;

#[cfg(feature = "custom_list_v2")]
use bookmark::BookMarkEndpoint;
use delete::DeleteGroupBuilder;
use follow::FollowEndpoint;
use get::GetGroupBuilder;
use put::UpdateGroupBuilder;

#[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 }
    }
    #[cfg(feature = "custom_list_v2")]
    pub fn bookmark(&self) -> BookMarkEndpoint {
        BookMarkEndpoint::new(self.http_client.clone(), self.id)
    }
    #[cfg_attr(
        feature = "custom_list_v2",
        deprecated(since = "3.0.0-alpha.1", note = "use .bookmark() instead")
    )]
    pub fn follow(&self) -> FollowEndpoint {
        FollowEndpoint::new(self.http_client.clone(), self.id)
    }
    pub fn get(&self) -> GetGroupBuilder {
        GetGroupBuilder::default()
            .group_id(self.id)
            .http_client(self.http_client.clone())
    }
    pub fn delete(&self) -> DeleteGroupBuilder {
        DeleteGroupBuilder::default()
            .group_id(self.id)
            .http_client(self.http_client.clone())
    }
    pub fn put(&self) -> UpdateGroupBuilder {
        UpdateGroupBuilder::default()
            .group_id(self.id)
            .http_client(self.http_client.clone())
    }
}