#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ToMoveGame {
#[serde(rename = "url")]
pub url: String,
#[serde(rename = "move_by")]
#[serde(with = "chrono::serde::ts_seconds")]
pub move_by: chrono::DateTime<chrono::Utc>,
#[serde(rename = "draw_offer", skip_serializing_if = "Option::is_none")]
pub draw_offer: Option<bool>,
#[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,
}
}
}