lichess_api/model/users/
status.rs

1use crate::model::Title;
2use serde::{Deserialize, Serialize};
3
4#[derive(Default, Clone, Debug, Serialize)]
5#[serde(rename_all = "camelCase")]
6pub struct GetQuery {
7    pub ids: String,
8    pub with_game_ids: bool,
9}
10
11pub type GetRequest = crate::model::Request<GetQuery>;
12
13impl GetRequest {
14    pub fn new(user_ids: Vec<String>, with_game_ids: bool) -> Self {
15        Self::get(
16            "/api/users/status",
17            Some(GetQuery {
18                ids: user_ids.join(","),
19                with_game_ids,
20            }),
21            None,
22        )
23    }
24}
25
26#[serde_with::skip_serializing_none]
27#[derive(Clone, Debug, Deserialize, Serialize)]
28pub struct User {
29    pub id: String,
30    pub name: String,
31    pub flair: Option<String>,
32    pub title: Option<Title>,
33    pub online: Option<bool>,
34    pub playing: Option<bool>,
35    pub streaming: Option<bool>,
36    pub patron: Option<bool>,
37}