From 09475b87821142c5cd36c6b90fb97deb2a058312 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Tue, 22 Jan 2019 21:41:35 -0800 Subject: 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. --- rust/fatcat-api-spec/src/lib.rs | 84 +++++++++++++++++++++++++++++++++++------ 1 file changed, 73 insertions(+), 11 deletions(-) (limited to 'rust/fatcat-api-spec/src/lib.rs') diff --git a/rust/fatcat-api-spec/src/lib.rs b/rust/fatcat-api-spec/src/lib.rs index 20e53f62..59129869 100644 --- a/rust/fatcat-api-spec/src/lib.rs +++ b/rust/fatcat-api-spec/src/lib.rs @@ -1345,6 +1345,8 @@ pub trait Api { entity_list: &Vec, autoaccept: Option, editgroup_id: Option, + description: Option, + extra: Option, context: &Context, ) -> Box + Send>; @@ -1380,6 +1382,8 @@ pub trait Api { entity_list: &Vec, autoaccept: Option, editgroup_id: Option, + description: Option, + extra: Option, context: &Context, ) -> Box + Send>; @@ -1473,6 +1477,8 @@ pub trait Api { entity_list: &Vec, autoaccept: Option, editgroup_id: Option, + description: Option, + extra: Option, context: &Context, ) -> Box + Send>; @@ -1509,6 +1515,8 @@ pub trait Api { entity_list: &Vec, autoaccept: Option, editgroup_id: Option, + description: Option, + extra: Option, context: &Context, ) -> Box + Send>; @@ -1535,6 +1543,8 @@ pub trait Api { entity_list: &Vec, autoaccept: Option, editgroup_id: Option, + description: Option, + extra: Option, context: &Context, ) -> Box + Send>; @@ -1584,6 +1594,8 @@ pub trait Api { entity_list: &Vec, autoaccept: Option, editgroup_id: Option, + description: Option, + extra: Option, context: &Context, ) -> Box + Send>; @@ -1608,6 +1620,8 @@ pub trait Api { entity_list: &Vec, autoaccept: Option, editgroup_id: Option, + description: Option, + extra: Option, context: &Context, ) -> Box + Send>; @@ -1639,6 +1653,8 @@ pub trait ApiNoContext { entity_list: &Vec, autoaccept: Option, editgroup_id: Option, + description: Option, + extra: Option, ) -> Box + Send>; fn delete_container(&self, ident: String, editgroup_id: String) -> Box + Send>; @@ -1672,6 +1688,8 @@ pub trait ApiNoContext { entity_list: &Vec, autoaccept: Option, editgroup_id: Option, + description: Option, + extra: Option, ) -> Box + Send>; fn delete_creator(&self, ident: String, editgroup_id: String) -> Box + Send>; @@ -1744,7 +1762,14 @@ pub trait ApiNoContext { fn create_file(&self, entity: models::FileEntity, editgroup_id: String) -> Box + Send>; - fn create_file_batch(&self, entity_list: &Vec, autoaccept: Option, editgroup_id: Option) -> Box + Send>; + fn create_file_batch( + &self, + entity_list: &Vec, + autoaccept: Option, + editgroup_id: Option, + description: Option, + extra: Option, + ) -> Box + Send>; fn delete_file(&self, ident: String, editgroup_id: String) -> Box + Send>; @@ -1778,6 +1803,8 @@ pub trait ApiNoContext { entity_list: &Vec, autoaccept: Option, editgroup_id: Option, + description: Option, + extra: Option, ) -> Box + Send>; fn delete_fileset(&self, ident: String, editgroup_id: String) -> Box + Send>; @@ -1803,6 +1830,8 @@ pub trait ApiNoContext { entity_list: &Vec, autoaccept: Option, editgroup_id: Option, + description: Option, + extra: Option, ) -> Box + Send>; fn create_work(&self, entity: models::WorkEntity, editgroup_id: String) -> Box + Send>; @@ -1850,6 +1879,8 @@ pub trait ApiNoContext { entity_list: &Vec, autoaccept: Option, editgroup_id: Option, + description: Option, + extra: Option, ) -> Box + Send>; fn delete_webcapture(&self, ident: String, editgroup_id: String) -> Box + Send>; @@ -1868,7 +1899,14 @@ pub trait ApiNoContext { fn update_webcapture(&self, ident: String, entity: models::WebcaptureEntity, editgroup_id: String) -> Box + Send>; - fn create_work_batch(&self, entity_list: &Vec, autoaccept: Option, editgroup_id: Option) -> Box + Send>; + fn create_work_batch( + &self, + entity_list: &Vec, + autoaccept: Option, + editgroup_id: Option, + description: Option, + extra: Option, + ) -> Box + Send>; fn delete_work(&self, ident: String, editgroup_id: String) -> Box + Send>; @@ -1914,8 +1952,10 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { entity_list: &Vec, autoaccept: Option, editgroup_id: Option, + description: Option, + extra: Option, ) -> Box + Send> { - self.api().create_container_batch(entity_list, autoaccept, editgroup_id, &self.context()) + self.api().create_container_batch(entity_list, autoaccept, editgroup_id, description, extra, &self.context()) } fn delete_container(&self, ident: String, editgroup_id: String) -> Box + Send> { @@ -1969,8 +2009,10 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { entity_list: &Vec, autoaccept: Option, editgroup_id: Option, + description: Option, + extra: Option, ) -> Box + Send> { - self.api().create_creator_batch(entity_list, autoaccept, editgroup_id, &self.context()) + self.api().create_creator_batch(entity_list, autoaccept, editgroup_id, description, extra, &self.context()) } fn delete_creator(&self, ident: String, editgroup_id: String) -> Box + Send> { @@ -2095,8 +2137,15 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { self.api().create_file(entity, editgroup_id, &self.context()) } - fn create_file_batch(&self, entity_list: &Vec, autoaccept: Option, editgroup_id: Option) -> Box + Send> { - self.api().create_file_batch(entity_list, autoaccept, editgroup_id, &self.context()) + fn create_file_batch( + &self, + entity_list: &Vec, + autoaccept: Option, + editgroup_id: Option, + description: Option, + extra: Option, + ) -> Box + Send> { + self.api().create_file_batch(entity_list, autoaccept, editgroup_id, description, extra, &self.context()) } fn delete_file(&self, ident: String, editgroup_id: String) -> Box + Send> { @@ -2151,8 +2200,10 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { entity_list: &Vec, autoaccept: Option, editgroup_id: Option, + description: Option, + extra: Option, ) -> Box + Send> { - self.api().create_fileset_batch(entity_list, autoaccept, editgroup_id, &self.context()) + self.api().create_fileset_batch(entity_list, autoaccept, editgroup_id, description, extra, &self.context()) } fn delete_fileset(&self, ident: String, editgroup_id: String) -> Box + Send> { @@ -2196,8 +2247,10 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { entity_list: &Vec, autoaccept: Option, editgroup_id: Option, + description: Option, + extra: Option, ) -> Box + Send> { - self.api().create_release_batch(entity_list, autoaccept, editgroup_id, &self.context()) + self.api().create_release_batch(entity_list, autoaccept, editgroup_id, description, extra, &self.context()) } fn create_work(&self, entity: models::WorkEntity, editgroup_id: String) -> Box + Send> { @@ -2274,8 +2327,10 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { entity_list: &Vec, autoaccept: Option, editgroup_id: Option, + description: Option, + extra: Option, ) -> Box + Send> { - self.api().create_webcapture_batch(entity_list, autoaccept, editgroup_id, &self.context()) + self.api().create_webcapture_batch(entity_list, autoaccept, editgroup_id, description, extra, &self.context()) } fn delete_webcapture(&self, ident: String, editgroup_id: String) -> Box + Send> { @@ -2310,8 +2365,15 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { self.api().update_webcapture(ident, entity, editgroup_id, &self.context()) } - fn create_work_batch(&self, entity_list: &Vec, autoaccept: Option, editgroup_id: Option) -> Box + Send> { - self.api().create_work_batch(entity_list, autoaccept, editgroup_id, &self.context()) + fn create_work_batch( + &self, + entity_list: &Vec, + autoaccept: Option, + editgroup_id: Option, + description: Option, + extra: Option, + ) -> Box + Send> { + self.api().create_work_batch(entity_list, autoaccept, editgroup_id, description, extra, &self.context()) } fn delete_work(&self, ident: String, editgroup_id: String) -> Box + Send> { -- cgit v1.2.3