stadar 0.1.25

Rust SDK for the stadar.net esports data API.
/*
 * 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};

/// Dota2PlayerLine : One player's per-match depth from STRATZ.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Dota2PlayerLine {
    /// Valve account id, serialized as a string — the id exceeds the JavaScript safe-integer range (2^53), so a numeric encoding would lose precision in JS clients. 
    #[serde(rename = "steam_account_id")]
    pub steam_account_id: String,
    /// Valve hero id the player picked.
    #[serde(rename = "hero_id")]
    pub hero_id: i32,
    #[serde(rename = "is_radiant")]
    pub is_radiant: bool,
    #[serde(rename = "is_victory")]
    pub is_victory: bool,
    #[serde(rename = "kills")]
    pub kills: i32,
    #[serde(rename = "deaths")]
    pub deaths: i32,
    #[serde(rename = "assists")]
    pub assists: i32,
    /// STRATZ `MatchPlayerRoleType` verbatim (e.g. `CORE`, `LIGHT_SUPPORT`, `HARD_SUPPORT`). Null if unclassified. 
    #[serde(rename = "role", skip_serializing_if = "Option::is_none")]
    pub role: Option<String>,
    /// Coarse role classification (verbatim STRATZ enum).
    #[serde(rename = "role_basic", skip_serializing_if = "Option::is_none")]
    pub role_basic: Option<String>,
    /// STRATZ Individual Match Performance — a SIGNED score that runs negative for below-baseline performances. Null if absent. 
    #[serde(rename = "imp", skip_serializing_if = "Option::is_none")]
    pub imp: Option<i32>,
    #[serde(rename = "gold_per_minute")]
    pub gold_per_minute: i32,
    #[serde(rename = "experience_per_minute")]
    pub experience_per_minute: i32,
    #[serde(rename = "networth")]
    pub networth: i32,
    #[serde(rename = "hero_damage")]
    pub hero_damage: i32,
    #[serde(rename = "tower_damage")]
    pub tower_damage: i32,
    #[serde(rename = "hero_healing")]
    pub hero_healing: i32,
    /// Final 6-slot item build (item0Id..item5Id). Exactly 6 elements; an element is null for an empty inventory slot, preserved positionally. 
    #[serde(rename = "items")]
    pub items: Vec<i32>,
}

impl Dota2PlayerLine {
    /// One player's per-match depth from STRATZ.
    pub fn new(steam_account_id: String, hero_id: i32, is_radiant: bool, is_victory: bool, kills: i32, deaths: i32, assists: i32, gold_per_minute: i32, experience_per_minute: i32, networth: i32, hero_damage: i32, tower_damage: i32, hero_healing: i32, items: Vec<i32>) -> Dota2PlayerLine {
        Dota2PlayerLine {
            steam_account_id,
            hero_id,
            is_radiant,
            is_victory,
            kills,
            deaths,
            assists,
            role: None,
            role_basic: None,
            imp: None,
            gold_per_minute,
            experience_per_minute,
            networth,
            hero_damage,
            tower_damage,
            hero_healing,
            items,
        }
    }
}