diff options
Diffstat (limited to 'rust/fatcat-api-spec/src/models.rs')
-rw-r--r-- | rust/fatcat-api-spec/src/models.rs | 62 |
1 files changed, 44 insertions, 18 deletions
diff --git a/rust/fatcat-api-spec/src/models.rs b/rust/fatcat-api-spec/src/models.rs index 5d05b737..d6e6e07f 100644 --- a/rust/fatcat-api-spec/src/models.rs +++ b/rust/fatcat-api-spec/src/models.rs @@ -79,14 +79,6 @@ impl ChangelogEntry { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct ContainerEntity { - #[serde(rename = "coden")] - #[serde(skip_serializing_if = "Option::is_none")] - pub coden: Option<String>, - - #[serde(rename = "abbrev")] - #[serde(skip_serializing_if = "Option::is_none")] - pub abbrev: Option<String>, - #[serde(rename = "wikidata_qid")] #[serde(skip_serializing_if = "Option::is_none")] pub wikidata_qid: Option<String>, @@ -99,6 +91,11 @@ pub struct ContainerEntity { #[serde(skip_serializing_if = "Option::is_none")] pub publisher: Option<String>, + /// Eg, 'journal' + #[serde(rename = "container_type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub container_type: Option<String>, + /// Required for valid entities #[serde(rename = "name")] #[serde(skip_serializing_if = "Option::is_none")] @@ -136,11 +133,10 @@ pub struct ContainerEntity { impl ContainerEntity { pub fn new() -> ContainerEntity { ContainerEntity { - coden: None, - abbrev: None, wikidata_qid: None, issnl: None, publisher: None, + container_type: None, name: None, edit_extra: None, extra: None, @@ -709,13 +705,18 @@ pub struct ReleaseContrib { #[serde(skip_serializing_if = "Option::is_none")] pub raw_name: Option<String>, - #[serde(rename = "extra")] - #[serde(skip_serializing_if = "Option::is_none")] - pub extra: Option<serde_json::Value>, - #[serde(rename = "role")] #[serde(skip_serializing_if = "Option::is_none")] pub role: Option<String>, + + /// Raw affiliation string as displayed in text + #[serde(rename = "raw_affiliation")] + #[serde(skip_serializing_if = "Option::is_none")] + pub raw_affiliation: Option<String>, + + #[serde(rename = "extra")] + #[serde(skip_serializing_if = "Option::is_none")] + pub extra: Option<serde_json::Value>, } impl ReleaseContrib { @@ -725,8 +726,9 @@ impl ReleaseContrib { creator_id: None, creator: None, raw_name: None, - extra: None, role: None, + raw_affiliation: None, + extra: None, } } } @@ -745,6 +747,11 @@ pub struct ReleaseEntity { #[serde(skip_serializing_if = "Option::is_none")] pub contribs: Option<Vec<models::ReleaseContrib>>, + /// Short version of license name. Eg, 'CC-BY' + #[serde(rename = "license_slug")] + #[serde(skip_serializing_if = "Option::is_none")] + pub license_slug: Option<String>, + /// Two-letter RFC1766/ISO639-1 language code, with extensions #[serde(rename = "language")] #[serde(skip_serializing_if = "Option::is_none")] @@ -766,6 +773,14 @@ pub struct ReleaseEntity { #[serde(skip_serializing_if = "Option::is_none")] pub volume: Option<String>, + #[serde(rename = "jstor_id")] + #[serde(skip_serializing_if = "Option::is_none")] + pub jstor_id: Option<String>, + + #[serde(rename = "arxiv_id")] + #[serde(skip_serializing_if = "Option::is_none")] + pub arxiv_id: Option<String>, + #[serde(rename = "core_id")] #[serde(skip_serializing_if = "Option::is_none")] pub core_id: Option<String>, @@ -834,7 +849,12 @@ pub struct ReleaseEntity { #[serde(skip_serializing_if = "Option::is_none")] pub work_id: Option<String>, - /// Required for valid entities + /// Title in original language (or, the language of the full text of this release) + #[serde(rename = "original_title")] + #[serde(skip_serializing_if = "Option::is_none")] + pub original_title: Option<String>, + + /// Required for valid entities. The title used in citations and for display; usually English #[serde(rename = "title")] #[serde(skip_serializing_if = "Option::is_none")] pub title: Option<String>, @@ -874,11 +894,14 @@ impl ReleaseEntity { abstracts: None, refs: None, contribs: None, + license_slug: None, language: None, publisher: None, pages: None, issue: None, volume: None, + jstor_id: None, + arxiv_id: None, core_id: None, pmcid: None, pmid: None, @@ -895,6 +918,7 @@ impl ReleaseEntity { files: None, container: None, work_id: None, + original_title: None, title: None, state: None, ident: None, @@ -1008,6 +1032,7 @@ pub struct WebcaptureEntity { #[serde(skip_serializing_if = "Option::is_none")] pub release_ids: Option<Vec<String>>, + /// same format as CDX line timestamp (UTC, etc). Corresponds to the overall capture timestamp. Can be the earliest or average of CDX timestamps if that makes sense. #[serde(rename = "timestamp")] #[serde(skip_serializing_if = "Option::is_none")] pub timestamp: Option<chrono::DateTime<chrono::Utc>>, @@ -1091,8 +1116,9 @@ pub struct WebcaptureEntityCdx { #[serde(rename = "surt")] pub surt: String, + /// UTC, 'Z'-terminated, second (or better) precision #[serde(rename = "timestamp")] - pub timestamp: String, + pub timestamp: chrono::DateTime<chrono::Utc>, #[serde(rename = "url")] pub url: String, @@ -1114,7 +1140,7 @@ pub struct WebcaptureEntityCdx { } impl WebcaptureEntityCdx { - pub fn new(surt: String, timestamp: String, url: String, sha1: String) -> WebcaptureEntityCdx { + pub fn new(surt: String, timestamp: chrono::DateTime<chrono::Utc>, url: String, sha1: String) -> WebcaptureEntityCdx { WebcaptureEntityCdx { surt: surt, timestamp: timestamp, |