From e9d7d73339df14ef2fe35815e693f0dbd7d1d244 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Sat, 22 Sep 2018 17:25:57 -0700 Subject: codegen fatcat-api-spec --- rust/fatcat-api-spec/src/lib.rs | 672 ++++++++++++++++++++-------------------- 1 file changed, 336 insertions(+), 336 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 a246bb43..baf130a1 100644 --- a/rust/fatcat-api-spec/src/lib.rs +++ b/rust/fatcat-api-spec/src/lib.rs @@ -32,20 +32,6 @@ mod mimetypes; pub use swagger::{ApiError, Context, ContextWrapper}; -#[derive(Debug, PartialEq)] -pub enum AcceptEditgroupResponse { - /// Merged Successfully - MergedSuccessfully(models::Success), - /// Bad Request - BadRequest(models::ErrorResponse), - /// Not Found - NotFound(models::ErrorResponse), - /// Edit Conflict - EditConflict(models::ErrorResponse), - /// Generic Error - GenericError(models::ErrorResponse), -} - #[derive(Debug, PartialEq)] pub enum CreateContainerResponse { /// Created Entity @@ -71,9 +57,9 @@ pub enum CreateContainerBatchResponse { } #[derive(Debug, PartialEq)] -pub enum CreateCreatorResponse { - /// Created Entity - CreatedEntity(models::EntityEdit), +pub enum DeleteContainerResponse { + /// Deleted Entity + DeletedEntity(models::EntityEdit), /// Bad Request BadRequest(models::ErrorResponse), /// Not Found @@ -83,9 +69,9 @@ pub enum CreateCreatorResponse { } #[derive(Debug, PartialEq)] -pub enum CreateCreatorBatchResponse { - /// Created Entities - CreatedEntities(Vec), +pub enum GetContainerResponse { + /// Found Entity + FoundEntity(models::ContainerEntity), /// Bad Request BadRequest(models::ErrorResponse), /// Not Found @@ -95,19 +81,21 @@ pub enum CreateCreatorBatchResponse { } #[derive(Debug, PartialEq)] -pub enum CreateEditgroupResponse { - /// Successfully Created - SuccessfullyCreated(models::Editgroup), +pub enum GetContainerHistoryResponse { + /// Found Entity History + FoundEntityHistory(Vec), /// Bad Request BadRequest(models::ErrorResponse), + /// Not Found + NotFound(models::ErrorResponse), /// Generic Error GenericError(models::ErrorResponse), } #[derive(Debug, PartialEq)] -pub enum CreateFileResponse { - /// Created Entity - CreatedEntity(models::EntityEdit), +pub enum LookupContainerResponse { + /// Found Entity + FoundEntity(models::ContainerEntity), /// Bad Request BadRequest(models::ErrorResponse), /// Not Found @@ -117,9 +105,9 @@ pub enum CreateFileResponse { } #[derive(Debug, PartialEq)] -pub enum CreateFileBatchResponse { - /// Created Entities - CreatedEntities(Vec), +pub enum UpdateContainerResponse { + /// Updated Entity + UpdatedEntity(models::EntityEdit), /// Bad Request BadRequest(models::ErrorResponse), /// Not Found @@ -129,7 +117,7 @@ pub enum CreateFileBatchResponse { } #[derive(Debug, PartialEq)] -pub enum CreateReleaseResponse { +pub enum CreateCreatorResponse { /// Created Entity CreatedEntity(models::EntityEdit), /// Bad Request @@ -141,7 +129,7 @@ pub enum CreateReleaseResponse { } #[derive(Debug, PartialEq)] -pub enum CreateReleaseBatchResponse { +pub enum CreateCreatorBatchResponse { /// Created Entities CreatedEntities(Vec), /// Bad Request @@ -153,9 +141,9 @@ pub enum CreateReleaseBatchResponse { } #[derive(Debug, PartialEq)] -pub enum CreateWorkResponse { - /// Created Entity - CreatedEntity(models::EntityEdit), +pub enum DeleteCreatorResponse { + /// Deleted Entity + DeletedEntity(models::EntityEdit), /// Bad Request BadRequest(models::ErrorResponse), /// Not Found @@ -165,9 +153,9 @@ pub enum CreateWorkResponse { } #[derive(Debug, PartialEq)] -pub enum CreateWorkBatchResponse { - /// Created Entities - CreatedEntities(Vec), +pub enum GetCreatorResponse { + /// Found Entity + FoundEntity(models::CreatorEntity), /// Bad Request BadRequest(models::ErrorResponse), /// Not Found @@ -177,9 +165,9 @@ pub enum CreateWorkBatchResponse { } #[derive(Debug, PartialEq)] -pub enum DeleteContainerResponse { - /// Deleted Entity - DeletedEntity(models::EntityEdit), +pub enum GetCreatorHistoryResponse { + /// Found Entity History + FoundEntityHistory(Vec), /// Bad Request BadRequest(models::ErrorResponse), /// Not Found @@ -189,9 +177,9 @@ pub enum DeleteContainerResponse { } #[derive(Debug, PartialEq)] -pub enum DeleteCreatorResponse { - /// Deleted Entity - DeletedEntity(models::EntityEdit), +pub enum GetCreatorReleasesResponse { + /// Found + Found(Vec), /// Bad Request BadRequest(models::ErrorResponse), /// Not Found @@ -201,9 +189,9 @@ pub enum DeleteCreatorResponse { } #[derive(Debug, PartialEq)] -pub enum DeleteFileResponse { - /// Deleted Entity - DeletedEntity(models::EntityEdit), +pub enum LookupCreatorResponse { + /// Found Entity + FoundEntity(models::CreatorEntity), /// Bad Request BadRequest(models::ErrorResponse), /// Not Found @@ -213,9 +201,9 @@ pub enum DeleteFileResponse { } #[derive(Debug, PartialEq)] -pub enum DeleteReleaseResponse { - /// Deleted Entity - DeletedEntity(models::EntityEdit), +pub enum UpdateCreatorResponse { + /// Updated Entity + UpdatedEntity(models::EntityEdit), /// Bad Request BadRequest(models::ErrorResponse), /// Not Found @@ -225,9 +213,9 @@ pub enum DeleteReleaseResponse { } #[derive(Debug, PartialEq)] -pub enum DeleteWorkResponse { - /// Deleted Entity - DeletedEntity(models::EntityEdit), +pub enum GetEditorResponse { + /// Found + Found(models::Editor), /// Bad Request BadRequest(models::ErrorResponse), /// Not Found @@ -237,65 +225,61 @@ pub enum DeleteWorkResponse { } #[derive(Debug, PartialEq)] -pub enum GetChangelogResponse { - /// Success - Success(Vec), +pub enum GetEditorChangelogResponse { + /// Found + Found(Vec), + /// Bad Request + BadRequest(models::ErrorResponse), + /// Not Found + NotFound(models::ErrorResponse), /// Generic Error GenericError(models::ErrorResponse), } #[derive(Debug, PartialEq)] -pub enum GetChangelogEntryResponse { - /// Found Changelog Entry - FoundChangelogEntry(models::ChangelogEntry), - /// Not Found - NotFound(models::ErrorResponse), +pub enum GetStatsResponse { + /// Success + Success(models::StatsResponse), /// Generic Error GenericError(models::ErrorResponse), } #[derive(Debug, PartialEq)] -pub enum GetContainerResponse { - /// Found Entity - FoundEntity(models::ContainerEntity), +pub enum AcceptEditgroupResponse { + /// Merged Successfully + MergedSuccessfully(models::Success), /// Bad Request BadRequest(models::ErrorResponse), /// Not Found NotFound(models::ErrorResponse), + /// Edit Conflict + EditConflict(models::ErrorResponse), /// Generic Error GenericError(models::ErrorResponse), } #[derive(Debug, PartialEq)] -pub enum GetContainerHistoryResponse { - /// Found Entity History - FoundEntityHistory(Vec), +pub enum CreateEditgroupResponse { + /// Successfully Created + SuccessfullyCreated(models::Editgroup), /// Bad Request BadRequest(models::ErrorResponse), - /// Not Found - NotFound(models::ErrorResponse), /// Generic Error GenericError(models::ErrorResponse), } #[derive(Debug, PartialEq)] -pub enum GetCreatorResponse { - /// Found Entity - FoundEntity(models::CreatorEntity), - /// Bad Request - BadRequest(models::ErrorResponse), - /// Not Found - NotFound(models::ErrorResponse), +pub enum GetChangelogResponse { + /// Success + Success(Vec), /// Generic Error GenericError(models::ErrorResponse), } #[derive(Debug, PartialEq)] -pub enum GetCreatorHistoryResponse { - /// Found Entity History - FoundEntityHistory(Vec), - /// Bad Request - BadRequest(models::ErrorResponse), +pub enum GetChangelogEntryResponse { + /// Found Changelog Entry + FoundChangelogEntry(models::ChangelogEntry), /// Not Found NotFound(models::ErrorResponse), /// Generic Error @@ -303,9 +287,9 @@ pub enum GetCreatorHistoryResponse { } #[derive(Debug, PartialEq)] -pub enum GetCreatorReleasesResponse { +pub enum GetEditgroupResponse { /// Found - Found(Vec), + Found(models::Editgroup), /// Bad Request BadRequest(models::ErrorResponse), /// Not Found @@ -315,9 +299,9 @@ pub enum GetCreatorReleasesResponse { } #[derive(Debug, PartialEq)] -pub enum GetEditgroupResponse { - /// Found - Found(models::Editgroup), +pub enum CreateFileResponse { + /// Created Entity + CreatedEntity(models::EntityEdit), /// Bad Request BadRequest(models::ErrorResponse), /// Not Found @@ -327,9 +311,9 @@ pub enum GetEditgroupResponse { } #[derive(Debug, PartialEq)] -pub enum GetEditorResponse { - /// Found - Found(models::Editor), +pub enum CreateFileBatchResponse { + /// Created Entities + CreatedEntities(Vec), /// Bad Request BadRequest(models::ErrorResponse), /// Not Found @@ -339,9 +323,9 @@ pub enum GetEditorResponse { } #[derive(Debug, PartialEq)] -pub enum GetEditorChangelogResponse { - /// Found - Found(Vec), +pub enum DeleteFileResponse { + /// Deleted Entity + DeletedEntity(models::EntityEdit), /// Bad Request BadRequest(models::ErrorResponse), /// Not Found @@ -375,9 +359,9 @@ pub enum GetFileHistoryResponse { } #[derive(Debug, PartialEq)] -pub enum GetReleaseResponse { +pub enum LookupFileResponse { /// Found Entity - FoundEntity(models::ReleaseEntity), + FoundEntity(models::FileEntity), /// Bad Request BadRequest(models::ErrorResponse), /// Not Found @@ -387,9 +371,9 @@ pub enum GetReleaseResponse { } #[derive(Debug, PartialEq)] -pub enum GetReleaseFilesResponse { - /// Found - Found(Vec), +pub enum UpdateFileResponse { + /// Updated Entity + UpdatedEntity(models::EntityEdit), /// Bad Request BadRequest(models::ErrorResponse), /// Not Found @@ -399,9 +383,9 @@ pub enum GetReleaseFilesResponse { } #[derive(Debug, PartialEq)] -pub enum GetReleaseHistoryResponse { - /// Found Entity History - FoundEntityHistory(Vec), +pub enum CreateReleaseResponse { + /// Created Entity + CreatedEntity(models::EntityEdit), /// Bad Request BadRequest(models::ErrorResponse), /// Not Found @@ -411,17 +395,9 @@ pub enum GetReleaseHistoryResponse { } #[derive(Debug, PartialEq)] -pub enum GetStatsResponse { - /// Success - Success(models::StatsResponse), - /// Generic Error - GenericError(models::ErrorResponse), -} - -#[derive(Debug, PartialEq)] -pub enum GetWorkResponse { - /// Found Entity - FoundEntity(models::WorkEntity), +pub enum CreateReleaseBatchResponse { + /// Created Entities + CreatedEntities(Vec), /// Bad Request BadRequest(models::ErrorResponse), /// Not Found @@ -431,9 +407,9 @@ pub enum GetWorkResponse { } #[derive(Debug, PartialEq)] -pub enum GetWorkHistoryResponse { - /// Found Entity History - FoundEntityHistory(Vec), +pub enum CreateWorkResponse { + /// Created Entity + CreatedEntity(models::EntityEdit), /// Bad Request BadRequest(models::ErrorResponse), /// Not Found @@ -443,9 +419,9 @@ pub enum GetWorkHistoryResponse { } #[derive(Debug, PartialEq)] -pub enum GetWorkReleasesResponse { - /// Found - Found(Vec), +pub enum DeleteReleaseResponse { + /// Deleted Entity + DeletedEntity(models::EntityEdit), /// Bad Request BadRequest(models::ErrorResponse), /// Not Found @@ -455,9 +431,9 @@ pub enum GetWorkReleasesResponse { } #[derive(Debug, PartialEq)] -pub enum LookupContainerResponse { +pub enum GetReleaseResponse { /// Found Entity - FoundEntity(models::ContainerEntity), + FoundEntity(models::ReleaseEntity), /// Bad Request BadRequest(models::ErrorResponse), /// Not Found @@ -467,9 +443,9 @@ pub enum LookupContainerResponse { } #[derive(Debug, PartialEq)] -pub enum LookupCreatorResponse { - /// Found Entity - FoundEntity(models::CreatorEntity), +pub enum GetReleaseFilesResponse { + /// Found + Found(Vec), /// Bad Request BadRequest(models::ErrorResponse), /// Not Found @@ -479,9 +455,9 @@ pub enum LookupCreatorResponse { } #[derive(Debug, PartialEq)] -pub enum LookupFileResponse { - /// Found Entity - FoundEntity(models::FileEntity), +pub enum GetReleaseHistoryResponse { + /// Found Entity History + FoundEntityHistory(Vec), /// Bad Request BadRequest(models::ErrorResponse), /// Not Found @@ -503,7 +479,7 @@ pub enum LookupReleaseResponse { } #[derive(Debug, PartialEq)] -pub enum UpdateContainerResponse { +pub enum UpdateReleaseResponse { /// Updated Entity UpdatedEntity(models::EntityEdit), /// Bad Request @@ -515,9 +491,9 @@ pub enum UpdateContainerResponse { } #[derive(Debug, PartialEq)] -pub enum UpdateCreatorResponse { - /// Updated Entity - UpdatedEntity(models::EntityEdit), +pub enum CreateWorkBatchResponse { + /// Created Entities + CreatedEntities(Vec), /// Bad Request BadRequest(models::ErrorResponse), /// Not Found @@ -527,9 +503,9 @@ pub enum UpdateCreatorResponse { } #[derive(Debug, PartialEq)] -pub enum UpdateFileResponse { - /// Updated Entity - UpdatedEntity(models::EntityEdit), +pub enum DeleteWorkResponse { + /// Deleted Entity + DeletedEntity(models::EntityEdit), /// Bad Request BadRequest(models::ErrorResponse), /// Not Found @@ -539,9 +515,9 @@ pub enum UpdateFileResponse { } #[derive(Debug, PartialEq)] -pub enum UpdateReleaseResponse { - /// Updated Entity - UpdatedEntity(models::EntityEdit), +pub enum GetWorkResponse { + /// Found Entity + FoundEntity(models::WorkEntity), /// Bad Request BadRequest(models::ErrorResponse), /// Not Found @@ -551,9 +527,9 @@ pub enum UpdateReleaseResponse { } #[derive(Debug, PartialEq)] -pub enum UpdateWorkResponse { - /// Updated Entity - UpdatedEntity(models::EntityEdit), +pub enum GetWorkHistoryResponse { + /// Found Entity History + FoundEntityHistory(Vec), /// Bad Request BadRequest(models::ErrorResponse), /// Not Found @@ -562,12 +538,34 @@ pub enum UpdateWorkResponse { GenericError(models::ErrorResponse), } -/// API -pub trait Api { - fn accept_editgroup(&self, id: String, context: &Context) -> Box + Send>; - - fn create_container(&self, entity: models::ContainerEntity, editgroup: Option, context: &Context) -> Box + Send>; - +#[derive(Debug, PartialEq)] +pub enum GetWorkReleasesResponse { + /// Found + Found(Vec), + /// Bad Request + BadRequest(models::ErrorResponse), + /// Not Found + NotFound(models::ErrorResponse), + /// Generic Error + GenericError(models::ErrorResponse), +} + +#[derive(Debug, PartialEq)] +pub enum UpdateWorkResponse { + /// Updated Entity + UpdatedEntity(models::EntityEdit), + /// Bad Request + BadRequest(models::ErrorResponse), + /// Not Found + NotFound(models::ErrorResponse), + /// Generic Error + GenericError(models::ErrorResponse), +} + +/// API +pub trait Api { + fn create_container(&self, entity: models::ContainerEntity, editgroup: Option, context: &Context) -> Box + Send>; + fn create_container_batch( &self, entity_list: &Vec, @@ -576,6 +574,16 @@ pub trait Api { context: &Context, ) -> Box + Send>; + fn delete_container(&self, id: String, editgroup: Option, context: &Context) -> Box + Send>; + + fn get_container(&self, id: String, expand: Option, context: &Context) -> Box + Send>; + + fn get_container_history(&self, id: String, limit: Option, context: &Context) -> Box + Send>; + + fn lookup_container(&self, issnl: String, context: &Context) -> Box + Send>; + + fn update_container(&self, id: String, entity: models::ContainerEntity, editgroup: Option, context: &Context) -> Box + Send>; + fn create_creator(&self, entity: models::CreatorEntity, editgroup: Option, context: &Context) -> Box + Send>; fn create_creator_batch( @@ -586,7 +594,33 @@ pub trait Api { context: &Context, ) -> Box + Send>; - fn create_editgroup(&self, entity: models::Editgroup, context: &Context) -> Box + Send>; + fn delete_creator(&self, id: String, editgroup: Option, context: &Context) -> Box + Send>; + + fn get_creator(&self, id: String, expand: Option, context: &Context) -> Box + Send>; + + fn get_creator_history(&self, id: String, limit: Option, context: &Context) -> Box + Send>; + + fn get_creator_releases(&self, id: String, context: &Context) -> Box + Send>; + + fn lookup_creator(&self, orcid: String, context: &Context) -> Box + Send>; + + fn update_creator(&self, id: String, entity: models::CreatorEntity, editgroup: Option, context: &Context) -> Box + Send>; + + fn get_editor(&self, id: String, context: &Context) -> Box + Send>; + + fn get_editor_changelog(&self, id: String, context: &Context) -> Box + Send>; + + fn get_stats(&self, more: Option, context: &Context) -> Box + Send>; + + fn accept_editgroup(&self, id: String, context: &Context) -> Box + Send>; + + fn create_editgroup(&self, editgroup: models::Editgroup, context: &Context) -> Box + Send>; + + fn get_changelog(&self, limit: Option, context: &Context) -> Box + Send>; + + fn get_changelog_entry(&self, id: i64, context: &Context) -> Box + Send>; + + fn get_editgroup(&self, id: String, context: &Context) -> Box + Send>; fn create_file(&self, entity: models::FileEntity, editgroup: Option, context: &Context) -> Box + Send>; @@ -598,6 +632,16 @@ pub trait Api { context: &Context, ) -> Box + Send>; + fn delete_file(&self, id: String, editgroup: Option, context: &Context) -> Box + Send>; + + fn get_file(&self, id: String, expand: Option, context: &Context) -> Box + Send>; + + fn get_file_history(&self, id: String, limit: Option, context: &Context) -> Box + Send>; + + fn lookup_file(&self, sha1: String, context: &Context) -> Box + Send>; + + fn update_file(&self, id: String, entity: models::FileEntity, editgroup: Option, context: &Context) -> Box + Send>; + fn create_release(&self, entity: models::ReleaseEntity, editgroup: Option, context: &Context) -> Box + Send>; fn create_release_batch( @@ -610,6 +654,18 @@ pub trait Api { fn create_work(&self, entity: models::WorkEntity, editgroup: Option, context: &Context) -> Box + Send>; + fn delete_release(&self, id: String, editgroup: Option, context: &Context) -> Box + Send>; + + fn get_release(&self, id: String, expand: Option, context: &Context) -> Box + Send>; + + fn get_release_files(&self, id: String, context: &Context) -> Box + Send>; + + fn get_release_history(&self, id: String, limit: Option, context: &Context) -> Box + Send>; + + fn lookup_release(&self, doi: String, context: &Context) -> Box + Send>; + + fn update_release(&self, id: String, entity: models::ReleaseEntity, editgroup: Option, context: &Context) -> Box + Send>; + fn create_work_batch( &self, entity_list: &Vec, @@ -618,77 +674,19 @@ pub trait Api { context: &Context, ) -> Box + Send>; - fn delete_container(&self, id: String, editgroup: Option, context: &Context) -> Box + Send>; - - fn delete_creator(&self, id: String, editgroup: Option, context: &Context) -> Box + Send>; - - fn delete_file(&self, id: String, editgroup: Option, context: &Context) -> Box + Send>; - - fn delete_release(&self, id: String, editgroup: Option, context: &Context) -> Box + Send>; - fn delete_work(&self, id: String, editgroup: Option, context: &Context) -> Box + Send>; - fn get_changelog(&self, limit: Option, context: &Context) -> Box + Send>; - - fn get_changelog_entry(&self, id: i64, context: &Context) -> Box + Send>; - - fn get_container(&self, id: String, expand: Option, context: &Context) -> Box + Send>; - - fn get_container_history(&self, id: String, limit: Option, context: &Context) -> Box + Send>; - - fn get_creator(&self, id: String, expand: Option, context: &Context) -> Box + Send>; - - fn get_creator_history(&self, id: String, limit: Option, context: &Context) -> Box + Send>; - - fn get_creator_releases(&self, id: String, context: &Context) -> Box + Send>; - - fn get_editgroup(&self, id: String, context: &Context) -> Box + Send>; - - fn get_editor(&self, id: String, context: &Context) -> Box + Send>; - - fn get_editor_changelog(&self, id: String, context: &Context) -> Box + Send>; - - fn get_file(&self, id: String, expand: Option, context: &Context) -> Box + Send>; - - fn get_file_history(&self, id: String, limit: Option, context: &Context) -> Box + Send>; - - fn get_release(&self, id: String, expand: Option, context: &Context) -> Box + Send>; - - fn get_release_files(&self, id: String, context: &Context) -> Box + Send>; - - fn get_release_history(&self, id: String, limit: Option, context: &Context) -> Box + Send>; - - fn get_stats(&self, more: Option, context: &Context) -> Box + Send>; - fn get_work(&self, id: String, expand: Option, context: &Context) -> Box + Send>; fn get_work_history(&self, id: String, limit: Option, context: &Context) -> Box + Send>; fn get_work_releases(&self, id: String, context: &Context) -> Box + Send>; - fn lookup_container(&self, issnl: String, context: &Context) -> Box + Send>; - - fn lookup_creator(&self, orcid: String, context: &Context) -> Box + Send>; - - fn lookup_file(&self, sha1: String, context: &Context) -> Box + Send>; - - fn lookup_release(&self, doi: String, context: &Context) -> Box + Send>; - - fn update_container(&self, id: String, entity: models::ContainerEntity, editgroup: Option, context: &Context) -> Box + Send>; - - fn update_creator(&self, id: String, entity: models::CreatorEntity, editgroup: Option, context: &Context) -> Box + Send>; - - fn update_file(&self, id: String, entity: models::FileEntity, editgroup: Option, context: &Context) -> Box + Send>; - - fn update_release(&self, id: String, entity: models::ReleaseEntity, editgroup: Option, context: &Context) -> Box + Send>; - fn update_work(&self, id: String, entity: models::WorkEntity, editgroup: Option, context: &Context) -> Box + Send>; } /// API without a `Context` pub trait ApiNoContext { - fn accept_editgroup(&self, id: String) -> Box + Send>; - fn create_container(&self, entity: models::ContainerEntity, editgroup: Option) -> Box + Send>; fn create_container_batch( @@ -698,6 +696,16 @@ pub trait ApiNoContext { editgroup: Option, ) -> Box + Send>; + fn delete_container(&self, id: String, editgroup: Option) -> Box + Send>; + + fn get_container(&self, id: String, expand: Option) -> Box + Send>; + + fn get_container_history(&self, id: String, limit: Option) -> Box + Send>; + + fn lookup_container(&self, issnl: String) -> Box + Send>; + + fn update_container(&self, id: String, entity: models::ContainerEntity, editgroup: Option) -> Box + Send>; + fn create_creator(&self, entity: models::CreatorEntity, editgroup: Option) -> Box + Send>; fn create_creator_batch( @@ -707,88 +715,80 @@ pub trait ApiNoContext { editgroup: Option, ) -> Box + Send>; - fn create_editgroup(&self, entity: models::Editgroup) -> Box + Send>; - - fn create_file(&self, entity: models::FileEntity, editgroup: Option) -> Box + Send>; + fn delete_creator(&self, id: String, editgroup: Option) -> Box + Send>; - fn create_file_batch(&self, entity_list: &Vec, autoaccept: Option, editgroup: Option) -> Box + Send>; + fn get_creator(&self, id: String, expand: Option) -> Box + Send>; - fn create_release(&self, entity: models::ReleaseEntity, editgroup: Option) -> Box + Send>; + fn get_creator_history(&self, id: String, limit: Option) -> Box + Send>; - fn create_release_batch( - &self, - entity_list: &Vec, - autoaccept: Option, - editgroup: Option, - ) -> Box + Send>; + fn get_creator_releases(&self, id: String) -> Box + Send>; - fn create_work(&self, entity: models::WorkEntity, editgroup: Option) -> Box + Send>; + fn lookup_creator(&self, orcid: String) -> Box + Send>; - fn create_work_batch(&self, entity_list: &Vec, autoaccept: Option, editgroup: Option) -> Box + Send>; + fn update_creator(&self, id: String, entity: models::CreatorEntity, editgroup: Option) -> Box + Send>; - fn delete_container(&self, id: String, editgroup: Option) -> Box + Send>; + fn get_editor(&self, id: String) -> Box + Send>; - fn delete_creator(&self, id: String, editgroup: Option) -> Box + Send>; + fn get_editor_changelog(&self, id: String) -> Box + Send>; - fn delete_file(&self, id: String, editgroup: Option) -> Box + Send>; + fn get_stats(&self, more: Option) -> Box + Send>; - fn delete_release(&self, id: String, editgroup: Option) -> Box + Send>; + fn accept_editgroup(&self, id: String) -> Box + Send>; - fn delete_work(&self, id: String, editgroup: Option) -> Box + Send>; + fn create_editgroup(&self, editgroup: models::Editgroup) -> Box + Send>; fn get_changelog(&self, limit: Option) -> Box + Send>; fn get_changelog_entry(&self, id: i64) -> Box + Send>; - fn get_container(&self, id: String, expand: Option) -> Box + Send>; - - fn get_container_history(&self, id: String, limit: Option) -> Box + Send>; - - fn get_creator(&self, id: String, expand: Option) -> Box + Send>; - - fn get_creator_history(&self, id: String, limit: Option) -> Box + Send>; - - fn get_creator_releases(&self, id: String) -> Box + Send>; - fn get_editgroup(&self, id: String) -> Box + Send>; - fn get_editor(&self, id: String) -> Box + Send>; + fn create_file(&self, entity: models::FileEntity, editgroup: Option) -> Box + Send>; - fn get_editor_changelog(&self, id: String) -> Box + Send>; + fn create_file_batch(&self, entity_list: &Vec, autoaccept: Option, editgroup: Option) -> Box + Send>; + + fn delete_file(&self, id: String, editgroup: Option) -> Box + Send>; fn get_file(&self, id: String, expand: Option) -> Box + Send>; fn get_file_history(&self, id: String, limit: Option) -> Box + Send>; - fn get_release(&self, id: String, expand: Option) -> Box + Send>; - - fn get_release_files(&self, id: String) -> Box + Send>; + fn lookup_file(&self, sha1: String) -> Box + Send>; - fn get_release_history(&self, id: String, limit: Option) -> Box + Send>; + fn update_file(&self, id: String, entity: models::FileEntity, editgroup: Option) -> Box + Send>; - fn get_stats(&self, more: Option) -> Box + Send>; + fn create_release(&self, entity: models::ReleaseEntity, editgroup: Option) -> Box + Send>; - fn get_work(&self, id: String, expand: Option) -> Box + Send>; + fn create_release_batch( + &self, + entity_list: &Vec, + autoaccept: Option, + editgroup: Option, + ) -> Box + Send>; - fn get_work_history(&self, id: String, limit: Option) -> Box + Send>; + fn create_work(&self, entity: models::WorkEntity, editgroup: Option) -> Box + Send>; - fn get_work_releases(&self, id: String) -> Box + Send>; + fn delete_release(&self, id: String, editgroup: Option) -> Box + Send>; - fn lookup_container(&self, issnl: String) -> Box + Send>; + fn get_release(&self, id: String, expand: Option) -> Box + Send>; - fn lookup_creator(&self, orcid: String) -> Box + Send>; + fn get_release_files(&self, id: String) -> Box + Send>; - fn lookup_file(&self, sha1: String) -> Box + Send>; + fn get_release_history(&self, id: String, limit: Option) -> Box + Send>; fn lookup_release(&self, doi: String) -> Box + Send>; - fn update_container(&self, id: String, entity: models::ContainerEntity, editgroup: Option) -> Box + Send>; + fn update_release(&self, id: String, entity: models::ReleaseEntity, editgroup: Option) -> Box + Send>; - fn update_creator(&self, id: String, entity: models::CreatorEntity, editgroup: Option) -> Box + Send>; + fn create_work_batch(&self, entity_list: &Vec, autoaccept: Option, editgroup: Option) -> Box + Send>; - fn update_file(&self, id: String, entity: models::FileEntity, editgroup: Option) -> Box + Send>; + fn delete_work(&self, id: String, editgroup: Option) -> Box + Send>; - fn update_release(&self, id: String, entity: models::ReleaseEntity, editgroup: Option) -> Box + Send>; + fn get_work(&self, id: String, expand: Option) -> Box + Send>; + + fn get_work_history(&self, id: String, limit: Option) -> Box + Send>; + + fn get_work_releases(&self, id: String) -> Box + Send>; fn update_work(&self, id: String, entity: models::WorkEntity, editgroup: Option) -> Box + Send>; } @@ -809,10 +809,6 @@ impl<'a, T: Api + Sized> ContextWrapperExt<'a> for T { } impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { - fn accept_editgroup(&self, id: String) -> Box + Send> { - self.api().accept_editgroup(id, &self.context()) - } - fn create_container(&self, entity: models::ContainerEntity, editgroup: Option) -> Box + Send> { self.api().create_container(entity, editgroup, &self.context()) } @@ -826,110 +822,105 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { self.api().create_container_batch(entity_list, autoaccept, editgroup, &self.context()) } - fn create_creator(&self, entity: models::CreatorEntity, editgroup: Option) -> Box + Send> { - self.api().create_creator(entity, editgroup, &self.context()) + fn delete_container(&self, id: String, editgroup: Option) -> Box + Send> { + self.api().delete_container(id, editgroup, &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 get_container(&self, id: String, expand: Option) -> Box + Send> { + self.api().get_container(id, expand, &self.context()) } - fn create_editgroup(&self, entity: models::Editgroup) -> Box + Send> { - self.api().create_editgroup(entity, &self.context()) + fn get_container_history(&self, id: String, limit: Option) -> Box + Send> { + self.api().get_container_history(id, limit, &self.context()) } - fn create_file(&self, entity: models::FileEntity, editgroup: Option) -> Box + Send> { - self.api().create_file(entity, editgroup, &self.context()) + fn lookup_container(&self, issnl: String) -> Box + Send> { + self.api().lookup_container(issnl, &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 update_container(&self, id: String, entity: models::ContainerEntity, editgroup: Option) -> Box + Send> { + self.api().update_container(id, entity, editgroup, &self.context()) } - fn create_release(&self, entity: models::ReleaseEntity, editgroup: Option) -> Box + Send> { - self.api().create_release(entity, editgroup, &self.context()) + fn create_creator(&self, entity: models::CreatorEntity, editgroup: Option) -> Box + Send> { + self.api().create_creator(entity, editgroup, &self.context()) } - fn create_release_batch( + fn create_creator_batch( &self, - entity_list: &Vec, + 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, editgroup: Option) -> Box + Send> { - self.api().create_work(entity, editgroup, &self.context()) + ) -> Box + Send> { + self.api().create_creator_batch(entity_list, autoaccept, editgroup, &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 delete_creator(&self, id: String, editgroup: Option) -> Box + Send> { + self.api().delete_creator(id, editgroup, &self.context()) } - fn delete_container(&self, id: String, editgroup: Option) -> Box + Send> { - self.api().delete_container(id, editgroup, &self.context()) + fn get_creator(&self, id: String, expand: Option) -> Box + Send> { + self.api().get_creator(id, expand, &self.context()) } - fn delete_creator(&self, id: String, editgroup: Option) -> Box + Send> { - self.api().delete_creator(id, editgroup, &self.context()) + fn get_creator_history(&self, id: String, limit: Option) -> Box + Send> { + self.api().get_creator_history(id, limit, &self.context()) } - fn delete_file(&self, id: String, editgroup: Option) -> Box + Send> { - self.api().delete_file(id, editgroup, &self.context()) + fn get_creator_releases(&self, id: String) -> Box + Send> { + self.api().get_creator_releases(id, &self.context()) } - fn delete_release(&self, id: String, editgroup: Option) -> Box + Send> { - self.api().delete_release(id, editgroup, &self.context()) + fn lookup_creator(&self, orcid: String) -> Box + Send> { + self.api().lookup_creator(orcid, &self.context()) } - fn delete_work(&self, id: String, editgroup: Option) -> Box + Send> { - self.api().delete_work(id, editgroup, &self.context()) + fn update_creator(&self, id: String, entity: models::CreatorEntity, editgroup: Option) -> Box + Send> { + self.api().update_creator(id, entity, editgroup, &self.context()) } - fn get_changelog(&self, limit: Option) -> Box + Send> { - self.api().get_changelog(limit, &self.context()) + fn get_editor(&self, id: String) -> Box + Send> { + self.api().get_editor(id, &self.context()) } - fn get_changelog_entry(&self, id: i64) -> Box + Send> { - self.api().get_changelog_entry(id, &self.context()) + fn get_editor_changelog(&self, id: String) -> Box + Send> { + self.api().get_editor_changelog(id, &self.context()) } - fn get_container(&self, id: String, expand: Option) -> Box + Send> { - self.api().get_container(id, expand, &self.context()) + fn get_stats(&self, more: Option) -> Box + Send> { + self.api().get_stats(more, &self.context()) } - fn get_container_history(&self, id: String, limit: Option) -> Box + Send> { - self.api().get_container_history(id, limit, &self.context()) + fn accept_editgroup(&self, id: String) -> Box + Send> { + self.api().accept_editgroup(id, &self.context()) } - fn get_creator(&self, id: String, expand: Option) -> Box + Send> { - self.api().get_creator(id, expand, &self.context()) + fn create_editgroup(&self, editgroup: models::Editgroup) -> Box + Send> { + self.api().create_editgroup(editgroup, &self.context()) } - fn get_creator_history(&self, id: String, limit: Option) -> Box + Send> { - self.api().get_creator_history(id, limit, &self.context()) + fn get_changelog(&self, limit: Option) -> Box + Send> { + self.api().get_changelog(limit, &self.context()) } - fn get_creator_releases(&self, id: String) -> Box + Send> { - self.api().get_creator_releases(id, &self.context()) + fn get_changelog_entry(&self, id: i64) -> Box + Send> { + self.api().get_changelog_entry(id, &self.context()) } fn get_editgroup(&self, id: String) -> Box + Send> { self.api().get_editgroup(id, &self.context()) } - fn get_editor(&self, id: String) -> Box + Send> { - self.api().get_editor(id, &self.context()) + fn create_file(&self, entity: models::FileEntity, editgroup: Option) -> Box + Send> { + self.api().create_file(entity, editgroup, &self.context()) } - fn get_editor_changelog(&self, id: String) -> Box + Send> { - self.api().get_editor_changelog(id, &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 delete_file(&self, id: String, editgroup: Option) -> Box + Send> { + self.api().delete_file(id, editgroup, &self.context()) } fn get_file(&self, id: String, expand: Option) -> Box + Send> { @@ -940,64 +931,73 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { self.api().get_file_history(id, limit, &self.context()) } - fn get_release(&self, id: String, expand: Option) -> Box + Send> { - self.api().get_release(id, expand, &self.context()) - } - - fn get_release_files(&self, id: String) -> Box + Send> { - self.api().get_release_files(id, &self.context()) + fn lookup_file(&self, sha1: String) -> Box + Send> { + self.api().lookup_file(sha1, &self.context()) } - fn get_release_history(&self, id: String, limit: Option) -> Box + Send> { - self.api().get_release_history(id, limit, &self.context()) + fn update_file(&self, id: String, entity: models::FileEntity, editgroup: Option) -> Box + Send> { + self.api().update_file(id, entity, editgroup, &self.context()) } - fn get_stats(&self, more: Option) -> Box + Send> { - self.api().get_stats(more, &self.context()) + fn create_release(&self, entity: models::ReleaseEntity, editgroup: Option) -> Box + Send> { + self.api().create_release(entity, editgroup, &self.context()) } - fn get_work(&self, id: String, expand: Option) -> Box + Send> { - self.api().get_work(id, expand, &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 get_work_history(&self, id: String, limit: Option) -> Box + Send> { - self.api().get_work_history(id, limit, &self.context()) + fn create_work(&self, entity: models::WorkEntity, editgroup: Option) -> Box + Send> { + self.api().create_work(entity, editgroup, &self.context()) } - fn get_work_releases(&self, id: String) -> Box + Send> { - self.api().get_work_releases(id, &self.context()) + fn delete_release(&self, id: String, editgroup: Option) -> Box + Send> { + self.api().delete_release(id, editgroup, &self.context()) } - fn lookup_container(&self, issnl: String) -> Box + Send> { - self.api().lookup_container(issnl, &self.context()) + fn get_release(&self, id: String, expand: Option) -> Box + Send> { + self.api().get_release(id, expand, &self.context()) } - fn lookup_creator(&self, orcid: String) -> Box + Send> { - self.api().lookup_creator(orcid, &self.context()) + fn get_release_files(&self, id: String) -> Box + Send> { + self.api().get_release_files(id, &self.context()) } - fn lookup_file(&self, sha1: String) -> Box + Send> { - self.api().lookup_file(sha1, &self.context()) + fn get_release_history(&self, id: String, limit: Option) -> Box + Send> { + self.api().get_release_history(id, limit, &self.context()) } fn lookup_release(&self, doi: String) -> Box + Send> { self.api().lookup_release(doi, &self.context()) } - fn update_container(&self, id: String, entity: models::ContainerEntity, editgroup: Option) -> Box + Send> { - self.api().update_container(id, entity, editgroup, &self.context()) + fn update_release(&self, id: String, entity: models::ReleaseEntity, editgroup: Option) -> Box + Send> { + self.api().update_release(id, entity, editgroup, &self.context()) } - fn update_creator(&self, id: String, entity: models::CreatorEntity, editgroup: Option) -> Box + Send> { - self.api().update_creator(id, entity, editgroup, &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 update_file(&self, id: String, entity: models::FileEntity, editgroup: Option) -> Box + Send> { - self.api().update_file(id, entity, editgroup, &self.context()) + fn delete_work(&self, id: String, editgroup: Option) -> Box + Send> { + self.api().delete_work(id, editgroup, &self.context()) } - fn update_release(&self, id: String, entity: models::ReleaseEntity, editgroup: Option) -> Box + Send> { - self.api().update_release(id, entity, editgroup, &self.context()) + fn get_work(&self, id: String, expand: Option) -> Box + Send> { + self.api().get_work(id, expand, &self.context()) + } + + fn get_work_history(&self, id: String, limit: Option) -> Box + Send> { + self.api().get_work_history(id, limit, &self.context()) + } + + fn get_work_releases(&self, id: String) -> Box + Send> { + self.api().get_work_releases(id, &self.context()) } fn update_work(&self, id: String, entity: models::WorkEntity, editgroup: Option) -> Box + Send> { -- cgit v1.2.3