use projectx_client::{Client, Credentials, ProviderList};
#[tokio::main(flavor = "current_thread")]
async fn main() -> Result<(), projectx_client::Error> {
let credentials = Credentials::new("your-user-name", "your-api-key")?;
let client = Client::builder(credentials).build()?;
client.authenticate().await?;
match client.search_active_accounts().await? {
ProviderList::Listed(accounts) => {
for account in accounts {
println!("{}", account.name);
}
}
ProviderList::Absent => println!("the provider omitted the account list"),
}
Ok(())
}