diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2020-11-19 12:19:38 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2020-11-19 14:55:15 -0800 |
commit | 40b5d40bed9e20e5c7a40d1741601a8317e078d8 (patch) | |
tree | 67c46917c2d2be2dc4d30543656a39ca5a3c014e /rust/fatcat-openapi/src | |
parent | ba4a85cf2ee51d775137541944e2e9d24b2e1bc9 (diff) | |
download | fatcat-40b5d40bed9e20e5c7a40d1741601a8317e078d8.tar.gz fatcat-40b5d40bed9e20e5c7a40d1741601a8317e078d8.zip |
codegen rust schema crate
Diffstat (limited to 'rust/fatcat-openapi/src')
-rw-r--r-- | rust/fatcat-openapi/src/client.rs | 5 | ||||
-rw-r--r-- | rust/fatcat-openapi/src/lib.rs | 5 | ||||
-rw-r--r-- | rust/fatcat-openapi/src/models.rs | 6 | ||||
-rw-r--r-- | rust/fatcat-openapi/src/server.rs | 2 |
4 files changed, 16 insertions, 2 deletions
diff --git a/rust/fatcat-openapi/src/client.rs b/rust/fatcat-openapi/src/client.rs index 45591b9a..fdb03405 100644 --- a/rust/fatcat-openapi/src/client.rs +++ b/rust/fatcat-openapi/src/client.rs @@ -5879,6 +5879,7 @@ impl Api for Client { param_mag: Option<String>, param_doaj: Option<String>, param_dblp: Option<String>, + param_oai: Option<String>, param_expand: Option<String>, param_hide: Option<String>, context: &Context, @@ -5896,11 +5897,12 @@ impl Api for Client { let query_mag = param_mag.map_or_else(String::new, |query| format!("mag={mag}&", mag = query.to_string())); let query_doaj = param_doaj.map_or_else(String::new, |query| format!("doaj={doaj}&", doaj = query.to_string())); let query_dblp = param_dblp.map_or_else(String::new, |query| format!("dblp={dblp}&", dblp = query.to_string())); + let query_oai = param_oai.map_or_else(String::new, |query| format!("oai={oai}&", oai = query.to_string())); let query_expand = param_expand.map_or_else(String::new, |query| format!("expand={expand}&", expand = query.to_string())); let query_hide = param_hide.map_or_else(String::new, |query| format!("hide={hide}&", hide = query.to_string())); let url = format!( - "{}/v0/release/lookup?{doi}{wikidata_qid}{isbn13}{pmid}{pmcid}{core}{arxiv}{jstor}{ark}{mag}{doaj}{dblp}{expand}{hide}", + "{}/v0/release/lookup?{doi}{wikidata_qid}{isbn13}{pmid}{pmcid}{core}{arxiv}{jstor}{ark}{mag}{doaj}{dblp}{oai}{expand}{hide}", self.base_path, doi = utf8_percent_encode(&query_doi, QUERY_ENCODE_SET), wikidata_qid = utf8_percent_encode(&query_wikidata_qid, QUERY_ENCODE_SET), @@ -5914,6 +5916,7 @@ impl Api for Client { mag = utf8_percent_encode(&query_mag, QUERY_ENCODE_SET), doaj = utf8_percent_encode(&query_doaj, QUERY_ENCODE_SET), dblp = utf8_percent_encode(&query_dblp, QUERY_ENCODE_SET), + oai = utf8_percent_encode(&query_oai, QUERY_ENCODE_SET), expand = utf8_percent_encode(&query_expand, QUERY_ENCODE_SET), hide = utf8_percent_encode(&query_hide, QUERY_ENCODE_SET) ); diff --git a/rust/fatcat-openapi/src/lib.rs b/rust/fatcat-openapi/src/lib.rs index d82b7368..4fe878e1 100644 --- a/rust/fatcat-openapi/src/lib.rs +++ b/rust/fatcat-openapi/src/lib.rs @@ -1559,6 +1559,7 @@ pub trait Api { mag: Option<String>, doaj: Option<String>, dblp: Option<String>, + oai: Option<String>, expand: Option<String>, hide: Option<String>, context: &Context, @@ -1812,6 +1813,7 @@ pub trait ApiNoContext { mag: Option<String>, doaj: Option<String>, dblp: Option<String>, + oai: Option<String>, expand: Option<String>, hide: Option<String>, ) -> Box<dyn Future<Item = LookupReleaseResponse, Error = ApiError> + Send>; @@ -2216,11 +2218,12 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { mag: Option<String>, doaj: Option<String>, dblp: Option<String>, + oai: Option<String>, expand: Option<String>, hide: Option<String>, ) -> Box<dyn Future<Item = LookupReleaseResponse, Error = ApiError> + Send> { self.api() - .lookup_release(doi, wikidata_qid, isbn13, pmid, pmcid, core, arxiv, jstor, ark, mag, doaj, dblp, expand, hide, &self.context()) + .lookup_release(doi, wikidata_qid, isbn13, pmid, pmcid, core, arxiv, jstor, ark, mag, doaj, dblp, oai, expand, hide, &self.context()) } fn update_release(&self, editgroup_id: String, ident: String, entity: models::ReleaseEntity) -> Box<dyn Future<Item = UpdateReleaseResponse, Error = ApiError> + Send> { diff --git a/rust/fatcat-openapi/src/models.rs b/rust/fatcat-openapi/src/models.rs index c539339e..965caacf 100644 --- a/rust/fatcat-openapi/src/models.rs +++ b/rust/fatcat-openapi/src/models.rs @@ -1240,6 +1240,11 @@ pub struct ReleaseExtIds { #[serde(rename = "dblp")] #[serde(skip_serializing_if = "Option::is_none")] pub dblp: Option<String>, + + /// OAI-PMH identifier; only used when an OAI-PMH record is the only authoritative metadata (eg, journal OAI-PMH feeds w/o DOIs) + #[serde(rename = "oai")] + #[serde(skip_serializing_if = "Option::is_none")] + pub oai: Option<String>, } impl ReleaseExtIds { @@ -1257,6 +1262,7 @@ impl ReleaseExtIds { mag: None, doaj: None, dblp: None, + oai: None, } } } diff --git a/rust/fatcat-openapi/src/server.rs b/rust/fatcat-openapi/src/server.rs index 230aea45..59e83124 100644 --- a/rust/fatcat-openapi/src/server.rs +++ b/rust/fatcat-openapi/src/server.rs @@ -8289,6 +8289,7 @@ where let param_mag = query_params.get("mag").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok()); let param_doaj = query_params.get("doaj").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok()); let param_dblp = query_params.get("dblp").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok()); + let param_oai = query_params.get("oai").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok()); let param_expand = query_params.get("expand").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok()); let param_hide = query_params.get("hide").and_then(|list| list.first()).and_then(|x| x.parse::<String>().ok()); @@ -8306,6 +8307,7 @@ where param_mag, param_doaj, param_dblp, + param_oai, param_expand, param_hide, context, |