aboutsummaryrefslogtreecommitdiffstats
path: root/rust/fatcat-api/examples
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-08-24 12:59:28 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-08-24 12:59:28 -0700
commit8528f06157b0e60842c860f81e3f2a69aa07aae9 (patch)
treebb9c291e3ae482f9e39b36560169d0d5dd5b2d45 /rust/fatcat-api/examples
parent54fbdd96193f82adeb3d92095a6955656c67f5e3 (diff)
downloadfatcat-8528f06157b0e60842c860f81e3f2a69aa07aae9.tar.gz
fatcat-8528f06157b0e60842c860f81e3f2a69aa07aae9.zip
WIP: autoaccept
Diffstat (limited to 'rust/fatcat-api/examples')
-rw-r--r--rust/fatcat-api/examples/client.rs10
-rw-r--r--rust/fatcat-api/examples/server_lib/server.rs48
2 files changed, 44 insertions, 14 deletions
diff --git a/rust/fatcat-api/examples/client.rs b/rust/fatcat-api/examples/client.rs
index 06519232..34653196 100644
--- a/rust/fatcat-api/examples/client.rs
+++ b/rust/fatcat-api/examples/client.rs
@@ -95,7 +95,7 @@ fn main() {
// println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from("<none>")));
// },
Some("CreateContainerBatch") => {
- let result = client.create_container_batch(&Vec::new(), Some(true)).wait();
+ let result = client.create_container_batch(&Vec::new(), Some(true), Some("editgroup_example".to_string())).wait();
println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from("<none>")));
}
@@ -105,7 +105,7 @@ fn main() {
// println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from("<none>")));
// },
Some("CreateCreatorBatch") => {
- let result = client.create_creator_batch(&Vec::new(), Some(true)).wait();
+ let result = client.create_creator_batch(&Vec::new(), Some(true), Some("editgroup_example".to_string())).wait();
println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from("<none>")));
}
@@ -121,7 +121,7 @@ fn main() {
// println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from("<none>")));
// },
Some("CreateFileBatch") => {
- let result = client.create_file_batch(&Vec::new(), Some(true)).wait();
+ let result = client.create_file_batch(&Vec::new(), Some(true), Some("editgroup_example".to_string())).wait();
println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from("<none>")));
}
@@ -131,7 +131,7 @@ fn main() {
// println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from("<none>")));
// },
Some("CreateReleaseBatch") => {
- let result = client.create_release_batch(&Vec::new(), Some(true)).wait();
+ let result = client.create_release_batch(&Vec::new(), Some(true), Some("editgroup_example".to_string())).wait();
println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from("<none>")));
}
@@ -141,7 +141,7 @@ fn main() {
// println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from("<none>")));
// },
Some("CreateWorkBatch") => {
- let result = client.create_work_batch(&Vec::new(), Some(true)).wait();
+ let result = client.create_work_batch(&Vec::new(), Some(true), Some("editgroup_example".to_string())).wait();
println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from("<none>")));
}
diff --git a/rust/fatcat-api/examples/server_lib/server.rs b/rust/fatcat-api/examples/server_lib/server.rs
index 32c7e97f..60e19847 100644
--- a/rust/fatcat-api/examples/server_lib/server.rs
+++ b/rust/fatcat-api/examples/server_lib/server.rs
@@ -38,13 +38,15 @@ impl Api for Server {
&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()))
@@ -56,12 +58,19 @@ impl Api for Server {
Box::new(futures::failed("Generic failure".into()))
}
- fn create_creator_batch(&self, entity_list: &Vec<models::CreatorEntity>, autoaccept: Option<bool>, 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: {:?}",
+ "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()))
@@ -79,12 +88,19 @@ impl Api for Server {
Box::new(futures::failed("Generic failure".into()))
}
- fn create_file_batch(&self, entity_list: &Vec<models::FileEntity>, autoaccept: Option<bool>, 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: {:?}",
+ "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()))
@@ -96,12 +112,19 @@ impl Api for Server {
Box::new(futures::failed("Generic failure".into()))
}
- fn create_release_batch(&self, entity_list: &Vec<models::ReleaseEntity>, autoaccept: Option<bool>, 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: {:?}",
+ "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()))
@@ -113,12 +136,19 @@ impl Api for Server {
Box::new(futures::failed("Generic failure".into()))
}
- fn create_work_batch(&self, entity_list: &Vec<models::WorkEntity>, autoaccept: Option<bool>, 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: {:?}",
+ "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()))