Skip to main content

lichess_api/model/challenges/
show.rs

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