lichess-api 1.0.0

A client library for the Lichess API
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use serde::Serialize;

#[derive(Default, Clone, Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct PostQuery {
    pub offering_draw: bool,
}

pub type PostRequest = crate::model::Request<PostQuery>;

impl PostRequest {
    pub fn new(game_id: &str, r#move: &str, offering_draw: bool) -> Self {
        let path = format!("/api/bot/game/{game_id}/move/{move}");
        Self::post(path, PostQuery { offering_draw }, None, None)
    }
}