shared/api/endpoints/
audio.rspub mod user {
use crate::{
api::{endpoints::ApiEndpoint, Method},
domain::{
audio::{
user::{
UserAudioCreatePath, UserAudioDeletePath, UserAudioGetPath, UserAudioListPath,
UserAudioListResponse, UserAudioResponse, UserAudioUploadPath,
UserAudioUploadRequest, UserAudioUploadResponse,
},
AudioId,
},
CreateResponse,
},
error::EmptyError,
};
pub struct List;
impl ApiEndpoint for List {
type Path = UserAudioListPath;
type Req = ();
type Res = UserAudioListResponse;
type Err = EmptyError;
const METHOD: Method = Method::Get;
}
pub struct Get;
impl ApiEndpoint for Get {
type Path = UserAudioGetPath;
type Req = ();
type Res = UserAudioResponse;
type Err = EmptyError;
const METHOD: Method = Method::Get;
}
pub struct Create;
impl ApiEndpoint for Create {
type Path = UserAudioCreatePath;
type Req = ();
type Res = CreateResponse<AudioId>;
type Err = EmptyError;
const METHOD: Method = Method::Post;
}
pub struct Upload;
impl ApiEndpoint for Upload {
type Path = UserAudioUploadPath;
type Req = UserAudioUploadRequest;
type Res = UserAudioUploadResponse;
type Err = EmptyError;
const METHOD: Method = Method::Put;
}
pub struct Delete;
impl ApiEndpoint for Delete {
type Path = UserAudioDeletePath;
type Req = ();
type Res = ();
type Err = EmptyError;
const METHOD: Method = Method::Delete;
}
}