shared/api/endpoints/
media.rs1use crate::{
2 api::Method,
3 domain::media::{
4 MediaCreatePath, MediaIdDeletePath, MediaIdGetPath, MediaUrlDeletePath, MediaUrlGetPath,
5 UrlCreatedResponse, WebMediaMetadataResponse, WebMediaUrlCreateRequest,
6 },
7 error::EmptyError,
8};
9
10use super::ApiEndpoint;
11
12pub struct Create;
15impl ApiEndpoint for Create {
16 type Path = MediaCreatePath;
17 type Req = WebMediaUrlCreateRequest;
18 type Res = UrlCreatedResponse;
19 type Err = EmptyError;
20 const METHOD: Method = Method::Post;
21}
22
23pub struct GetUrl;
25impl ApiEndpoint for GetUrl {
26 type Path = MediaUrlGetPath;
27 type Req = ();
28 type Res = WebMediaMetadataResponse;
29 type Err = EmptyError;
30 const METHOD: Method = Method::Get;
31}
32
33pub struct GetId;
35impl ApiEndpoint for GetId {
36 type Path = MediaIdGetPath;
37 type Req = ();
38 type Res = WebMediaMetadataResponse;
39 type Err = EmptyError;
40 const METHOD: Method = Method::Get;
41}
42
43pub struct DeleteUrl;
45impl ApiEndpoint for DeleteUrl {
46 type Path = MediaUrlDeletePath;
47 type Req = ();
48 type Res = ();
49 type Err = EmptyError;
50 const METHOD: Method = Method::Delete;
51}
52
53pub struct DeleteId;
55impl ApiEndpoint for DeleteId {
56 type Path = MediaIdDeletePath;
57 type Req = ();
58 type Res = ();
59 type Err = EmptyError;
60 const METHOD: Method = Method::Delete;
61}