//! Generate 10 random integers between 1 and 100.
//!
//! Run with: `RANDOM_ORG_API_KEY=... cargo run --example integers`

use randomorg_rpc::{Client, IntegersParams};

#[tokio::main]
async fn main() -> Result<(), randomorg_rpc::Error> {
    let key = std::env::var("RANDOM_ORG_API_KEY").expect("RANDOM_ORG_API_KEY missing");
    let client = Client::new(key);

    let r = client
        .generate_integers(IntegersParams::new(10, 1, 100))
        .await?;

    println!("integers: {:?}", r.random.data);
    println!("bits left: {}", r.bits_left);
    println!("requests left: {}", r.requests_left);
    Ok(())
}
