//! List the sailboxes in your org.
//!
//! Run with your credentials in the environment:
//!
//! ```text
//! SAIL_API_KEY=sk_... cargo run --example list_sailboxes
//! ```

use sail::sailbox::types::ListSailboxesQuery;
use sail::Client;

#[tokio::main]
async fn main() -> Result<(), sail::error::SailError> {
    let client = Client::from_env()?;
    let page = client
        .list_sailboxes(&ListSailboxesQuery::default())
        .await?;
    println!("{} sailboxes", page.items.len());
    for sb in &page.items {
        println!("{}\t{}\t{}", sb.sailbox_id, sb.status, sb.name);
    }
    Ok(())
}
