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
17
use crate::model::{Body, Request};
use serde::Serialize;

use super::UpdateExternalEngine;

#[derive(Default, Clone, Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct PutQuery;

pub type PutRequest = Request<PutQuery, UpdateExternalEngine>;

impl PutRequest {
    pub fn new(id: &str, engine: UpdateExternalEngine) -> Self {
        let path = format!("/api/external-engine/{id}");
        Self::put(path, None, Body::Json(engine), None)
    }
}