From a82cffed703665496913d9ca0155e888ec35716b Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Sat, 30 Jun 2018 17:53:28 -0700 Subject: add remaining history endpoints --- rust/fatcat-api/examples/server_lib/server.rs | 49 +++++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 2 deletions(-) (limited to 'rust/fatcat-api/examples/server_lib/server.rs') diff --git a/rust/fatcat-api/examples/server_lib/server.rs b/rust/fatcat-api/examples/server_lib/server.rs index 0155782b..062fca02 100644 --- a/rust/fatcat-api/examples/server_lib/server.rs +++ b/rust/fatcat-api/examples/server_lib/server.rs @@ -12,8 +12,9 @@ use swagger; use fatcat::models; use fatcat::{AcceptEditgroupResponse, Api, ApiError, Context, CreateContainerBatchResponse, CreateContainerResponse, CreateCreatorBatchResponse, CreateCreatorResponse, CreateEditgroupResponse, CreateFileBatchResponse, CreateFileResponse, CreateReleaseBatchResponse, CreateReleaseResponse, CreateWorkBatchResponse, CreateWorkResponse, GetContainerHistoryResponse, - GetContainerResponse, GetCreatorReleasesResponse, GetCreatorResponse, GetEditgroupResponse, GetEditorChangelogResponse, GetEditorResponse, GetFileResponse, GetReleaseFilesResponse, - GetReleaseResponse, GetStatsResponse, GetWorkReleasesResponse, GetWorkResponse, LookupContainerResponse, LookupCreatorResponse, LookupFileResponse, LookupReleaseResponse}; + GetContainerResponse, GetCreatorHistoryResponse, GetCreatorReleasesResponse, GetCreatorResponse, GetEditgroupResponse, GetEditorChangelogResponse, GetEditorResponse, + GetFileHistoryResponse, GetFileResponse, GetReleaseFilesResponse, GetReleaseHistoryResponse, GetReleaseResponse, GetStatsResponse, GetWorkHistoryResponse, GetWorkReleasesResponse, + GetWorkResponse, LookupContainerResponse, LookupCreatorResponse, LookupFileResponse, LookupReleaseResponse}; #[derive(Copy, Clone)] pub struct Server; @@ -118,6 +119,17 @@ impl Api for Server { Box::new(futures::failed("Generic failure".into())) } + fn get_creator_history(&self, id: String, limit: Option, context: &Context) -> Box + Send> { + let context = context.clone(); + println!( + "get_creator_history(\"{}\", {:?}) - X-Span-ID: {:?}", + id, + limit, + context.x_span_id.unwrap_or(String::from("")).clone() + ); + Box::new(futures::failed("Generic failure".into())) + } + fn get_creator_releases(&self, id: String, context: &Context) -> Box + Send> { let context = context.clone(); println!("get_creator_releases(\"{}\") - X-Span-ID: {:?}", id, context.x_span_id.unwrap_or(String::from("")).clone()); @@ -148,6 +160,17 @@ impl Api for Server { Box::new(futures::failed("Generic failure".into())) } + fn get_file_history(&self, id: String, limit: Option, context: &Context) -> Box + Send> { + let context = context.clone(); + println!( + "get_file_history(\"{}\", {:?}) - X-Span-ID: {:?}", + id, + limit, + context.x_span_id.unwrap_or(String::from("")).clone() + ); + Box::new(futures::failed("Generic failure".into())) + } + fn get_release(&self, id: String, context: &Context) -> Box + Send> { let context = context.clone(); println!("get_release(\"{}\") - X-Span-ID: {:?}", id, context.x_span_id.unwrap_or(String::from("")).clone()); @@ -160,6 +183,17 @@ impl Api for Server { Box::new(futures::failed("Generic failure".into())) } + fn get_release_history(&self, id: String, limit: Option, context: &Context) -> Box + Send> { + let context = context.clone(); + println!( + "get_release_history(\"{}\", {:?}) - X-Span-ID: {:?}", + id, + limit, + context.x_span_id.unwrap_or(String::from("")).clone() + ); + Box::new(futures::failed("Generic failure".into())) + } + fn get_stats(&self, more: Option, context: &Context) -> Box + Send> { let context = context.clone(); println!("get_stats({:?}) - X-Span-ID: {:?}", more, context.x_span_id.unwrap_or(String::from("")).clone()); @@ -172,6 +206,17 @@ impl Api for Server { Box::new(futures::failed("Generic failure".into())) } + fn get_work_history(&self, id: String, limit: Option, context: &Context) -> Box + Send> { + let context = context.clone(); + println!( + "get_work_history(\"{}\", {:?}) - X-Span-ID: {:?}", + id, + limit, + context.x_span_id.unwrap_or(String::from("")).clone() + ); + Box::new(futures::failed("Generic failure".into())) + } + fn get_work_releases(&self, id: String, context: &Context) -> Box + Send> { let context = context.clone(); println!("get_work_releases(\"{}\") - X-Span-ID: {:?}", id, context.x_span_id.unwrap_or(String::from("")).clone()); -- cgit v1.2.3