From 3a45076685471b969596ef5b58823ce8074224c6 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Tue, 12 Oct 2021 16:45:07 -0700 Subject: rust codegen for v0.4 --- rust/fatcat-openapi/src/lib.rs | 55 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 52 insertions(+), 3 deletions(-) (limited to 'rust/fatcat-openapi/src/lib.rs') diff --git a/rust/fatcat-openapi/src/lib.rs b/rust/fatcat-openapi/src/lib.rs index 4fe878e1..686cd84e 100644 --- a/rust/fatcat-openapi/src/lib.rs +++ b/rust/fatcat-openapi/src/lib.rs @@ -562,6 +562,18 @@ pub enum GetEditorEditgroupsResponse { GenericError(models::ErrorResponse), } +#[derive(Debug, PartialEq)] +pub enum LookupEditorResponse { + /// Found + Found(models::Editor), + /// Bad Request + BadRequest(models::ErrorResponse), + /// Not Found + NotFound(models::ErrorResponse), + /// Generic Error + GenericError(models::ErrorResponse), +} + #[derive(Debug, PartialEq)] pub enum UpdateEditorResponse { /// Updated Editor @@ -1383,6 +1395,9 @@ pub trait Api { fn lookup_container( &self, issnl: Option, + issne: Option, + issnp: Option, + issn: Option, wikidata_qid: Option, expand: Option, hide: Option, @@ -1469,6 +1484,8 @@ pub trait Api { context: &Context, ) -> Box + Send>; + fn lookup_editor(&self, username: Option, context: &Context) -> Box + Send>; + fn update_editor(&self, editor_id: String, editor: models::Editor, context: &Context) -> Box + Send>; fn create_file(&self, editgroup_id: String, entity: models::FileEntity, context: &Context) -> Box + Send>; @@ -1560,6 +1577,7 @@ pub trait Api { doaj: Option, dblp: Option, oai: Option, + hdl: Option, expand: Option, hide: Option, context: &Context, @@ -1649,6 +1667,9 @@ pub trait ApiNoContext { fn lookup_container( &self, issnl: Option, + issne: Option, + issnp: Option, + issn: Option, wikidata_qid: Option, expand: Option, hide: Option, @@ -1724,6 +1745,8 @@ pub trait ApiNoContext { since: Option>, ) -> Box + Send>; + fn lookup_editor(&self, username: Option) -> Box + Send>; + fn update_editor(&self, editor_id: String, editor: models::Editor) -> Box + Send>; fn create_file(&self, editgroup_id: String, entity: models::FileEntity) -> Box + Send>; @@ -1814,6 +1837,7 @@ pub trait ApiNoContext { doaj: Option, dblp: Option, oai: Option, + hdl: Option, expand: Option, hide: Option, ) -> Box + Send>; @@ -1938,11 +1962,14 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { fn lookup_container( &self, issnl: Option, + issne: Option, + issnp: Option, + issn: Option, wikidata_qid: Option, expand: Option, hide: Option, ) -> Box + Send> { - self.api().lookup_container(issnl, wikidata_qid, expand, hide, &self.context()) + self.api().lookup_container(issnl, issne, issnp, issn, wikidata_qid, expand, hide, &self.context()) } fn update_container(&self, editgroup_id: String, ident: String, entity: models::ContainerEntity) -> Box + Send> { @@ -2061,6 +2088,10 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { self.api().get_editor_editgroups(editor_id, limit, before, since, &self.context()) } + fn lookup_editor(&self, username: Option) -> Box + Send> { + self.api().lookup_editor(username, &self.context()) + } + fn update_editor(&self, editor_id: String, editor: models::Editor) -> Box + Send> { self.api().update_editor(editor_id, editor, &self.context()) } @@ -2219,11 +2250,29 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { doaj: Option, dblp: Option, oai: Option, + hdl: Option, expand: Option, hide: Option, ) -> Box + Send> { - self.api() - .lookup_release(doi, wikidata_qid, isbn13, pmid, pmcid, core, arxiv, jstor, ark, mag, doaj, dblp, oai, expand, hide, &self.context()) + self.api().lookup_release( + doi, + wikidata_qid, + isbn13, + pmid, + pmcid, + core, + arxiv, + jstor, + ark, + mag, + doaj, + dblp, + oai, + hdl, + expand, + hide, + &self.context(), + ) } fn update_release(&self, editgroup_id: String, ident: String, entity: models::ReleaseEntity) -> Box + Send> { -- cgit v1.2.3