From d2f50808ef9b96afc36d864adec74f10c9cea9af Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Tue, 19 Jun 2018 18:31:55 -0700 Subject: implement (most) of stats endpoint --- rust/fatcat-api/src/lib.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'rust/fatcat-api/src/lib.rs') diff --git a/rust/fatcat-api/src/lib.rs b/rust/fatcat-api/src/lib.rs index c926966e..fd0cfe54 100644 --- a/rust/fatcat-api/src/lib.rs +++ b/rust/fatcat-api/src/lib.rs @@ -278,6 +278,14 @@ pub enum GetReleaseFilesResponse { GenericError(models::ErrorResponse), } +#[derive(Debug, PartialEq)] +pub enum GetStatsResponse { + /// Success + Success(models::StatsResponse), + /// Generic Error + GenericError(models::ErrorResponse), +} + #[derive(Debug, PartialEq)] pub enum GetWorkResponse { /// Found Entity @@ -394,6 +402,8 @@ pub trait Api { fn get_release_files(&self, id: String, context: &Context) -> Box + Send>; + fn get_stats(&self, more: Option, context: &Context) -> Box + Send>; + fn get_work(&self, id: String, context: &Context) -> Box + Send>; fn get_work_releases(&self, id: String, context: &Context) -> Box + Send>; @@ -451,6 +461,8 @@ pub trait ApiNoContext { fn get_release_files(&self, id: String) -> Box + Send>; + fn get_stats(&self, more: Option) -> Box + Send>; + fn get_work(&self, id: String) -> Box + Send>; fn get_work_releases(&self, id: String) -> Box + Send>; @@ -564,6 +576,10 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { self.api().get_release_files(id, &self.context()) } + fn get_stats(&self, more: Option) -> Box + Send> { + self.api().get_stats(more, &self.context()) + } + fn get_work(&self, id: String) -> Box + Send> { self.api().get_work(id, &self.context()) } -- cgit v1.2.3