From 0a71247fb61a91c1f6d519762013c1445713a728 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 13 Oct 2021 17:42:41 -0700 Subject: codegen for API schema v0.4.0 --- fatcat-openapi/src/lib.rs | 58 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 56 insertions(+), 2 deletions(-) (limited to 'fatcat-openapi/src/lib.rs') diff --git a/fatcat-openapi/src/lib.rs b/fatcat-openapi/src/lib.rs index ba49f27..8dd8e15 100644 --- a/fatcat-openapi/src/lib.rs +++ b/fatcat-openapi/src/lib.rs @@ -17,7 +17,7 @@ use swagger::{ApiError, ContextWrapper}; type ServiceError = Box; pub const BASE_PATH: &'static str = "/v0"; -pub const API_VERSION: &'static str = "0.3.3"; +pub const API_VERSION: &'static str = "0.4.0"; #[derive(Debug, PartialEq)] #[must_use] @@ -1361,6 +1361,19 @@ pub enum LookupCreatorResponse { GenericError(models::ErrorResponse), } +#[derive(Debug, PartialEq)] +#[must_use] +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)] #[must_use] pub enum LookupFileResponse { @@ -2145,6 +2158,9 @@ pub trait Api { async fn lookup_container( &self, issnl: Option, + issne: Option, + issnp: Option, + issn: Option, wikidata_qid: Option, expand: Option, hide: Option, @@ -2160,6 +2176,12 @@ pub trait Api { context: &C, ) -> Result; + async fn lookup_editor( + &self, + username: Option, + context: &C, + ) -> Result; + async fn lookup_file( &self, md5: Option, @@ -2185,6 +2207,7 @@ pub trait Api { doaj: Option, dblp: Option, oai: Option, + hdl: Option, expand: Option, hide: Option, context: &C, @@ -2721,6 +2744,9 @@ pub trait ApiNoContext { async fn lookup_container( &self, issnl: Option, + issne: Option, + issnp: Option, + issn: Option, wikidata_qid: Option, expand: Option, hide: Option, @@ -2734,6 +2760,11 @@ pub trait ApiNoContext { hide: Option, ) -> Result; + async fn lookup_editor( + &self, + username: Option, + ) -> Result; + async fn lookup_file( &self, md5: Option, @@ -2758,6 +2789,7 @@ pub trait ApiNoContext { doaj: Option, dblp: Option, oai: Option, + hdl: Option, expand: Option, hide: Option, ) -> Result; @@ -3637,13 +3669,25 @@ impl + Send + Sync, C: Clone + Send + Sync> ApiNoContext for Contex async fn lookup_container( &self, issnl: Option, + issne: Option, + issnp: Option, + issn: Option, wikidata_qid: Option, expand: Option, hide: Option, ) -> Result { let context = self.context().clone(); self.api() - .lookup_container(issnl, wikidata_qid, expand, hide, &context) + .lookup_container( + issnl, + issne, + issnp, + issn, + wikidata_qid, + expand, + hide, + &context, + ) .await } @@ -3660,6 +3704,14 @@ impl + Send + Sync, C: Clone + Send + Sync> ApiNoContext for Contex .await } + async fn lookup_editor( + &self, + username: Option, + ) -> Result { + let context = self.context().clone(); + self.api().lookup_editor(username, &context).await + } + async fn lookup_file( &self, md5: Option, @@ -3689,6 +3741,7 @@ impl + Send + Sync, C: Clone + Send + Sync> ApiNoContext for Contex doaj: Option, dblp: Option, oai: Option, + hdl: Option, expand: Option, hide: Option, ) -> Result { @@ -3708,6 +3761,7 @@ impl + Send + Sync, C: Clone + Send + Sync> ApiNoContext for Contex doaj, dblp, oai, + hdl, expand, hide, &context, -- cgit v1.2.3