summaryrefslogtreecommitdiffstats
path: root/rust/fatcat-api/examples/server_lib/server.rs
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-09-07 21:51:31 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-09-07 21:51:31 -0700
commitd2070ba3718978a9615ae2aa3d81825803522a91 (patch)
treef62fe241fdbbd32180e582bd5533582558c6b979 /rust/fatcat-api/examples/server_lib/server.rs
parent20c5cf5a8b9acf98db7487ab49de8dcbc1ddb2f9 (diff)
parent8cccbcdef11e7ddc761ec494cb894a8d49a0d510 (diff)
downloadfatcat-d2070ba3718978a9615ae2aa3d81825803522a91.tar.gz
fatcat-d2070ba3718978a9615ae2aa3d81825803522a91.zip
Merge branch 'autoaccept' into http-verbs
Started resolving conflicts in: TODO notes/cloud_instances.txt rust/fatcat-api/README.md rust/src/api_server.rs
Diffstat (limited to 'rust/fatcat-api/examples/server_lib/server.rs')
-rw-r--r--rust/fatcat-api/examples/server_lib/server.rs76
1 files changed, 66 insertions, 10 deletions
diff --git a/rust/fatcat-api/examples/server_lib/server.rs b/rust/fatcat-api/examples/server_lib/server.rs
index af3ece12..ab08f594 100644
--- a/rust/fatcat-api/examples/server_lib/server.rs
+++ b/rust/fatcat-api/examples/server_lib/server.rs
@@ -35,11 +35,19 @@ impl Api for Server {
Box::new(futures::failed("Generic failure".into()))
}
- fn create_container_batch(&self, entity_list: &Vec<models::ContainerEntity>, context: &Context) -> Box<Future<Item = CreateContainerBatchResponse, Error = ApiError> + Send> {
+ fn create_container_batch(
+ &self,
+ entity_list: &Vec<models::ContainerEntity>,
+ autoaccept: Option<bool>,
+ editgroup: Option<String>,
+ context: &Context,
+ ) -> Box<Future<Item = CreateContainerBatchResponse, Error = ApiError> + Send> {
let context = context.clone();
println!(
- "create_container_batch({:?}) - X-Span-ID: {:?}",
+ "create_container_batch({:?}, {:?}, {:?}) - X-Span-ID: {:?}",
entity_list,
+ autoaccept,
+ editgroup,
context.x_span_id.unwrap_or(String::from("<none>")).clone()
);
Box::new(futures::failed("Generic failure".into()))
@@ -51,9 +59,21 @@ impl Api for Server {
Box::new(futures::failed("Generic failure".into()))
}
- fn create_creator_batch(&self, entity_list: &Vec<models::CreatorEntity>, context: &Context) -> Box<Future<Item = CreateCreatorBatchResponse, Error = ApiError> + Send> {
+ fn create_creator_batch(
+ &self,
+ entity_list: &Vec<models::CreatorEntity>,
+ autoaccept: Option<bool>,
+ editgroup: Option<String>,
+ context: &Context,
+ ) -> Box<Future<Item = CreateCreatorBatchResponse, Error = ApiError> + Send> {
let context = context.clone();
- println!("create_creator_batch({:?}) - X-Span-ID: {:?}", entity_list, context.x_span_id.unwrap_or(String::from("<none>")).clone());
+ println!(
+ "create_creator_batch({:?}, {:?}, {:?}) - X-Span-ID: {:?}",
+ entity_list,
+ autoaccept,
+ editgroup,
+ context.x_span_id.unwrap_or(String::from("<none>")).clone()
+ );
Box::new(futures::failed("Generic failure".into()))
}
@@ -69,9 +89,21 @@ impl Api for Server {
Box::new(futures::failed("Generic failure".into()))
}
- fn create_file_batch(&self, entity_list: &Vec<models::FileEntity>, context: &Context) -> Box<Future<Item = CreateFileBatchResponse, Error = ApiError> + Send> {
+ fn create_file_batch(
+ &self,
+ entity_list: &Vec<models::FileEntity>,
+ autoaccept: Option<bool>,
+ editgroup: Option<String>,
+ context: &Context,
+ ) -> Box<Future<Item = CreateFileBatchResponse, Error = ApiError> + Send> {
let context = context.clone();
- println!("create_file_batch({:?}) - X-Span-ID: {:?}", entity_list, context.x_span_id.unwrap_or(String::from("<none>")).clone());
+ println!(
+ "create_file_batch({:?}, {:?}, {:?}) - X-Span-ID: {:?}",
+ entity_list,
+ autoaccept,
+ editgroup,
+ context.x_span_id.unwrap_or(String::from("<none>")).clone()
+ );
Box::new(futures::failed("Generic failure".into()))
}
@@ -81,9 +113,21 @@ impl Api for Server {
Box::new(futures::failed("Generic failure".into()))
}
- fn create_release_batch(&self, entity_list: &Vec<models::ReleaseEntity>, context: &Context) -> Box<Future<Item = CreateReleaseBatchResponse, Error = ApiError> + Send> {
+ fn create_release_batch(
+ &self,
+ entity_list: &Vec<models::ReleaseEntity>,
+ autoaccept: Option<bool>,
+ editgroup: Option<String>,
+ context: &Context,
+ ) -> Box<Future<Item = CreateReleaseBatchResponse, Error = ApiError> + Send> {
let context = context.clone();
- println!("create_release_batch({:?}) - X-Span-ID: {:?}", entity_list, context.x_span_id.unwrap_or(String::from("<none>")).clone());
+ println!(
+ "create_release_batch({:?}, {:?}, {:?}) - X-Span-ID: {:?}",
+ entity_list,
+ autoaccept,
+ editgroup,
+ context.x_span_id.unwrap_or(String::from("<none>")).clone()
+ );
Box::new(futures::failed("Generic failure".into()))
}
@@ -93,9 +137,21 @@ impl Api for Server {
Box::new(futures::failed("Generic failure".into()))
}
- fn create_work_batch(&self, entity_list: &Vec<models::WorkEntity>, context: &Context) -> Box<Future<Item = CreateWorkBatchResponse, Error = ApiError> + Send> {
+ fn create_work_batch(
+ &self,
+ entity_list: &Vec<models::WorkEntity>,
+ autoaccept: Option<bool>,
+ editgroup: Option<String>,
+ context: &Context,
+ ) -> Box<Future<Item = CreateWorkBatchResponse, Error = ApiError> + Send> {
let context = context.clone();
- println!("create_work_batch({:?}) - X-Span-ID: {:?}", entity_list, context.x_span_id.unwrap_or(String::from("<none>")).clone());
+ println!(
+ "create_work_batch({:?}, {:?}, {:?}) - X-Span-ID: {:?}",
+ entity_list,
+ autoaccept,
+ editgroup,
+ context.x_span_id.unwrap_or(String::from("<none>")).clone()
+ );
Box::new(futures::failed("Generic failure".into()))
}