pub mod check;
#[cfg(feature = "legacy-auth")]
pub mod login;
#[cfg(feature = "legacy-auth")]
pub mod logout;
#[cfg(feature = "legacy-auth")]
pub mod refresh;
use crate::v5::auth::check::CheckEndpoint;
#[cfg(feature = "legacy-auth")]
use crate::v5::auth::login::LoginEndpoint;
#[cfg(feature = "legacy-auth")]
use crate::v5::auth::logout::LogoutEndpoint;
#[cfg(feature = "legacy-auth")]
use crate::v5::auth::refresh::RefreshEndpoint;
use crate::HttpClientRef;
#[derive(Debug)]
pub struct AuthBuilder {
http_client: HttpClientRef,
}
impl AuthBuilder {
#[doc(hidden)]
pub(crate) fn new(http_client: HttpClientRef) -> Self {
Self { http_client }
}
cfg_legacy_auth! {
#[deprecated = "Usage deprecated after the introduction of OAuth authentification from Mangadex API 5.9"]
pub fn login(&self) -> LoginEndpoint {
LoginEndpoint::new(self.http_client.clone())
}
}
cfg_legacy_auth! {
#[deprecated = "Usage deprecated after the introduction of OAuth authentification from Mangadex API 5.9"]
pub fn logout(&self) -> LogoutEndpoint {
LogoutEndpoint::new(self.http_client.clone())
}
}
cfg_legacy_auth! {
#[deprecated = "Usage deprecated after the introduction of OAuth authentification from Mangadex API 5.9"]
pub fn refresh(&self) -> RefreshEndpoint {
RefreshEndpoint::new(self.http_client.clone())
}
}
pub fn check(&self) -> CheckEndpoint {
CheckEndpoint::new(self.http_client.clone())
}
}