From 43ebd22582c33e95479572c213657a781e1eca3f Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Tue, 14 May 2019 17:09:35 -0700 Subject: rust codegen --- rust/fatcat-api-spec/src/lib.rs | 476 ++++++++++++++-------------------------- 1 file changed, 161 insertions(+), 315 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 e01c4fd8..b19b5793 100644 --- a/rust/fatcat-api-spec/src/lib.rs +++ b/rust/fatcat-api-spec/src/lib.rs @@ -49,9 +49,9 @@ pub enum CreateContainerResponse { } #[derive(Debug, PartialEq)] -pub enum CreateContainerBatchResponse { - /// Created Entities - CreatedEntities(Vec), +pub enum CreateContainerAutoBatchResponse { + /// Created Editgroup + CreatedEditgroup(models::Editgroup), /// Bad Request BadRequest(models::ErrorResponse), /// Not Authorized @@ -201,9 +201,9 @@ pub enum CreateCreatorResponse { } #[derive(Debug, PartialEq)] -pub enum CreateCreatorBatchResponse { - /// Created Entities - CreatedEntities(Vec), +pub enum CreateCreatorAutoBatchResponse { + /// Created Editgroup + CreatedEditgroup(models::Editgroup), /// Bad Request BadRequest(models::ErrorResponse), /// Not Authorized @@ -581,9 +581,9 @@ pub enum CreateFileResponse { } #[derive(Debug, PartialEq)] -pub enum CreateFileBatchResponse { - /// Created Entities - CreatedEntities(Vec), +pub enum CreateFileAutoBatchResponse { + /// Created Editgroup + CreatedEditgroup(models::Editgroup), /// Bad Request BadRequest(models::ErrorResponse), /// Not Authorized @@ -733,9 +733,9 @@ pub enum CreateFilesetResponse { } #[derive(Debug, PartialEq)] -pub enum CreateFilesetBatchResponse { - /// Created Entities - CreatedEntities(Vec), +pub enum CreateFilesetAutoBatchResponse { + /// Created Editgroup + CreatedEditgroup(models::Editgroup), /// Bad Request BadRequest(models::ErrorResponse), /// Not Authorized @@ -873,9 +873,9 @@ pub enum CreateReleaseResponse { } #[derive(Debug, PartialEq)] -pub enum CreateReleaseBatchResponse { - /// Created Entities - CreatedEntities(Vec), +pub enum CreateReleaseAutoBatchResponse { + /// Created Editgroup + CreatedEditgroup(models::Editgroup), /// Bad Request BadRequest(models::ErrorResponse), /// Not Authorized @@ -1077,9 +1077,9 @@ pub enum CreateWebcaptureResponse { } #[derive(Debug, PartialEq)] -pub enum CreateWebcaptureBatchResponse { - /// Created Entities - CreatedEntities(Vec), +pub enum CreateWebcaptureAutoBatchResponse { + /// Created Editgroup + CreatedEditgroup(models::Editgroup), /// Bad Request BadRequest(models::ErrorResponse), /// Not Authorized @@ -1201,9 +1201,9 @@ pub enum UpdateWebcaptureResponse { } #[derive(Debug, PartialEq)] -pub enum CreateWorkBatchResponse { - /// Created Entities - CreatedEntities(Vec), +pub enum CreateWorkAutoBatchResponse { + /// Created Editgroup + CreatedEditgroup(models::Editgroup), /// Bad Request BadRequest(models::ErrorResponse), /// Not Authorized @@ -1338,21 +1338,13 @@ pub enum UpdateWorkResponse { /// API pub trait Api { - fn create_container(&self, entity: models::ContainerEntity, editgroup_id: String, context: &Context) -> Box + Send>; + fn create_container(&self, editgroup_id: String, entity: models::ContainerEntity, context: &Context) -> Box + Send>; - fn create_container_batch( - &self, - entity_list: &Vec, - autoaccept: Option, - editgroup_id: Option, - description: Option, - extra: Option, - context: &Context, - ) -> Box + Send>; + fn create_container_auto_batch(&self, auto_batch: models::ContainerAutoBatch, context: &Context) -> Box + Send>; - fn delete_container(&self, ident: String, editgroup_id: String, context: &Context) -> Box + Send>; + fn delete_container(&self, editgroup_id: String, ident: String, context: &Context) -> Box + Send>; - fn delete_container_edit(&self, edit_id: String, context: &Context) -> Box + Send>; + fn delete_container_edit(&self, editgroup_id: String, edit_id: String, context: &Context) -> Box + Send>; fn get_container(&self, ident: String, expand: Option, hide: Option, context: &Context) -> Box + Send>; @@ -1373,23 +1365,15 @@ pub trait Api { context: &Context, ) -> Box + Send>; - fn update_container(&self, ident: String, entity: models::ContainerEntity, editgroup_id: String, context: &Context) -> Box + Send>; + fn update_container(&self, editgroup_id: String, ident: String, entity: models::ContainerEntity, context: &Context) -> Box + Send>; - fn create_creator(&self, entity: models::CreatorEntity, editgroup_id: String, context: &Context) -> Box + Send>; + fn create_creator(&self, editgroup_id: String, entity: models::CreatorEntity, context: &Context) -> Box + Send>; - fn create_creator_batch( - &self, - entity_list: &Vec, - autoaccept: Option, - editgroup_id: Option, - description: Option, - extra: Option, - context: &Context, - ) -> Box + Send>; + fn create_creator_auto_batch(&self, auto_batch: models::CreatorAutoBatch, context: &Context) -> Box + Send>; - fn delete_creator(&self, ident: String, editgroup_id: String, context: &Context) -> Box + Send>; + fn delete_creator(&self, editgroup_id: String, ident: String, context: &Context) -> Box + Send>; - fn delete_creator_edit(&self, edit_id: String, context: &Context) -> Box + Send>; + fn delete_creator_edit(&self, editgroup_id: String, edit_id: String, context: &Context) -> Box + Send>; fn get_creator(&self, ident: String, expand: Option, hide: Option, context: &Context) -> Box + Send>; @@ -1412,7 +1396,7 @@ pub trait Api { context: &Context, ) -> Box + Send>; - fn update_creator(&self, ident: String, entity: models::CreatorEntity, editgroup_id: String, context: &Context) -> Box + Send>; + fn update_creator(&self, editgroup_id: String, ident: String, entity: models::CreatorEntity, context: &Context) -> Box + Send>; fn auth_check(&self, role: Option, context: &Context) -> Box + Send>; @@ -1470,21 +1454,13 @@ pub trait Api { context: &Context, ) -> Box + Send>; - fn create_file(&self, entity: models::FileEntity, editgroup_id: String, context: &Context) -> Box + Send>; + fn create_file(&self, editgroup_id: String, entity: models::FileEntity, context: &Context) -> Box + Send>; - fn create_file_batch( - &self, - entity_list: &Vec, - autoaccept: Option, - editgroup_id: Option, - description: Option, - extra: Option, - context: &Context, - ) -> Box + Send>; + fn create_file_auto_batch(&self, auto_batch: models::FileAutoBatch, context: &Context) -> Box + Send>; - fn delete_file(&self, ident: String, editgroup_id: String, context: &Context) -> Box + Send>; + fn delete_file(&self, editgroup_id: String, ident: String, context: &Context) -> Box + Send>; - fn delete_file_edit(&self, edit_id: String, context: &Context) -> Box + Send>; + fn delete_file_edit(&self, editgroup_id: String, edit_id: String, context: &Context) -> Box + Send>; fn get_file(&self, ident: String, expand: Option, hide: Option, context: &Context) -> Box + Send>; @@ -1506,23 +1482,15 @@ pub trait Api { context: &Context, ) -> Box + Send>; - fn update_file(&self, ident: String, entity: models::FileEntity, editgroup_id: String, context: &Context) -> Box + Send>; + fn update_file(&self, editgroup_id: String, ident: String, entity: models::FileEntity, context: &Context) -> Box + Send>; - fn create_fileset(&self, entity: models::FilesetEntity, editgroup_id: String, context: &Context) -> Box + Send>; + fn create_fileset(&self, editgroup_id: String, entity: models::FilesetEntity, context: &Context) -> Box + Send>; - fn create_fileset_batch( - &self, - entity_list: &Vec, - autoaccept: Option, - editgroup_id: Option, - description: Option, - extra: Option, - context: &Context, - ) -> Box + Send>; + fn create_fileset_auto_batch(&self, auto_batch: models::FilesetAutoBatch, context: &Context) -> Box + Send>; - fn delete_fileset(&self, ident: String, editgroup_id: String, context: &Context) -> Box + Send>; + fn delete_fileset(&self, editgroup_id: String, ident: String, context: &Context) -> Box + Send>; - fn delete_fileset_edit(&self, edit_id: String, context: &Context) -> Box + Send>; + fn delete_fileset_edit(&self, editgroup_id: String, edit_id: String, context: &Context) -> Box + Send>; fn get_fileset(&self, ident: String, expand: Option, hide: Option, context: &Context) -> Box + Send>; @@ -1534,25 +1502,17 @@ pub trait Api { fn get_fileset_revision(&self, rev_id: String, expand: Option, hide: Option, context: &Context) -> Box + Send>; - fn update_fileset(&self, ident: String, entity: models::FilesetEntity, editgroup_id: String, context: &Context) -> Box + Send>; + fn update_fileset(&self, editgroup_id: String, ident: String, entity: models::FilesetEntity, context: &Context) -> Box + Send>; - fn create_release(&self, entity: models::ReleaseEntity, editgroup_id: String, context: &Context) -> Box + Send>; + fn create_release(&self, editgroup_id: String, entity: models::ReleaseEntity, context: &Context) -> Box + Send>; - fn create_release_batch( - &self, - entity_list: &Vec, - autoaccept: Option, - editgroup_id: Option, - description: Option, - extra: Option, - context: &Context, - ) -> Box + Send>; + fn create_release_auto_batch(&self, auto_batch: models::ReleaseAutoBatch, context: &Context) -> Box + Send>; - fn create_work(&self, entity: models::WorkEntity, editgroup_id: String, context: &Context) -> Box + Send>; + fn create_work(&self, editgroup_id: String, entity: models::WorkEntity, context: &Context) -> Box + Send>; - fn delete_release(&self, ident: String, editgroup_id: String, context: &Context) -> Box + Send>; + fn delete_release(&self, editgroup_id: String, ident: String, context: &Context) -> Box + Send>; - fn delete_release_edit(&self, edit_id: String, context: &Context) -> Box + Send>; + fn delete_release_edit(&self, editgroup_id: String, edit_id: String, context: &Context) -> Box + Send>; fn get_release(&self, ident: String, expand: Option, hide: Option, context: &Context) -> Box + Send>; @@ -1587,23 +1547,15 @@ pub trait Api { context: &Context, ) -> Box + Send>; - fn update_release(&self, ident: String, entity: models::ReleaseEntity, editgroup_id: String, context: &Context) -> Box + Send>; + fn update_release(&self, editgroup_id: String, ident: String, entity: models::ReleaseEntity, context: &Context) -> Box + Send>; - fn create_webcapture(&self, entity: models::WebcaptureEntity, editgroup_id: String, context: &Context) -> Box + Send>; + fn create_webcapture(&self, editgroup_id: String, entity: models::WebcaptureEntity, context: &Context) -> Box + Send>; - fn create_webcapture_batch( - &self, - entity_list: &Vec, - autoaccept: Option, - editgroup_id: Option, - description: Option, - extra: Option, - context: &Context, - ) -> Box + Send>; + fn create_webcapture_auto_batch(&self, auto_batch: models::WebcaptureAutoBatch, context: &Context) -> Box + Send>; - fn delete_webcapture(&self, ident: String, editgroup_id: String, context: &Context) -> Box + Send>; + fn delete_webcapture(&self, editgroup_id: String, ident: String, context: &Context) -> Box + Send>; - fn delete_webcapture_edit(&self, edit_id: String, context: &Context) -> Box + Send>; + fn delete_webcapture_edit(&self, editgroup_id: String, edit_id: String, context: &Context) -> Box + Send>; fn get_webcapture(&self, ident: String, expand: Option, hide: Option, context: &Context) -> Box + Send>; @@ -1615,21 +1567,13 @@ pub trait Api { fn get_webcapture_revision(&self, rev_id: String, expand: Option, hide: Option, context: &Context) -> Box + Send>; - fn update_webcapture(&self, ident: String, entity: models::WebcaptureEntity, editgroup_id: String, context: &Context) -> Box + Send>; + fn update_webcapture(&self, editgroup_id: String, ident: String, entity: models::WebcaptureEntity, context: &Context) -> Box + Send>; - fn create_work_batch( - &self, - entity_list: &Vec, - autoaccept: Option, - editgroup_id: Option, - description: Option, - extra: Option, - context: &Context, - ) -> Box + Send>; + fn create_work_auto_batch(&self, auto_batch: models::WorkAutoBatch, context: &Context) -> Box + Send>; - fn delete_work(&self, ident: String, editgroup_id: String, context: &Context) -> Box + Send>; + fn delete_work(&self, editgroup_id: String, ident: String, context: &Context) -> Box + Send>; - fn delete_work_edit(&self, edit_id: String, context: &Context) -> Box + Send>; + fn delete_work_edit(&self, editgroup_id: String, edit_id: String, context: &Context) -> Box + Send>; fn get_work(&self, ident: String, expand: Option, hide: Option, context: &Context) -> Box + Send>; @@ -1643,25 +1587,18 @@ pub trait Api { fn get_work_revision(&self, rev_id: String, expand: Option, hide: Option, context: &Context) -> Box + Send>; - fn update_work(&self, ident: String, entity: models::WorkEntity, editgroup_id: String, context: &Context) -> Box + Send>; + fn update_work(&self, editgroup_id: String, ident: String, entity: models::WorkEntity, context: &Context) -> Box + Send>; } /// API without a `Context` pub trait ApiNoContext { - fn create_container(&self, entity: models::ContainerEntity, editgroup_id: String) -> Box + Send>; + fn create_container(&self, editgroup_id: String, entity: models::ContainerEntity) -> Box + Send>; - fn create_container_batch( - &self, - entity_list: &Vec, - autoaccept: Option, - editgroup_id: Option, - description: Option, - extra: Option, - ) -> Box + Send>; + fn create_container_auto_batch(&self, auto_batch: models::ContainerAutoBatch) -> Box + Send>; - fn delete_container(&self, ident: String, editgroup_id: String) -> Box + Send>; + fn delete_container(&self, editgroup_id: String, ident: String) -> Box + Send>; - fn delete_container_edit(&self, edit_id: String) -> Box + Send>; + fn delete_container_edit(&self, editgroup_id: String, edit_id: String) -> Box + Send>; fn get_container(&self, ident: String, expand: Option, hide: Option) -> Box + Send>; @@ -1681,22 +1618,15 @@ pub trait ApiNoContext { hide: Option, ) -> Box + Send>; - fn update_container(&self, ident: String, entity: models::ContainerEntity, editgroup_id: String) -> Box + Send>; + fn update_container(&self, editgroup_id: String, ident: String, entity: models::ContainerEntity) -> Box + Send>; - fn create_creator(&self, entity: models::CreatorEntity, editgroup_id: String) -> Box + Send>; + fn create_creator(&self, editgroup_id: String, entity: models::CreatorEntity) -> Box + Send>; - fn create_creator_batch( - &self, - entity_list: &Vec, - autoaccept: Option, - editgroup_id: Option, - description: Option, - extra: Option, - ) -> Box + Send>; + fn create_creator_auto_batch(&self, auto_batch: models::CreatorAutoBatch) -> Box + Send>; - fn delete_creator(&self, ident: String, editgroup_id: String) -> Box + Send>; + fn delete_creator(&self, editgroup_id: String, ident: String) -> Box + Send>; - fn delete_creator_edit(&self, edit_id: String) -> Box + Send>; + fn delete_creator_edit(&self, editgroup_id: String, edit_id: String) -> Box + Send>; fn get_creator(&self, ident: String, expand: Option, hide: Option) -> Box + Send>; @@ -1712,7 +1642,7 @@ pub trait ApiNoContext { fn lookup_creator(&self, orcid: Option, wikidata_qid: Option, expand: Option, hide: Option) -> Box + Send>; - fn update_creator(&self, ident: String, entity: models::CreatorEntity, editgroup_id: String) -> Box + Send>; + fn update_creator(&self, editgroup_id: String, ident: String, entity: models::CreatorEntity) -> Box + Send>; fn auth_check(&self, role: Option) -> Box + Send>; @@ -1762,20 +1692,13 @@ pub trait ApiNoContext { since: Option>, ) -> Box + Send>; - fn create_file(&self, entity: models::FileEntity, editgroup_id: String) -> Box + Send>; + fn create_file(&self, editgroup_id: String, entity: models::FileEntity) -> Box + Send>; - fn create_file_batch( - &self, - entity_list: &Vec, - autoaccept: Option, - editgroup_id: Option, - description: Option, - extra: Option, - ) -> Box + Send>; + fn create_file_auto_batch(&self, auto_batch: models::FileAutoBatch) -> Box + Send>; - fn delete_file(&self, ident: String, editgroup_id: String) -> Box + Send>; + fn delete_file(&self, editgroup_id: String, ident: String) -> Box + Send>; - fn delete_file_edit(&self, edit_id: String) -> Box + Send>; + fn delete_file_edit(&self, editgroup_id: String, edit_id: String) -> Box + Send>; fn get_file(&self, ident: String, expand: Option, hide: Option) -> Box + Send>; @@ -1796,22 +1719,15 @@ pub trait ApiNoContext { hide: Option, ) -> Box + Send>; - fn update_file(&self, ident: String, entity: models::FileEntity, editgroup_id: String) -> Box + Send>; + fn update_file(&self, editgroup_id: String, ident: String, entity: models::FileEntity) -> Box + Send>; - fn create_fileset(&self, entity: models::FilesetEntity, editgroup_id: String) -> Box + Send>; + fn create_fileset(&self, editgroup_id: String, entity: models::FilesetEntity) -> Box + Send>; - fn create_fileset_batch( - &self, - entity_list: &Vec, - autoaccept: Option, - editgroup_id: Option, - description: Option, - extra: Option, - ) -> Box + Send>; + fn create_fileset_auto_batch(&self, auto_batch: models::FilesetAutoBatch) -> Box + Send>; - fn delete_fileset(&self, ident: String, editgroup_id: String) -> Box + Send>; + fn delete_fileset(&self, editgroup_id: String, ident: String) -> Box + Send>; - fn delete_fileset_edit(&self, edit_id: String) -> Box + Send>; + fn delete_fileset_edit(&self, editgroup_id: String, edit_id: String) -> Box + Send>; fn get_fileset(&self, ident: String, expand: Option, hide: Option) -> Box + Send>; @@ -1823,24 +1739,17 @@ pub trait ApiNoContext { fn get_fileset_revision(&self, rev_id: String, expand: Option, hide: Option) -> Box + Send>; - fn update_fileset(&self, ident: String, entity: models::FilesetEntity, editgroup_id: String) -> Box + Send>; + fn update_fileset(&self, editgroup_id: String, ident: String, entity: models::FilesetEntity) -> Box + Send>; - fn create_release(&self, entity: models::ReleaseEntity, editgroup_id: String) -> Box + Send>; + fn create_release(&self, editgroup_id: String, entity: models::ReleaseEntity) -> Box + Send>; - fn create_release_batch( - &self, - entity_list: &Vec, - autoaccept: Option, - editgroup_id: Option, - description: Option, - extra: Option, - ) -> Box + Send>; + fn create_release_auto_batch(&self, auto_batch: models::ReleaseAutoBatch) -> Box + Send>; - fn create_work(&self, entity: models::WorkEntity, editgroup_id: String) -> Box + Send>; + fn create_work(&self, editgroup_id: String, entity: models::WorkEntity) -> Box + Send>; - fn delete_release(&self, ident: String, editgroup_id: String) -> Box + Send>; + fn delete_release(&self, editgroup_id: String, ident: String) -> Box + Send>; - fn delete_release_edit(&self, edit_id: String) -> Box + Send>; + fn delete_release_edit(&self, editgroup_id: String, edit_id: String) -> Box + Send>; fn get_release(&self, ident: String, expand: Option, hide: Option) -> Box + Send>; @@ -1874,22 +1783,15 @@ pub trait ApiNoContext { hide: Option, ) -> Box + Send>; - fn update_release(&self, ident: String, entity: models::ReleaseEntity, editgroup_id: String) -> Box + Send>; + fn update_release(&self, editgroup_id: String, ident: String, entity: models::ReleaseEntity) -> Box + Send>; - fn create_webcapture(&self, entity: models::WebcaptureEntity, editgroup_id: String) -> Box + Send>; + fn create_webcapture(&self, editgroup_id: String, entity: models::WebcaptureEntity) -> Box + Send>; - fn create_webcapture_batch( - &self, - entity_list: &Vec, - autoaccept: Option, - editgroup_id: Option, - description: Option, - extra: Option, - ) -> Box + Send>; + fn create_webcapture_auto_batch(&self, auto_batch: models::WebcaptureAutoBatch) -> Box + Send>; - fn delete_webcapture(&self, ident: String, editgroup_id: String) -> Box + Send>; + fn delete_webcapture(&self, editgroup_id: String, ident: String) -> Box + Send>; - fn delete_webcapture_edit(&self, edit_id: String) -> Box + Send>; + fn delete_webcapture_edit(&self, editgroup_id: String, edit_id: String) -> Box + Send>; fn get_webcapture(&self, ident: String, expand: Option, hide: Option) -> Box + Send>; @@ -1901,20 +1803,13 @@ pub trait ApiNoContext { fn get_webcapture_revision(&self, rev_id: String, expand: Option, hide: Option) -> Box + Send>; - fn update_webcapture(&self, ident: String, entity: models::WebcaptureEntity, editgroup_id: String) -> Box + Send>; + fn update_webcapture(&self, editgroup_id: String, ident: String, entity: models::WebcaptureEntity) -> Box + Send>; - fn create_work_batch( - &self, - entity_list: &Vec, - autoaccept: Option, - editgroup_id: Option, - description: Option, - extra: Option, - ) -> Box + Send>; + fn create_work_auto_batch(&self, auto_batch: models::WorkAutoBatch) -> Box + Send>; - fn delete_work(&self, ident: String, editgroup_id: String) -> Box + Send>; + fn delete_work(&self, editgroup_id: String, ident: String) -> Box + Send>; - fn delete_work_edit(&self, edit_id: String) -> Box + Send>; + fn delete_work_edit(&self, editgroup_id: String, edit_id: String) -> Box + Send>; fn get_work(&self, ident: String, expand: Option, hide: Option) -> Box + Send>; @@ -1928,7 +1823,7 @@ pub trait ApiNoContext { fn get_work_revision(&self, rev_id: String, expand: Option, hide: Option) -> Box + Send>; - fn update_work(&self, ident: String, entity: models::WorkEntity, editgroup_id: String) -> Box + Send>; + fn update_work(&self, editgroup_id: String, ident: String, entity: models::WorkEntity) -> Box + Send>; } /// Trait to extend an API to make it easy to bind it to a context. @@ -1947,27 +1842,20 @@ impl<'a, T: Api + Sized> ContextWrapperExt<'a> for T { } impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { - fn create_container(&self, entity: models::ContainerEntity, editgroup_id: String) -> Box + Send> { - self.api().create_container(entity, editgroup_id, &self.context()) + fn create_container(&self, editgroup_id: String, entity: models::ContainerEntity) -> Box + Send> { + self.api().create_container(editgroup_id, entity, &self.context()) } - fn create_container_batch( - &self, - entity_list: &Vec, - autoaccept: Option, - editgroup_id: Option, - description: Option, - extra: Option, - ) -> Box + Send> { - self.api().create_container_batch(entity_list, autoaccept, editgroup_id, description, extra, &self.context()) + fn create_container_auto_batch(&self, auto_batch: models::ContainerAutoBatch) -> Box + Send> { + self.api().create_container_auto_batch(auto_batch, &self.context()) } - fn delete_container(&self, ident: String, editgroup_id: String) -> Box + Send> { - self.api().delete_container(ident, editgroup_id, &self.context()) + fn delete_container(&self, editgroup_id: String, ident: String) -> Box + Send> { + self.api().delete_container(editgroup_id, ident, &self.context()) } - fn delete_container_edit(&self, edit_id: String) -> Box + Send> { - self.api().delete_container_edit(edit_id, &self.context()) + fn delete_container_edit(&self, editgroup_id: String, edit_id: String) -> Box + Send> { + self.api().delete_container_edit(editgroup_id, edit_id, &self.context()) } fn get_container(&self, ident: String, expand: Option, hide: Option) -> Box + Send> { @@ -2000,31 +1888,24 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { self.api().lookup_container(issnl, wikidata_qid, expand, hide, &self.context()) } - fn update_container(&self, ident: String, entity: models::ContainerEntity, editgroup_id: String) -> Box + Send> { - self.api().update_container(ident, entity, editgroup_id, &self.context()) + fn update_container(&self, editgroup_id: String, ident: String, entity: models::ContainerEntity) -> Box + Send> { + self.api().update_container(editgroup_id, ident, entity, &self.context()) } - fn create_creator(&self, entity: models::CreatorEntity, editgroup_id: String) -> Box + Send> { - self.api().create_creator(entity, editgroup_id, &self.context()) + fn create_creator(&self, editgroup_id: String, entity: models::CreatorEntity) -> Box + Send> { + self.api().create_creator(editgroup_id, entity, &self.context()) } - fn create_creator_batch( - &self, - entity_list: &Vec, - autoaccept: Option, - editgroup_id: Option, - description: Option, - extra: Option, - ) -> Box + Send> { - self.api().create_creator_batch(entity_list, autoaccept, editgroup_id, description, extra, &self.context()) + fn create_creator_auto_batch(&self, auto_batch: models::CreatorAutoBatch) -> Box + Send> { + self.api().create_creator_auto_batch(auto_batch, &self.context()) } - fn delete_creator(&self, ident: String, editgroup_id: String) -> Box + Send> { - self.api().delete_creator(ident, editgroup_id, &self.context()) + fn delete_creator(&self, editgroup_id: String, ident: String) -> Box + Send> { + self.api().delete_creator(editgroup_id, ident, &self.context()) } - fn delete_creator_edit(&self, edit_id: String) -> Box + Send> { - self.api().delete_creator_edit(edit_id, &self.context()) + fn delete_creator_edit(&self, editgroup_id: String, edit_id: String) -> Box + Send> { + self.api().delete_creator_edit(editgroup_id, edit_id, &self.context()) } fn get_creator(&self, ident: String, expand: Option, hide: Option) -> Box + Send> { @@ -2055,8 +1936,8 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { self.api().lookup_creator(orcid, wikidata_qid, expand, hide, &self.context()) } - fn update_creator(&self, ident: String, entity: models::CreatorEntity, editgroup_id: String) -> Box + Send> { - self.api().update_creator(ident, entity, editgroup_id, &self.context()) + fn update_creator(&self, editgroup_id: String, ident: String, entity: models::CreatorEntity) -> Box + Send> { + self.api().update_creator(editgroup_id, ident, entity, &self.context()) } fn auth_check(&self, role: Option) -> Box + Send> { @@ -2137,27 +2018,20 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { self.api().get_editor_annotations(editor_id, limit, before, since, &self.context()) } - fn create_file(&self, entity: models::FileEntity, editgroup_id: String) -> Box + Send> { - self.api().create_file(entity, editgroup_id, &self.context()) + fn create_file(&self, editgroup_id: String, entity: models::FileEntity) -> Box + Send> { + self.api().create_file(editgroup_id, entity, &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 create_file_auto_batch(&self, auto_batch: models::FileAutoBatch) -> Box + Send> { + self.api().create_file_auto_batch(auto_batch, &self.context()) } - fn delete_file(&self, ident: String, editgroup_id: String) -> Box + Send> { - self.api().delete_file(ident, editgroup_id, &self.context()) + fn delete_file(&self, editgroup_id: String, ident: String) -> Box + Send> { + self.api().delete_file(editgroup_id, ident, &self.context()) } - fn delete_file_edit(&self, edit_id: String) -> Box + Send> { - self.api().delete_file_edit(edit_id, &self.context()) + fn delete_file_edit(&self, editgroup_id: String, edit_id: String) -> Box + Send> { + self.api().delete_file_edit(editgroup_id, edit_id, &self.context()) } fn get_file(&self, ident: String, expand: Option, hide: Option) -> Box + Send> { @@ -2191,31 +2065,24 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { self.api().lookup_file(md5, sha1, sha256, expand, hide, &self.context()) } - fn update_file(&self, ident: String, entity: models::FileEntity, editgroup_id: String) -> Box + Send> { - self.api().update_file(ident, entity, editgroup_id, &self.context()) + fn update_file(&self, editgroup_id: String, ident: String, entity: models::FileEntity) -> Box + Send> { + self.api().update_file(editgroup_id, ident, entity, &self.context()) } - fn create_fileset(&self, entity: models::FilesetEntity, editgroup_id: String) -> Box + Send> { - self.api().create_fileset(entity, editgroup_id, &self.context()) + fn create_fileset(&self, editgroup_id: String, entity: models::FilesetEntity) -> Box + Send> { + self.api().create_fileset(editgroup_id, entity, &self.context()) } - fn create_fileset_batch( - &self, - entity_list: &Vec, - autoaccept: Option, - editgroup_id: Option, - description: Option, - extra: Option, - ) -> Box + Send> { - self.api().create_fileset_batch(entity_list, autoaccept, editgroup_id, description, extra, &self.context()) + fn create_fileset_auto_batch(&self, auto_batch: models::FilesetAutoBatch) -> Box + Send> { + self.api().create_fileset_auto_batch(auto_batch, &self.context()) } - fn delete_fileset(&self, ident: String, editgroup_id: String) -> Box + Send> { - self.api().delete_fileset(ident, editgroup_id, &self.context()) + fn delete_fileset(&self, editgroup_id: String, ident: String) -> Box + Send> { + self.api().delete_fileset(editgroup_id, ident, &self.context()) } - fn delete_fileset_edit(&self, edit_id: String) -> Box + Send> { - self.api().delete_fileset_edit(edit_id, &self.context()) + fn delete_fileset_edit(&self, editgroup_id: String, edit_id: String) -> Box + Send> { + self.api().delete_fileset_edit(editgroup_id, edit_id, &self.context()) } fn get_fileset(&self, ident: String, expand: Option, hide: Option) -> Box + Send> { @@ -2238,35 +2105,28 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { self.api().get_fileset_revision(rev_id, expand, hide, &self.context()) } - fn update_fileset(&self, ident: String, entity: models::FilesetEntity, editgroup_id: String) -> Box + Send> { - self.api().update_fileset(ident, entity, editgroup_id, &self.context()) + fn update_fileset(&self, editgroup_id: String, ident: String, entity: models::FilesetEntity) -> Box + Send> { + self.api().update_fileset(editgroup_id, ident, entity, &self.context()) } - fn create_release(&self, entity: models::ReleaseEntity, editgroup_id: String) -> Box + Send> { - self.api().create_release(entity, editgroup_id, &self.context()) + fn create_release(&self, editgroup_id: String, entity: models::ReleaseEntity) -> Box + Send> { + self.api().create_release(editgroup_id, entity, &self.context()) } - fn create_release_batch( - &self, - entity_list: &Vec, - autoaccept: Option, - editgroup_id: Option, - description: Option, - extra: Option, - ) -> Box + Send> { - self.api().create_release_batch(entity_list, autoaccept, editgroup_id, description, extra, &self.context()) + fn create_release_auto_batch(&self, auto_batch: models::ReleaseAutoBatch) -> Box + Send> { + self.api().create_release_auto_batch(auto_batch, &self.context()) } - fn create_work(&self, entity: models::WorkEntity, editgroup_id: String) -> Box + Send> { - self.api().create_work(entity, editgroup_id, &self.context()) + fn create_work(&self, editgroup_id: String, entity: models::WorkEntity) -> Box + Send> { + self.api().create_work(editgroup_id, entity, &self.context()) } - fn delete_release(&self, ident: String, editgroup_id: String) -> Box + Send> { - self.api().delete_release(ident, editgroup_id, &self.context()) + fn delete_release(&self, editgroup_id: String, ident: String) -> Box + Send> { + self.api().delete_release(editgroup_id, ident, &self.context()) } - fn delete_release_edit(&self, edit_id: String) -> Box + Send> { - self.api().delete_release_edit(edit_id, &self.context()) + fn delete_release_edit(&self, editgroup_id: String, edit_id: String) -> Box + Send> { + self.api().delete_release_edit(editgroup_id, edit_id, &self.context()) } fn get_release(&self, ident: String, expand: Option, hide: Option) -> Box + Send> { @@ -2320,31 +2180,24 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { .lookup_release(doi, wikidata_qid, isbn13, pmid, pmcid, core, arxiv, jstor, ark, mag, expand, hide, &self.context()) } - fn update_release(&self, ident: String, entity: models::ReleaseEntity, editgroup_id: String) -> Box + Send> { - self.api().update_release(ident, entity, editgroup_id, &self.context()) + fn update_release(&self, editgroup_id: String, ident: String, entity: models::ReleaseEntity) -> Box + Send> { + self.api().update_release(editgroup_id, ident, entity, &self.context()) } - fn create_webcapture(&self, entity: models::WebcaptureEntity, editgroup_id: String) -> Box + Send> { - self.api().create_webcapture(entity, editgroup_id, &self.context()) + fn create_webcapture(&self, editgroup_id: String, entity: models::WebcaptureEntity) -> Box + Send> { + self.api().create_webcapture(editgroup_id, entity, &self.context()) } - fn create_webcapture_batch( - &self, - entity_list: &Vec, - autoaccept: Option, - editgroup_id: Option, - description: Option, - extra: Option, - ) -> Box + Send> { - self.api().create_webcapture_batch(entity_list, autoaccept, editgroup_id, description, extra, &self.context()) + fn create_webcapture_auto_batch(&self, auto_batch: models::WebcaptureAutoBatch) -> Box + Send> { + self.api().create_webcapture_auto_batch(auto_batch, &self.context()) } - fn delete_webcapture(&self, ident: String, editgroup_id: String) -> Box + Send> { - self.api().delete_webcapture(ident, editgroup_id, &self.context()) + fn delete_webcapture(&self, editgroup_id: String, ident: String) -> Box + Send> { + self.api().delete_webcapture(editgroup_id, ident, &self.context()) } - fn delete_webcapture_edit(&self, edit_id: String) -> Box + Send> { - self.api().delete_webcapture_edit(edit_id, &self.context()) + fn delete_webcapture_edit(&self, editgroup_id: String, edit_id: String) -> Box + Send> { + self.api().delete_webcapture_edit(editgroup_id, edit_id, &self.context()) } fn get_webcapture(&self, ident: String, expand: Option, hide: Option) -> Box + Send> { @@ -2367,27 +2220,20 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { self.api().get_webcapture_revision(rev_id, expand, hide, &self.context()) } - fn update_webcapture(&self, ident: String, entity: models::WebcaptureEntity, editgroup_id: String) -> Box + Send> { - self.api().update_webcapture(ident, entity, editgroup_id, &self.context()) + fn update_webcapture(&self, editgroup_id: String, ident: String, entity: models::WebcaptureEntity) -> Box + Send> { + self.api().update_webcapture(editgroup_id, ident, entity, &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 create_work_auto_batch(&self, auto_batch: models::WorkAutoBatch) -> Box + Send> { + self.api().create_work_auto_batch(auto_batch, &self.context()) } - fn delete_work(&self, ident: String, editgroup_id: String) -> Box + Send> { - self.api().delete_work(ident, editgroup_id, &self.context()) + fn delete_work(&self, editgroup_id: String, ident: String) -> Box + Send> { + self.api().delete_work(editgroup_id, ident, &self.context()) } - fn delete_work_edit(&self, edit_id: String) -> Box + Send> { - self.api().delete_work_edit(edit_id, &self.context()) + fn delete_work_edit(&self, editgroup_id: String, edit_id: String) -> Box + Send> { + self.api().delete_work_edit(editgroup_id, edit_id, &self.context()) } fn get_work(&self, ident: String, expand: Option, hide: Option) -> Box + Send> { @@ -2414,8 +2260,8 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { self.api().get_work_revision(rev_id, expand, hide, &self.context()) } - fn update_work(&self, ident: String, entity: models::WorkEntity, editgroup_id: String) -> Box + Send> { - self.api().update_work(ident, entity, editgroup_id, &self.context()) + fn update_work(&self, editgroup_id: String, ident: String, entity: models::WorkEntity) -> Box + Send> { + self.api().update_work(editgroup_id, ident, entity, &self.context()) } } -- cgit v1.2.3