lichess_api/model/account/
preferences.rs

1use serde::{Deserialize, 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() -> Self {
10        Self::get("/api/account/preferences", None, None)
11    }
12}
13
14impl Default for GetRequest {
15    fn default() -> Self {
16        Self::new()
17    }
18}
19
20#[derive(Clone, Debug, Deserialize, Serialize)]
21#[serde(rename_all = "camelCase")]
22pub struct UserPreferences {
23    pub dark: bool,
24    pub transp: bool,
25    pub bg_img: String,
26    pub is3d: bool,
27    pub theme: Theme,
28    pub piece_set: PieceSet,
29    pub theme3d: Theme3D,
30    pub piece_set3d: PieceSet3D,
31    pub sound_set: SoundSet,
32    pub blindfold: u32,
33    pub auto_queen: u32,
34    pub auto_threefold: u32,
35    pub takeback: u32,
36    pub moretime: u32,
37    pub clock_tenths: u32,
38    pub clock_bar: bool,
39    pub clock_sound: bool,
40    pub premove: bool,
41    pub animation: u32,
42    pub captured: bool,
43    pub follow: bool,
44    pub highlight: bool,
45    pub destination: bool,
46    pub coords: u32,
47    pub replay: u32,
48    pub challenge: u32,
49    pub message: u32,
50    pub coord_color: u32,
51    pub submit_move: u32,
52    pub confirm_resign: u32,
53    pub insight_share: u32,
54    pub keybord_move: u32,
55    pub zen: u32,
56    pub move_event: u32,
57    pub rook_castle: u32,
58}
59
60#[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize)]
61#[serde(rename_all = "kebab-case")]
62pub enum Theme {
63    Blue,
64    Blue2,
65    Blue3,
66    BlueMarble,
67    Canvas,
68    Wood,
69    Wood2,
70    Wood3,
71    Wood4,
72    Maple,
73    Maple2,
74    Brown,
75    Leather,
76    Green,
77    Marble,
78    GreenPlastic,
79    Grey,
80    Metal,
81    Olive,
82    Newspaper,
83    Purple,
84    PurpleDiag,
85    Pink,
86    Ic,
87}
88
89#[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize)]
90#[serde(rename_all = "lowercase")]
91pub enum PieceSet {
92    Cburnett,
93    Merida,
94    Alpha,
95    Pirouetti,
96    Chessnut,
97    Chess7,
98    Reillycraig,
99    Companion,
100    Riohacha,
101    Kosal,
102    Leipzig,
103    Fantasy,
104    Spatial,
105    California,
106    Pixel,
107    Maestro,
108    Fresca,
109    Cardinal,
110    Gioco,
111    Tatiana,
112    Staunty,
113    Governor,
114    Dubrovny,
115    Icpieces,
116    Shapes,
117    Letter,
118}
119
120#[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize)]
121pub enum Theme3D {
122    #[serde(rename = "Black-White-Aluminium")]
123    BlackWhiteAluminium,
124    #[serde(rename = "Brushed-Aluminium")]
125    BrushedAluminium,
126    #[serde(rename = "China-Blue")]
127    ChinaBlue,
128    #[serde(rename = "China-Green")]
129    ChinaGreen,
130    #[serde(rename = "China-Grey")]
131    ChinaGrey,
132    #[serde(rename = "China-Scarlet")]
133    ChinaScarlet,
134    #[serde(rename = "Classic-Blue")]
135    ClassicBlue,
136    #[serde(rename = "Gold-Silver")]
137    GoldSilver,
138    #[serde(rename = "Light-Wood")]
139    LightWood,
140    #[serde(rename = "Power-Coated")]
141    PowerCoated,
142    Rosewood,
143    Marble,
144    Wax,
145    Jade,
146    Woodi,
147}
148
149#[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize)]
150pub enum PieceSet3D {
151    Basic,
152    Wood,
153    Metal,
154    RedVBlue,
155    ModernJade,
156    ModernWood,
157    Glass,
158    Trimmed,
159    Experimental,
160    Staunton,
161    CubesAndPi,
162}
163
164#[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize)]
165#[serde(rename_all = "lowercase")]
166pub enum SoundSet {
167    Silent,
168    Standard,
169    Piano,
170    Nes,
171    Sfx,
172    Futuristic,
173    Robot,
174    Music,
175    Speech,
176}