1pub mod check;
6#[cfg(feature = "legacy-auth")]
7pub mod login;
8#[cfg(feature = "legacy-auth")]
9pub mod logout;
10#[cfg(feature = "legacy-auth")]
11pub mod refresh;
12
13use crate::v5::auth::check::CheckEndpoint;
14#[cfg(feature = "legacy-auth")]
15use crate::v5::auth::login::LoginEndpoint;
16#[cfg(feature = "legacy-auth")]
17use crate::v5::auth::logout::LogoutEndpoint;
18#[cfg(feature = "legacy-auth")]
19use crate::v5::auth::refresh::RefreshEndpoint;
20use crate::HttpClientRef;
21
22#[derive(Debug)]
24pub struct AuthBuilder {
25 http_client: HttpClientRef,
26}
27
28impl AuthBuilder {
29 #[doc(hidden)]
30 pub(crate) fn new(http_client: HttpClientRef) -> Self {
31 Self { http_client }
32 }
33
34 cfg_legacy_auth! {
35 #[deprecated = "Usage deprecated after the introduction of OAuth authentification from Mangadex API 5.9"]
39 pub fn login(&self) -> LoginEndpoint {
40 LoginEndpoint::new(self.http_client.clone())
41 }
42 }
43
44 cfg_legacy_auth! {
45 #[deprecated = "Usage deprecated after the introduction of OAuth authentification from Mangadex API 5.9"]
49 pub fn logout(&self) -> LogoutEndpoint {
50 LogoutEndpoint::new(self.http_client.clone())
51 }
52 }
53
54 cfg_legacy_auth! {
55 #[deprecated = "Usage deprecated after the introduction of OAuth authentification from Mangadex API 5.9"]
59 pub fn refresh(&self) -> RefreshEndpoint {
60 RefreshEndpoint::new(self.http_client.clone())
61 }
62 }
63 pub fn check(&self) -> CheckEndpoint {
67 CheckEndpoint::new(self.http_client.clone())
68 }
69}