diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2018-07-20 20:00:16 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2018-07-20 20:00:16 -0700 |
commit | 313f6926a6608e9740924e3ff4fe6dfea2016397 (patch) | |
tree | d8ca08c6e73afa079673fe04ac54d45851f100a8 /rust/fatcat-api/examples | |
parent | 1cd3969ce81470a24f5443e3ea1ad4ce73482288 (diff) | |
download | fatcat-313f6926a6608e9740924e3ff4fe6dfea2016397.tar.gz fatcat-313f6926a6608e9740924e3ff4fe6dfea2016397.zip |
update fatcat-api lib with schema changes
Diffstat (limited to 'rust/fatcat-api/examples')
-rw-r--r-- | rust/fatcat-api/examples/client.rs | 8 | ||||
-rw-r--r-- | rust/fatcat-api/examples/server_lib/server.rs | 16 |
2 files changed, 12 insertions, 12 deletions
diff --git a/rust/fatcat-api/examples/client.rs b/rust/fatcat-api/examples/client.rs index c79110d9..3fa6508e 100644 --- a/rust/fatcat-api/examples/client.rs +++ b/rust/fatcat-api/examples/client.rs @@ -83,7 +83,7 @@ fn main() { match matches.value_of("operation") { Some("AcceptEditgroup") => { - let result = client.accept_editgroup(789).wait(); + let result = client.accept_editgroup("id_example".to_string()).wait(); println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from("<none>"))); } @@ -179,17 +179,17 @@ fn main() { } Some("GetEditgroup") => { - let result = client.get_editgroup(789).wait(); + let result = client.get_editgroup("id_example".to_string()).wait(); println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from("<none>"))); } Some("GetEditor") => { - let result = client.get_editor("username_example".to_string()).wait(); + let result = client.get_editor("id_example".to_string()).wait(); println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from("<none>"))); } Some("GetEditorChangelog") => { - let result = client.get_editor_changelog("username_example".to_string()).wait(); + let result = client.get_editor_changelog("id_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 76d7d13c..608d715f 100644 --- a/rust/fatcat-api/examples/server_lib/server.rs +++ b/rust/fatcat-api/examples/server_lib/server.rs @@ -20,9 +20,9 @@ use fatcat::{AcceptEditgroupResponse, Api, ApiError, Context, CreateContainerBat pub struct Server; impl Api for Server { - fn accept_editgroup(&self, id: i64, context: &Context) -> Box<Future<Item = AcceptEditgroupResponse, Error = ApiError> + Send> { + fn accept_editgroup(&self, id: String, context: &Context) -> Box<Future<Item = AcceptEditgroupResponse, Error = ApiError> + Send> { let context = context.clone(); - println!("accept_editgroup({}) - X-Span-ID: {:?}", id, context.x_span_id.unwrap_or(String::from("<none>")).clone()); + println!("accept_editgroup(\"{}\") - X-Span-ID: {:?}", id, context.x_span_id.unwrap_or(String::from("<none>")).clone()); Box::new(futures::failed("Generic failure".into())) } @@ -148,21 +148,21 @@ impl Api for Server { Box::new(futures::failed("Generic failure".into())) } - fn get_editgroup(&self, id: i64, context: &Context) -> Box<Future<Item = GetEditgroupResponse, Error = ApiError> + Send> { + fn get_editgroup(&self, id: String, context: &Context) -> Box<Future<Item = GetEditgroupResponse, Error = ApiError> + Send> { let context = context.clone(); - println!("get_editgroup({}) - X-Span-ID: {:?}", id, context.x_span_id.unwrap_or(String::from("<none>")).clone()); + println!("get_editgroup(\"{}\") - X-Span-ID: {:?}", id, context.x_span_id.unwrap_or(String::from("<none>")).clone()); Box::new(futures::failed("Generic failure".into())) } - fn get_editor(&self, username: String, context: &Context) -> Box<Future<Item = GetEditorResponse, Error = ApiError> + Send> { + fn get_editor(&self, id: String, context: &Context) -> Box<Future<Item = GetEditorResponse, Error = ApiError> + Send> { let context = context.clone(); - println!("get_editor(\"{}\") - X-Span-ID: {:?}", username, context.x_span_id.unwrap_or(String::from("<none>")).clone()); + println!("get_editor(\"{}\") - X-Span-ID: {:?}", id, context.x_span_id.unwrap_or(String::from("<none>")).clone()); Box::new(futures::failed("Generic failure".into())) } - fn get_editor_changelog(&self, username: String, context: &Context) -> Box<Future<Item = GetEditorChangelogResponse, Error = ApiError> + Send> { + fn get_editor_changelog(&self, id: String, context: &Context) -> Box<Future<Item = GetEditorChangelogResponse, Error = ApiError> + Send> { let context = context.clone(); - println!("get_editor_changelog(\"{}\") - X-Span-ID: {:?}", username, context.x_span_id.unwrap_or(String::from("<none>")).clone()); + println!("get_editor_changelog(\"{}\") - X-Span-ID: {:?}", id, context.x_span_id.unwrap_or(String::from("<none>")).clone()); Box::new(futures::failed("Generic failure".into())) } |