summaryrefslogtreecommitdiffstats
path: root/fatcat-openapi/src/models.rs
diff options
context:
space:
mode:
Diffstat (limited to 'fatcat-openapi/src/models.rs')
-rw-r--r--fatcat-openapi/src/models.rs1817
1 files changed, 986 insertions, 831 deletions
diff --git a/fatcat-openapi/src/models.rs b/fatcat-openapi/src/models.rs
index 094d8b3..2aead11 100644
--- a/fatcat-openapi/src/models.rs
+++ b/fatcat-openapi/src/models.rs
@@ -4,51 +4,6 @@
use crate::header;
use crate::models;
-// Methods for converting between header::IntoHeaderValue<AuthOidc> and hyper::header::HeaderValue
-
-#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<header::IntoHeaderValue<AuthOidc>> for hyper::header::HeaderValue {
- type Error = String;
-
- fn try_from(
- hdr_value: header::IntoHeaderValue<AuthOidc>,
- ) -> std::result::Result<Self, Self::Error> {
- let hdr_value = hdr_value.to_string();
- match hyper::header::HeaderValue::from_str(&hdr_value) {
- std::result::Result::Ok(value) => std::result::Result::Ok(value),
- std::result::Result::Err(e) => std::result::Result::Err(format!(
- "Invalid header value for AuthOidc - value: {} is invalid {}",
- hdr_value, e
- )),
- }
- }
-}
-
-#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<AuthOidc> {
- type Error = String;
-
- fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result<Self, Self::Error> {
- match hdr_value.to_str() {
- std::result::Result::Ok(value) => {
- match <AuthOidc as std::str::FromStr>::from_str(value) {
- std::result::Result::Ok(value) => {
- std::result::Result::Ok(header::IntoHeaderValue(value))
- }
- std::result::Result::Err(err) => std::result::Result::Err(format!(
- "Unable to convert header value '{}' into AuthOidc - {}",
- value, err
- )),
- }
- }
- std::result::Result::Err(e) => std::result::Result::Err(format!(
- "Unable to convert header: {:?} to string: {}",
- hdr_value, e
- )),
- }
- }
-}
-
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
#[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))]
pub struct AuthOidc {
@@ -137,18 +92,22 @@ impl std::str::FromStr for AuthOidc {
if let Some(key) = key_result {
match key {
- "provider" => intermediate_rep
- .provider
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "sub" => intermediate_rep
- .sub
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "iss" => intermediate_rep
- .iss
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "preferred_username" => intermediate_rep
- .preferred_username
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
+ "provider" => intermediate_rep.provider.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "sub" => intermediate_rep.sub.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "iss" => intermediate_rep.iss.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "preferred_username" => intermediate_rep.preferred_username.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
_ => {
return std::result::Result::Err(
"Unexpected key while parsing AuthOidc".to_string(),
@@ -187,20 +146,20 @@ impl std::str::FromStr for AuthOidc {
}
}
-// Methods for converting between header::IntoHeaderValue<AuthOidcResult> and hyper::header::HeaderValue
+// Methods for converting between header::IntoHeaderValue<AuthOidc> and hyper::header::HeaderValue
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<header::IntoHeaderValue<AuthOidcResult>> for hyper::header::HeaderValue {
+impl std::convert::TryFrom<header::IntoHeaderValue<AuthOidc>> for hyper::header::HeaderValue {
type Error = String;
fn try_from(
- hdr_value: header::IntoHeaderValue<AuthOidcResult>,
+ hdr_value: header::IntoHeaderValue<AuthOidc>,
) -> std::result::Result<Self, Self::Error> {
let hdr_value = hdr_value.to_string();
match hyper::header::HeaderValue::from_str(&hdr_value) {
std::result::Result::Ok(value) => std::result::Result::Ok(value),
std::result::Result::Err(e) => std::result::Result::Err(format!(
- "Invalid header value for AuthOidcResult - value: {} is invalid {}",
+ "Invalid header value for AuthOidc - value: {} is invalid {}",
hdr_value, e
)),
}
@@ -208,18 +167,18 @@ impl std::convert::TryFrom<header::IntoHeaderValue<AuthOidcResult>> for hyper::h
}
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<AuthOidcResult> {
+impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<AuthOidc> {
type Error = String;
fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result<Self, Self::Error> {
match hdr_value.to_str() {
std::result::Result::Ok(value) => {
- match <AuthOidcResult as std::str::FromStr>::from_str(value) {
+ match <AuthOidc as std::str::FromStr>::from_str(value) {
std::result::Result::Ok(value) => {
std::result::Result::Ok(header::IntoHeaderValue(value))
}
std::result::Result::Err(err) => std::result::Result::Err(format!(
- "Unable to convert header value '{}' into AuthOidcResult - {}",
+ "Unable to convert header value '{}' into AuthOidc - {}",
value, err
)),
}
@@ -298,12 +257,14 @@ impl std::str::FromStr for AuthOidcResult {
if let Some(key) = key_result {
match key {
- "editor" => intermediate_rep
- .editor
- .push(models::Editor::from_str(val).map_err(|x| format!("{}", x))?),
- "token" => intermediate_rep
- .token
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
+ "editor" => intermediate_rep.editor.push(
+ <models::Editor as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "token" => intermediate_rep.token.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
_ => {
return std::result::Result::Err(
"Unexpected key while parsing AuthOidcResult".to_string(),
@@ -332,22 +293,20 @@ impl std::str::FromStr for AuthOidcResult {
}
}
-// Methods for converting between header::IntoHeaderValue<AuthTokenResult> and hyper::header::HeaderValue
+// Methods for converting between header::IntoHeaderValue<AuthOidcResult> and hyper::header::HeaderValue
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<header::IntoHeaderValue<AuthTokenResult>>
- for hyper::header::HeaderValue
-{
+impl std::convert::TryFrom<header::IntoHeaderValue<AuthOidcResult>> for hyper::header::HeaderValue {
type Error = String;
fn try_from(
- hdr_value: header::IntoHeaderValue<AuthTokenResult>,
+ hdr_value: header::IntoHeaderValue<AuthOidcResult>,
) -> std::result::Result<Self, Self::Error> {
let hdr_value = hdr_value.to_string();
match hyper::header::HeaderValue::from_str(&hdr_value) {
std::result::Result::Ok(value) => std::result::Result::Ok(value),
std::result::Result::Err(e) => std::result::Result::Err(format!(
- "Invalid header value for AuthTokenResult - value: {} is invalid {}",
+ "Invalid header value for AuthOidcResult - value: {} is invalid {}",
hdr_value, e
)),
}
@@ -355,20 +314,18 @@ impl std::convert::TryFrom<header::IntoHeaderValue<AuthTokenResult>>
}
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<hyper::header::HeaderValue>
- for header::IntoHeaderValue<AuthTokenResult>
-{
+impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<AuthOidcResult> {
type Error = String;
fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result<Self, Self::Error> {
match hdr_value.to_str() {
std::result::Result::Ok(value) => {
- match <AuthTokenResult as std::str::FromStr>::from_str(value) {
+ match <AuthOidcResult as std::str::FromStr>::from_str(value) {
std::result::Result::Ok(value) => {
std::result::Result::Ok(header::IntoHeaderValue(value))
}
std::result::Result::Err(err) => std::result::Result::Err(format!(
- "Unable to convert header value '{}' into AuthTokenResult - {}",
+ "Unable to convert header value '{}' into AuthOidcResult - {}",
value, err
)),
}
@@ -439,9 +396,10 @@ impl std::str::FromStr for AuthTokenResult {
if let Some(key) = key_result {
match key {
- "token" => intermediate_rep
- .token
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
+ "token" => intermediate_rep.token.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
_ => {
return std::result::Result::Err(
"Unexpected key while parsing AuthTokenResult".to_string(),
@@ -465,20 +423,22 @@ impl std::str::FromStr for AuthTokenResult {
}
}
-// Methods for converting between header::IntoHeaderValue<ChangelogEntry> and hyper::header::HeaderValue
+// Methods for converting between header::IntoHeaderValue<AuthTokenResult> and hyper::header::HeaderValue
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<header::IntoHeaderValue<ChangelogEntry>> for hyper::header::HeaderValue {
+impl std::convert::TryFrom<header::IntoHeaderValue<AuthTokenResult>>
+ for hyper::header::HeaderValue
+{
type Error = String;
fn try_from(
- hdr_value: header::IntoHeaderValue<ChangelogEntry>,
+ hdr_value: header::IntoHeaderValue<AuthTokenResult>,
) -> std::result::Result<Self, Self::Error> {
let hdr_value = hdr_value.to_string();
match hyper::header::HeaderValue::from_str(&hdr_value) {
std::result::Result::Ok(value) => std::result::Result::Ok(value),
std::result::Result::Err(e) => std::result::Result::Err(format!(
- "Invalid header value for ChangelogEntry - value: {} is invalid {}",
+ "Invalid header value for AuthTokenResult - value: {} is invalid {}",
hdr_value, e
)),
}
@@ -486,18 +446,20 @@ impl std::convert::TryFrom<header::IntoHeaderValue<ChangelogEntry>> for hyper::h
}
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<ChangelogEntry> {
+impl std::convert::TryFrom<hyper::header::HeaderValue>
+ for header::IntoHeaderValue<AuthTokenResult>
+{
type Error = String;
fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result<Self, Self::Error> {
match hdr_value.to_str() {
std::result::Result::Ok(value) => {
- match <ChangelogEntry as std::str::FromStr>::from_str(value) {
+ match <AuthTokenResult as std::str::FromStr>::from_str(value) {
std::result::Result::Ok(value) => {
std::result::Result::Ok(header::IntoHeaderValue(value))
}
std::result::Result::Err(err) => std::result::Result::Err(format!(
- "Unable to convert header value '{}' into ChangelogEntry - {}",
+ "Unable to convert header value '{}' into AuthTokenResult - {}",
value, err
)),
}
@@ -600,19 +562,21 @@ impl std::str::FromStr for ChangelogEntry {
if let Some(key) = key_result {
match key {
- "index" => intermediate_rep
- .index
- .push(i64::from_str(val).map_err(|x| format!("{}", x))?),
- "editgroup_id" => intermediate_rep
- .editgroup_id
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
+ "index" => intermediate_rep.index.push(
+ <i64 as std::str::FromStr>::from_str(val).map_err(|x| format!("{}", x))?,
+ ),
+ "editgroup_id" => intermediate_rep.editgroup_id.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
"timestamp" => intermediate_rep.timestamp.push(
- chrono::DateTime::<chrono::Utc>::from_str(val)
+ <chrono::DateTime<chrono::Utc> as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "editgroup" => intermediate_rep.editgroup.push(
+ <models::Editgroup as std::str::FromStr>::from_str(val)
.map_err(|x| format!("{}", x))?,
),
- "editgroup" => intermediate_rep
- .editgroup
- .push(models::Editgroup::from_str(val).map_err(|x| format!("{}", x))?),
_ => {
return std::result::Result::Err(
"Unexpected key while parsing ChangelogEntry".to_string(),
@@ -647,22 +611,20 @@ impl std::str::FromStr for ChangelogEntry {
}
}
-// Methods for converting between header::IntoHeaderValue<ContainerAutoBatch> and hyper::header::HeaderValue
+// Methods for converting between header::IntoHeaderValue<ChangelogEntry> and hyper::header::HeaderValue
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<header::IntoHeaderValue<ContainerAutoBatch>>
- for hyper::header::HeaderValue
-{
+impl std::convert::TryFrom<header::IntoHeaderValue<ChangelogEntry>> for hyper::header::HeaderValue {
type Error = String;
fn try_from(
- hdr_value: header::IntoHeaderValue<ContainerAutoBatch>,
+ hdr_value: header::IntoHeaderValue<ChangelogEntry>,
) -> std::result::Result<Self, Self::Error> {
let hdr_value = hdr_value.to_string();
match hyper::header::HeaderValue::from_str(&hdr_value) {
std::result::Result::Ok(value) => std::result::Result::Ok(value),
std::result::Result::Err(e) => std::result::Result::Err(format!(
- "Invalid header value for ContainerAutoBatch - value: {} is invalid {}",
+ "Invalid header value for ChangelogEntry - value: {} is invalid {}",
hdr_value, e
)),
}
@@ -670,20 +632,18 @@ impl std::convert::TryFrom<header::IntoHeaderValue<ContainerAutoBatch>>
}
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<hyper::header::HeaderValue>
- for header::IntoHeaderValue<ContainerAutoBatch>
-{
+impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<ChangelogEntry> {
type Error = String;
fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result<Self, Self::Error> {
match hdr_value.to_str() {
std::result::Result::Ok(value) => {
- match <ContainerAutoBatch as std::str::FromStr>::from_str(value) {
+ match <ChangelogEntry as std::str::FromStr>::from_str(value) {
std::result::Result::Ok(value) => {
std::result::Result::Ok(header::IntoHeaderValue(value))
}
std::result::Result::Err(err) => std::result::Result::Err(format!(
- "Unable to convert header value '{}' into ContainerAutoBatch - {}",
+ "Unable to convert header value '{}' into ChangelogEntry - {}",
value, err
)),
}
@@ -764,9 +724,10 @@ impl std::str::FromStr for ContainerAutoBatch {
if let Some(key) = key_result {
match key {
- "editgroup" => intermediate_rep
- .editgroup
- .push(models::Editgroup::from_str(val).map_err(|x| format!("{}", x))?),
+ "editgroup" => intermediate_rep.editgroup.push(
+ <models::Editgroup as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
"entity_list" => return std::result::Result::Err(
"Parsing a container in this style is not supported in ContainerAutoBatch"
.to_string(),
@@ -799,22 +760,22 @@ impl std::str::FromStr for ContainerAutoBatch {
}
}
-// Methods for converting between header::IntoHeaderValue<ContainerEntity> and hyper::header::HeaderValue
+// Methods for converting between header::IntoHeaderValue<ContainerAutoBatch> and hyper::header::HeaderValue
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<header::IntoHeaderValue<ContainerEntity>>
+impl std::convert::TryFrom<header::IntoHeaderValue<ContainerAutoBatch>>
for hyper::header::HeaderValue
{
type Error = String;
fn try_from(
- hdr_value: header::IntoHeaderValue<ContainerEntity>,
+ hdr_value: header::IntoHeaderValue<ContainerAutoBatch>,
) -> std::result::Result<Self, Self::Error> {
let hdr_value = hdr_value.to_string();
match hyper::header::HeaderValue::from_str(&hdr_value) {
std::result::Result::Ok(value) => std::result::Result::Ok(value),
std::result::Result::Err(e) => std::result::Result::Err(format!(
- "Invalid header value for ContainerEntity - value: {} is invalid {}",
+ "Invalid header value for ContainerAutoBatch - value: {} is invalid {}",
hdr_value, e
)),
}
@@ -823,19 +784,19 @@ impl std::convert::TryFrom<header::IntoHeaderValue<ContainerEntity>>
#[cfg(any(feature = "client", feature = "server"))]
impl std::convert::TryFrom<hyper::header::HeaderValue>
- for header::IntoHeaderValue<ContainerEntity>
+ for header::IntoHeaderValue<ContainerAutoBatch>
{
type Error = String;
fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result<Self, Self::Error> {
match hdr_value.to_str() {
std::result::Result::Ok(value) => {
- match <ContainerEntity as std::str::FromStr>::from_str(value) {
+ match <ContainerAutoBatch as std::str::FromStr>::from_str(value) {
std::result::Result::Ok(value) => {
std::result::Result::Ok(header::IntoHeaderValue(value))
}
std::result::Result::Err(err) => std::result::Result::Err(format!(
- "Unable to convert header value '{}' into ContainerEntity - {}",
+ "Unable to convert header value '{}' into ContainerAutoBatch - {}",
value, err
)),
}
@@ -1063,18 +1024,22 @@ impl std::str::FromStr for ContainerEntity {
if let Some(key) = key_result {
match key {
- "state" => intermediate_rep
- .state
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "ident" => intermediate_rep
- .ident
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "revision" => intermediate_rep
- .revision
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "redirect" => intermediate_rep
- .redirect
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
+ "state" => intermediate_rep.state.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "ident" => intermediate_rep.ident.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "revision" => intermediate_rep.revision.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "redirect" => intermediate_rep.redirect.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
"extra" => {
return std::result::Result::Err(
"Parsing a container in this style is not supported in ContainerEntity"
@@ -1087,30 +1052,38 @@ impl std::str::FromStr for ContainerEntity {
.to_string(),
)
}
- "name" => intermediate_rep
- .name
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "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))?),
+ "name" => intermediate_rep.name.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "container_type" => intermediate_rep.container_type.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "publication_status" => intermediate_rep.publication_status.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "publisher" => intermediate_rep.publisher.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "issnl" => intermediate_rep.issnl.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "issne" => intermediate_rep.issne.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "issnp" => intermediate_rep.issnp.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "wikidata_qid" => intermediate_rep.wikidata_qid.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
_ => {
return std::result::Result::Err(
"Unexpected key while parsing ContainerEntity".to_string(),
@@ -1143,22 +1116,22 @@ impl std::str::FromStr for ContainerEntity {
}
}
-// Methods for converting between header::IntoHeaderValue<CreatorAutoBatch> and hyper::header::HeaderValue
+// Methods for converting between header::IntoHeaderValue<ContainerEntity> and hyper::header::HeaderValue
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<header::IntoHeaderValue<CreatorAutoBatch>>
+impl std::convert::TryFrom<header::IntoHeaderValue<ContainerEntity>>
for hyper::header::HeaderValue
{
type Error = String;
fn try_from(
- hdr_value: header::IntoHeaderValue<CreatorAutoBatch>,
+ hdr_value: header::IntoHeaderValue<ContainerEntity>,
) -> std::result::Result<Self, Self::Error> {
let hdr_value = hdr_value.to_string();
match hyper::header::HeaderValue::from_str(&hdr_value) {
std::result::Result::Ok(value) => std::result::Result::Ok(value),
std::result::Result::Err(e) => std::result::Result::Err(format!(
- "Invalid header value for CreatorAutoBatch - value: {} is invalid {}",
+ "Invalid header value for ContainerEntity - value: {} is invalid {}",
hdr_value, e
)),
}
@@ -1167,19 +1140,19 @@ impl std::convert::TryFrom<header::IntoHeaderValue<CreatorAutoBatch>>
#[cfg(any(feature = "client", feature = "server"))]
impl std::convert::TryFrom<hyper::header::HeaderValue>
- for header::IntoHeaderValue<CreatorAutoBatch>
+ for header::IntoHeaderValue<ContainerEntity>
{
type Error = String;
fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result<Self, Self::Error> {
match hdr_value.to_str() {
std::result::Result::Ok(value) => {
- match <CreatorAutoBatch as std::str::FromStr>::from_str(value) {
+ match <ContainerEntity as std::str::FromStr>::from_str(value) {
std::result::Result::Ok(value) => {
std::result::Result::Ok(header::IntoHeaderValue(value))
}
std::result::Result::Err(err) => std::result::Result::Err(format!(
- "Unable to convert header value '{}' into CreatorAutoBatch - {}",
+ "Unable to convert header value '{}' into ContainerEntity - {}",
value, err
)),
}
@@ -1260,9 +1233,10 @@ impl std::str::FromStr for CreatorAutoBatch {
if let Some(key) = key_result {
match key {
- "editgroup" => intermediate_rep
- .editgroup
- .push(models::Editgroup::from_str(val).map_err(|x| format!("{}", x))?),
+ "editgroup" => intermediate_rep.editgroup.push(
+ <models::Editgroup as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
"entity_list" => return std::result::Result::Err(
"Parsing a container in this style is not supported in CreatorAutoBatch"
.to_string(),
@@ -1295,20 +1269,22 @@ impl std::str::FromStr for CreatorAutoBatch {
}
}
-// Methods for converting between header::IntoHeaderValue<CreatorEntity> and hyper::header::HeaderValue
+// Methods for converting between header::IntoHeaderValue<CreatorAutoBatch> and hyper::header::HeaderValue
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<header::IntoHeaderValue<CreatorEntity>> for hyper::header::HeaderValue {
+impl std::convert::TryFrom<header::IntoHeaderValue<CreatorAutoBatch>>
+ for hyper::header::HeaderValue
+{
type Error = String;
fn try_from(
- hdr_value: header::IntoHeaderValue<CreatorEntity>,
+ hdr_value: header::IntoHeaderValue<CreatorAutoBatch>,
) -> std::result::Result<Self, Self::Error> {
let hdr_value = hdr_value.to_string();
match hyper::header::HeaderValue::from_str(&hdr_value) {
std::result::Result::Ok(value) => std::result::Result::Ok(value),
std::result::Result::Err(e) => std::result::Result::Err(format!(
- "Invalid header value for CreatorEntity - value: {} is invalid {}",
+ "Invalid header value for CreatorAutoBatch - value: {} is invalid {}",
hdr_value, e
)),
}
@@ -1316,18 +1292,20 @@ impl std::convert::TryFrom<header::IntoHeaderValue<CreatorEntity>> for hyper::he
}
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<CreatorEntity> {
+impl std::convert::TryFrom<hyper::header::HeaderValue>
+ for header::IntoHeaderValue<CreatorAutoBatch>
+{
type Error = String;
fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result<Self, Self::Error> {
match hdr_value.to_str() {
std::result::Result::Ok(value) => {
- match <CreatorEntity as std::str::FromStr>::from_str(value) {
+ match <CreatorAutoBatch as std::str::FromStr>::from_str(value) {
std::result::Result::Ok(value) => {
std::result::Result::Ok(header::IntoHeaderValue(value))
}
std::result::Result::Err(err) => std::result::Result::Err(format!(
- "Unable to convert header value '{}' into CreatorEntity - {}",
+ "Unable to convert header value '{}' into CreatorAutoBatch - {}",
value, err
)),
}
@@ -1520,18 +1498,22 @@ impl std::str::FromStr for CreatorEntity {
if let Some(key) = key_result {
match key {
- "state" => intermediate_rep
- .state
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "ident" => intermediate_rep
- .ident
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "revision" => intermediate_rep
- .revision
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "redirect" => intermediate_rep
- .redirect
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
+ "state" => intermediate_rep.state.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "ident" => intermediate_rep.ident.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "revision" => intermediate_rep.revision.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "redirect" => intermediate_rep.redirect.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
"extra" => {
return std::result::Result::Err(
"Parsing a container in this style is not supported in CreatorEntity"
@@ -1544,21 +1526,26 @@ impl std::str::FromStr for CreatorEntity {
.to_string(),
)
}
- "display_name" => intermediate_rep
- .display_name
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "given_name" => intermediate_rep
- .given_name
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "surname" => intermediate_rep
- .surname
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "orcid" => intermediate_rep
- .orcid
- .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))?),
+ "display_name" => intermediate_rep.display_name.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "given_name" => intermediate_rep.given_name.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "surname" => intermediate_rep.surname.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "orcid" => intermediate_rep.orcid.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "wikidata_qid" => intermediate_rep.wikidata_qid.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
_ => {
return std::result::Result::Err(
"Unexpected key while parsing CreatorEntity".to_string(),
@@ -1588,20 +1575,20 @@ impl std::str::FromStr for CreatorEntity {
}
}
-// Methods for converting between header::IntoHeaderValue<Editgroup> and hyper::header::HeaderValue
+// Methods for converting between header::IntoHeaderValue<CreatorEntity> and hyper::header::HeaderValue
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<header::IntoHeaderValue<Editgroup>> for hyper::header::HeaderValue {
+impl std::convert::TryFrom<header::IntoHeaderValue<CreatorEntity>> for hyper::header::HeaderValue {
type Error = String;
fn try_from(
- hdr_value: header::IntoHeaderValue<Editgroup>,
+ hdr_value: header::IntoHeaderValue<CreatorEntity>,
) -> std::result::Result<Self, Self::Error> {
let hdr_value = hdr_value.to_string();
match hyper::header::HeaderValue::from_str(&hdr_value) {
std::result::Result::Ok(value) => std::result::Result::Ok(value),
std::result::Result::Err(e) => std::result::Result::Err(format!(
- "Invalid header value for Editgroup - value: {} is invalid {}",
+ "Invalid header value for CreatorEntity - value: {} is invalid {}",
hdr_value, e
)),
}
@@ -1609,18 +1596,18 @@ impl std::convert::TryFrom<header::IntoHeaderValue<Editgroup>> for hyper::header
}
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<Editgroup> {
+impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<CreatorEntity> {
type Error = String;
fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result<Self, Self::Error> {
match hdr_value.to_str() {
std::result::Result::Ok(value) => {
- match <Editgroup as std::str::FromStr>::from_str(value) {
+ match <CreatorEntity as std::str::FromStr>::from_str(value) {
std::result::Result::Ok(value) => {
std::result::Result::Ok(header::IntoHeaderValue(value))
}
std::result::Result::Err(err) => std::result::Result::Err(format!(
- "Unable to convert header value '{}' into Editgroup - {}",
+ "Unable to convert header value '{}' into CreatorEntity - {}",
value, err
)),
}
@@ -1786,29 +1773,33 @@ impl std::str::FromStr for Editgroup {
if let Some(key) = key_result {
match key {
- "editgroup_id" => intermediate_rep
- .editgroup_id
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "editor_id" => intermediate_rep
- .editor_id
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "editor" => intermediate_rep
- .editor
- .push(models::Editor::from_str(val).map_err(|x| format!("{}", x))?),
- "changelog_index" => intermediate_rep
- .changelog_index
- .push(i64::from_str(val).map_err(|x| format!("{}", x))?),
+ "editgroup_id" => intermediate_rep.editgroup_id.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "editor_id" => intermediate_rep.editor_id.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "editor" => intermediate_rep.editor.push(
+ <models::Editor as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "changelog_index" => intermediate_rep.changelog_index.push(
+ <i64 as std::str::FromStr>::from_str(val).map_err(|x| format!("{}", x))?,
+ ),
"created" => intermediate_rep.created.push(
- chrono::DateTime::<chrono::Utc>::from_str(val)
+ <chrono::DateTime<chrono::Utc> as std::str::FromStr>::from_str(val)
.map_err(|x| format!("{}", x))?,
),
"submitted" => intermediate_rep.submitted.push(
- chrono::DateTime::<chrono::Utc>::from_str(val)
+ <chrono::DateTime<chrono::Utc> as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "description" => intermediate_rep.description.push(
+ <String as std::str::FromStr>::from_str(val)
.map_err(|x| format!("{}", x))?,
),
- "description" => intermediate_rep
- .description
- .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 Editgroup"
@@ -1821,9 +1812,10 @@ impl std::str::FromStr for Editgroup {
.to_string(),
)
}
- "edits" => intermediate_rep
- .edits
- .push(models::EditgroupEdits::from_str(val).map_err(|x| format!("{}", x))?),
+ "edits" => intermediate_rep.edits.push(
+ <models::EditgroupEdits as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
_ => {
return std::result::Result::Err(
"Unexpected key while parsing Editgroup".to_string(),
@@ -1852,22 +1844,20 @@ impl std::str::FromStr for Editgroup {
}
}
-// Methods for converting between header::IntoHeaderValue<EditgroupAnnotation> and hyper::header::HeaderValue
+// Methods for converting between header::IntoHeaderValue<Editgroup> and hyper::header::HeaderValue
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<header::IntoHeaderValue<EditgroupAnnotation>>
- for hyper::header::HeaderValue
-{
+impl std::convert::TryFrom<header::IntoHeaderValue<Editgroup>> for hyper::header::HeaderValue {
type Error = String;
fn try_from(
- hdr_value: header::IntoHeaderValue<EditgroupAnnotation>,
+ hdr_value: header::IntoHeaderValue<Editgroup>,
) -> std::result::Result<Self, Self::Error> {
let hdr_value = hdr_value.to_string();
match hyper::header::HeaderValue::from_str(&hdr_value) {
std::result::Result::Ok(value) => std::result::Result::Ok(value),
std::result::Result::Err(e) => std::result::Result::Err(format!(
- "Invalid header value for EditgroupAnnotation - value: {} is invalid {}",
+ "Invalid header value for Editgroup - value: {} is invalid {}",
hdr_value, e
)),
}
@@ -1875,20 +1865,18 @@ impl std::convert::TryFrom<header::IntoHeaderValue<EditgroupAnnotation>>
}
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<hyper::header::HeaderValue>
- for header::IntoHeaderValue<EditgroupAnnotation>
-{
+impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<Editgroup> {
type Error = String;
fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result<Self, Self::Error> {
match hdr_value.to_str() {
std::result::Result::Ok(value) => {
- match <EditgroupAnnotation as std::str::FromStr>::from_str(value) {
+ match <Editgroup as std::str::FromStr>::from_str(value) {
std::result::Result::Ok(value) => {
std::result::Result::Ok(header::IntoHeaderValue(value))
}
std::result::Result::Err(err) => std::result::Result::Err(format!(
- "Unable to convert header value '{}' into EditgroupAnnotation - {}",
+ "Unable to convert header value '{}' into Editgroup - {}",
value, err
)),
}
@@ -2027,25 +2015,30 @@ impl std::str::FromStr for EditgroupAnnotation {
if let Some(key) = key_result {
match key {
- "annotation_id" => intermediate_rep
- .annotation_id
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "editgroup_id" => intermediate_rep
- .editgroup_id
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "editor_id" => intermediate_rep
- .editor_id
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "editor" => intermediate_rep
- .editor
- .push(models::Editor::from_str(val).map_err(|x| format!("{}", x))?),
+ "annotation_id" => intermediate_rep.annotation_id.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "editgroup_id" => intermediate_rep.editgroup_id.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "editor_id" => intermediate_rep.editor_id.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "editor" => intermediate_rep.editor.push(
+ <models::Editor as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
"created" => intermediate_rep.created.push(
- chrono::DateTime::<chrono::Utc>::from_str(val)
+ <chrono::DateTime<chrono::Utc> as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "comment_markdown" => intermediate_rep.comment_markdown.push(
+ <String as std::str::FromStr>::from_str(val)
.map_err(|x| format!("{}", x))?,
),
- "comment_markdown" => intermediate_rep
- .comment_markdown
- .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 EditgroupAnnotation"
.to_string(),
@@ -2075,21 +2068,22 @@ impl std::str::FromStr for EditgroupAnnotation {
}
}
-/// Only included in GET responses, and not in all contexts. Do not include this field in PUT or POST requests.
-// Methods for converting between header::IntoHeaderValue<EditgroupEdits> and hyper::header::HeaderValue
+// Methods for converting between header::IntoHeaderValue<EditgroupAnnotation> and hyper::header::HeaderValue
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<header::IntoHeaderValue<EditgroupEdits>> for hyper::header::HeaderValue {
+impl std::convert::TryFrom<header::IntoHeaderValue<EditgroupAnnotation>>
+ for hyper::header::HeaderValue
+{
type Error = String;
fn try_from(
- hdr_value: header::IntoHeaderValue<EditgroupEdits>,
+ hdr_value: header::IntoHeaderValue<EditgroupAnnotation>,
) -> std::result::Result<Self, Self::Error> {
let hdr_value = hdr_value.to_string();
match hyper::header::HeaderValue::from_str(&hdr_value) {
std::result::Result::Ok(value) => std::result::Result::Ok(value),
std::result::Result::Err(e) => std::result::Result::Err(format!(
- "Invalid header value for EditgroupEdits - value: {} is invalid {}",
+ "Invalid header value for EditgroupAnnotation - value: {} is invalid {}",
hdr_value, e
)),
}
@@ -2097,18 +2091,20 @@ impl std::convert::TryFrom<header::IntoHeaderValue<EditgroupEdits>> for hyper::h
}
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<EditgroupEdits> {
+impl std::convert::TryFrom<hyper::header::HeaderValue>
+ for header::IntoHeaderValue<EditgroupAnnotation>
+{
type Error = String;
fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result<Self, Self::Error> {
match hdr_value.to_str() {
std::result::Result::Ok(value) => {
- match <EditgroupEdits as std::str::FromStr>::from_str(value) {
+ match <EditgroupAnnotation as std::str::FromStr>::from_str(value) {
std::result::Result::Ok(value) => {
std::result::Result::Ok(header::IntoHeaderValue(value))
}
std::result::Result::Err(err) => std::result::Result::Err(format!(
- "Unable to convert header value '{}' into EditgroupEdits - {}",
+ "Unable to convert header value '{}' into EditgroupAnnotation - {}",
value, err
)),
}
@@ -2121,6 +2117,7 @@ impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderVal
}
}
+/// Only included in GET responses, and not in all contexts. Do not include this field in PUT or POST requests.
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
#[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))]
pub struct EditgroupEdits {
@@ -2295,20 +2292,20 @@ impl std::str::FromStr for EditgroupEdits {
}
}
-// Methods for converting between header::IntoHeaderValue<Editor> and hyper::header::HeaderValue
+// Methods for converting between header::IntoHeaderValue<EditgroupEdits> and hyper::header::HeaderValue
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<header::IntoHeaderValue<Editor>> for hyper::header::HeaderValue {
+impl std::convert::TryFrom<header::IntoHeaderValue<EditgroupEdits>> for hyper::header::HeaderValue {
type Error = String;
fn try_from(
- hdr_value: header::IntoHeaderValue<Editor>,
+ hdr_value: header::IntoHeaderValue<EditgroupEdits>,
) -> std::result::Result<Self, Self::Error> {
let hdr_value = hdr_value.to_string();
match hyper::header::HeaderValue::from_str(&hdr_value) {
std::result::Result::Ok(value) => std::result::Result::Ok(value),
std::result::Result::Err(e) => std::result::Result::Err(format!(
- "Invalid header value for Editor - value: {} is invalid {}",
+ "Invalid header value for EditgroupEdits - value: {} is invalid {}",
hdr_value, e
)),
}
@@ -2316,18 +2313,18 @@ impl std::convert::TryFrom<header::IntoHeaderValue<Editor>> for hyper::header::H
}
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<Editor> {
+impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<EditgroupEdits> {
type Error = String;
fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result<Self, Self::Error> {
match hdr_value.to_str() {
std::result::Result::Ok(value) => {
- match <Editor as std::str::FromStr>::from_str(value) {
+ match <EditgroupEdits as std::str::FromStr>::from_str(value) {
std::result::Result::Ok(value) => {
std::result::Result::Ok(header::IntoHeaderValue(value))
}
std::result::Result::Err(err) => std::result::Result::Err(format!(
- "Unable to convert header value '{}' into Editor - {}",
+ "Unable to convert header value '{}' into EditgroupEdits - {}",
value, err
)),
}
@@ -2449,21 +2446,23 @@ impl std::str::FromStr for Editor {
if let Some(key) = key_result {
match key {
- "editor_id" => intermediate_rep
- .editor_id
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "username" => intermediate_rep
- .username
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "is_admin" => intermediate_rep
- .is_admin
- .push(bool::from_str(val).map_err(|x| format!("{}", x))?),
- "is_bot" => intermediate_rep
- .is_bot
- .push(bool::from_str(val).map_err(|x| format!("{}", x))?),
- "is_active" => intermediate_rep
- .is_active
- .push(bool::from_str(val).map_err(|x| format!("{}", x))?),
+ "editor_id" => intermediate_rep.editor_id.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "username" => intermediate_rep.username.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "is_admin" => intermediate_rep.is_admin.push(
+ <bool as std::str::FromStr>::from_str(val).map_err(|x| format!("{}", x))?,
+ ),
+ "is_bot" => intermediate_rep.is_bot.push(
+ <bool as std::str::FromStr>::from_str(val).map_err(|x| format!("{}", x))?,
+ ),
+ "is_active" => intermediate_rep.is_active.push(
+ <bool as std::str::FromStr>::from_str(val).map_err(|x| format!("{}", x))?,
+ ),
_ => {
return std::result::Result::Err(
"Unexpected key while parsing Editor".to_string(),
@@ -2491,20 +2490,20 @@ impl std::str::FromStr for Editor {
}
}
-// Methods for converting between header::IntoHeaderValue<EntityEdit> and hyper::header::HeaderValue
+// Methods for converting between header::IntoHeaderValue<Editor> and hyper::header::HeaderValue
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<header::IntoHeaderValue<EntityEdit>> for hyper::header::HeaderValue {
+impl std::convert::TryFrom<header::IntoHeaderValue<Editor>> for hyper::header::HeaderValue {
type Error = String;
fn try_from(
- hdr_value: header::IntoHeaderValue<EntityEdit>,
+ hdr_value: header::IntoHeaderValue<Editor>,
) -> std::result::Result<Self, Self::Error> {
let hdr_value = hdr_value.to_string();
match hyper::header::HeaderValue::from_str(&hdr_value) {
std::result::Result::Ok(value) => std::result::Result::Ok(value),
std::result::Result::Err(e) => std::result::Result::Err(format!(
- "Invalid header value for EntityEdit - value: {} is invalid {}",
+ "Invalid header value for Editor - value: {} is invalid {}",
hdr_value, e
)),
}
@@ -2512,18 +2511,18 @@ impl std::convert::TryFrom<header::IntoHeaderValue<EntityEdit>> for hyper::heade
}
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<EntityEdit> {
+impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<Editor> {
type Error = String;
fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result<Self, Self::Error> {
match hdr_value.to_str() {
std::result::Result::Ok(value) => {
- match <EntityEdit as std::str::FromStr>::from_str(value) {
+ match <Editor as std::str::FromStr>::from_str(value) {
std::result::Result::Ok(value) => {
std::result::Result::Ok(header::IntoHeaderValue(value))
}
std::result::Result::Err(err) => std::result::Result::Err(format!(
- "Unable to convert header value '{}' into EntityEdit - {}",
+ "Unable to convert header value '{}' into Editor - {}",
value, err
)),
}
@@ -2660,24 +2659,30 @@ impl std::str::FromStr for EntityEdit {
if let Some(key) = key_result {
match key {
- "edit_id" => intermediate_rep
- .edit_id
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "ident" => intermediate_rep
- .ident
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "revision" => intermediate_rep
- .revision
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "prev_revision" => intermediate_rep
- .prev_revision
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "redirect_ident" => intermediate_rep
- .redirect_ident
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "editgroup_id" => intermediate_rep
- .editgroup_id
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
+ "edit_id" => intermediate_rep.edit_id.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "ident" => intermediate_rep.ident.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "revision" => intermediate_rep.revision.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "prev_revision" => intermediate_rep.prev_revision.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "redirect_ident" => intermediate_rep.redirect_ident.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "editgroup_id" => intermediate_rep.editgroup_id.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
"extra" => {
return std::result::Result::Err(
"Parsing a container in this style is not supported in EntityEdit"
@@ -2721,22 +2726,20 @@ impl std::str::FromStr for EntityEdit {
}
}
-// Methods for converting between header::IntoHeaderValue<EntityHistoryEntry> and hyper::header::HeaderValue
+// Methods for converting between header::IntoHeaderValue<EntityEdit> and hyper::header::HeaderValue
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<header::IntoHeaderValue<EntityHistoryEntry>>
- for hyper::header::HeaderValue
-{
+impl std::convert::TryFrom<header::IntoHeaderValue<EntityEdit>> for hyper::header::HeaderValue {
type Error = String;
fn try_from(
- hdr_value: header::IntoHeaderValue<EntityHistoryEntry>,
+ hdr_value: header::IntoHeaderValue<EntityEdit>,
) -> std::result::Result<Self, Self::Error> {
let hdr_value = hdr_value.to_string();
match hyper::header::HeaderValue::from_str(&hdr_value) {
std::result::Result::Ok(value) => std::result::Result::Ok(value),
std::result::Result::Err(e) => std::result::Result::Err(format!(
- "Invalid header value for EntityHistoryEntry - value: {} is invalid {}",
+ "Invalid header value for EntityEdit - value: {} is invalid {}",
hdr_value, e
)),
}
@@ -2744,20 +2747,18 @@ impl std::convert::TryFrom<header::IntoHeaderValue<EntityHistoryEntry>>
}
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<hyper::header::HeaderValue>
- for header::IntoHeaderValue<EntityHistoryEntry>
-{
+impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<EntityEdit> {
type Error = String;
fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result<Self, Self::Error> {
match hdr_value.to_str() {
std::result::Result::Ok(value) => {
- match <EntityHistoryEntry as std::str::FromStr>::from_str(value) {
+ match <EntityEdit as std::str::FromStr>::from_str(value) {
std::result::Result::Ok(value) => {
std::result::Result::Ok(header::IntoHeaderValue(value))
}
std::result::Result::Err(err) => std::result::Result::Err(format!(
- "Unable to convert header value '{}' into EntityHistoryEntry - {}",
+ "Unable to convert header value '{}' into EntityEdit - {}",
value, err
)),
}
@@ -2846,15 +2847,18 @@ impl std::str::FromStr for EntityHistoryEntry {
if let Some(key) = key_result {
match key {
- "edit" => intermediate_rep
- .edit
- .push(models::EntityEdit::from_str(val).map_err(|x| format!("{}", x))?),
- "editgroup" => intermediate_rep
- .editgroup
- .push(models::Editgroup::from_str(val).map_err(|x| format!("{}", x))?),
- "changelog_entry" => intermediate_rep
- .changelog_entry
- .push(models::ChangelogEntry::from_str(val).map_err(|x| format!("{}", x))?),
+ "edit" => intermediate_rep.edit.push(
+ <models::EntityEdit as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "editgroup" => intermediate_rep.editgroup.push(
+ <models::Editgroup as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "changelog_entry" => intermediate_rep.changelog_entry.push(
+ <models::ChangelogEntry as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
_ => {
return std::result::Result::Err(
"Unexpected key while parsing EntityHistoryEntry".to_string(),
@@ -2888,20 +2892,22 @@ impl std::str::FromStr for EntityHistoryEntry {
}
}
-// Methods for converting between header::IntoHeaderValue<ErrorResponse> and hyper::header::HeaderValue
+// Methods for converting between header::IntoHeaderValue<EntityHistoryEntry> and hyper::header::HeaderValue
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<header::IntoHeaderValue<ErrorResponse>> for hyper::header::HeaderValue {
+impl std::convert::TryFrom<header::IntoHeaderValue<EntityHistoryEntry>>
+ for hyper::header::HeaderValue
+{
type Error = String;
fn try_from(
- hdr_value: header::IntoHeaderValue<ErrorResponse>,
+ hdr_value: header::IntoHeaderValue<EntityHistoryEntry>,
) -> std::result::Result<Self, Self::Error> {
let hdr_value = hdr_value.to_string();
match hyper::header::HeaderValue::from_str(&hdr_value) {
std::result::Result::Ok(value) => std::result::Result::Ok(value),
std::result::Result::Err(e) => std::result::Result::Err(format!(
- "Invalid header value for ErrorResponse - value: {} is invalid {}",
+ "Invalid header value for EntityHistoryEntry - value: {} is invalid {}",
hdr_value, e
)),
}
@@ -2909,18 +2915,20 @@ impl std::convert::TryFrom<header::IntoHeaderValue<ErrorResponse>> for hyper::he
}
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<ErrorResponse> {
+impl std::convert::TryFrom<hyper::header::HeaderValue>
+ for header::IntoHeaderValue<EntityHistoryEntry>
+{
type Error = String;
fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result<Self, Self::Error> {
match hdr_value.to_str() {
std::result::Result::Ok(value) => {
- match <ErrorResponse as std::str::FromStr>::from_str(value) {
+ match <EntityHistoryEntry as std::str::FromStr>::from_str(value) {
std::result::Result::Ok(value) => {
std::result::Result::Ok(header::IntoHeaderValue(value))
}
std::result::Result::Err(err) => std::result::Result::Err(format!(
- "Unable to convert header value '{}' into ErrorResponse - {}",
+ "Unable to convert header value '{}' into EntityHistoryEntry - {}",
value, err
)),
}
@@ -3009,15 +3017,17 @@ impl std::str::FromStr for ErrorResponse {
if let Some(key) = key_result {
match key {
- "success" => intermediate_rep
- .success
- .push(bool::from_str(val).map_err(|x| format!("{}", x))?),
- "error" => intermediate_rep
- .error
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "message" => intermediate_rep
- .message
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
+ "success" => intermediate_rep.success.push(
+ <bool as std::str::FromStr>::from_str(val).map_err(|x| format!("{}", x))?,
+ ),
+ "error" => intermediate_rep.error.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "message" => intermediate_rep.message.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
_ => {
return std::result::Result::Err(
"Unexpected key while parsing ErrorResponse".to_string(),
@@ -3051,20 +3061,20 @@ impl std::str::FromStr for ErrorResponse {
}
}
-// Methods for converting between header::IntoHeaderValue<FileAutoBatch> and hyper::header::HeaderValue
+// Methods for converting between header::IntoHeaderValue<ErrorResponse> and hyper::header::HeaderValue
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<header::IntoHeaderValue<FileAutoBatch>> for hyper::header::HeaderValue {
+impl std::convert::TryFrom<header::IntoHeaderValue<ErrorResponse>> for hyper::header::HeaderValue {
type Error = String;
fn try_from(
- hdr_value: header::IntoHeaderValue<FileAutoBatch>,
+ hdr_value: header::IntoHeaderValue<ErrorResponse>,
) -> std::result::Result<Self, Self::Error> {
let hdr_value = hdr_value.to_string();
match hyper::header::HeaderValue::from_str(&hdr_value) {
std::result::Result::Ok(value) => std::result::Result::Ok(value),
std::result::Result::Err(e) => std::result::Result::Err(format!(
- "Invalid header value for FileAutoBatch - value: {} is invalid {}",
+ "Invalid header value for ErrorResponse - value: {} is invalid {}",
hdr_value, e
)),
}
@@ -3072,18 +3082,18 @@ impl std::convert::TryFrom<header::IntoHeaderValue<FileAutoBatch>> for hyper::he
}
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<FileAutoBatch> {
+impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<ErrorResponse> {
type Error = String;
fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result<Self, Self::Error> {
match hdr_value.to_str() {
std::result::Result::Ok(value) => {
- match <FileAutoBatch as std::str::FromStr>::from_str(value) {
+ match <ErrorResponse as std::str::FromStr>::from_str(value) {
std::result::Result::Ok(value) => {
std::result::Result::Ok(header::IntoHeaderValue(value))
}
std::result::Result::Err(err) => std::result::Result::Err(format!(
- "Unable to convert header value '{}' into FileAutoBatch - {}",
+ "Unable to convert header value '{}' into ErrorResponse - {}",
value, err
)),
}
@@ -3164,9 +3174,10 @@ impl std::str::FromStr for FileAutoBatch {
if let Some(key) = key_result {
match key {
- "editgroup" => intermediate_rep
- .editgroup
- .push(models::Editgroup::from_str(val).map_err(|x| format!("{}", x))?),
+ "editgroup" => intermediate_rep.editgroup.push(
+ <models::Editgroup as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
"entity_list" => {
return std::result::Result::Err(
"Parsing a container in this style is not supported in FileAutoBatch"
@@ -3201,20 +3212,20 @@ impl std::str::FromStr for FileAutoBatch {
}
}
-// Methods for converting between header::IntoHeaderValue<FileEntity> and hyper::header::HeaderValue
+// Methods for converting between header::IntoHeaderValue<FileAutoBatch> and hyper::header::HeaderValue
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<header::IntoHeaderValue<FileEntity>> for hyper::header::HeaderValue {
+impl std::convert::TryFrom<header::IntoHeaderValue<FileAutoBatch>> for hyper::header::HeaderValue {
type Error = String;
fn try_from(
- hdr_value: header::IntoHeaderValue<FileEntity>,
+ hdr_value: header::IntoHeaderValue<FileAutoBatch>,
) -> std::result::Result<Self, Self::Error> {
let hdr_value = hdr_value.to_string();
match hyper::header::HeaderValue::from_str(&hdr_value) {
std::result::Result::Ok(value) => std::result::Result::Ok(value),
std::result::Result::Err(e) => std::result::Result::Err(format!(
- "Invalid header value for FileEntity - value: {} is invalid {}",
+ "Invalid header value for FileAutoBatch - value: {} is invalid {}",
hdr_value, e
)),
}
@@ -3222,18 +3233,18 @@ impl std::convert::TryFrom<header::IntoHeaderValue<FileEntity>> for hyper::heade
}
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<FileEntity> {
+impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<FileAutoBatch> {
type Error = String;
fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result<Self, Self::Error> {
match hdr_value.to_str() {
std::result::Result::Ok(value) => {
- match <FileEntity as std::str::FromStr>::from_str(value) {
+ match <FileAutoBatch as std::str::FromStr>::from_str(value) {
std::result::Result::Ok(value) => {
std::result::Result::Ok(header::IntoHeaderValue(value))
}
std::result::Result::Err(err) => std::result::Result::Err(format!(
- "Unable to convert header value '{}' into FileEntity - {}",
+ "Unable to convert header value '{}' into FileAutoBatch - {}",
value, err
)),
}
@@ -3472,18 +3483,22 @@ impl std::str::FromStr for FileEntity {
if let Some(key) = key_result {
match key {
- "state" => intermediate_rep
- .state
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "ident" => intermediate_rep
- .ident
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "revision" => intermediate_rep
- .revision
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "redirect" => intermediate_rep
- .redirect
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
+ "state" => intermediate_rep.state.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "ident" => intermediate_rep.ident.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "revision" => intermediate_rep.revision.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "redirect" => intermediate_rep.redirect.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
"extra" => {
return std::result::Result::Err(
"Parsing a container in this style is not supported in FileEntity"
@@ -3496,30 +3511,35 @@ impl std::str::FromStr for FileEntity {
.to_string(),
)
}
- "size" => intermediate_rep
- .size
- .push(i64::from_str(val).map_err(|x| format!("{}", x))?),
- "md5" => intermediate_rep
- .md5
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "sha1" => intermediate_rep
- .sha1
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "sha256" => intermediate_rep
- .sha256
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
+ "size" => intermediate_rep.size.push(
+ <i64 as std::str::FromStr>::from_str(val).map_err(|x| format!("{}", x))?,
+ ),
+ "md5" => intermediate_rep.md5.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "sha1" => intermediate_rep.sha1.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "sha256" => intermediate_rep.sha256.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
"urls" => {
return std::result::Result::Err(
"Parsing a container in this style is not supported in FileEntity"
.to_string(),
)
}
- "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))?),
+ "mimetype" => intermediate_rep.mimetype.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "content_scope" => intermediate_rep.content_scope.push(
+ <String as std::str::FromStr>::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"
@@ -3565,20 +3585,20 @@ impl std::str::FromStr for FileEntity {
}
}
-// Methods for converting between header::IntoHeaderValue<FileUrl> and hyper::header::HeaderValue
+// Methods for converting between header::IntoHeaderValue<FileEntity> and hyper::header::HeaderValue
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<header::IntoHeaderValue<FileUrl>> for hyper::header::HeaderValue {
+impl std::convert::TryFrom<header::IntoHeaderValue<FileEntity>> for hyper::header::HeaderValue {
type Error = String;
fn try_from(
- hdr_value: header::IntoHeaderValue<FileUrl>,
+ hdr_value: header::IntoHeaderValue<FileEntity>,
) -> std::result::Result<Self, Self::Error> {
let hdr_value = hdr_value.to_string();
match hyper::header::HeaderValue::from_str(&hdr_value) {
std::result::Result::Ok(value) => std::result::Result::Ok(value),
std::result::Result::Err(e) => std::result::Result::Err(format!(
- "Invalid header value for FileUrl - value: {} is invalid {}",
+ "Invalid header value for FileEntity - value: {} is invalid {}",
hdr_value, e
)),
}
@@ -3586,18 +3606,18 @@ impl std::convert::TryFrom<header::IntoHeaderValue<FileUrl>> for hyper::header::
}
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<FileUrl> {
+impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<FileEntity> {
type Error = String;
fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result<Self, Self::Error> {
match hdr_value.to_str() {
std::result::Result::Ok(value) => {
- match <FileUrl as std::str::FromStr>::from_str(value) {
+ match <FileEntity as std::str::FromStr>::from_str(value) {
std::result::Result::Ok(value) => {
std::result::Result::Ok(header::IntoHeaderValue(value))
}
std::result::Result::Err(err) => std::result::Result::Err(format!(
- "Unable to convert header value '{}' into FileUrl - {}",
+ "Unable to convert header value '{}' into FileEntity - {}",
value, err
)),
}
@@ -3677,12 +3697,14 @@ impl std::str::FromStr for FileUrl {
if let Some(key) = key_result {
match key {
- "url" => intermediate_rep
- .url
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "rel" => intermediate_rep
- .rel
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
+ "url" => intermediate_rep.url.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "rel" => intermediate_rep.rel.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
_ => {
return std::result::Result::Err(
"Unexpected key while parsing FileUrl".to_string(),
@@ -3711,22 +3733,20 @@ impl std::str::FromStr for FileUrl {
}
}
-// Methods for converting between header::IntoHeaderValue<FilesetAutoBatch> and hyper::header::HeaderValue
+// Methods for converting between header::IntoHeaderValue<FileUrl> and hyper::header::HeaderValue
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<header::IntoHeaderValue<FilesetAutoBatch>>
- for hyper::header::HeaderValue
-{
+impl std::convert::TryFrom<header::IntoHeaderValue<FileUrl>> for hyper::header::HeaderValue {
type Error = String;
fn try_from(
- hdr_value: header::IntoHeaderValue<FilesetAutoBatch>,
+ hdr_value: header::IntoHeaderValue<FileUrl>,
) -> std::result::Result<Self, Self::Error> {
let hdr_value = hdr_value.to_string();
match hyper::header::HeaderValue::from_str(&hdr_value) {
std::result::Result::Ok(value) => std::result::Result::Ok(value),
std::result::Result::Err(e) => std::result::Result::Err(format!(
- "Invalid header value for FilesetAutoBatch - value: {} is invalid {}",
+ "Invalid header value for FileUrl - value: {} is invalid {}",
hdr_value, e
)),
}
@@ -3734,20 +3754,18 @@ impl std::convert::TryFrom<header::IntoHeaderValue<FilesetAutoBatch>>
}
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<hyper::header::HeaderValue>
- for header::IntoHeaderValue<FilesetAutoBatch>
-{
+impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<FileUrl> {
type Error = String;
fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result<Self, Self::Error> {
match hdr_value.to_str() {
std::result::Result::Ok(value) => {
- match <FilesetAutoBatch as std::str::FromStr>::from_str(value) {
+ match <FileUrl as std::str::FromStr>::from_str(value) {
std::result::Result::Ok(value) => {
std::result::Result::Ok(header::IntoHeaderValue(value))
}
std::result::Result::Err(err) => std::result::Result::Err(format!(
- "Unable to convert header value '{}' into FilesetAutoBatch - {}",
+ "Unable to convert header value '{}' into FileUrl - {}",
value, err
)),
}
@@ -3828,9 +3846,10 @@ impl std::str::FromStr for FilesetAutoBatch {
if let Some(key) = key_result {
match key {
- "editgroup" => intermediate_rep
- .editgroup
- .push(models::Editgroup::from_str(val).map_err(|x| format!("{}", x))?),
+ "editgroup" => intermediate_rep.editgroup.push(
+ <models::Editgroup as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
"entity_list" => return std::result::Result::Err(
"Parsing a container in this style is not supported in FilesetAutoBatch"
.to_string(),
@@ -3863,20 +3882,22 @@ impl std::str::FromStr for FilesetAutoBatch {
}
}
-// Methods for converting between header::IntoHeaderValue<FilesetEntity> and hyper::header::HeaderValue
+// Methods for converting between header::IntoHeaderValue<FilesetAutoBatch> and hyper::header::HeaderValue
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<header::IntoHeaderValue<FilesetEntity>> for hyper::header::HeaderValue {
+impl std::convert::TryFrom<header::IntoHeaderValue<FilesetAutoBatch>>
+ for hyper::header::HeaderValue
+{
type Error = String;
fn try_from(
- hdr_value: header::IntoHeaderValue<FilesetEntity>,
+ hdr_value: header::IntoHeaderValue<FilesetAutoBatch>,
) -> std::result::Result<Self, Self::Error> {
let hdr_value = hdr_value.to_string();
match hyper::header::HeaderValue::from_str(&hdr_value) {
std::result::Result::Ok(value) => std::result::Result::Ok(value),
std::result::Result::Err(e) => std::result::Result::Err(format!(
- "Invalid header value for FilesetEntity - value: {} is invalid {}",
+ "Invalid header value for FilesetAutoBatch - value: {} is invalid {}",
hdr_value, e
)),
}
@@ -3884,18 +3905,20 @@ impl std::convert::TryFrom<header::IntoHeaderValue<FilesetEntity>> for hyper::he
}
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<FilesetEntity> {
+impl std::convert::TryFrom<hyper::header::HeaderValue>
+ for header::IntoHeaderValue<FilesetAutoBatch>
+{
type Error = String;
fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result<Self, Self::Error> {
match hdr_value.to_str() {
std::result::Result::Ok(value) => {
- match <FilesetEntity as std::str::FromStr>::from_str(value) {
+ match <FilesetAutoBatch as std::str::FromStr>::from_str(value) {
std::result::Result::Ok(value) => {
std::result::Result::Ok(header::IntoHeaderValue(value))
}
std::result::Result::Err(err) => std::result::Result::Err(format!(
- "Unable to convert header value '{}' into FilesetEntity - {}",
+ "Unable to convert header value '{}' into FilesetAutoBatch - {}",
value, err
)),
}
@@ -4083,18 +4106,22 @@ impl std::str::FromStr for FilesetEntity {
if let Some(key) = key_result {
match key {
- "state" => intermediate_rep
- .state
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "ident" => intermediate_rep
- .ident
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "revision" => intermediate_rep
- .revision
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "redirect" => intermediate_rep
- .redirect
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
+ "state" => intermediate_rep.state.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "ident" => intermediate_rep.ident.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "revision" => intermediate_rep.revision.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "redirect" => intermediate_rep.redirect.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
"extra" => {
return std::result::Result::Err(
"Parsing a container in this style is not supported in FilesetEntity"
@@ -4107,9 +4134,10 @@ impl std::str::FromStr for FilesetEntity {
.to_string(),
)
}
- "content_scope" => intermediate_rep
- .content_scope
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
+ "content_scope" => intermediate_rep.content_scope.push(
+ <String as std::str::FromStr>::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"
@@ -4163,20 +4191,20 @@ impl std::str::FromStr for FilesetEntity {
}
}
-// Methods for converting between header::IntoHeaderValue<FilesetFile> and hyper::header::HeaderValue
+// Methods for converting between header::IntoHeaderValue<FilesetEntity> and hyper::header::HeaderValue
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<header::IntoHeaderValue<FilesetFile>> for hyper::header::HeaderValue {
+impl std::convert::TryFrom<header::IntoHeaderValue<FilesetEntity>> for hyper::header::HeaderValue {
type Error = String;
fn try_from(
- hdr_value: header::IntoHeaderValue<FilesetFile>,
+ hdr_value: header::IntoHeaderValue<FilesetEntity>,
) -> std::result::Result<Self, Self::Error> {
let hdr_value = hdr_value.to_string();
match hyper::header::HeaderValue::from_str(&hdr_value) {
std::result::Result::Ok(value) => std::result::Result::Ok(value),
std::result::Result::Err(e) => std::result::Result::Err(format!(
- "Invalid header value for FilesetFile - value: {} is invalid {}",
+ "Invalid header value for FilesetEntity - value: {} is invalid {}",
hdr_value, e
)),
}
@@ -4184,18 +4212,18 @@ impl std::convert::TryFrom<header::IntoHeaderValue<FilesetFile>> for hyper::head
}
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<FilesetFile> {
+impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<FilesetEntity> {
type Error = String;
fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result<Self, Self::Error> {
match hdr_value.to_str() {
std::result::Result::Ok(value) => {
- match <FilesetFile as std::str::FromStr>::from_str(value) {
+ match <FilesetEntity as std::str::FromStr>::from_str(value) {
std::result::Result::Ok(value) => {
std::result::Result::Ok(header::IntoHeaderValue(value))
}
std::result::Result::Err(err) => std::result::Result::Err(format!(
- "Unable to convert header value '{}' into FilesetFile - {}",
+ "Unable to convert header value '{}' into FilesetEntity - {}",
value, err
)),
}
@@ -4335,24 +4363,29 @@ impl std::str::FromStr for FilesetFile {
if let Some(key) = key_result {
match key {
- "path" => intermediate_rep
- .path
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "size" => intermediate_rep
- .size
- .push(i64::from_str(val).map_err(|x| format!("{}", x))?),
- "md5" => intermediate_rep
- .md5
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "sha1" => intermediate_rep
- .sha1
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "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))?),
+ "path" => intermediate_rep.path.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "size" => intermediate_rep.size.push(
+ <i64 as std::str::FromStr>::from_str(val).map_err(|x| format!("{}", x))?,
+ ),
+ "md5" => intermediate_rep.md5.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "sha1" => intermediate_rep.sha1.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "sha256" => intermediate_rep.sha256.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "mimetype" => intermediate_rep.mimetype.push(
+ <String as std::str::FromStr>::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"
@@ -4392,20 +4425,20 @@ impl std::str::FromStr for FilesetFile {
}
}
-// Methods for converting between header::IntoHeaderValue<FilesetUrl> and hyper::header::HeaderValue
+// Methods for converting between header::IntoHeaderValue<FilesetFile> and hyper::header::HeaderValue
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<header::IntoHeaderValue<FilesetUrl>> for hyper::header::HeaderValue {
+impl std::convert::TryFrom<header::IntoHeaderValue<FilesetFile>> for hyper::header::HeaderValue {
type Error = String;
fn try_from(
- hdr_value: header::IntoHeaderValue<FilesetUrl>,
+ hdr_value: header::IntoHeaderValue<FilesetFile>,
) -> std::result::Result<Self, Self::Error> {
let hdr_value = hdr_value.to_string();
match hyper::header::HeaderValue::from_str(&hdr_value) {
std::result::Result::Ok(value) => std::result::Result::Ok(value),
std::result::Result::Err(e) => std::result::Result::Err(format!(
- "Invalid header value for FilesetUrl - value: {} is invalid {}",
+ "Invalid header value for FilesetFile - value: {} is invalid {}",
hdr_value, e
)),
}
@@ -4413,18 +4446,18 @@ impl std::convert::TryFrom<header::IntoHeaderValue<FilesetUrl>> for hyper::heade
}
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<FilesetUrl> {
+impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<FilesetFile> {
type Error = String;
fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result<Self, Self::Error> {
match hdr_value.to_str() {
std::result::Result::Ok(value) => {
- match <FilesetUrl as std::str::FromStr>::from_str(value) {
+ match <FilesetFile as std::str::FromStr>::from_str(value) {
std::result::Result::Ok(value) => {
std::result::Result::Ok(header::IntoHeaderValue(value))
}
std::result::Result::Err(err) => std::result::Result::Err(format!(
- "Unable to convert header value '{}' into FilesetUrl - {}",
+ "Unable to convert header value '{}' into FilesetFile - {}",
value, err
)),
}
@@ -4503,12 +4536,14 @@ impl std::str::FromStr for FilesetUrl {
if let Some(key) = key_result {
match key {
- "url" => intermediate_rep
- .url
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "rel" => intermediate_rep
- .rel
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
+ "url" => intermediate_rep.url.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "rel" => intermediate_rep.rel.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
_ => {
return std::result::Result::Err(
"Unexpected key while parsing FilesetUrl".to_string(),
@@ -4537,22 +4572,20 @@ impl std::str::FromStr for FilesetUrl {
}
}
-// Methods for converting between header::IntoHeaderValue<ReleaseAbstract> and hyper::header::HeaderValue
+// Methods for converting between header::IntoHeaderValue<FilesetUrl> and hyper::header::HeaderValue
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<header::IntoHeaderValue<ReleaseAbstract>>
- for hyper::header::HeaderValue
-{
+impl std::convert::TryFrom<header::IntoHeaderValue<FilesetUrl>> for hyper::header::HeaderValue {
type Error = String;
fn try_from(
- hdr_value: header::IntoHeaderValue<ReleaseAbstract>,
+ hdr_value: header::IntoHeaderValue<FilesetUrl>,
) -> std::result::Result<Self, Self::Error> {
let hdr_value = hdr_value.to_string();
match hyper::header::HeaderValue::from_str(&hdr_value) {
std::result::Result::Ok(value) => std::result::Result::Ok(value),
std::result::Result::Err(e) => std::result::Result::Err(format!(
- "Invalid header value for ReleaseAbstract - value: {} is invalid {}",
+ "Invalid header value for FilesetUrl - value: {} is invalid {}",
hdr_value, e
)),
}
@@ -4560,20 +4593,18 @@ impl std::convert::TryFrom<header::IntoHeaderValue<ReleaseAbstract>>
}
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<hyper::header::HeaderValue>
- for header::IntoHeaderValue<ReleaseAbstract>
-{
+impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<FilesetUrl> {
type Error = String;
fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result<Self, Self::Error> {
match hdr_value.to_str() {
std::result::Result::Ok(value) => {
- match <ReleaseAbstract as std::str::FromStr>::from_str(value) {
+ match <FilesetUrl as std::str::FromStr>::from_str(value) {
std::result::Result::Ok(value) => {
std::result::Result::Ok(header::IntoHeaderValue(value))
}
std::result::Result::Err(err) => std::result::Result::Err(format!(
- "Unable to convert header value '{}' into ReleaseAbstract - {}",
+ "Unable to convert header value '{}' into FilesetUrl - {}",
value, err
)),
}
@@ -4686,18 +4717,22 @@ impl std::str::FromStr for ReleaseAbstract {
if let Some(key) = key_result {
match key {
- "sha1" => intermediate_rep
- .sha1
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "content" => intermediate_rep
- .content
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "mimetype" => intermediate_rep
- .mimetype
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "lang" => intermediate_rep
- .lang
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
+ "sha1" => intermediate_rep.sha1.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "content" => intermediate_rep.content.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "mimetype" => intermediate_rep.mimetype.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "lang" => intermediate_rep.lang.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
_ => {
return std::result::Result::Err(
"Unexpected key while parsing ReleaseAbstract".to_string(),
@@ -4720,22 +4755,22 @@ impl std::str::FromStr for ReleaseAbstract {
}
}
-// Methods for converting between header::IntoHeaderValue<ReleaseAutoBatch> and hyper::header::HeaderValue
+// Methods for converting between header::IntoHeaderValue<ReleaseAbstract> and hyper::header::HeaderValue
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<header::IntoHeaderValue<ReleaseAutoBatch>>
+impl std::convert::TryFrom<header::IntoHeaderValue<ReleaseAbstract>>
for hyper::header::HeaderValue
{
type Error = String;
fn try_from(
- hdr_value: header::IntoHeaderValue<ReleaseAutoBatch>,
+ hdr_value: header::IntoHeaderValue<ReleaseAbstract>,
) -> std::result::Result<Self, Self::Error> {
let hdr_value = hdr_value.to_string();
match hyper::header::HeaderValue::from_str(&hdr_value) {
std::result::Result::Ok(value) => std::result::Result::Ok(value),
std::result::Result::Err(e) => std::result::Result::Err(format!(
- "Invalid header value for ReleaseAutoBatch - value: {} is invalid {}",
+ "Invalid header value for ReleaseAbstract - value: {} is invalid {}",
hdr_value, e
)),
}
@@ -4744,19 +4779,19 @@ impl std::convert::TryFrom<header::IntoHeaderValue<ReleaseAutoBatch>>
#[cfg(any(feature = "client", feature = "server"))]
impl std::convert::TryFrom<hyper::header::HeaderValue>
- for header::IntoHeaderValue<ReleaseAutoBatch>
+ for header::IntoHeaderValue<ReleaseAbstract>
{
type Error = String;
fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result<Self, Self::Error> {
match hdr_value.to_str() {
std::result::Result::Ok(value) => {
- match <ReleaseAutoBatch as std::str::FromStr>::from_str(value) {
+ match <ReleaseAbstract as std::str::FromStr>::from_str(value) {
std::result::Result::Ok(value) => {
std::result::Result::Ok(header::IntoHeaderValue(value))
}
std::result::Result::Err(err) => std::result::Result::Err(format!(
- "Unable to convert header value '{}' into ReleaseAutoBatch - {}",
+ "Unable to convert header value '{}' into ReleaseAbstract - {}",
value, err
)),
}
@@ -4837,9 +4872,10 @@ impl std::str::FromStr for ReleaseAutoBatch {
if let Some(key) = key_result {
match key {
- "editgroup" => intermediate_rep
- .editgroup
- .push(models::Editgroup::from_str(val).map_err(|x| format!("{}", x))?),
+ "editgroup" => intermediate_rep.editgroup.push(
+ <models::Editgroup as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
"entity_list" => return std::result::Result::Err(
"Parsing a container in this style is not supported in ReleaseAutoBatch"
.to_string(),
@@ -4872,20 +4908,22 @@ impl std::str::FromStr for ReleaseAutoBatch {
}
}
-// Methods for converting between header::IntoHeaderValue<ReleaseContrib> and hyper::header::HeaderValue
+// Methods for converting between header::IntoHeaderValue<ReleaseAutoBatch> and hyper::header::HeaderValue
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<header::IntoHeaderValue<ReleaseContrib>> for hyper::header::HeaderValue {
+impl std::convert::TryFrom<header::IntoHeaderValue<ReleaseAutoBatch>>
+ for hyper::header::HeaderValue
+{
type Error = String;
fn try_from(
- hdr_value: header::IntoHeaderValue<ReleaseContrib>,
+ hdr_value: header::IntoHeaderValue<ReleaseAutoBatch>,
) -> std::result::Result<Self, Self::Error> {
let hdr_value = hdr_value.to_string();
match hyper::header::HeaderValue::from_str(&hdr_value) {
std::result::Result::Ok(value) => std::result::Result::Ok(value),
std::result::Result::Err(e) => std::result::Result::Err(format!(
- "Invalid header value for ReleaseContrib - value: {} is invalid {}",
+ "Invalid header value for ReleaseAutoBatch - value: {} is invalid {}",
hdr_value, e
)),
}
@@ -4893,18 +4931,20 @@ impl std::convert::TryFrom<header::IntoHeaderValue<ReleaseContrib>> for hyper::h
}
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<ReleaseContrib> {
+impl std::convert::TryFrom<hyper::header::HeaderValue>
+ for header::IntoHeaderValue<ReleaseAutoBatch>
+{
type Error = String;
fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result<Self, Self::Error> {
match hdr_value.to_str() {
std::result::Result::Ok(value) => {
- match <ReleaseContrib as std::str::FromStr>::from_str(value) {
+ match <ReleaseAutoBatch as std::str::FromStr>::from_str(value) {
std::result::Result::Ok(value) => {
std::result::Result::Ok(header::IntoHeaderValue(value))
}
std::result::Result::Err(err) => std::result::Result::Err(format!(
- "Unable to convert header value '{}' into ReleaseContrib - {}",
+ "Unable to convert header value '{}' into ReleaseAutoBatch - {}",
value, err
)),
}
@@ -5071,30 +5111,37 @@ impl std::str::FromStr for ReleaseContrib {
if let Some(key) = key_result {
match key {
- "index" => intermediate_rep
- .index
- .push(i64::from_str(val).map_err(|x| format!("{}", x))?),
- "creator_id" => intermediate_rep
- .creator_id
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "creator" => intermediate_rep
- .creator
- .push(models::CreatorEntity::from_str(val).map_err(|x| format!("{}", x))?),
- "raw_name" => intermediate_rep
- .raw_name
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "given_name" => intermediate_rep
- .given_name
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "surname" => intermediate_rep
- .surname
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "role" => intermediate_rep
- .role
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "raw_affiliation" => intermediate_rep
- .raw_affiliation
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
+ "index" => intermediate_rep.index.push(
+ <i64 as std::str::FromStr>::from_str(val).map_err(|x| format!("{}", x))?,
+ ),
+ "creator_id" => intermediate_rep.creator_id.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "creator" => intermediate_rep.creator.push(
+ <models::CreatorEntity as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "raw_name" => intermediate_rep.raw_name.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "given_name" => intermediate_rep.given_name.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "surname" => intermediate_rep.surname.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "role" => intermediate_rep.role.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "raw_affiliation" => intermediate_rep.raw_affiliation.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
"extra" => {
return std::result::Result::Err(
"Parsing a container in this style is not supported in ReleaseContrib"
@@ -5128,20 +5175,20 @@ impl std::str::FromStr for ReleaseContrib {
}
}
-// Methods for converting between header::IntoHeaderValue<ReleaseEntity> and hyper::header::HeaderValue
+// Methods for converting between header::IntoHeaderValue<ReleaseContrib> and hyper::header::HeaderValue
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<header::IntoHeaderValue<ReleaseEntity>> for hyper::header::HeaderValue {
+impl std::convert::TryFrom<header::IntoHeaderValue<ReleaseContrib>> for hyper::header::HeaderValue {
type Error = String;
fn try_from(
- hdr_value: header::IntoHeaderValue<ReleaseEntity>,
+ hdr_value: header::IntoHeaderValue<ReleaseContrib>,
) -> std::result::Result<Self, Self::Error> {
let hdr_value = hdr_value.to_string();
match hyper::header::HeaderValue::from_str(&hdr_value) {
std::result::Result::Ok(value) => std::result::Result::Ok(value),
std::result::Result::Err(e) => std::result::Result::Err(format!(
- "Invalid header value for ReleaseEntity - value: {} is invalid {}",
+ "Invalid header value for ReleaseContrib - value: {} is invalid {}",
hdr_value, e
)),
}
@@ -5149,18 +5196,18 @@ impl std::convert::TryFrom<header::IntoHeaderValue<ReleaseEntity>> for hyper::he
}
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<ReleaseEntity> {
+impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<ReleaseContrib> {
type Error = String;
fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result<Self, Self::Error> {
match hdr_value.to_str() {
std::result::Result::Ok(value) => {
- match <ReleaseEntity as std::str::FromStr>::from_str(value) {
+ match <ReleaseContrib as std::str::FromStr>::from_str(value) {
std::result::Result::Ok(value) => {
std::result::Result::Ok(header::IntoHeaderValue(value))
}
std::result::Result::Err(err) => std::result::Result::Err(format!(
- "Unable to convert header value '{}' into ReleaseEntity - {}",
+ "Unable to convert header value '{}' into ReleaseContrib - {}",
value, err
)),
}
@@ -5593,18 +5640,22 @@ impl std::str::FromStr for ReleaseEntity {
if let Some(key) = key_result {
match key {
- "state" => intermediate_rep
- .state
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "ident" => intermediate_rep
- .ident
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "revision" => intermediate_rep
- .revision
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "redirect" => intermediate_rep
- .redirect
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
+ "state" => intermediate_rep.state.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "ident" => intermediate_rep.ident.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "revision" => intermediate_rep.revision.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "redirect" => intermediate_rep.redirect.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
"extra" => {
return std::result::Result::Err(
"Parsing a container in this style is not supported in ReleaseEntity"
@@ -5617,20 +5668,25 @@ impl std::str::FromStr for ReleaseEntity {
.to_string(),
)
}
- "title" => intermediate_rep
- .title
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "subtitle" => intermediate_rep
- .subtitle
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "original_title" => intermediate_rep
- .original_title
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "work_id" => intermediate_rep
- .work_id
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
+ "title" => intermediate_rep.title.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "subtitle" => intermediate_rep.subtitle.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "original_title" => intermediate_rep.original_title.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "work_id" => intermediate_rep.work_id.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
"container" => intermediate_rep.container.push(
- models::ContainerEntity::from_str(val).map_err(|x| format!("{}", x))?,
+ <models::ContainerEntity as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
),
"files" => {
return std::result::Result::Err(
@@ -5650,57 +5706,72 @@ impl std::str::FromStr for ReleaseEntity {
.to_string(),
)
}
- "container_id" => intermediate_rep
- .container_id
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "release_type" => intermediate_rep
- .release_type
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "release_stage" => intermediate_rep
- .release_stage
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "release_date" => intermediate_rep
- .release_date
- .push(chrono::NaiveDate::from_str(val).map_err(|x| format!("{}", x))?),
- "release_year" => intermediate_rep
- .release_year
- .push(i64::from_str(val).map_err(|x| format!("{}", x))?),
- "withdrawn_status" => intermediate_rep
- .withdrawn_status
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "withdrawn_date" => intermediate_rep
- .withdrawn_date
- .push(chrono::NaiveDate::from_str(val).map_err(|x| format!("{}", x))?),
- "withdrawn_year" => intermediate_rep
- .withdrawn_year
- .push(i64::from_str(val).map_err(|x| format!("{}", x))?),
- "ext_ids" => intermediate_rep
- .ext_ids
- .push(models::ReleaseExtIds::from_str(val).map_err(|x| format!("{}", x))?),
- "volume" => intermediate_rep
- .volume
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "issue" => intermediate_rep
- .issue
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "pages" => intermediate_rep
- .pages
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "number" => intermediate_rep
- .number
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "version" => intermediate_rep
- .version
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "publisher" => intermediate_rep
- .publisher
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "language" => intermediate_rep
- .language
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "license_slug" => intermediate_rep
- .license_slug
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
+ "container_id" => intermediate_rep.container_id.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "release_type" => intermediate_rep.release_type.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "release_stage" => intermediate_rep.release_stage.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "release_date" => intermediate_rep.release_date.push(
+ <chrono::NaiveDate as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "release_year" => intermediate_rep.release_year.push(
+ <i64 as std::str::FromStr>::from_str(val).map_err(|x| format!("{}", x))?,
+ ),
+ "withdrawn_status" => intermediate_rep.withdrawn_status.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "withdrawn_date" => intermediate_rep.withdrawn_date.push(
+ <chrono::NaiveDate as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "withdrawn_year" => intermediate_rep.withdrawn_year.push(
+ <i64 as std::str::FromStr>::from_str(val).map_err(|x| format!("{}", x))?,
+ ),
+ "ext_ids" => intermediate_rep.ext_ids.push(
+ <models::ReleaseExtIds as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "volume" => intermediate_rep.volume.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "issue" => intermediate_rep.issue.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "pages" => intermediate_rep.pages.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "number" => intermediate_rep.number.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "version" => intermediate_rep.version.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "publisher" => intermediate_rep.publisher.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "language" => intermediate_rep.language.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "license_slug" => intermediate_rep.license_slug.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
"contribs" => {
return std::result::Result::Err(
"Parsing a container in this style is not supported in ReleaseEntity"
@@ -5775,20 +5846,20 @@ impl std::str::FromStr for ReleaseEntity {
}
}
-// Methods for converting between header::IntoHeaderValue<ReleaseExtIds> and hyper::header::HeaderValue
+// Methods for converting between header::IntoHeaderValue<ReleaseEntity> and hyper::header::HeaderValue
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<header::IntoHeaderValue<ReleaseExtIds>> for hyper::header::HeaderValue {
+impl std::convert::TryFrom<header::IntoHeaderValue<ReleaseEntity>> for hyper::header::HeaderValue {
type Error = String;
fn try_from(
- hdr_value: header::IntoHeaderValue<ReleaseExtIds>,
+ hdr_value: header::IntoHeaderValue<ReleaseEntity>,
) -> std::result::Result<Self, Self::Error> {
let hdr_value = hdr_value.to_string();
match hyper::header::HeaderValue::from_str(&hdr_value) {
std::result::Result::Ok(value) => std::result::Result::Ok(value),
std::result::Result::Err(e) => std::result::Result::Err(format!(
- "Invalid header value for ReleaseExtIds - value: {} is invalid {}",
+ "Invalid header value for ReleaseEntity - value: {} is invalid {}",
hdr_value, e
)),
}
@@ -5796,18 +5867,18 @@ impl std::convert::TryFrom<header::IntoHeaderValue<ReleaseExtIds>> for hyper::he
}
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<ReleaseExtIds> {
+impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<ReleaseEntity> {
type Error = String;
fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result<Self, Self::Error> {
match hdr_value.to_str() {
std::result::Result::Ok(value) => {
- match <ReleaseExtIds as std::str::FromStr>::from_str(value) {
+ match <ReleaseEntity as std::str::FromStr>::from_str(value) {
std::result::Result::Ok(value) => {
std::result::Result::Ok(header::IntoHeaderValue(value))
}
std::result::Result::Err(err) => std::result::Result::Err(format!(
- "Unable to convert header value '{}' into ReleaseExtIds - {}",
+ "Unable to convert header value '{}' into ReleaseEntity - {}",
value, err
)),
}
@@ -6040,48 +6111,62 @@ impl std::str::FromStr for ReleaseExtIds {
if let Some(key) = key_result {
match key {
- "doi" => intermediate_rep
- .doi
- .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))?),
- "isbn13" => intermediate_rep
- .isbn13
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "pmid" => intermediate_rep
- .pmid
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "pmcid" => intermediate_rep
- .pmcid
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "core" => intermediate_rep
- .core
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "arxiv" => intermediate_rep
- .arxiv
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "jstor" => intermediate_rep
- .jstor
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "ark" => intermediate_rep
- .ark
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "mag" => intermediate_rep
- .mag
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "doaj" => intermediate_rep
- .doaj
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "dblp" => intermediate_rep
- .dblp
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "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))?),
+ "doi" => intermediate_rep.doi.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "wikidata_qid" => intermediate_rep.wikidata_qid.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "isbn13" => intermediate_rep.isbn13.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "pmid" => intermediate_rep.pmid.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "pmcid" => intermediate_rep.pmcid.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "core" => intermediate_rep.core.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "arxiv" => intermediate_rep.arxiv.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "jstor" => intermediate_rep.jstor.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "ark" => intermediate_rep.ark.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "mag" => intermediate_rep.mag.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "doaj" => intermediate_rep.doaj.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "dblp" => intermediate_rep.dblp.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "oai" => intermediate_rep.oai.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "hdl" => intermediate_rep.hdl.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
_ => {
return std::result::Result::Err(
"Unexpected key while parsing ReleaseExtIds".to_string(),
@@ -6114,20 +6199,20 @@ impl std::str::FromStr for ReleaseExtIds {
}
}
-// Methods for converting between header::IntoHeaderValue<ReleaseRef> and hyper::header::HeaderValue
+// Methods for converting between header::IntoHeaderValue<ReleaseExtIds> and hyper::header::HeaderValue
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<header::IntoHeaderValue<ReleaseRef>> for hyper::header::HeaderValue {
+impl std::convert::TryFrom<header::IntoHeaderValue<ReleaseExtIds>> for hyper::header::HeaderValue {
type Error = String;
fn try_from(
- hdr_value: header::IntoHeaderValue<ReleaseRef>,
+ hdr_value: header::IntoHeaderValue<ReleaseExtIds>,
) -> std::result::Result<Self, Self::Error> {
let hdr_value = hdr_value.to_string();
match hyper::header::HeaderValue::from_str(&hdr_value) {
std::result::Result::Ok(value) => std::result::Result::Ok(value),
std::result::Result::Err(e) => std::result::Result::Err(format!(
- "Invalid header value for ReleaseRef - value: {} is invalid {}",
+ "Invalid header value for ReleaseExtIds - value: {} is invalid {}",
hdr_value, e
)),
}
@@ -6135,18 +6220,18 @@ impl std::convert::TryFrom<header::IntoHeaderValue<ReleaseRef>> for hyper::heade
}
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<ReleaseRef> {
+impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<ReleaseExtIds> {
type Error = String;
fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result<Self, Self::Error> {
match hdr_value.to_str() {
std::result::Result::Ok(value) => {
- match <ReleaseRef as std::str::FromStr>::from_str(value) {
+ match <ReleaseExtIds as std::str::FromStr>::from_str(value) {
std::result::Result::Ok(value) => {
std::result::Result::Ok(header::IntoHeaderValue(value))
}
std::result::Result::Err(err) => std::result::Result::Err(format!(
- "Unable to convert header value '{}' into ReleaseRef - {}",
+ "Unable to convert header value '{}' into ReleaseExtIds - {}",
value, err
)),
}
@@ -6305,33 +6390,38 @@ impl std::str::FromStr for ReleaseRef {
if let Some(key) = key_result {
match key {
- "index" => intermediate_rep
- .index
- .push(i64::from_str(val).map_err(|x| format!("{}", x))?),
- "target_release_id" => intermediate_rep
- .target_release_id
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
+ "index" => intermediate_rep.index.push(
+ <i64 as std::str::FromStr>::from_str(val).map_err(|x| format!("{}", x))?,
+ ),
+ "target_release_id" => intermediate_rep.target_release_id.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
"extra" => {
return std::result::Result::Err(
"Parsing a container in this style is not supported in ReleaseRef"
.to_string(),
)
}
- "key" => intermediate_rep
- .key
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "year" => intermediate_rep
- .year
- .push(i64::from_str(val).map_err(|x| format!("{}", x))?),
- "container_name" => intermediate_rep
- .container_name
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "title" => intermediate_rep
- .title
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "locator" => intermediate_rep
- .locator
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
+ "key" => intermediate_rep.key.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "year" => intermediate_rep.year.push(
+ <i64 as std::str::FromStr>::from_str(val).map_err(|x| format!("{}", x))?,
+ ),
+ "container_name" => intermediate_rep.container_name.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "title" => intermediate_rep.title.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "locator" => intermediate_rep.locator.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
_ => {
return std::result::Result::Err(
"Unexpected key while parsing ReleaseRef".to_string(),
@@ -6358,20 +6448,20 @@ impl std::str::FromStr for ReleaseRef {
}
}
-// Methods for converting between header::IntoHeaderValue<Success> and hyper::header::HeaderValue
+// Methods for converting between header::IntoHeaderValue<ReleaseRef> and hyper::header::HeaderValue
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<header::IntoHeaderValue<Success>> for hyper::header::HeaderValue {
+impl std::convert::TryFrom<header::IntoHeaderValue<ReleaseRef>> for hyper::header::HeaderValue {
type Error = String;
fn try_from(
- hdr_value: header::IntoHeaderValue<Success>,
+ hdr_value: header::IntoHeaderValue<ReleaseRef>,
) -> std::result::Result<Self, Self::Error> {
let hdr_value = hdr_value.to_string();
match hyper::header::HeaderValue::from_str(&hdr_value) {
std::result::Result::Ok(value) => std::result::Result::Ok(value),
std::result::Result::Err(e) => std::result::Result::Err(format!(
- "Invalid header value for Success - value: {} is invalid {}",
+ "Invalid header value for ReleaseRef - value: {} is invalid {}",
hdr_value, e
)),
}
@@ -6379,18 +6469,18 @@ impl std::convert::TryFrom<header::IntoHeaderValue<Success>> for hyper::header::
}
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<Success> {
+impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<ReleaseRef> {
type Error = String;
fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result<Self, Self::Error> {
match hdr_value.to_str() {
std::result::Result::Ok(value) => {
- match <Success as std::str::FromStr>::from_str(value) {
+ match <ReleaseRef as std::str::FromStr>::from_str(value) {
std::result::Result::Ok(value) => {
std::result::Result::Ok(header::IntoHeaderValue(value))
}
std::result::Result::Err(err) => std::result::Result::Err(format!(
- "Unable to convert header value '{}' into Success - {}",
+ "Unable to convert header value '{}' into ReleaseRef - {}",
value, err
)),
}
@@ -6471,12 +6561,13 @@ impl std::str::FromStr for Success {
if let Some(key) = key_result {
match key {
- "success" => intermediate_rep
- .success
- .push(bool::from_str(val).map_err(|x| format!("{}", x))?),
- "message" => intermediate_rep
- .message
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
+ "success" => intermediate_rep.success.push(
+ <bool as std::str::FromStr>::from_str(val).map_err(|x| format!("{}", x))?,
+ ),
+ "message" => intermediate_rep.message.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
_ => {
return std::result::Result::Err(
"Unexpected key while parsing Success".to_string(),
@@ -6505,22 +6596,20 @@ impl std::str::FromStr for Success {
}
}
-// Methods for converting between header::IntoHeaderValue<WebcaptureAutoBatch> and hyper::header::HeaderValue
+// Methods for converting between header::IntoHeaderValue<Success> and hyper::header::HeaderValue
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<header::IntoHeaderValue<WebcaptureAutoBatch>>
- for hyper::header::HeaderValue
-{
+impl std::convert::TryFrom<header::IntoHeaderValue<Success>> for hyper::header::HeaderValue {
type Error = String;
fn try_from(
- hdr_value: header::IntoHeaderValue<WebcaptureAutoBatch>,
+ hdr_value: header::IntoHeaderValue<Success>,
) -> std::result::Result<Self, Self::Error> {
let hdr_value = hdr_value.to_string();
match hyper::header::HeaderValue::from_str(&hdr_value) {
std::result::Result::Ok(value) => std::result::Result::Ok(value),
std::result::Result::Err(e) => std::result::Result::Err(format!(
- "Invalid header value for WebcaptureAutoBatch - value: {} is invalid {}",
+ "Invalid header value for Success - value: {} is invalid {}",
hdr_value, e
)),
}
@@ -6528,20 +6617,18 @@ impl std::convert::TryFrom<header::IntoHeaderValue<WebcaptureAutoBatch>>
}
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<hyper::header::HeaderValue>
- for header::IntoHeaderValue<WebcaptureAutoBatch>
-{
+impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<Success> {
type Error = String;
fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result<Self, Self::Error> {
match hdr_value.to_str() {
std::result::Result::Ok(value) => {
- match <WebcaptureAutoBatch as std::str::FromStr>::from_str(value) {
+ match <Success as std::str::FromStr>::from_str(value) {
std::result::Result::Ok(value) => {
std::result::Result::Ok(header::IntoHeaderValue(value))
}
std::result::Result::Err(err) => std::result::Result::Err(format!(
- "Unable to convert header value '{}' into WebcaptureAutoBatch - {}",
+ "Unable to convert header value '{}' into Success - {}",
value, err
)),
}
@@ -6622,9 +6709,10 @@ impl std::str::FromStr for WebcaptureAutoBatch {
if let Some(key) = key_result {
match key {
- "editgroup" => intermediate_rep
- .editgroup
- .push(models::Editgroup::from_str(val).map_err(|x| format!("{}", x))?),
+ "editgroup" => intermediate_rep.editgroup.push(
+ <models::Editgroup as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
"entity_list" => return std::result::Result::Err(
"Parsing a container in this style is not supported in WebcaptureAutoBatch"
.to_string(),
@@ -6657,22 +6745,22 @@ impl std::str::FromStr for WebcaptureAutoBatch {
}
}
-// Methods for converting between header::IntoHeaderValue<WebcaptureCdxLine> and hyper::header::HeaderValue
+// Methods for converting between header::IntoHeaderValue<WebcaptureAutoBatch> and hyper::header::HeaderValue
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<header::IntoHeaderValue<WebcaptureCdxLine>>
+impl std::convert::TryFrom<header::IntoHeaderValue<WebcaptureAutoBatch>>
for hyper::header::HeaderValue
{
type Error = String;
fn try_from(
- hdr_value: header::IntoHeaderValue<WebcaptureCdxLine>,
+ hdr_value: header::IntoHeaderValue<WebcaptureAutoBatch>,
) -> std::result::Result<Self, Self::Error> {
let hdr_value = hdr_value.to_string();
match hyper::header::HeaderValue::from_str(&hdr_value) {
std::result::Result::Ok(value) => std::result::Result::Ok(value),
std::result::Result::Err(e) => std::result::Result::Err(format!(
- "Invalid header value for WebcaptureCdxLine - value: {} is invalid {}",
+ "Invalid header value for WebcaptureAutoBatch - value: {} is invalid {}",
hdr_value, e
)),
}
@@ -6681,19 +6769,19 @@ impl std::convert::TryFrom<header::IntoHeaderValue<WebcaptureCdxLine>>
#[cfg(any(feature = "client", feature = "server"))]
impl std::convert::TryFrom<hyper::header::HeaderValue>
- for header::IntoHeaderValue<WebcaptureCdxLine>
+ for header::IntoHeaderValue<WebcaptureAutoBatch>
{
type Error = String;
fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result<Self, Self::Error> {
match hdr_value.to_str() {
std::result::Result::Ok(value) => {
- match <WebcaptureCdxLine as std::str::FromStr>::from_str(value) {
+ match <WebcaptureAutoBatch as std::str::FromStr>::from_str(value) {
std::result::Result::Ok(value) => {
std::result::Result::Ok(header::IntoHeaderValue(value))
}
std::result::Result::Err(err) => std::result::Result::Err(format!(
- "Unable to convert header value '{}' into WebcaptureCdxLine - {}",
+ "Unable to convert header value '{}' into WebcaptureAutoBatch - {}",
value, err
)),
}
@@ -6846,31 +6934,36 @@ impl std::str::FromStr for WebcaptureCdxLine {
if let Some(key) = key_result {
match key {
- "surt" => intermediate_rep
- .surt
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
+ "surt" => intermediate_rep.surt.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
"timestamp" => intermediate_rep.timestamp.push(
- chrono::DateTime::<chrono::Utc>::from_str(val)
- .map_err(|x| format!("{}", x))?,
- ),
- "url" => intermediate_rep
- .url
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "mimetype" => intermediate_rep
- .mimetype
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "status_code" => intermediate_rep
- .status_code
- .push(i64::from_str(val).map_err(|x| format!("{}", x))?),
- "size" => intermediate_rep
- .size
- .push(i64::from_str(val).map_err(|x| format!("{}", x))?),
- "sha1" => intermediate_rep
- .sha1
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "sha256" => intermediate_rep
- .sha256
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
+ <chrono::DateTime<chrono::Utc> as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "url" => intermediate_rep.url.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "mimetype" => intermediate_rep.mimetype.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "status_code" => intermediate_rep.status_code.push(
+ <i64 as std::str::FromStr>::from_str(val).map_err(|x| format!("{}", x))?,
+ ),
+ "size" => intermediate_rep.size.push(
+ <i64 as std::str::FromStr>::from_str(val).map_err(|x| format!("{}", x))?,
+ ),
+ "sha1" => intermediate_rep.sha1.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "sha256" => intermediate_rep.sha256.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
_ => {
return std::result::Result::Err(
"Unexpected key while parsing WebcaptureCdxLine".to_string(),
@@ -6913,22 +7006,22 @@ impl std::str::FromStr for WebcaptureCdxLine {
}
}
-// Methods for converting between header::IntoHeaderValue<WebcaptureEntity> and hyper::header::HeaderValue
+// Methods for converting between header::IntoHeaderValue<WebcaptureCdxLine> and hyper::header::HeaderValue
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<header::IntoHeaderValue<WebcaptureEntity>>
+impl std::convert::TryFrom<header::IntoHeaderValue<WebcaptureCdxLine>>
for hyper::header::HeaderValue
{
type Error = String;
fn try_from(
- hdr_value: header::IntoHeaderValue<WebcaptureEntity>,
+ hdr_value: header::IntoHeaderValue<WebcaptureCdxLine>,
) -> std::result::Result<Self, Self::Error> {
let hdr_value = hdr_value.to_string();
match hyper::header::HeaderValue::from_str(&hdr_value) {
std::result::Result::Ok(value) => std::result::Result::Ok(value),
std::result::Result::Err(e) => std::result::Result::Err(format!(
- "Invalid header value for WebcaptureEntity - value: {} is invalid {}",
+ "Invalid header value for WebcaptureCdxLine - value: {} is invalid {}",
hdr_value, e
)),
}
@@ -6937,19 +7030,19 @@ impl std::convert::TryFrom<header::IntoHeaderValue<WebcaptureEntity>>
#[cfg(any(feature = "client", feature = "server"))]
impl std::convert::TryFrom<hyper::header::HeaderValue>
- for header::IntoHeaderValue<WebcaptureEntity>
+ for header::IntoHeaderValue<WebcaptureCdxLine>
{
type Error = String;
fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result<Self, Self::Error> {
match hdr_value.to_str() {
std::result::Result::Ok(value) => {
- match <WebcaptureEntity as std::str::FromStr>::from_str(value) {
+ match <WebcaptureCdxLine as std::str::FromStr>::from_str(value) {
std::result::Result::Ok(value) => {
std::result::Result::Ok(header::IntoHeaderValue(value))
}
std::result::Result::Err(err) => std::result::Result::Err(format!(
- "Unable to convert header value '{}' into WebcaptureEntity - {}",
+ "Unable to convert header value '{}' into WebcaptureCdxLine - {}",
value, err
)),
}
@@ -7158,18 +7251,22 @@ impl std::str::FromStr for WebcaptureEntity {
if let Some(key) = key_result {
match key {
- "state" => intermediate_rep
- .state
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "ident" => intermediate_rep
- .ident
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "revision" => intermediate_rep
- .revision
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "redirect" => intermediate_rep
- .redirect
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
+ "state" => intermediate_rep.state.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "ident" => intermediate_rep.ident.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "revision" => intermediate_rep.revision.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "redirect" => intermediate_rep.redirect.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
"extra" => return std::result::Result::Err(
"Parsing a container in this style is not supported in WebcaptureEntity"
.to_string(),
@@ -7186,16 +7283,18 @@ impl std::str::FromStr for WebcaptureEntity {
"Parsing a container in this style is not supported in WebcaptureEntity"
.to_string(),
),
- "original_url" => intermediate_rep
- .original_url
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
+ "original_url" => intermediate_rep.original_url.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
"timestamp" => intermediate_rep.timestamp.push(
- chrono::DateTime::<chrono::Utc>::from_str(val)
+ <chrono::DateTime<chrono::Utc> as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "content_scope" => intermediate_rep.content_scope.push(
+ <String as std::str::FromStr>::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(),
@@ -7235,20 +7334,22 @@ impl std::str::FromStr for WebcaptureEntity {
}
}
-// Methods for converting between header::IntoHeaderValue<WebcaptureUrl> and hyper::header::HeaderValue
+// Methods for converting between header::IntoHeaderValue<WebcaptureEntity> and hyper::header::HeaderValue
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<header::IntoHeaderValue<WebcaptureUrl>> for hyper::header::HeaderValue {
+impl std::convert::TryFrom<header::IntoHeaderValue<WebcaptureEntity>>
+ for hyper::header::HeaderValue
+{
type Error = String;
fn try_from(
- hdr_value: header::IntoHeaderValue<WebcaptureUrl>,
+ hdr_value: header::IntoHeaderValue<WebcaptureEntity>,
) -> std::result::Result<Self, Self::Error> {
let hdr_value = hdr_value.to_string();
match hyper::header::HeaderValue::from_str(&hdr_value) {
std::result::Result::Ok(value) => std::result::Result::Ok(value),
std::result::Result::Err(e) => std::result::Result::Err(format!(
- "Invalid header value for WebcaptureUrl - value: {} is invalid {}",
+ "Invalid header value for WebcaptureEntity - value: {} is invalid {}",
hdr_value, e
)),
}
@@ -7256,18 +7357,20 @@ impl std::convert::TryFrom<header::IntoHeaderValue<WebcaptureUrl>> for hyper::he
}
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<WebcaptureUrl> {
+impl std::convert::TryFrom<hyper::header::HeaderValue>
+ for header::IntoHeaderValue<WebcaptureEntity>
+{
type Error = String;
fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result<Self, Self::Error> {
match hdr_value.to_str() {
std::result::Result::Ok(value) => {
- match <WebcaptureUrl as std::str::FromStr>::from_str(value) {
+ match <WebcaptureEntity as std::str::FromStr>::from_str(value) {
std::result::Result::Ok(value) => {
std::result::Result::Ok(header::IntoHeaderValue(value))
}
std::result::Result::Err(err) => std::result::Result::Err(format!(
- "Unable to convert header value '{}' into WebcaptureUrl - {}",
+ "Unable to convert header value '{}' into WebcaptureEntity - {}",
value, err
)),
}
@@ -7347,12 +7450,14 @@ impl std::str::FromStr for WebcaptureUrl {
if let Some(key) = key_result {
match key {
- "url" => intermediate_rep
- .url
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "rel" => intermediate_rep
- .rel
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
+ "url" => intermediate_rep.url.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "rel" => intermediate_rep.rel.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
_ => {
return std::result::Result::Err(
"Unexpected key while parsing WebcaptureUrl".to_string(),
@@ -7381,20 +7486,20 @@ impl std::str::FromStr for WebcaptureUrl {
}
}
-// Methods for converting between header::IntoHeaderValue<WorkAutoBatch> and hyper::header::HeaderValue
+// Methods for converting between header::IntoHeaderValue<WebcaptureUrl> and hyper::header::HeaderValue
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<header::IntoHeaderValue<WorkAutoBatch>> for hyper::header::HeaderValue {
+impl std::convert::TryFrom<header::IntoHeaderValue<WebcaptureUrl>> for hyper::header::HeaderValue {
type Error = String;
fn try_from(
- hdr_value: header::IntoHeaderValue<WorkAutoBatch>,
+ hdr_value: header::IntoHeaderValue<WebcaptureUrl>,
) -> std::result::Result<Self, Self::Error> {
let hdr_value = hdr_value.to_string();
match hyper::header::HeaderValue::from_str(&hdr_value) {
std::result::Result::Ok(value) => std::result::Result::Ok(value),
std::result::Result::Err(e) => std::result::Result::Err(format!(
- "Invalid header value for WorkAutoBatch - value: {} is invalid {}",
+ "Invalid header value for WebcaptureUrl - value: {} is invalid {}",
hdr_value, e
)),
}
@@ -7402,18 +7507,18 @@ impl std::convert::TryFrom<header::IntoHeaderValue<WorkAutoBatch>> for hyper::he
}
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<WorkAutoBatch> {
+impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<WebcaptureUrl> {
type Error = String;
fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result<Self, Self::Error> {
match hdr_value.to_str() {
std::result::Result::Ok(value) => {
- match <WorkAutoBatch as std::str::FromStr>::from_str(value) {
+ match <WebcaptureUrl as std::str::FromStr>::from_str(value) {
std::result::Result::Ok(value) => {
std::result::Result::Ok(header::IntoHeaderValue(value))
}
std::result::Result::Err(err) => std::result::Result::Err(format!(
- "Unable to convert header value '{}' into WorkAutoBatch - {}",
+ "Unable to convert header value '{}' into WebcaptureUrl - {}",
value, err
)),
}
@@ -7494,9 +7599,10 @@ impl std::str::FromStr for WorkAutoBatch {
if let Some(key) = key_result {
match key {
- "editgroup" => intermediate_rep
- .editgroup
- .push(models::Editgroup::from_str(val).map_err(|x| format!("{}", x))?),
+ "editgroup" => intermediate_rep.editgroup.push(
+ <models::Editgroup as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
"entity_list" => {
return std::result::Result::Err(
"Parsing a container in this style is not supported in WorkAutoBatch"
@@ -7531,20 +7637,20 @@ impl std::str::FromStr for WorkAutoBatch {
}
}
-// Methods for converting between header::IntoHeaderValue<WorkEntity> and hyper::header::HeaderValue
+// Methods for converting between header::IntoHeaderValue<WorkAutoBatch> and hyper::header::HeaderValue
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<header::IntoHeaderValue<WorkEntity>> for hyper::header::HeaderValue {
+impl std::convert::TryFrom<header::IntoHeaderValue<WorkAutoBatch>> for hyper::header::HeaderValue {
type Error = String;
fn try_from(
- hdr_value: header::IntoHeaderValue<WorkEntity>,
+ hdr_value: header::IntoHeaderValue<WorkAutoBatch>,
) -> std::result::Result<Self, Self::Error> {
let hdr_value = hdr_value.to_string();
match hyper::header::HeaderValue::from_str(&hdr_value) {
std::result::Result::Ok(value) => std::result::Result::Ok(value),
std::result::Result::Err(e) => std::result::Result::Err(format!(
- "Invalid header value for WorkEntity - value: {} is invalid {}",
+ "Invalid header value for WorkAutoBatch - value: {} is invalid {}",
hdr_value, e
)),
}
@@ -7552,18 +7658,18 @@ impl std::convert::TryFrom<header::IntoHeaderValue<WorkEntity>> for hyper::heade
}
#[cfg(any(feature = "client", feature = "server"))]
-impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<WorkEntity> {
+impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<WorkAutoBatch> {
type Error = String;
fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result<Self, Self::Error> {
match hdr_value.to_str() {
std::result::Result::Ok(value) => {
- match <WorkEntity as std::str::FromStr>::from_str(value) {
+ match <WorkAutoBatch as std::str::FromStr>::from_str(value) {
std::result::Result::Ok(value) => {
std::result::Result::Ok(header::IntoHeaderValue(value))
}
std::result::Result::Err(err) => std::result::Result::Err(format!(
- "Unable to convert header value '{}' into WorkEntity - {}",
+ "Unable to convert header value '{}' into WorkAutoBatch - {}",
value, err
)),
}
@@ -7696,18 +7802,22 @@ impl std::str::FromStr for WorkEntity {
if let Some(key) = key_result {
match key {
- "state" => intermediate_rep
- .state
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "ident" => intermediate_rep
- .ident
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "revision" => intermediate_rep
- .revision
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
- "redirect" => intermediate_rep
- .redirect
- .push(String::from_str(val).map_err(|x| format!("{}", x))?),
+ "state" => intermediate_rep.state.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "ident" => intermediate_rep.ident.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "revision" => intermediate_rep.revision.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
+ "redirect" => intermediate_rep.redirect.push(
+ <String as std::str::FromStr>::from_str(val)
+ .map_err(|x| format!("{}", x))?,
+ ),
"extra" => {
return std::result::Result::Err(
"Parsing a container in this style is not supported in WorkEntity"
@@ -7743,3 +7853,48 @@ impl std::str::FromStr for WorkEntity {
})
}
}
+
+// Methods for converting between header::IntoHeaderValue<WorkEntity> and hyper::header::HeaderValue
+
+#[cfg(any(feature = "client", feature = "server"))]
+impl std::convert::TryFrom<header::IntoHeaderValue<WorkEntity>> for hyper::header::HeaderValue {
+ type Error = String;
+
+ fn try_from(
+ hdr_value: header::IntoHeaderValue<WorkEntity>,
+ ) -> std::result::Result<Self, Self::Error> {
+ let hdr_value = hdr_value.to_string();
+ match hyper::header::HeaderValue::from_str(&hdr_value) {
+ std::result::Result::Ok(value) => std::result::Result::Ok(value),
+ std::result::Result::Err(e) => std::result::Result::Err(format!(
+ "Invalid header value for WorkEntity - value: {} is invalid {}",
+ hdr_value, e
+ )),
+ }
+ }
+}
+
+#[cfg(any(feature = "client", feature = "server"))]
+impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderValue<WorkEntity> {
+ type Error = String;
+
+ fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result<Self, Self::Error> {
+ match hdr_value.to_str() {
+ std::result::Result::Ok(value) => {
+ match <WorkEntity as std::str::FromStr>::from_str(value) {
+ std::result::Result::Ok(value) => {
+ std::result::Result::Ok(header::IntoHeaderValue(value))
+ }
+ std::result::Result::Err(err) => std::result::Result::Err(format!(
+ "Unable to convert header value '{}' into WorkEntity - {}",
+ value, err
+ )),
+ }
+ }
+ std::result::Result::Err(e) => std::result::Result::Err(format!(
+ "Unable to convert header: {:?} to string: {}",
+ hdr_value, e
+ )),
+ }
+ }
+}