diff options
author | Bryan Newbold <bnewbold@archive.org> | 2021-10-13 17:42:41 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2021-10-13 17:42:41 -0700 |
commit | 0a71247fb61a91c1f6d519762013c1445713a728 (patch) | |
tree | cbade44d03cd523478a0a821d92504c99376e12b /fatcat-openapi/src/models.rs | |
parent | 052581220de7018d8ccbfe62eb18d8b01a82b83d (diff) | |
download | fatcat-cli-0a71247fb61a91c1f6d519762013c1445713a728.tar.gz fatcat-cli-0a71247fb61a91c1f6d519762013c1445713a728.zip |
codegen for API schema v0.4.0
Diffstat (limited to 'fatcat-openapi/src/models.rs')
-rw-r--r-- | fatcat-openapi/src/models.rs | 81 |
1 files changed, 80 insertions, 1 deletions
diff --git a/fatcat-openapi/src/models.rs b/fatcat-openapi/src/models.rs index d642c62..e418053 100644 --- a/fatcat-openapi/src/models.rs +++ b/fatcat-openapi/src/models.rs @@ -891,6 +891,11 @@ pub struct ContainerEntity { #[serde(skip_serializing_if = "Option::is_none")] pub container_type: Option<String>, + /// Whether the container is active, discontinued, etc + #[serde(rename = "publication_status")] + #[serde(skip_serializing_if = "Option::is_none")] + pub publication_status: Option<String>, + /// Name of the organization or entity responsible for publication. Not the complete imprint/brand. #[serde(rename = "publisher")] #[serde(skip_serializing_if = "Option::is_none")] @@ -901,6 +906,16 @@ pub struct ContainerEntity { #[serde(skip_serializing_if = "Option::is_none")] pub issnl: Option<String>, + /// Electronic ISSN number (ISSN-E). Should be valid and registered with issn.org + #[serde(rename = "issne")] + #[serde(skip_serializing_if = "Option::is_none")] + pub issne: Option<String>, + + /// Print ISSN number (ISSN-P). Should be valid and registered with issn.org + #[serde(rename = "issnp")] + #[serde(skip_serializing_if = "Option::is_none")] + pub issnp: Option<String>, + #[serde(rename = "wikidata_qid")] #[serde(skip_serializing_if = "Option::is_none")] pub wikidata_qid: Option<String>, @@ -917,8 +932,11 @@ impl ContainerEntity { edit_extra: None, name: None, container_type: None, + publication_status: None, publisher: None, issnl: None, + issne: None, + issnp: None, wikidata_qid: None, } } @@ -967,6 +985,11 @@ impl std::string::ToString for ContainerEntity { params.push(container_type.to_string()); } + if let Some(ref publication_status) = self.publication_status { + params.push("publication_status".to_string()); + params.push(publication_status.to_string()); + } + if let Some(ref publisher) = self.publisher { params.push("publisher".to_string()); params.push(publisher.to_string()); @@ -977,6 +1000,16 @@ impl std::string::ToString for ContainerEntity { params.push(issnl.to_string()); } + if let Some(ref issne) = self.issne { + params.push("issne".to_string()); + params.push(issne.to_string()); + } + + if let Some(ref issnp) = self.issnp { + params.push("issnp".to_string()); + params.push(issnp.to_string()); + } + if let Some(ref wikidata_qid) = self.wikidata_qid { params.push("wikidata_qid".to_string()); params.push(wikidata_qid.to_string()); @@ -1004,8 +1037,11 @@ impl std::str::FromStr for ContainerEntity { pub edit_extra: Vec<std::collections::HashMap<String, serde_json::Value>>, pub name: Vec<String>, pub container_type: Vec<String>, + pub publication_status: Vec<String>, pub publisher: Vec<String>, pub issnl: Vec<String>, + pub issne: Vec<String>, + pub issnp: Vec<String>, pub wikidata_qid: Vec<String>, } @@ -1057,12 +1093,21 @@ impl std::str::FromStr for ContainerEntity { "container_type" => intermediate_rep .container_type .push(String::from_str(val).map_err(|x| format!("{}", x))?), + "publication_status" => intermediate_rep + .publication_status + .push(String::from_str(val).map_err(|x| format!("{}", x))?), "publisher" => intermediate_rep .publisher .push(String::from_str(val).map_err(|x| format!("{}", x))?), "issnl" => intermediate_rep .issnl .push(String::from_str(val).map_err(|x| format!("{}", x))?), + "issne" => intermediate_rep + .issne + .push(String::from_str(val).map_err(|x| format!("{}", x))?), + "issnp" => intermediate_rep + .issnp + .push(String::from_str(val).map_err(|x| format!("{}", x))?), "wikidata_qid" => intermediate_rep .wikidata_qid .push(String::from_str(val).map_err(|x| format!("{}", x))?), @@ -1088,8 +1133,11 @@ impl std::str::FromStr for ContainerEntity { edit_extra: intermediate_rep.edit_extra.into_iter().next(), name: intermediate_rep.name.into_iter().next(), container_type: intermediate_rep.container_type.into_iter().next(), + publication_status: intermediate_rep.publication_status.into_iter().next(), publisher: intermediate_rep.publisher.into_iter().next(), issnl: intermediate_rep.issnl.into_iter().next(), + issne: intermediate_rep.issne.into_iter().next(), + issnp: intermediate_rep.issnp.into_iter().next(), wikidata_qid: intermediate_rep.wikidata_qid.into_iter().next(), }) } @@ -4156,7 +4204,11 @@ pub struct FilesetFile { #[serde(skip_serializing_if = "Option::is_none")] pub sha256: Option<String>, - /// Free-form additional metadata about this specific file in the set. Eg, `mimetype`. See guide for nomative (but unenforced) schema fields. + #[serde(rename = "mimetype")] + #[serde(skip_serializing_if = "Option::is_none")] + pub mimetype: Option<String>, + + /// Free-form additional metadata about this specific file in the set. Eg, `original_url`. See guide for normative (but unenforced) schema fields. #[serde(rename = "extra")] #[serde(skip_serializing_if = "Option::is_none")] pub extra: Option<std::collections::HashMap<String, serde_json::Value>>, @@ -4170,6 +4222,7 @@ impl FilesetFile { md5: None, sha1: None, sha256: None, + mimetype: None, extra: None, } } @@ -4203,6 +4256,11 @@ impl std::string::ToString for FilesetFile { params.push(sha256.to_string()); } + if let Some(ref mimetype) = self.mimetype { + params.push("mimetype".to_string()); + params.push(mimetype.to_string()); + } + // Skipping extra in query parameter serialization // Skipping extra in query parameter serialization @@ -4225,6 +4283,7 @@ impl std::str::FromStr for FilesetFile { pub md5: Vec<String>, pub sha1: Vec<String>, pub sha256: Vec<String>, + pub mimetype: Vec<String>, pub extra: Vec<std::collections::HashMap<String, serde_json::Value>>, } @@ -4261,6 +4320,9 @@ impl std::str::FromStr for FilesetFile { "sha256" => intermediate_rep .sha256 .push(String::from_str(val).map_err(|x| format!("{}", x))?), + "mimetype" => intermediate_rep + .mimetype + .push(String::from_str(val).map_err(|x| format!("{}", x))?), "extra" => { return std::result::Result::Err( "Parsing a container in this style is not supported in FilesetFile" @@ -4294,6 +4356,7 @@ impl std::str::FromStr for FilesetFile { md5: intermediate_rep.md5.into_iter().next(), sha1: intermediate_rep.sha1.into_iter().next(), sha256: intermediate_rep.sha256.into_iter().next(), + mimetype: intermediate_rep.mimetype.into_iter().next(), extra: intermediate_rep.extra.into_iter().next(), }) } @@ -5794,6 +5857,11 @@ pub struct ReleaseExtIds { #[serde(rename = "oai")] #[serde(skip_serializing_if = "Option::is_none")] pub oai: Option<String>, + + /// Handle identifier. Do not put DOIs in this field + #[serde(rename = "hdl")] + #[serde(skip_serializing_if = "Option::is_none")] + pub hdl: Option<String>, } impl ReleaseExtIds { @@ -5812,6 +5880,7 @@ impl ReleaseExtIds { doaj: None, dblp: None, oai: None, + hdl: None, } } } @@ -5888,6 +5957,11 @@ impl std::string::ToString for ReleaseExtIds { params.push(oai.to_string()); } + if let Some(ref hdl) = self.hdl { + params.push("hdl".to_string()); + params.push(hdl.to_string()); + } + params.join(",").to_string() } } @@ -5915,6 +5989,7 @@ impl std::str::FromStr for ReleaseExtIds { pub doaj: Vec<String>, pub dblp: Vec<String>, pub oai: Vec<String>, + pub hdl: Vec<String>, } let mut intermediate_rep = IntermediateRep::default(); @@ -5974,6 +6049,9 @@ impl std::str::FromStr for ReleaseExtIds { "oai" => intermediate_rep .oai .push(String::from_str(val).map_err(|x| format!("{}", x))?), + "hdl" => intermediate_rep + .hdl + .push(String::from_str(val).map_err(|x| format!("{}", x))?), _ => { return std::result::Result::Err( "Unexpected key while parsing ReleaseExtIds".to_string(), @@ -6001,6 +6079,7 @@ impl std::str::FromStr for ReleaseExtIds { doaj: intermediate_rep.doaj.into_iter().next(), dblp: intermediate_rep.dblp.into_iter().next(), oai: intermediate_rep.oai.into_iter().next(), + hdl: intermediate_rep.hdl.into_iter().next(), }) } } |