From 1dd7fede5c8fb44a7819a25c74144ad0eff78627 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 17 Nov 2021 17:40:36 -0800 Subject: fatcat-openapi: update with v0.5.0 schema --- fatcat-openapi/src/lib.rs | 2 +- fatcat-openapi/src/models.rs | 45 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) (limited to 'fatcat-openapi/src') diff --git a/fatcat-openapi/src/lib.rs b/fatcat-openapi/src/lib.rs index 8dd8e15..42b1b8c 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.4.0"; +pub const API_VERSION: &'static str = "0.5.0"; #[derive(Debug, PartialEq)] #[must_use] diff --git a/fatcat-openapi/src/models.rs b/fatcat-openapi/src/models.rs index e418053..094d8b3 100644 --- a/fatcat-openapi/src/models.rs +++ b/fatcat-openapi/src/models.rs @@ -3307,6 +3307,10 @@ pub struct FileEntity { #[serde(skip_serializing_if = "Option::is_none")] pub mimetype: Option, + #[serde(rename = "content_scope")] + #[serde(skip_serializing_if = "Option::is_none")] + pub content_scope: Option, + /// Set of identifier of release entities this file represents a full manifestation of. Usually a single release, but some files contain content of multiple full releases (eg, an issue of a journal). #[serde(rename = "release_ids")] #[serde(skip_serializing_if = "Option::is_none")] @@ -3333,6 +3337,7 @@ impl FileEntity { sha256: None, urls: None, mimetype: None, + content_scope: None, release_ids: None, releases: None, } @@ -3399,6 +3404,11 @@ impl std::string::ToString for FileEntity { params.push(mimetype.to_string()); } + if let Some(ref content_scope) = self.content_scope { + params.push("content_scope".to_string()); + params.push(content_scope.to_string()); + } + if let Some(ref release_ids) = self.release_ids { params.push("release_ids".to_string()); params.push( @@ -3439,6 +3449,7 @@ impl std::str::FromStr for FileEntity { pub sha256: Vec, pub urls: Vec>, pub mimetype: Vec, + pub content_scope: Vec, pub release_ids: Vec>, pub releases: Vec>, } @@ -3506,6 +3517,9 @@ impl std::str::FromStr for FileEntity { "mimetype" => intermediate_rep .mimetype .push(String::from_str(val).map_err(|x| format!("{}", x))?), + "content_scope" => intermediate_rep + .content_scope + .push(String::from_str(val).map_err(|x| format!("{}", x))?), "release_ids" => { return std::result::Result::Err( "Parsing a container in this style is not supported in FileEntity" @@ -3544,6 +3558,7 @@ impl std::str::FromStr for FileEntity { sha256: intermediate_rep.sha256.into_iter().next(), urls: intermediate_rep.urls.into_iter().next(), mimetype: intermediate_rep.mimetype.into_iter().next(), + content_scope: intermediate_rep.content_scope.into_iter().next(), release_ids: intermediate_rep.release_ids.into_iter().next(), releases: intermediate_rep.releases.into_iter().next(), }) @@ -3926,6 +3941,10 @@ pub struct FilesetEntity { #[serde(skip_serializing_if = "Option::is_none")] pub edit_extra: Option>, + #[serde(rename = "content_scope")] + #[serde(skip_serializing_if = "Option::is_none")] + pub content_scope: Option, + #[serde(rename = "manifest")] #[serde(skip_serializing_if = "Option::is_none")] pub manifest: Option>, @@ -3954,6 +3973,7 @@ impl FilesetEntity { redirect: None, extra: None, edit_extra: None, + content_scope: None, manifest: None, urls: None, release_ids: None, @@ -3995,6 +4015,11 @@ impl std::string::ToString for FilesetEntity { // Skipping edit_extra in query parameter serialization // Skipping edit_extra in query parameter serialization + if let Some(ref content_scope) = self.content_scope { + params.push("content_scope".to_string()); + params.push(content_scope.to_string()); + } + // Skipping manifest in query parameter serialization // Skipping urls in query parameter serialization @@ -4033,6 +4058,7 @@ impl std::str::FromStr for FilesetEntity { pub redirect: Vec, pub extra: Vec>, pub edit_extra: Vec>, + pub content_scope: Vec, pub manifest: Vec>, pub urls: Vec>, pub release_ids: Vec>, @@ -4081,6 +4107,9 @@ impl std::str::FromStr for FilesetEntity { .to_string(), ) } + "content_scope" => intermediate_rep + .content_scope + .push(String::from_str(val).map_err(|x| format!("{}", x))?), "manifest" => { return std::result::Result::Err( "Parsing a container in this style is not supported in FilesetEntity" @@ -4125,6 +4154,7 @@ impl std::str::FromStr for FilesetEntity { redirect: intermediate_rep.redirect.into_iter().next(), extra: intermediate_rep.extra.into_iter().next(), edit_extra: intermediate_rep.edit_extra.into_iter().next(), + content_scope: intermediate_rep.content_scope.into_iter().next(), manifest: intermediate_rep.manifest.into_iter().next(), urls: intermediate_rep.urls.into_iter().next(), release_ids: intermediate_rep.release_ids.into_iter().next(), @@ -6983,6 +7013,10 @@ pub struct WebcaptureEntity { #[serde(skip_serializing_if = "Option::is_none")] pub timestamp: Option>, + #[serde(rename = "content_scope")] + #[serde(skip_serializing_if = "Option::is_none")] + pub content_scope: Option, + /// Set of identifier of release entities this fileset represents a full manifestation of. Usually a single release. #[serde(rename = "release_ids")] #[serde(skip_serializing_if = "Option::is_none")] @@ -7007,6 +7041,7 @@ impl WebcaptureEntity { archive_urls: None, original_url: None, timestamp: None, + content_scope: None, release_ids: None, releases: None, } @@ -7057,6 +7092,11 @@ impl std::string::ToString for WebcaptureEntity { // Skipping timestamp in query parameter serialization + if let Some(ref content_scope) = self.content_scope { + params.push("content_scope".to_string()); + params.push(content_scope.to_string()); + } + if let Some(ref release_ids) = self.release_ids { params.push("release_ids".to_string()); params.push( @@ -7095,6 +7135,7 @@ impl std::str::FromStr for WebcaptureEntity { pub archive_urls: Vec>, pub original_url: Vec, pub timestamp: Vec>, + pub content_scope: Vec, pub release_ids: Vec>, pub releases: Vec>, } @@ -7152,6 +7193,9 @@ impl std::str::FromStr for WebcaptureEntity { chrono::DateTime::::from_str(val) .map_err(|x| format!("{}", x))?, ), + "content_scope" => intermediate_rep + .content_scope + .push(String::from_str(val).map_err(|x| format!("{}", x))?), "release_ids" => return std::result::Result::Err( "Parsing a container in this style is not supported in WebcaptureEntity" .to_string(), @@ -7184,6 +7228,7 @@ impl std::str::FromStr for WebcaptureEntity { archive_urls: intermediate_rep.archive_urls.into_iter().next(), original_url: intermediate_rep.original_url.into_iter().next(), timestamp: intermediate_rep.timestamp.into_iter().next(), + content_scope: intermediate_rep.content_scope.into_iter().next(), release_ids: intermediate_rep.release_ids.into_iter().next(), releases: intermediate_rep.releases.into_iter().next(), }) -- cgit v1.2.3