stadar 0.1.6

Rust SDK for the stadar.net esports data API.
docs.rs failed to build stadar-0.1.6
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.

stadar — Rust SDK for the esports-api

Auto-generated from the OpenAPI 3.1 spec via openapi-generator. Async via reqwest. Rust 1.78+.

Install

# Cargo.toml
[dependencies]
stadar = "0.1"
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }

Use

use stadar::from_env::from_env;
use stadar::apis::games_api::list_games;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let cfg = from_env()?;   // reads STADAR_API_KEY
    let games = list_games(&cfg, None).await?;
    println!("{:#?}", games);
    Ok(())
}

Webhook signature verification

use stadar::webhooks::verify;

if verify(&body, signature_header, &secret).is_err() {
    return http::StatusCode::UNAUTHORIZED.into_response();
}

Publishing

.github/workflows/sdk-publish.yml runs on git tag sdk-rust-v* and pushes to crates.io via cargo publish (requires CRATES_IO_TOKEN GitHub secret).

Regenerating

scripts/generate-sdks.sh