romm_api/endpoints/
tasks.rs1use serde_json::Value;
4
5use super::Endpoint;
6
7#[derive(Debug, Default, Clone)]
9pub struct ListTasks;
10
11impl Endpoint for ListTasks {
12 type Output = Value;
13
14 fn method(&self) -> &'static str {
15 "GET"
16 }
17
18 fn path(&self) -> String {
19 "/api/tasks".into()
20 }
21}
22
23#[derive(Debug, Default, Clone)]
25pub struct RunAllTasks;
26
27impl Endpoint for RunAllTasks {
28 type Output = Value;
29
30 fn method(&self) -> &'static str {
31 "POST"
32 }
33
34 fn path(&self) -> String {
35 "/api/tasks/run".into()
36 }
37}
38
39#[derive(Debug, Default, Clone)]
41pub struct GetTasksStatus;
42
43impl Endpoint for GetTasksStatus {
44 type Output = Value;
45
46 fn method(&self) -> &'static str {
47 "GET"
48 }
49
50 fn path(&self) -> String {
51 "/api/tasks/status".into()
52 }
53}