mangadex_api/v5/api_client/id/
secret.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
pub mod get;
pub mod post;

use crate::HttpClientRef;
use uuid::Uuid;

use get::GetClientSecretBuilder;
use post::RegenerateClientSecretBuilder;

create_endpoint_node! {
    #[name] SecretEndpoint SecretEndpointMethods,
    #[args] {
        http_client: HttpClientRef,
        id: Uuid,
    },
    #[methods] {
        get() -> GetClientSecretBuilder;
        post() -> RegenerateClientSecretBuilder;
    }
}

impl SecretEndpointMethods for SecretEndpoint {
    fn get(&self) -> GetClientSecretBuilder {
        GetClientSecretBuilder::default()
            .client_id(<&Self as Into<Uuid>>::into(self))
            .http_client(<&Self as Into<HttpClientRef>>::into(self))
    }

    fn post(&self) -> RegenerateClientSecretBuilder {
        RegenerateClientSecretBuilder::default()
            .client_id(<&Self as Into<Uuid>>::into(self))
            .http_client(<&Self as Into<HttpClientRef>>::into(self))
    }
}