eve-esi-api 0.0.4

This library provides an authentication to Eve-esi API and some endpoints to call.
Documentation
use std::error::Error;

use eve_esi_api::EveApiParam;

#[tokio::main]
pub async fn main() -> Result<(), Box<dyn Error>> {
    let client_id = std::env::var("CLIENT_ID").expect("CLIENT_ID needed as environment variable");
    let client_secret = std::env::var("CLIENT_SECRET").expect("CLIENT_SECRET missing");
    let scopes = vec!["publicData"];
    let params = EveApiParam {
        client_id,
        client_secret,
        scopes,
        token_path: None,
    };
    let eve_api = eve_esi_api::EveApi::new(params).await?;

    let regions = eve_esi_api::universe::all_regions(eve_api.client()).await?;
    if let Some(regions) = regions {
        for region_id in regions {
            let region = eve_esi_api::universe::region(eve_api.client(), region_id).await?;
            println!(
                "{}",
                region
                    .map(|region| region.name)
                    .unwrap_or(format!("Unknown region ({})", region_id))
            );
        }
    }
    Ok(())
}