use serde_json::json;
use crate::types::EmailCheck;
use crate::{Client, Error};
#[derive(Debug, Clone, Copy)]
pub struct Email<'a> {
client: &'a Client,
}
impl<'a> Email<'a> {
pub(crate) fn new(client: &'a Client) -> Self {
Email { client }
}
pub async fn check(&self, email: &str) -> Result<EmailCheck, Error> {
self.client
.post("/email/check", &json!({ "email": email }))
.await
}
}