Crates.io | nhl-stats |
lib.rs | nhl-stats |
version | 0.1.2 |
source | src |
created_at | 2019-08-07 18:12:21.937405 |
updated_at | 2019-08-09 23:38:31.326853 |
description | NHL Stats API client for Rust created using openapi-generator |
homepage | |
repository | https://github.com/tarkah/rust-nhl-stats-api |
max_upload_size | |
id | 154839 |
size | 455,005 |
Rust client for using the NHL Stats API.
Both reqwest
and hyper
clients are avaialable by default, and behind feature flags sync
and async
, respectively.
use nhl_stats::parameters::*;
use nhl_stats::sync::configuration::Configuration;
use nhl_stats::sync::*;
use std::rc::Rc;
fn main() -> Result<(), Error> {
let config = Rc::from(Configuration::default());
let teams_client = TeamsApiClient::new(config);
// First parameter is expand=, use applicable enum from parameters module
// Second parameter is season (both years included)
let expand = EnumExpandTeams::TeamRoster;
let teams = teams_client.get_teams(expand, "20192020")?;
for team in teams.teams.unwrap() {
println!("{:#?}", team);
}
Ok(())
}
This API client was generated by the OpenAPI Generator project. By using the openapi-spec from a remote server, you can easily generate an API client.
API version: 1.0.0
Package version: 1.0.0
Build package: org.openapitools.codegen.languages.RustClientCodegen For more information, please visit https://github.com/erunion/sport-api-specifications
All URIs are relative to https://statsapi.web.nhl.com/api/v1
Class | Method | HTTP request | Description |
---|---|---|---|
ConferencesApi | get_conference | Get /conferences/{id} | Get an NHL conference. |
ConferencesApi | get_conferences | Get /conferences | Get all current NHL conferences. |
DivisionsApi | get_division | Get /divisions/{id} | Get an NHL division. |
DivisionsApi | get_divisions | Get /divisions | Get all current NHL divisions. |
DraftApi | get_draft | Get /draft | Get round-by-round data for current year's NHL Entry Draft. |
DraftApi | get_draft_by_year | Get /draft/{year} | Get round-by-round data for a specific year's NHL Entry Draft. |
DraftApi | get_draft_prospect | Get /draft/prospects/{id} | Get an NHL Entry Draft prospect. |
DraftApi | get_draft_prospects | Get /draft/prospects | Get all NHL Entry Draft prospects. |
GamesApi | get_game | Get /game/{id}/feed/live | Get all available data for an NHL game. |
GamesApi | get_game_boxscore | Get /game/{id}/boxscore | Get the boxscore for an NHL game. |
GamesApi | get_game_content | Get /game/{id}/content | Get editorials, video replays and photo highlights for an NHL game. |
GamesApi | get_game_diff | Get /game/{id}/feed/live/diffPatch | Get all available data for an NHL game after a specific time. |
PlayersApi | get_player | Get /people/{id} | Get an NHL player. |
PlayersApi | get_player_stats | Get /people/{id}/stats | Get specific statistics for an NHL player. |
ScheduleApi | get_schedule | Get /schedule | Get the NHL game schedule. |
StandingsApi | get_standing_types | Get /standingsTypes | Get all available NHL standing types. |
StandingsApi | get_standings | Get /standings | Get NHL division standings. |
StandingsApi | get_standings_by_type | Get /standings/{type} | Get NHL standings for a specific standing type. |
StatsApi | get_stat_types | Get /statTypes | Get all available NHL statistic types. |
TeamsApi | get_team | Get /teams/{id} | Get an NHL team. |
TeamsApi | get_team_roster | Get /teams/{id}/roster | Get an NHL team's roster. |
TeamsApi | get_team_stats | Get /teams/{id}/stats | Get all statistics for an NHL team. |
TeamsApi | get_teams | Get /teams | Get all NHL teams. |
To get access to the crate's generated documentation, use:
cargo doc --open