shared/api/endpoints/
media.rsuse crate::{
api::Method,
domain::media::{
MediaCreatePath, MediaIdDeletePath, MediaIdGetPath, MediaUrlDeletePath, MediaUrlGetPath,
UrlCreatedResponse, WebMediaMetadataResponse, WebMediaUrlCreateRequest,
},
error::EmptyError,
};
use super::ApiEndpoint;
pub struct Create;
impl ApiEndpoint for Create {
type Path = MediaCreatePath;
type Req = WebMediaUrlCreateRequest;
type Res = UrlCreatedResponse;
type Err = EmptyError;
const METHOD: Method = Method::Post;
}
pub struct GetUrl;
impl ApiEndpoint for GetUrl {
type Path = MediaUrlGetPath;
type Req = ();
type Res = WebMediaMetadataResponse;
type Err = EmptyError;
const METHOD: Method = Method::Get;
}
pub struct GetId;
impl ApiEndpoint for GetId {
type Path = MediaIdGetPath;
type Req = ();
type Res = WebMediaMetadataResponse;
type Err = EmptyError;
const METHOD: Method = Method::Get;
}
pub struct DeleteUrl;
impl ApiEndpoint for DeleteUrl {
type Path = MediaUrlDeletePath;
type Req = ();
type Res = ();
type Err = EmptyError;
const METHOD: Method = Method::Delete;
}
pub struct DeleteId;
impl ApiEndpoint for DeleteId {
type Path = MediaIdDeletePath;
type Req = ();
type Res = ();
type Err = EmptyError;
const METHOD: Method = Method::Delete;
}