chesscom_openapi/models/
to_move_game.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
12
13
14#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
15pub struct ToMoveGame {
16    /// URL of this game
17    #[serde(rename = "url")]
18    pub url: String,
19    /// Timestamp of when the next move must be made
20    #[serde(rename = "move_by")]
21    #[serde(with = "chrono::serde::ts_seconds")]
22	pub move_by: chrono::DateTime<chrono::Utc>,
23    /// Player who has made a draw offer (optional)
24    #[serde(rename = "draw_offer", skip_serializing_if = "Option::is_none")]
25    pub draw_offer: Option<bool>,
26    /// Timestamp of the last activity on the game
27    #[serde(rename = "last_activity")]
28    #[serde(with = "chrono::serde::ts_seconds")]
29	pub last_activity: chrono::DateTime<chrono::Utc>,
30}
31
32impl ToMoveGame {
33    pub fn new(url: String, move_by: chrono::DateTime<chrono::Utc>, last_activity: chrono::DateTime<chrono::Utc>) -> ToMoveGame {
34        ToMoveGame {
35            url,
36            move_by,
37            draw_offer: None,
38            last_activity,
39        }
40    }
41}
42
43