1use std::error::Error;
2
3use crate::api::Method;
4pub use macros::{make_path_parts, PathPart};
5use serde::{de::DeserializeOwned, Serialize};
6use url::Url;
7use uuid::Uuid;
8
9pub trait ApiEndpoint {
13 type Path: PathParts;
15
16 type Req: Serialize;
18
19 type Res: DeserializeOwned + Serialize + 'static;
21
22 type Err: DeserializeOwned + Serialize + Error + 'static;
24
25 const METHOD: Method;
27}
28
29pub mod search;
31
32pub mod animation;
34
35pub mod category;
37
38pub mod image;
40
41pub mod meta;
43
44pub mod user;
46
47pub mod jig;
49
50pub mod admin;
52
53pub mod audio;
55
56pub mod media;
58
59pub mod session;
61
62pub mod locale;
64
65pub mod pdf;
67
68pub mod playlist;
70
71pub mod additional_resource;
73
74pub mod resource;
76
77pub mod circle;
79
80pub mod module;
82
83pub mod course;
85
86pub mod billing;
88
89pub mod account;
91
92pub trait PathPart {
94 fn get_path_string(&self) -> String;
96}
97
98pub trait PathParts {
100 const PATH: &'static str;
102
103 fn get_filled(&self) -> String;
105}
106
107impl PathPart for Uuid {
110 fn get_path_string(&self) -> String {
111 self.to_string()
112 }
113}
114
115impl PathPart for Url {
116 fn get_path_string(&self) -> String {
117 todo!();
119 }
120}
121
122impl PathPart for i32 {
123 fn get_path_string(&self) -> String {
124 self.to_string()
125 }
126}
127
128impl PathPart for u32 {
129 fn get_path_string(&self) -> String {
130 self.to_string()
131 }
132}
133
134impl PathPart for i16 {
135 fn get_path_string(&self) -> String {
136 self.to_string()
137 }
138}