shared/api/endpoints/
audio.rs1pub mod user {
3 use crate::{
4 api::{endpoints::ApiEndpoint, Method},
5 domain::{
6 audio::{
7 user::{
8 UserAudioCreatePath, UserAudioDeletePath, UserAudioGetPath, UserAudioListPath,
9 UserAudioListResponse, UserAudioResponse, UserAudioUploadPath,
10 UserAudioUploadRequest, UserAudioUploadResponse,
11 },
12 AudioId,
13 },
14 CreateResponse,
15 },
16 error::EmptyError,
17 };
18
19 pub struct List;
21 impl ApiEndpoint for List {
22 type Path = UserAudioListPath;
23 type Req = ();
24 type Res = UserAudioListResponse;
25 type Err = EmptyError;
26 const METHOD: Method = Method::Get;
27 }
28
29 pub struct Get;
31 impl ApiEndpoint for Get {
32 type Path = UserAudioGetPath;
33 type Req = ();
34 type Res = UserAudioResponse;
35 type Err = EmptyError;
36 const METHOD: Method = Method::Get;
37 }
38 pub struct Create;
40 impl ApiEndpoint for Create {
41 type Path = UserAudioCreatePath;
42 type Req = ();
43 type Res = CreateResponse<AudioId>;
44 type Err = EmptyError;
45 const METHOD: Method = Method::Post;
46 }
47
48 pub struct Upload;
53 impl ApiEndpoint for Upload {
54 type Path = UserAudioUploadPath;
56 type Req = UserAudioUploadRequest;
57 type Res = UserAudioUploadResponse;
58 type Err = EmptyError;
59 const METHOD: Method = Method::Put;
60 }
61
62 pub struct Delete;
64 impl ApiEndpoint for Delete {
65 type Path = UserAudioDeletePath;
66 type Req = ();
67 type Res = ();
68 type Err = EmptyError;
69 const METHOD: Method = Method::Delete;
70 }
71}