chesscom_openapi/models/
chess_stats_best.rs

1/*
2 * Chess
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 1.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// Best rating achieved by a win
12
13
14
15#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ChessStatsBest {
17    /// Highest rating achieved
18    #[serde(rename = "rating")]
19    pub rating: i32,
20    /// Timestamp of the best-win game
21    #[serde(rename = "date")]
22    #[serde(with = "chrono::serde::ts_seconds")]
23	pub date: chrono::DateTime<chrono::Utc>,
24    /// URL of the best-win game
25    #[serde(rename = "game")]
26    pub game: String,
27}
28
29impl ChessStatsBest {
30    /// Best rating achieved by a win
31    pub fn new(rating: i32, date: chrono::DateTime<chrono::Utc>, game: String) -> ChessStatsBest {
32        ChessStatsBest {
33            rating,
34            date,
35            game,
36        }
37    }
38}
39
40