lichess_api/model/puzzles/id.rs
1use serde::Serialize;
2
3#[derive(Default, Clone, Debug, Serialize)]
4pub struct GetQuery;
5
6pub type GetRequest = crate::model::Request<GetQuery>;
7
8impl GetRequest {
9 pub fn new(id: &str) -> Self {
10 Self::get(format!("/api/puzzle/{id}"), None, None)
11 }
12}
13
14impl<S: AsRef<str>> From<S> for GetRequest {
15 fn from(s: S) -> Self {
16 Self::new(s.as_ref())
17 }
18}
19
20pub type Puzzle = super::PuzzleAndGame;