aboutsummaryrefslogtreecommitdiffstats
path: root/rust/fatcat-api/src/lib.rs
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-06-30 17:34:22 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-06-30 17:34:22 -0700
commitf4064c19ec140987e15c64e80a3bf0c70025b31b (patch)
treee89548d5d5f350f65e9c294a34c71a2225a14099 /rust/fatcat-api/src/lib.rs
parent3ed7db573438d3620d295813a81237acb91155cb (diff)
downloadfatcat-f4064c19ec140987e15c64e80a3bf0c70025b31b.tar.gz
fatcat-f4064c19ec140987e15c64e80a3bf0c70025b31b.zip
history for container entities
Diffstat (limited to 'rust/fatcat-api/src/lib.rs')
-rw-r--r--rust/fatcat-api/src/lib.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/rust/fatcat-api/src/lib.rs b/rust/fatcat-api/src/lib.rs
index f45e113e..291dcaf4 100644
--- a/rust/fatcat-api/src/lib.rs
+++ b/rust/fatcat-api/src/lib.rs
@@ -187,6 +187,18 @@ pub enum GetContainerResponse {
}
#[derive(Debug, PartialEq)]
+pub enum GetContainerHistoryResponse {
+ /// Found Entity History
+ FoundEntityHistory(Vec<models::EntityHistoryEntry>),
+ /// Bad Request
+ BadRequest(models::ErrorResponse),
+ /// Not Found
+ NotFound(models::ErrorResponse),
+ /// Generic Error
+ GenericError(models::ErrorResponse),
+}
+
+#[derive(Debug, PartialEq)]
pub enum GetCreatorResponse {
/// Found Entity
FoundEntity(models::CreatorEntity),
@@ -386,6 +398,8 @@ pub trait Api {
fn get_container(&self, id: String, context: &Context) -> Box<Future<Item = GetContainerResponse, Error = ApiError> + Send>;
+ fn get_container_history(&self, id: String, limit: Option<i64>, context: &Context) -> Box<Future<Item = GetContainerHistoryResponse, Error = ApiError> + Send>;
+
fn get_creator(&self, id: String, context: &Context) -> Box<Future<Item = GetCreatorResponse, Error = ApiError> + Send>;
fn get_creator_releases(&self, id: String, context: &Context) -> Box<Future<Item = GetCreatorReleasesResponse, Error = ApiError> + Send>;
@@ -445,6 +459,8 @@ pub trait ApiNoContext {
fn get_container(&self, id: String) -> Box<Future<Item = GetContainerResponse, Error = ApiError> + Send>;
+ fn get_container_history(&self, id: String, limit: Option<i64>) -> Box<Future<Item = GetContainerHistoryResponse, Error = ApiError> + Send>;
+
fn get_creator(&self, id: String) -> Box<Future<Item = GetCreatorResponse, Error = ApiError> + Send>;
fn get_creator_releases(&self, id: String) -> Box<Future<Item = GetCreatorReleasesResponse, Error = ApiError> + Send>;
@@ -544,6 +560,10 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> {
self.api().get_container(id, &self.context())
}
+ fn get_container_history(&self, id: String, limit: Option<i64>) -> Box<Future<Item = GetContainerHistoryResponse, Error = ApiError> + Send> {
+ self.api().get_container_history(id, limit, &self.context())
+ }
+
fn get_creator(&self, id: String) -> Box<Future<Item = GetCreatorResponse, Error = ApiError> + Send> {
self.api().get_creator(id, &self.context())
}