From 061e66c4c41063e6b7321f1f421b5152e9e5a84d Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 13 Dec 2018 19:36:25 +0800 Subject: schema tweaks, and rust codegen --- rust/fatcat-api-spec/src/lib.rs | 464 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 448 insertions(+), 16 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 1650fbe6..dcc6e813 100644 --- a/rust/fatcat-api-spec/src/lib.rs +++ b/rust/fatcat-api-spec/src/lib.rs @@ -68,6 +68,18 @@ pub enum DeleteContainerResponse { GenericError(models::ErrorResponse), } +#[derive(Debug, PartialEq)] +pub enum DeleteContainerEditResponse { + /// Deleted Edit + DeletedEdit(models::Success), + /// Bad Request + BadRequest(models::ErrorResponse), + /// Not Found + NotFound(models::ErrorResponse), + /// Generic Error + GenericError(models::ErrorResponse), +} + #[derive(Debug, PartialEq)] pub enum GetContainerResponse { /// Found Entity @@ -80,6 +92,18 @@ pub enum GetContainerResponse { GenericError(models::ErrorResponse), } +#[derive(Debug, PartialEq)] +pub enum GetContainerEditResponse { + /// Found Edit + FoundEdit(models::EntityEdit), + /// Bad Request + BadRequest(models::ErrorResponse), + /// Not Found + NotFound(models::ErrorResponse), + /// Generic Error + GenericError(models::ErrorResponse), +} + #[derive(Debug, PartialEq)] pub enum GetContainerHistoryResponse { /// Found Entity History @@ -92,6 +116,30 @@ pub enum GetContainerHistoryResponse { GenericError(models::ErrorResponse), } +#[derive(Debug, PartialEq)] +pub enum GetContainerRedirectsResponse { + /// Found Entity Redirects + FoundEntityRedirects(Vec), + /// Bad Request + BadRequest(models::ErrorResponse), + /// Not Found + NotFound(models::ErrorResponse), + /// Generic Error + GenericError(models::ErrorResponse), +} + +#[derive(Debug, PartialEq)] +pub enum GetContainerRevisionResponse { + /// Found Entity Revision + FoundEntityRevision(models::ContainerEntity), + /// Bad Request + BadRequest(models::ErrorResponse), + /// Not Found + NotFound(models::ErrorResponse), + /// Generic Error + GenericError(models::ErrorResponse), +} + #[derive(Debug, PartialEq)] pub enum LookupContainerResponse { /// Found Entity @@ -152,6 +200,18 @@ pub enum DeleteCreatorResponse { GenericError(models::ErrorResponse), } +#[derive(Debug, PartialEq)] +pub enum DeleteCreatorEditResponse { + /// Deleted Edit + DeletedEdit(models::Success), + /// Bad Request + BadRequest(models::ErrorResponse), + /// Not Found + NotFound(models::ErrorResponse), + /// Generic Error + GenericError(models::ErrorResponse), +} + #[derive(Debug, PartialEq)] pub enum GetCreatorResponse { /// Found Entity @@ -164,6 +224,18 @@ pub enum GetCreatorResponse { GenericError(models::ErrorResponse), } +#[derive(Debug, PartialEq)] +pub enum GetCreatorEditResponse { + /// Found Edit + FoundEdit(models::EntityEdit), + /// Bad Request + BadRequest(models::ErrorResponse), + /// Not Found + NotFound(models::ErrorResponse), + /// Generic Error + GenericError(models::ErrorResponse), +} + #[derive(Debug, PartialEq)] pub enum GetCreatorHistoryResponse { /// Found Entity History @@ -176,6 +248,18 @@ pub enum GetCreatorHistoryResponse { GenericError(models::ErrorResponse), } +#[derive(Debug, PartialEq)] +pub enum GetCreatorRedirectsResponse { + /// Found Entity Redirects + FoundEntityRedirects(Vec), + /// Bad Request + BadRequest(models::ErrorResponse), + /// Not Found + NotFound(models::ErrorResponse), + /// Generic Error + GenericError(models::ErrorResponse), +} + #[derive(Debug, PartialEq)] pub enum GetCreatorReleasesResponse { /// Found @@ -188,6 +272,18 @@ pub enum GetCreatorReleasesResponse { GenericError(models::ErrorResponse), } +#[derive(Debug, PartialEq)] +pub enum GetCreatorRevisionResponse { + /// Found Entity Revision + FoundEntityRevision(models::CreatorEntity), + /// Bad Request + BadRequest(models::ErrorResponse), + /// Not Found + NotFound(models::ErrorResponse), + /// Generic Error + GenericError(models::ErrorResponse), +} + #[derive(Debug, PartialEq)] pub enum LookupCreatorResponse { /// Found Entity @@ -334,6 +430,18 @@ pub enum DeleteFileResponse { GenericError(models::ErrorResponse), } +#[derive(Debug, PartialEq)] +pub enum DeleteFileEditResponse { + /// Deleted Edit + DeletedEdit(models::Success), + /// Bad Request + BadRequest(models::ErrorResponse), + /// Not Found + NotFound(models::ErrorResponse), + /// Generic Error + GenericError(models::ErrorResponse), +} + #[derive(Debug, PartialEq)] pub enum GetFileResponse { /// Found Entity @@ -346,6 +454,18 @@ pub enum GetFileResponse { GenericError(models::ErrorResponse), } +#[derive(Debug, PartialEq)] +pub enum GetFileEditResponse { + /// Found Edit + FoundEdit(models::EntityEdit), + /// Bad Request + BadRequest(models::ErrorResponse), + /// Not Found + NotFound(models::ErrorResponse), + /// Generic Error + GenericError(models::ErrorResponse), +} + #[derive(Debug, PartialEq)] pub enum GetFileHistoryResponse { /// Found Entity History @@ -358,6 +478,30 @@ pub enum GetFileHistoryResponse { GenericError(models::ErrorResponse), } +#[derive(Debug, PartialEq)] +pub enum GetFileRedirectsResponse { + /// Found Entity Redirects + FoundEntityRedirects(Vec), + /// Bad Request + BadRequest(models::ErrorResponse), + /// Not Found + NotFound(models::ErrorResponse), + /// Generic Error + GenericError(models::ErrorResponse), +} + +#[derive(Debug, PartialEq)] +pub enum GetFileRevisionResponse { + /// Found Entity Revision + FoundEntityRevision(models::FileEntity), + /// Bad Request + BadRequest(models::ErrorResponse), + /// Not Found + NotFound(models::ErrorResponse), + /// Generic Error + GenericError(models::ErrorResponse), +} + #[derive(Debug, PartialEq)] pub enum LookupFileResponse { /// Found Entity @@ -430,6 +574,18 @@ pub enum DeleteReleaseResponse { GenericError(models::ErrorResponse), } +#[derive(Debug, PartialEq)] +pub enum DeleteReleaseEditResponse { + /// Deleted Edit + DeletedEdit(models::Success), + /// Bad Request + BadRequest(models::ErrorResponse), + /// Not Found + NotFound(models::ErrorResponse), + /// Generic Error + GenericError(models::ErrorResponse), +} + #[derive(Debug, PartialEq)] pub enum GetReleaseResponse { /// Found Entity @@ -442,6 +598,18 @@ pub enum GetReleaseResponse { GenericError(models::ErrorResponse), } +#[derive(Debug, PartialEq)] +pub enum GetReleaseEditResponse { + /// Found Edit + FoundEdit(models::EntityEdit), + /// Bad Request + BadRequest(models::ErrorResponse), + /// Not Found + NotFound(models::ErrorResponse), + /// Generic Error + GenericError(models::ErrorResponse), +} + #[derive(Debug, PartialEq)] pub enum GetReleaseFilesResponse { /// Found @@ -466,6 +634,30 @@ pub enum GetReleaseHistoryResponse { GenericError(models::ErrorResponse), } +#[derive(Debug, PartialEq)] +pub enum GetReleaseRedirectsResponse { + /// Found Entity Redirects + FoundEntityRedirects(Vec), + /// Bad Request + BadRequest(models::ErrorResponse), + /// Not Found + NotFound(models::ErrorResponse), + /// Generic Error + GenericError(models::ErrorResponse), +} + +#[derive(Debug, PartialEq)] +pub enum GetReleaseRevisionResponse { + /// Found Entity Revision + FoundEntityRevision(models::ReleaseEntity), + /// Bad Request + BadRequest(models::ErrorResponse), + /// Not Found + NotFound(models::ErrorResponse), + /// Generic Error + GenericError(models::ErrorResponse), +} + #[derive(Debug, PartialEq)] pub enum LookupReleaseResponse { /// Found Entity @@ -514,6 +706,18 @@ pub enum DeleteWorkResponse { GenericError(models::ErrorResponse), } +#[derive(Debug, PartialEq)] +pub enum DeleteWorkEditResponse { + /// Deleted Edit + DeletedEdit(models::Success), + /// Bad Request + BadRequest(models::ErrorResponse), + /// Not Found + NotFound(models::ErrorResponse), + /// Generic Error + GenericError(models::ErrorResponse), +} + #[derive(Debug, PartialEq)] pub enum GetWorkResponse { /// Found Entity @@ -526,6 +730,18 @@ pub enum GetWorkResponse { GenericError(models::ErrorResponse), } +#[derive(Debug, PartialEq)] +pub enum GetWorkEditResponse { + /// Found Edit + FoundEdit(models::EntityEdit), + /// Bad Request + BadRequest(models::ErrorResponse), + /// Not Found + NotFound(models::ErrorResponse), + /// Generic Error + GenericError(models::ErrorResponse), +} + #[derive(Debug, PartialEq)] pub enum GetWorkHistoryResponse { /// Found Entity History @@ -538,6 +754,18 @@ pub enum GetWorkHistoryResponse { GenericError(models::ErrorResponse), } +#[derive(Debug, PartialEq)] +pub enum GetWorkRedirectsResponse { + /// Found Entity Redirects + FoundEntityRedirects(Vec), + /// Bad Request + BadRequest(models::ErrorResponse), + /// Not Found + NotFound(models::ErrorResponse), + /// Generic Error + GenericError(models::ErrorResponse), +} + #[derive(Debug, PartialEq)] pub enum GetWorkReleasesResponse { /// Found @@ -550,6 +778,18 @@ pub enum GetWorkReleasesResponse { GenericError(models::ErrorResponse), } +#[derive(Debug, PartialEq)] +pub enum GetWorkRevisionResponse { + /// Found Entity Revision + FoundEntityRevision(models::WorkEntity), + /// Bad Request + BadRequest(models::ErrorResponse), + /// Not Found + NotFound(models::ErrorResponse), + /// Generic Error + GenericError(models::ErrorResponse), +} + #[derive(Debug, PartialEq)] pub enum UpdateWorkResponse { /// Updated Entity @@ -576,11 +816,19 @@ pub trait Api { fn delete_container(&self, id: String, editgroup: Option, context: &Context) -> Box + Send>; + fn delete_container_edit(&self, edit_id: i64, context: &Context) -> Box + Send>; + fn get_container(&self, id: String, expand: Option, hide: Option, context: &Context) -> Box + Send>; + fn get_container_edit(&self, edit_id: i64, context: &Context) -> Box + Send>; + fn get_container_history(&self, id: String, limit: Option, context: &Context) -> Box + Send>; - fn lookup_container(&self, issnl: String, hide: Option, context: &Context) -> Box + Send>; + fn get_container_redirects(&self, id: String, context: &Context) -> Box + Send>; + + fn get_container_revision(&self, id: String, expand: Option, hide: Option, context: &Context) -> Box + Send>; + + fn lookup_container(&self, issnl: Option, wikidata_qid: Option, hide: Option, context: &Context) -> Box + Send>; fn update_container(&self, id: String, entity: models::ContainerEntity, editgroup: Option, context: &Context) -> Box + Send>; @@ -596,13 +844,21 @@ pub trait Api { fn delete_creator(&self, id: String, editgroup: Option, context: &Context) -> Box + Send>; + fn delete_creator_edit(&self, edit_id: i64, context: &Context) -> Box + Send>; + fn get_creator(&self, id: String, expand: Option, hide: Option, context: &Context) -> Box + Send>; + fn get_creator_edit(&self, edit_id: i64, context: &Context) -> Box + Send>; + fn get_creator_history(&self, id: String, limit: Option, context: &Context) -> Box + Send>; + fn get_creator_redirects(&self, id: String, context: &Context) -> Box + Send>; + fn get_creator_releases(&self, id: String, hide: Option, context: &Context) -> Box + Send>; - fn lookup_creator(&self, orcid: String, hide: Option, context: &Context) -> Box + Send>; + fn get_creator_revision(&self, id: String, expand: Option, hide: Option, context: &Context) -> Box + Send>; + + fn lookup_creator(&self, orcid: Option, wikidata_qid: Option, hide: Option, context: &Context) -> Box + Send>; fn update_creator(&self, id: String, entity: models::CreatorEntity, editgroup: Option, context: &Context) -> Box + Send>; @@ -634,11 +890,26 @@ pub trait Api { fn delete_file(&self, id: String, editgroup: Option, context: &Context) -> Box + Send>; + fn delete_file_edit(&self, edit_id: i64, context: &Context) -> Box + Send>; + fn get_file(&self, id: String, expand: Option, hide: Option, context: &Context) -> Box + Send>; + fn get_file_edit(&self, edit_id: i64, context: &Context) -> Box + Send>; + fn get_file_history(&self, id: String, limit: Option, context: &Context) -> Box + Send>; - fn lookup_file(&self, sha1: String, hide: Option, context: &Context) -> Box + Send>; + fn get_file_redirects(&self, id: String, context: &Context) -> Box + Send>; + + fn get_file_revision(&self, id: String, expand: Option, hide: Option, context: &Context) -> Box + Send>; + + fn lookup_file( + &self, + md5: Option, + sha1: Option, + sha256: Option, + hide: Option, + context: &Context, + ) -> Box + Send>; fn update_file(&self, id: String, entity: models::FileEntity, editgroup: Option, context: &Context) -> Box + Send>; @@ -656,13 +927,30 @@ pub trait Api { fn delete_release(&self, id: String, editgroup: Option, context: &Context) -> Box + Send>; + fn delete_release_edit(&self, edit_id: i64, context: &Context) -> Box + Send>; + fn get_release(&self, id: String, expand: Option, hide: Option, context: &Context) -> Box + Send>; + fn get_release_edit(&self, edit_id: i64, context: &Context) -> Box + Send>; + fn get_release_files(&self, id: String, hide: Option, context: &Context) -> Box + Send>; fn get_release_history(&self, id: String, limit: Option, context: &Context) -> Box + Send>; - fn lookup_release(&self, doi: String, hide: Option, context: &Context) -> Box + Send>; + fn get_release_redirects(&self, id: String, context: &Context) -> Box + Send>; + + fn get_release_revision(&self, id: String, expand: Option, hide: Option, context: &Context) -> Box + Send>; + + fn lookup_release( + &self, + doi: Option, + wikidata_qid: Option, + isbn13: Option, + pmid: Option, + pmcid: Option, + hide: Option, + context: &Context, + ) -> Box + Send>; fn update_release(&self, id: String, entity: models::ReleaseEntity, editgroup: Option, context: &Context) -> Box + Send>; @@ -676,12 +964,20 @@ pub trait Api { fn delete_work(&self, id: String, editgroup: Option, context: &Context) -> Box + Send>; + fn delete_work_edit(&self, edit_id: i64, context: &Context) -> Box + Send>; + fn get_work(&self, id: String, expand: Option, hide: Option, context: &Context) -> Box + Send>; + fn get_work_edit(&self, edit_id: i64, context: &Context) -> Box + Send>; + fn get_work_history(&self, id: String, limit: Option, context: &Context) -> Box + Send>; + fn get_work_redirects(&self, id: String, context: &Context) -> Box + Send>; + fn get_work_releases(&self, id: String, hide: Option, context: &Context) -> Box + Send>; + fn get_work_revision(&self, id: String, expand: Option, hide: Option, context: &Context) -> Box + Send>; + fn update_work(&self, id: String, entity: models::WorkEntity, editgroup: Option, context: &Context) -> Box + Send>; } @@ -698,11 +994,19 @@ pub trait ApiNoContext { fn delete_container(&self, id: String, editgroup: Option) -> Box + Send>; + fn delete_container_edit(&self, edit_id: i64) -> Box + Send>; + fn get_container(&self, id: String, expand: Option, hide: Option) -> Box + Send>; + fn get_container_edit(&self, edit_id: i64) -> Box + Send>; + fn get_container_history(&self, id: String, limit: Option) -> Box + Send>; - fn lookup_container(&self, issnl: String, hide: Option) -> Box + Send>; + fn get_container_redirects(&self, id: String) -> Box + Send>; + + fn get_container_revision(&self, id: String, expand: Option, hide: Option) -> Box + Send>; + + fn lookup_container(&self, issnl: Option, wikidata_qid: Option, hide: Option) -> Box + Send>; fn update_container(&self, id: String, entity: models::ContainerEntity, editgroup: Option) -> Box + Send>; @@ -717,13 +1021,21 @@ pub trait ApiNoContext { fn delete_creator(&self, id: String, editgroup: Option) -> Box + Send>; + fn delete_creator_edit(&self, edit_id: i64) -> Box + Send>; + fn get_creator(&self, id: String, expand: Option, hide: Option) -> Box + Send>; + fn get_creator_edit(&self, edit_id: i64) -> Box + Send>; + fn get_creator_history(&self, id: String, limit: Option) -> Box + Send>; + fn get_creator_redirects(&self, id: String) -> Box + Send>; + fn get_creator_releases(&self, id: String, hide: Option) -> Box + Send>; - fn lookup_creator(&self, orcid: String, hide: Option) -> Box + Send>; + fn get_creator_revision(&self, id: String, expand: Option, hide: Option) -> Box + Send>; + + fn lookup_creator(&self, orcid: Option, wikidata_qid: Option, hide: Option) -> Box + Send>; fn update_creator(&self, id: String, entity: models::CreatorEntity, editgroup: Option) -> Box + Send>; @@ -749,11 +1061,19 @@ pub trait ApiNoContext { fn delete_file(&self, id: String, editgroup: Option) -> Box + Send>; + fn delete_file_edit(&self, edit_id: i64) -> Box + Send>; + fn get_file(&self, id: String, expand: Option, hide: Option) -> Box + Send>; + fn get_file_edit(&self, edit_id: i64) -> Box + Send>; + fn get_file_history(&self, id: String, limit: Option) -> Box + Send>; - fn lookup_file(&self, sha1: String, hide: Option) -> Box + Send>; + fn get_file_redirects(&self, id: String) -> Box + Send>; + + fn get_file_revision(&self, id: String, expand: Option, hide: Option) -> Box + Send>; + + fn lookup_file(&self, md5: Option, sha1: Option, sha256: Option, hide: Option) -> Box + Send>; fn update_file(&self, id: String, entity: models::FileEntity, editgroup: Option) -> Box + Send>; @@ -770,13 +1090,29 @@ pub trait ApiNoContext { fn delete_release(&self, id: String, editgroup: Option) -> Box + Send>; + fn delete_release_edit(&self, edit_id: i64) -> Box + Send>; + fn get_release(&self, id: String, expand: Option, hide: Option) -> Box + Send>; + fn get_release_edit(&self, edit_id: i64) -> Box + Send>; + fn get_release_files(&self, id: String, hide: Option) -> Box + Send>; fn get_release_history(&self, id: String, limit: Option) -> Box + Send>; - fn lookup_release(&self, doi: String, hide: Option) -> Box + Send>; + fn get_release_redirects(&self, id: String) -> Box + Send>; + + fn get_release_revision(&self, id: String, expand: Option, hide: Option) -> Box + Send>; + + fn lookup_release( + &self, + doi: Option, + wikidata_qid: Option, + isbn13: Option, + pmid: Option, + pmcid: Option, + hide: Option, + ) -> Box + Send>; fn update_release(&self, id: String, entity: models::ReleaseEntity, editgroup: Option) -> Box + Send>; @@ -784,12 +1120,20 @@ pub trait ApiNoContext { fn delete_work(&self, id: String, editgroup: Option) -> Box + Send>; + fn delete_work_edit(&self, edit_id: i64) -> Box + Send>; + fn get_work(&self, id: String, expand: Option, hide: Option) -> Box + Send>; + fn get_work_edit(&self, edit_id: i64) -> Box + Send>; + fn get_work_history(&self, id: String, limit: Option) -> Box + Send>; + fn get_work_redirects(&self, id: String) -> Box + Send>; + fn get_work_releases(&self, id: String, hide: Option) -> Box + Send>; + fn get_work_revision(&self, id: String, expand: Option, hide: Option) -> Box + Send>; + fn update_work(&self, id: String, entity: models::WorkEntity, editgroup: Option) -> Box + Send>; } @@ -826,16 +1170,32 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { self.api().delete_container(id, editgroup, &self.context()) } + fn delete_container_edit(&self, edit_id: i64) -> Box + Send> { + self.api().delete_container_edit(edit_id, &self.context()) + } + fn get_container(&self, id: String, expand: Option, hide: Option) -> Box + Send> { self.api().get_container(id, expand, hide, &self.context()) } + fn get_container_edit(&self, edit_id: i64) -> Box + Send> { + self.api().get_container_edit(edit_id, &self.context()) + } + fn get_container_history(&self, id: String, limit: Option) -> Box + Send> { self.api().get_container_history(id, limit, &self.context()) } - fn lookup_container(&self, issnl: String, hide: Option) -> Box + Send> { - self.api().lookup_container(issnl, hide, &self.context()) + fn get_container_redirects(&self, id: String) -> Box + Send> { + self.api().get_container_redirects(id, &self.context()) + } + + fn get_container_revision(&self, id: String, expand: Option, hide: Option) -> Box + Send> { + self.api().get_container_revision(id, expand, hide, &self.context()) + } + + fn lookup_container(&self, issnl: Option, wikidata_qid: Option, hide: Option) -> Box + Send> { + self.api().lookup_container(issnl, wikidata_qid, hide, &self.context()) } fn update_container(&self, id: String, entity: models::ContainerEntity, editgroup: Option) -> Box + Send> { @@ -859,20 +1219,36 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { self.api().delete_creator(id, editgroup, &self.context()) } + fn delete_creator_edit(&self, edit_id: i64) -> Box + Send> { + self.api().delete_creator_edit(edit_id, &self.context()) + } + fn get_creator(&self, id: String, expand: Option, hide: Option) -> Box + Send> { self.api().get_creator(id, expand, hide, &self.context()) } + fn get_creator_edit(&self, edit_id: i64) -> Box + Send> { + self.api().get_creator_edit(edit_id, &self.context()) + } + fn get_creator_history(&self, id: String, limit: Option) -> Box + Send> { self.api().get_creator_history(id, limit, &self.context()) } + fn get_creator_redirects(&self, id: String) -> Box + Send> { + self.api().get_creator_redirects(id, &self.context()) + } + fn get_creator_releases(&self, id: String, hide: Option) -> Box + Send> { self.api().get_creator_releases(id, hide, &self.context()) } - fn lookup_creator(&self, orcid: String, hide: Option) -> Box + Send> { - self.api().lookup_creator(orcid, hide, &self.context()) + fn get_creator_revision(&self, id: String, expand: Option, hide: Option) -> Box + Send> { + self.api().get_creator_revision(id, expand, hide, &self.context()) + } + + fn lookup_creator(&self, orcid: Option, wikidata_qid: Option, hide: Option) -> Box + Send> { + self.api().lookup_creator(orcid, wikidata_qid, hide, &self.context()) } fn update_creator(&self, id: String, entity: models::CreatorEntity, editgroup: Option) -> Box + Send> { @@ -923,16 +1299,32 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { self.api().delete_file(id, editgroup, &self.context()) } + fn delete_file_edit(&self, edit_id: i64) -> Box + Send> { + self.api().delete_file_edit(edit_id, &self.context()) + } + fn get_file(&self, id: String, expand: Option, hide: Option) -> Box + Send> { self.api().get_file(id, expand, hide, &self.context()) } + fn get_file_edit(&self, edit_id: i64) -> Box + Send> { + self.api().get_file_edit(edit_id, &self.context()) + } + fn get_file_history(&self, id: String, limit: Option) -> Box + Send> { self.api().get_file_history(id, limit, &self.context()) } - fn lookup_file(&self, sha1: String, hide: Option) -> Box + Send> { - self.api().lookup_file(sha1, hide, &self.context()) + fn get_file_redirects(&self, id: String) -> Box + Send> { + self.api().get_file_redirects(id, &self.context()) + } + + fn get_file_revision(&self, id: String, expand: Option, hide: Option) -> Box + Send> { + self.api().get_file_revision(id, expand, hide, &self.context()) + } + + fn lookup_file(&self, md5: Option, sha1: Option, sha256: Option, hide: Option) -> Box + Send> { + self.api().lookup_file(md5, sha1, sha256, hide, &self.context()) } fn update_file(&self, id: String, entity: models::FileEntity, editgroup: Option) -> Box + Send> { @@ -960,10 +1352,18 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { self.api().delete_release(id, editgroup, &self.context()) } + fn delete_release_edit(&self, edit_id: i64) -> Box + Send> { + self.api().delete_release_edit(edit_id, &self.context()) + } + fn get_release(&self, id: String, expand: Option, hide: Option) -> Box + Send> { self.api().get_release(id, expand, hide, &self.context()) } + fn get_release_edit(&self, edit_id: i64) -> Box + Send> { + self.api().get_release_edit(edit_id, &self.context()) + } + fn get_release_files(&self, id: String, hide: Option) -> Box + Send> { self.api().get_release_files(id, hide, &self.context()) } @@ -972,8 +1372,24 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { self.api().get_release_history(id, limit, &self.context()) } - fn lookup_release(&self, doi: String, hide: Option) -> Box + Send> { - self.api().lookup_release(doi, hide, &self.context()) + fn get_release_redirects(&self, id: String) -> Box + Send> { + self.api().get_release_redirects(id, &self.context()) + } + + fn get_release_revision(&self, id: String, expand: Option, hide: Option) -> Box + Send> { + self.api().get_release_revision(id, expand, hide, &self.context()) + } + + fn lookup_release( + &self, + doi: Option, + wikidata_qid: Option, + isbn13: Option, + pmid: Option, + pmcid: Option, + hide: Option, + ) -> Box + Send> { + self.api().lookup_release(doi, wikidata_qid, isbn13, pmid, pmcid, hide, &self.context()) } fn update_release(&self, id: String, entity: models::ReleaseEntity, editgroup: Option) -> Box + Send> { @@ -988,18 +1404,34 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { self.api().delete_work(id, editgroup, &self.context()) } + fn delete_work_edit(&self, edit_id: i64) -> Box + Send> { + self.api().delete_work_edit(edit_id, &self.context()) + } + fn get_work(&self, id: String, expand: Option, hide: Option) -> Box + Send> { self.api().get_work(id, expand, hide, &self.context()) } + fn get_work_edit(&self, edit_id: i64) -> Box + Send> { + self.api().get_work_edit(edit_id, &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_redirects(&self, id: String) -> Box + Send> { + self.api().get_work_redirects(id, &self.context()) + } + fn get_work_releases(&self, id: String, hide: Option) -> Box + Send> { self.api().get_work_releases(id, hide, &self.context()) } + fn get_work_revision(&self, id: String, expand: Option, hide: Option) -> Box + Send> { + self.api().get_work_revision(id, expand, hide, &self.context()) + } + fn update_work(&self, id: String, entity: models::WorkEntity, editgroup: Option) -> Box + Send> { self.api().update_work(id, entity, editgroup, &self.context()) } -- cgit v1.2.3