1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
 * 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
 */

/// ChessStatsRecord : 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,
    /// integer 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,
        }
    }
}