use super::{AgentConfiguration, Client, LoginOptions, LogoutOptions};
use std::fmt::{Display, Formatter};
#[derive(Clone, Debug)]
pub enum Error {
NoAgent,
}
impl Display for Error {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
match self {
Self::NoAgent => write!(f, "no agent"),
}
}
}
impl std::error::Error for Error {}
pub trait OAuth2Operations<C: Client> {
fn configure(&self, config: AgentConfiguration<C>) -> Result<(), Error>;
fn start_login(&self) -> Result<(), Error>;
fn start_login_opts(&self, options: LoginOptions) -> Result<(), Error>;
fn logout(&self) -> Result<(), Error>;
fn logout_opts(&self, options: LogoutOptions) -> Result<(), Error>;
}