linear-api 0.1.0

Unofficial async Rust client for the Linear GraphQL API (API-key auth)
Documentation
//! Prints the authenticated viewer and the current rate-limit budget.
//!
//! Usage: `LINEAR_API_KEY=lin_api_... cargo run --example viewer`

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let client = linear_api::LinearClient::from_env()?;

    let viewer = client.viewer().await?;
    println!("Logged in as {} <{}>", viewer.name, viewer.email);

    if let Some(info) = client.last_rate_limit() {
        println!(
            "Request budget: {:?} remaining of {:?} (complexity {:?} of {:?})",
            info.requests_remaining,
            info.requests_limit,
            info.complexity_remaining,
            info.complexity_limit,
        );
    }
    Ok(())
}