/*
* Stadar Esports Data API
*
* Read-only esports data across all major competitive titles. Flat-tier pricing (no per-game gates), monthly subscriptions, sandbox keys for evaluation. See https://stadar.net for tier pricing. All endpoints under `/v1/...`. The version in `info.version` matches the URL prefix; non-breaking field additions ship in `/v1`, breaking changes get a `/v2`. We commit to 24 months of `/v1` support after `/v2` ships. Times are UTC end-to-end (RFC 3339). Localization is the client's problem. Cursors are opaque base64 strings; treat them as such.
*
* The version of the OpenAPI document: v1
* Contact: api@stadar.net
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// Dota2Block : STRATZ Dota 2 match depth embedded on a match. Lane outcomes, the draft, and per-player stats for a single Dota 2 game.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Dota2Block {
/// Whether Radiant won (`match.didRadiantWin`). Null if absent.
#[serde(rename = "radiant_win", skip_serializing_if = "Option::is_none")]
pub radiant_win: Option<bool>,
/// Game length in seconds.
#[serde(rename = "duration_seconds", skip_serializing_if = "Option::is_none")]
pub duration_seconds: Option<i32>,
/// Dota 2 patch (game version) id the match was played on.
#[serde(rename = "game_version_id", skip_serializing_if = "Option::is_none")]
pub game_version_id: Option<i32>,
#[serde(rename = "lane_outcomes")]
pub lane_outcomes: Box<models::Dota2LaneOutcomes>,
/// Pick/ban actions in ascending draft order.
#[serde(rename = "draft")]
pub draft: Vec<models::Dota2DraftEntry>,
/// Per-player depth, 10 entries. Radiant players (`is_radiant=true`) first, then Dire; each side ordered by descending net worth.
#[serde(rename = "players")]
pub players: Vec<models::Dota2PlayerLine>,
}
impl Dota2Block {
/// STRATZ Dota 2 match depth embedded on a match. Lane outcomes, the draft, and per-player stats for a single Dota 2 game.
pub fn new(lane_outcomes: models::Dota2LaneOutcomes, draft: Vec<models::Dota2DraftEntry>, players: Vec<models::Dota2PlayerLine>) -> Dota2Block {
Dota2Block {
radiant_win: None,
duration_seconds: None,
game_version_id: None,
lane_outcomes: Box::new(lane_outcomes),
draft,
players,
}
}
}