aboutsummaryrefslogtreecommitdiffstats
path: root/rust/fatcat-api-spec/examples/server_lib
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-01-22 21:41:35 -0800
committerBryan Newbold <bnewbold@robocracy.org>2019-01-22 21:50:29 -0800
commit09475b87821142c5cd36c6b90fb97deb2a058312 (patch)
tree2f57b9623a8f8938e8d13b4441e8861b19e6e533 /rust/fatcat-api-spec/examples/server_lib
parent83d5c49f5093b1820b625e1b3a1e21fc7242f79e (diff)
downloadfatcat-09475b87821142c5cd36c6b90fb97deb2a058312.tar.gz
fatcat-09475b87821142c5cd36c6b90fb97deb2a058312.zip
allow passing description+extra to batch endpoints
Pretty messy, but I needed some way to do this. In particular, requires json.dumps() in python code, for now. Blech.
Diffstat (limited to 'rust/fatcat-api-spec/examples/server_lib')
-rw-r--r--rust/fatcat-api-spec/examples/server_lib/server.rs42
1 files changed, 35 insertions, 7 deletions
diff --git a/rust/fatcat-api-spec/examples/server_lib/server.rs b/rust/fatcat-api-spec/examples/server_lib/server.rs
index 20336528..98f31485 100644
--- a/rust/fatcat-api-spec/examples/server_lib/server.rs
+++ b/rust/fatcat-api-spec/examples/server_lib/server.rs
@@ -46,14 +46,18 @@ impl Api for Server {
entity_list: &Vec<models::ContainerEntity>,
autoaccept: Option<bool>,
editgroup_id: Option<String>,
+ description: Option<String>,
+ extra: 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_id,
+ description,
+ extra,
context.x_span_id.unwrap_or(String::from("<none>")).clone()
);
Box::new(futures::failed("Generic failure".into()))
@@ -171,14 +175,18 @@ impl Api for Server {
entity_list: &Vec<models::CreatorEntity>,
autoaccept: Option<bool>,
editgroup_id: Option<String>,
+ description: Option<String>,
+ extra: Option<String>,
context: &Context,
) -> Box<Future<Item = CreateCreatorBatchResponse, Error = ApiError> + Send> {
let context = context.clone();
println!(
- "create_creator_batch({:?}, {:?}, {:?}) - X-Span-ID: {:?}",
+ "create_creator_batch({:?}, {:?}, {:?}, {:?}, {:?}) - X-Span-ID: {:?}",
entity_list,
autoaccept,
editgroup_id,
+ description,
+ extra,
context.x_span_id.unwrap_or(String::from("<none>")).clone()
);
Box::new(futures::failed("Generic failure".into()))
@@ -465,14 +473,18 @@ impl Api for Server {
entity_list: &Vec<models::FileEntity>,
autoaccept: Option<bool>,
editgroup_id: Option<String>,
+ description: Option<String>,
+ extra: Option<String>,
context: &Context,
) -> Box<Future<Item = CreateFileBatchResponse, Error = ApiError> + Send> {
let context = context.clone();
println!(
- "create_file_batch({:?}, {:?}, {:?}) - X-Span-ID: {:?}",
+ "create_file_batch({:?}, {:?}, {:?}, {:?}, {:?}) - X-Span-ID: {:?}",
entity_list,
autoaccept,
editgroup_id,
+ description,
+ extra,
context.x_span_id.unwrap_or(String::from("<none>")).clone()
);
Box::new(futures::failed("Generic failure".into()))
@@ -592,14 +604,18 @@ impl Api for Server {
entity_list: &Vec<models::FilesetEntity>,
autoaccept: Option<bool>,
editgroup_id: Option<String>,
+ description: Option<String>,
+ extra: Option<String>,
context: &Context,
) -> Box<Future<Item = CreateFilesetBatchResponse, Error = ApiError> + Send> {
let context = context.clone();
println!(
- "create_fileset_batch({:?}, {:?}, {:?}) - X-Span-ID: {:?}",
+ "create_fileset_batch({:?}, {:?}, {:?}, {:?}, {:?}) - X-Span-ID: {:?}",
entity_list,
autoaccept,
editgroup_id,
+ description,
+ extra,
context.x_span_id.unwrap_or(String::from("<none>")).clone()
);
Box::new(futures::failed("Generic failure".into()))
@@ -697,14 +713,18 @@ impl Api for Server {
entity_list: &Vec<models::ReleaseEntity>,
autoaccept: Option<bool>,
editgroup_id: Option<String>,
+ description: Option<String>,
+ extra: Option<String>,
context: &Context,
) -> Box<Future<Item = CreateReleaseBatchResponse, Error = ApiError> + Send> {
let context = context.clone();
println!(
- "create_release_batch({:?}, {:?}, {:?}) - X-Span-ID: {:?}",
+ "create_release_batch({:?}, {:?}, {:?}, {:?}, {:?}) - X-Span-ID: {:?}",
entity_list,
autoaccept,
editgroup_id,
+ description,
+ extra,
context.x_span_id.unwrap_or(String::from("<none>")).clone()
);
Box::new(futures::failed("Generic failure".into()))
@@ -878,14 +898,18 @@ impl Api for Server {
entity_list: &Vec<models::WebcaptureEntity>,
autoaccept: Option<bool>,
editgroup_id: Option<String>,
+ description: Option<String>,
+ extra: Option<String>,
context: &Context,
) -> Box<Future<Item = CreateWebcaptureBatchResponse, Error = ApiError> + Send> {
let context = context.clone();
println!(
- "create_webcapture_batch({:?}, {:?}, {:?}) - X-Span-ID: {:?}",
+ "create_webcapture_batch({:?}, {:?}, {:?}, {:?}, {:?}) - X-Span-ID: {:?}",
entity_list,
autoaccept,
editgroup_id,
+ description,
+ extra,
context.x_span_id.unwrap_or(String::from("<none>")).clone()
);
Box::new(futures::failed("Generic failure".into()))
@@ -972,14 +996,18 @@ impl Api for Server {
entity_list: &Vec<models::WorkEntity>,
autoaccept: Option<bool>,
editgroup_id: Option<String>,
+ description: Option<String>,
+ extra: Option<String>,
context: &Context,
) -> Box<Future<Item = CreateWorkBatchResponse, Error = ApiError> + Send> {
let context = context.clone();
println!(
- "create_work_batch({:?}, {:?}, {:?}) - X-Span-ID: {:?}",
+ "create_work_batch({:?}, {:?}, {:?}, {:?}, {:?}) - X-Span-ID: {:?}",
entity_list,
autoaccept,
editgroup_id,
+ description,
+ extra,
context.x_span_id.unwrap_or(String::from("<none>")).clone()
);
Box::new(futures::failed("Generic failure".into()))