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
 */




#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ToMoveGame {
    /// URL of this game
    #[serde(rename = "url")]
    pub url: String,
    /// Timestamp of when the next move must be made
    #[serde(rename = "move_by")]
    #[serde(with = "chrono::serde::ts_seconds")]
	pub move_by: chrono::DateTime<chrono::Utc>,
    /// Player who has made a draw offer (optional)
    #[serde(rename = "draw_offer", skip_serializing_if = "Option::is_none")]
    pub draw_offer: Option<bool>,
    /// Timestamp of the last activity on the game
    #[serde(rename = "last_activity")]
    #[serde(with = "chrono::serde::ts_seconds")]
	pub last_activity: chrono::DateTime<chrono::Utc>,
}

impl ToMoveGame {
    pub fn new(url: String, move_by: chrono::DateTime<chrono::Utc>, last_activity: chrono::DateTime<chrono::Utc>) -> ToMoveGame {
        ToMoveGame {
            url,
            move_by,
            draw_offer: None,
            last_activity,
        }
    }
}