romm_cli/endpoints/mod.rs
1use serde_json::Value;
2
3pub mod client_tokens;
4pub mod collections;
5pub mod platforms;
6pub mod roms;
7pub mod system;
8pub mod tasks;
9
10/// Generic description of a ROMM API endpoint.
11pub trait Endpoint {
12 type Output;
13
14 /// HTTP method, e.g. "GET", "POST".
15 fn method(&self) -> &'static str;
16
17 /// Path relative to the base URL, e.g. "/api/roms".
18 fn path(&self) -> String;
19
20 /// Query parameters as key/value pairs.
21 fn query(&self) -> Vec<(String, String)> {
22 Vec::new()
23 }
24
25 /// Optional JSON request body.
26 fn body(&self) -> Option<Value> {
27 None
28 }
29}