shared/api/endpoints/
circle.rsuse crate::{
api::Method,
domain::{
circle::{
BrowseMembersQuery, BrowseMembersResponse, Circle, CircleBrowseMembersPath,
CircleBrowsePath, CircleBrowseQuery, CircleBrowseResponse, CircleCreatePath,
CircleCreateRequest, CircleDeletePath, CircleGetPath, CircleId, CircleRemoveMemberPath,
CircleSearchPath, CircleSearchQuery, CircleSearchResponse, CircleUpdateRequest,
JoinCirclePath, LeaveCirclePath, UpdateCirclePath,
},
CreateResponse,
},
error::EmptyError,
};
use super::ApiEndpoint;
pub struct Create;
impl ApiEndpoint for Create {
type Req = CircleCreateRequest;
type Res = CreateResponse<CircleId>;
type Path = CircleCreatePath;
type Err = EmptyError;
const METHOD: Method = Method::Post;
}
pub struct Update;
impl ApiEndpoint for Update {
type Req = CircleUpdateRequest;
type Res = ();
type Path = UpdateCirclePath;
type Err = EmptyError;
const METHOD: Method = Method::Patch;
}
pub struct Browse;
impl ApiEndpoint for Browse {
type Req = CircleBrowseQuery;
type Res = CircleBrowseResponse;
type Path = CircleBrowsePath;
type Err = EmptyError;
const METHOD: Method = Method::Get;
}
pub struct Search;
impl ApiEndpoint for Search {
type Req = CircleSearchQuery;
type Res = CircleSearchResponse;
type Path = CircleSearchPath;
type Err = EmptyError;
const METHOD: Method = Method::Get;
}
pub struct Delete;
impl ApiEndpoint for Delete {
type Req = ();
type Res = ();
type Path = CircleDeletePath;
type Err = EmptyError;
const METHOD: Method = Method::Delete;
}
pub struct Get;
impl ApiEndpoint for Get {
type Req = ();
type Res = Circle;
type Path = CircleGetPath;
type Err = EmptyError;
const METHOD: Method = Method::Get;
}
pub struct JoinCircle;
impl ApiEndpoint for JoinCircle {
type Req = ();
type Res = ();
type Path = JoinCirclePath;
type Err = EmptyError;
const METHOD: Method = Method::Post;
}
pub struct LeaveCircle;
impl ApiEndpoint for LeaveCircle {
type Req = ();
type Res = ();
type Path = LeaveCirclePath;
type Err = EmptyError;
const METHOD: Method = Method::Delete;
}
pub struct RemoveMember;
impl ApiEndpoint for RemoveMember {
type Req = ();
type Res = ();
type Path = CircleRemoveMemberPath;
type Err = EmptyError;
const METHOD: Method = Method::Delete;
}
pub struct BrowseMembers;
impl ApiEndpoint for BrowseMembers {
type Req = BrowseMembersQuery;
type Res = BrowseMembersResponse;
type Path = CircleBrowseMembersPath;
type Err = EmptyError;
const METHOD: Method = Method::Get;
}