use anyhow::Result;
use dotenv::dotenv;
use rtxmail::{client::Exmailer, Client};
use std::env;
#[tokio::main]
async fn main() -> Result<()> {
dotenv().ok();
let corp_id = env::var("CORP_ID")?;
let corp_secret = env::var("CORP_SECRET")?;
let c = Client::new(
corp_id,
corp_secret,
Some(tokio::time::Duration::from_millis(500)),
);
let resp = c.list_department(None).await?;
println!("{}", serde_json::to_string(&resp)?);
Ok(())
}