chesscom-openapi 0.1.1

OpenAPI-generated API client bindings for Chess.com
Documentation
/*
 * Chess
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.0
 * 
 * Generated by: https://openapi-generator.tech
 */

/// Summary of all games played



#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ChessStatsRecord {
    /// Number of games won
    #[serde(rename = "win")]
    pub win: i32,
    /// Number of games lost
    #[serde(rename = "loss")]
    pub loss: i32,
    /// Number of games drawn
    #[serde(rename = "draw")]
    pub draw: i32,
    /// Number of seconds per average move
    #[serde(rename = "time_per_move", skip_serializing_if = "Option::is_none")]
    pub time_per_move: Option<i32>,
    /// Timeout percentage in the last 90 days
    #[serde(rename = "timeout_percent", skip_serializing_if = "Option::is_none")]
    pub timeout_percent: Option<f32>,
}

impl ChessStatsRecord {
    /// Summary of all games played
    pub fn new(win: i32, loss: i32, draw: i32) -> ChessStatsRecord {
        ChessStatsRecord {
            win,
            loss,
            draw,
            time_per_move: None,
            timeout_percent: None,
        }
    }
}