From c88af3a8a92329a598287b5dd3457030e3b4529f Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Sat, 30 Jun 2018 18:40:27 -0700 Subject: generic changelog endpoints --- rust/fatcat-api/src/lib.rs | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 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 28636d47..ce5674cd 100644 --- a/rust/fatcat-api/src/lib.rs +++ b/rust/fatcat-api/src/lib.rs @@ -174,6 +174,24 @@ pub enum CreateWorkBatchResponse { GenericError(models::ErrorResponse), } +#[derive(Debug, PartialEq)] +pub enum GetChangelogResponse { + /// Success + Success(Vec), + /// Generic Error + GenericError(models::ErrorResponse), +} + +#[derive(Debug, PartialEq)] +pub enum GetChangelogEntryResponse { + /// Found Changelog Entry + FoundChangelogEntry(models::ChangelogEntry), + /// Not Found + NotFound(models::ErrorResponse), + /// Generic Error + GenericError(models::ErrorResponse), +} + #[derive(Debug, PartialEq)] pub enum GetContainerResponse { /// Found Entity @@ -444,6 +462,10 @@ pub trait Api { fn create_work_batch(&self, entity_list: &Vec, context: &Context) -> Box + Send>; + fn get_changelog(&self, limit: Option, context: &Context) -> Box + Send>; + + fn get_changelog_entry(&self, id: i64, context: &Context) -> Box + Send>; + fn get_container(&self, id: String, context: &Context) -> Box + Send>; fn get_container_history(&self, id: String, limit: Option, context: &Context) -> Box + Send>; @@ -513,6 +535,10 @@ pub trait ApiNoContext { fn create_work_batch(&self, entity_list: &Vec) -> Box + Send>; + fn get_changelog(&self, limit: Option) -> Box + Send>; + + fn get_changelog_entry(&self, id: i64) -> Box + Send>; + fn get_container(&self, id: String) -> Box + Send>; fn get_container_history(&self, id: String, limit: Option) -> Box + Send>; @@ -620,6 +646,14 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { self.api().create_work_batch(entity_list, &self.context()) } + fn get_changelog(&self, limit: Option) -> Box + Send> { + self.api().get_changelog(limit, &self.context()) + } + + fn get_changelog_entry(&self, id: i64) -> Box + Send> { + self.api().get_changelog_entry(id, &self.context()) + } + fn get_container(&self, id: String) -> Box + Send> { self.api().get_container(id, &self.context()) } -- cgit v1.2.3