1use crate::client::error::ApiError;
7use crate::client::types::{ListParams, ReviewQuery};
8use crate::models::{
9 EmailMessage, MailingList, Paginated, PatchId, Patchset, PatchsetDetail, ServerStats,
10};
11
12#[async_trait::async_trait]
18pub trait SashikoApi: Send + Sync {
19 async fn lists(&self) -> Result<Vec<MailingList>, ApiError>;
21
22 async fn patchsets(&self, params: &ListParams) -> Result<Paginated<Patchset>, ApiError>;
24
25 async fn messages(&self, params: &ListParams) -> Result<Paginated<EmailMessage>, ApiError>;
27
28 async fn patch_detail(&self, id: &PatchId) -> Result<PatchsetDetail, ApiError>;
30
31 async fn patchset_summary(&self, id: &PatchId) -> Result<PatchsetDetail, ApiError>;
33
34 async fn message_detail(&self, id: &PatchId) -> Result<EmailMessage, ApiError>;
36
37 async fn review(&self, params: &ReviewQuery) -> Result<serde_json::Value, ApiError>;
39
40 async fn review_log(&self, params: &ReviewQuery) -> Result<serde_json::Value, ApiError>;
42
43 async fn stats(&self) -> Result<ServerStats, ApiError>;
45
46 async fn stats_timeline(
48 &self,
49 subsystem_id: Option<i64>,
50 ) -> Result<serde_json::Value, ApiError>;
51
52 async fn stats_reviews(&self) -> Result<serde_json::Value, ApiError>;
54
55 async fn stats_tools(&self) -> Result<serde_json::Value, ApiError>;
57
58 fn clear_cache(&self) {}
60}