shared/api/endpoints/user/
fonts.rs

1use super::ApiEndpoint;
2
3use crate::{
4    api::method::Method,
5    domain::user::{
6        UserFontCreatePath, UserFontDeletePath, UserFontGetPath, UserFontNameRequest,
7        UserFontResponse, UserFontUpdatePath,
8    },
9    error::EmptyError,
10};
11
12/// Create a user font.
13///
14/// Appends the font name to the user's list of fonts.
15pub struct Create;
16impl ApiEndpoint for Create {
17    type Req = UserFontNameRequest;
18    type Res = UserFontResponse;
19    type Path = UserFontCreatePath;
20    type Err = EmptyError;
21    const METHOD: Method = Method::Post;
22}
23
24/// Get list of font names for the user.
25pub struct Get;
26impl ApiEndpoint for Get {
27    type Req = ();
28    type Res = UserFontResponse;
29    type Path = UserFontGetPath;
30    type Err = EmptyError;
31    const METHOD: Method = Method::Get;
32}
33
34/// Update a user font.
35pub struct Update;
36impl ApiEndpoint for Update {
37    type Req = UserFontNameRequest;
38    type Res = ();
39    type Path = UserFontUpdatePath;
40    type Err = EmptyError;
41    const METHOD: Method = Method::Patch;
42}
43
44/// Delete a user font.
45pub struct Delete;
46impl ApiEndpoint for Delete {
47    type Req = ();
48    type Res = ();
49    type Path = UserFontDeletePath;
50    type Err = EmptyError;
51    const METHOD: Method = Method::Delete;
52}