From 8528f06157b0e60842c860f81e3f2a69aa07aae9 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Fri, 24 Aug 2018 12:59:28 -0700 Subject: WIP: autoaccept --- rust/fatcat-api/src/lib.rs | 93 ++++++++++++++++++++++++++++++++++++---------- 1 file changed, 74 insertions(+), 19 deletions(-) (limited to 'rust/fatcat-api/src/lib.rs') diff --git a/rust/fatcat-api/src/lib.rs b/rust/fatcat-api/src/lib.rs index 044b934b..5de3647b 100644 --- a/rust/fatcat-api/src/lib.rs +++ b/rust/fatcat-api/src/lib.rs @@ -446,26 +446,51 @@ pub trait Api { &self, entity_list: &Vec, autoaccept: Option, + editgroup: Option, context: &Context, ) -> Box + Send>; fn create_creator(&self, entity: models::CreatorEntity, context: &Context) -> Box + Send>; - fn create_creator_batch(&self, entity_list: &Vec, autoaccept: Option, context: &Context) -> Box + Send>; + fn create_creator_batch( + &self, + entity_list: &Vec, + autoaccept: Option, + editgroup: Option, + context: &Context, + ) -> Box + Send>; fn create_editgroup(&self, entity: models::Editgroup, context: &Context) -> Box + Send>; fn create_file(&self, entity: models::FileEntity, context: &Context) -> Box + Send>; - fn create_file_batch(&self, entity_list: &Vec, autoaccept: Option, context: &Context) -> Box + Send>; + fn create_file_batch( + &self, + entity_list: &Vec, + autoaccept: Option, + editgroup: Option, + context: &Context, + ) -> Box + Send>; fn create_release(&self, entity: models::ReleaseEntity, context: &Context) -> Box + Send>; - fn create_release_batch(&self, entity_list: &Vec, autoaccept: Option, context: &Context) -> Box + Send>; + fn create_release_batch( + &self, + entity_list: &Vec, + autoaccept: Option, + editgroup: Option, + context: &Context, + ) -> Box + Send>; fn create_work(&self, entity: models::WorkEntity, context: &Context) -> Box + Send>; - fn create_work_batch(&self, entity_list: &Vec, autoaccept: Option, context: &Context) -> Box + Send>; + fn create_work_batch( + &self, + entity_list: &Vec, + autoaccept: Option, + editgroup: Option, + context: &Context, + ) -> Box + Send>; fn get_changelog(&self, limit: Option, context: &Context) -> Box + Send>; @@ -520,25 +545,40 @@ pub trait ApiNoContext { fn create_container(&self, entity: models::ContainerEntity) -> Box + Send>; - fn create_container_batch(&self, entity_list: &Vec, autoaccept: Option) -> Box + Send>; + fn create_container_batch( + &self, + entity_list: &Vec, + autoaccept: Option, + editgroup: Option, + ) -> Box + Send>; fn create_creator(&self, entity: models::CreatorEntity) -> Box + Send>; - fn create_creator_batch(&self, entity_list: &Vec, autoaccept: Option) -> Box + Send>; + fn create_creator_batch( + &self, + entity_list: &Vec, + autoaccept: Option, + editgroup: Option, + ) -> Box + Send>; fn create_editgroup(&self, entity: models::Editgroup) -> Box + Send>; fn create_file(&self, entity: models::FileEntity) -> Box + Send>; - fn create_file_batch(&self, entity_list: &Vec, autoaccept: Option) -> Box + Send>; + fn create_file_batch(&self, entity_list: &Vec, autoaccept: Option, editgroup: Option) -> Box + Send>; fn create_release(&self, entity: models::ReleaseEntity) -> Box + Send>; - fn create_release_batch(&self, entity_list: &Vec, autoaccept: Option) -> Box + Send>; + fn create_release_batch( + &self, + entity_list: &Vec, + autoaccept: Option, + editgroup: Option, + ) -> Box + Send>; fn create_work(&self, entity: models::WorkEntity) -> Box + Send>; - fn create_work_batch(&self, entity_list: &Vec, autoaccept: Option) -> Box + Send>; + fn create_work_batch(&self, entity_list: &Vec, autoaccept: Option, editgroup: Option) -> Box + Send>; fn get_changelog(&self, limit: Option) -> Box + Send>; @@ -611,16 +651,26 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { self.api().create_container(entity, &self.context()) } - fn create_container_batch(&self, entity_list: &Vec, autoaccept: Option) -> Box + Send> { - self.api().create_container_batch(entity_list, autoaccept, &self.context()) + fn create_container_batch( + &self, + entity_list: &Vec, + autoaccept: Option, + editgroup: Option, + ) -> Box + Send> { + self.api().create_container_batch(entity_list, autoaccept, editgroup, &self.context()) } fn create_creator(&self, entity: models::CreatorEntity) -> Box + Send> { self.api().create_creator(entity, &self.context()) } - fn create_creator_batch(&self, entity_list: &Vec, autoaccept: Option) -> Box + Send> { - self.api().create_creator_batch(entity_list, autoaccept, &self.context()) + fn create_creator_batch( + &self, + entity_list: &Vec, + autoaccept: Option, + editgroup: Option, + ) -> Box + Send> { + self.api().create_creator_batch(entity_list, autoaccept, editgroup, &self.context()) } fn create_editgroup(&self, entity: models::Editgroup) -> Box + Send> { @@ -631,24 +681,29 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { self.api().create_file(entity, &self.context()) } - fn create_file_batch(&self, entity_list: &Vec, autoaccept: Option) -> Box + Send> { - self.api().create_file_batch(entity_list, autoaccept, &self.context()) + fn create_file_batch(&self, entity_list: &Vec, autoaccept: Option, editgroup: Option) -> Box + Send> { + self.api().create_file_batch(entity_list, autoaccept, editgroup, &self.context()) } fn create_release(&self, entity: models::ReleaseEntity) -> Box + Send> { self.api().create_release(entity, &self.context()) } - fn create_release_batch(&self, entity_list: &Vec, autoaccept: Option) -> Box + Send> { - self.api().create_release_batch(entity_list, autoaccept, &self.context()) + fn create_release_batch( + &self, + entity_list: &Vec, + autoaccept: Option, + editgroup: Option, + ) -> Box + Send> { + self.api().create_release_batch(entity_list, autoaccept, editgroup, &self.context()) } fn create_work(&self, entity: models::WorkEntity) -> Box + Send> { self.api().create_work(entity, &self.context()) } - fn create_work_batch(&self, entity_list: &Vec, autoaccept: Option) -> Box + Send> { - self.api().create_work_batch(entity_list, autoaccept, &self.context()) + fn create_work_batch(&self, entity_list: &Vec, autoaccept: Option, editgroup: Option) -> Box + Send> { + self.api().create_work_batch(entity_list, autoaccept, editgroup, &self.context()) } fn get_changelog(&self, limit: Option) -> Box + Send> { -- cgit v1.2.3