shared/api/endpoints/
pdf.rs1pub mod user {
3 use crate::{
4 api::{ApiEndpoint, Method},
5 domain::{
6 pdf::{
7 user::{
8 UserPdfCreatePath, UserPdfDeletePath, UserPdfGetPath, UserPdfListPath,
9 UserPdfListResponse, UserPdfResponse, UserPdfUploadPath, UserPdfUploadRequest,
10 UserPdfUploadResponse,
11 },
12 PdfId,
13 },
14 CreateResponse,
15 },
16 error::EmptyError,
17 };
18
19 pub struct List;
21 impl ApiEndpoint for List {
22 type Path = UserPdfListPath;
23 type Req = ();
24 type Res = UserPdfListResponse;
25 type Err = EmptyError;
26 const METHOD: Method = Method::Get;
27 }
28
29 pub struct Get;
31 impl ApiEndpoint for Get {
32 type Path = UserPdfGetPath;
33 type Req = ();
34 type Res = UserPdfResponse;
35 type Err = EmptyError;
36 const METHOD: Method = Method::Get;
37 }
38
39 pub struct Create;
41 impl ApiEndpoint for Create {
42 type Path = UserPdfCreatePath;
43 type Req = ();
44 type Res = CreateResponse<PdfId>;
45 type Err = EmptyError;
46 const METHOD: Method = Method::Post;
47 }
48
49 pub struct Upload;
54 impl ApiEndpoint for Upload {
55 type Path = UserPdfUploadPath;
56 type Req = UserPdfUploadRequest;
58 type Res = UserPdfUploadResponse;
59 type Err = EmptyError;
60 const METHOD: Method = Method::Put;
61 }
62
63 pub struct Delete;
65 impl ApiEndpoint for Delete {
66 type Path = UserPdfDeletePath;
67 type Req = ();
68 type Res = ();
69 type Err = EmptyError;
70 const METHOD: Method = Method::Delete;
71 }
72}