#![allow(clippy::all)]
#![cfg_attr(any(), rustfmt::skip)]
#![allow(rustdoc::all)]
pub mod error {
pub struct ConversionError(::std::borrow::Cow<'static, str>);
impl ::std::error::Error for ConversionError {}
impl ::std::fmt::Display for ConversionError {
fn fmt(
&self,
f: &mut ::std::fmt::Formatter<'_>,
) -> Result<(), ::std::fmt::Error> {
::std::fmt::Display::fmt(&self.0, f)
}
}
impl ::std::fmt::Debug for ConversionError {
fn fmt(
&self,
f: &mut ::std::fmt::Formatter<'_>,
) -> Result<(), ::std::fmt::Error> {
::std::fmt::Debug::fmt(&self.0, f)
}
}
impl From<&'static str> for ConversionError {
fn from(value: &'static str) -> Self {
Self(value.into())
}
}
impl From<String> for ConversionError {
fn from(value: String) -> Self {
Self(value.into())
}
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, PartialEq)]
pub struct Acknowledgment {
#[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
pub names: ::std::vec::Vec<NameOfTheContributor>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub organization: ::std::option::Option<ContributingOrganization>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub summary: ::std::option::Option<SummaryOfTheAcknowledgment>,
#[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
pub urls: ::std::vec::Vec<::std::string::String>,
}
impl ::std::default::Default for Acknowledgment {
fn default() -> Self {
Self {
names: Default::default(),
organization: Default::default(),
summary: Default::default(),
urls: Default::default(),
}
}
}
impl Acknowledgment {
pub fn builder() -> builder::Acknowledgment {
Default::default()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, PartialEq)]
#[serde(transparent)]
pub struct AcknowledgmentsT(pub ::std::vec::Vec<Acknowledgment>);
impl ::std::ops::Deref for AcknowledgmentsT {
type Target = ::std::vec::Vec<Acknowledgment>;
fn deref(&self) -> &::std::vec::Vec<Acknowledgment> {
&self.0
}
}
impl ::std::convert::From<AcknowledgmentsT> for ::std::vec::Vec<Acknowledgment> {
fn from(value: AcknowledgmentsT) -> Self {
value.0
}
}
impl ::std::convert::From<::std::vec::Vec<Acknowledgment>> for AcknowledgmentsT {
fn from(value: ::std::vec::Vec<Acknowledgment>) -> Self {
Self(value)
}
}
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct AdditionalRestartInformation(::std::string::String);
impl ::std::ops::Deref for AdditionalRestartInformation {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<AdditionalRestartInformation> for ::std::string::String {
fn from(value: AdditionalRestartInformation) -> Self {
value.0
}
}
impl ::std::str::FromStr for AdditionalRestartInformation {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for AdditionalRestartInformation {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for AdditionalRestartInformation {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for AdditionalRestartInformation {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for AdditionalRestartInformation {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, PartialEq)]
pub struct AggregateSeverity {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub namespace: ::std::option::Option<::std::string::String>,
pub text: TextOfAggregateSeverity,
}
impl AggregateSeverity {
pub fn builder() -> builder::AggregateSeverity {
Default::default()
}
}
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct AlgorithmOfTheCryptographicHash(::std::string::String);
impl ::std::ops::Deref for AlgorithmOfTheCryptographicHash {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<AlgorithmOfTheCryptographicHash> for ::std::string::String {
fn from(value: AlgorithmOfTheCryptographicHash) -> Self {
value.0
}
}
impl ::std::default::Default for AlgorithmOfTheCryptographicHash {
fn default() -> Self {
AlgorithmOfTheCryptographicHash("sha256".to_string())
}
}
impl ::std::str::FromStr for AlgorithmOfTheCryptographicHash {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for AlgorithmOfTheCryptographicHash {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String>
for AlgorithmOfTheCryptographicHash {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for AlgorithmOfTheCryptographicHash {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for AlgorithmOfTheCryptographicHash {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct AlternateName(::std::string::String);
impl ::std::ops::Deref for AlternateName {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<AlternateName> for ::std::string::String {
fn from(value: AlternateName) -> Self {
value.0
}
}
impl ::std::str::FromStr for AlternateName {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for AlternateName {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for AlternateName {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for AlternateName {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for AlternateName {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct AudienceOfNote(::std::string::String);
impl ::std::ops::Deref for AudienceOfNote {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<AudienceOfNote> for ::std::string::String {
fn from(value: AudienceOfNote) -> Self {
value.0
}
}
impl ::std::str::FromStr for AudienceOfNote {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for AudienceOfNote {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for AudienceOfNote {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for AudienceOfNote {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for AudienceOfNote {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, PartialEq)]
pub struct Branch {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub branches: ::std::option::Option<BranchesT>,
pub category: CategoryOfTheBranch,
pub name: NameOfTheBranch,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub product: ::std::option::Option<FullProductNameT>,
}
impl Branch {
pub fn builder() -> builder::Branch {
Default::default()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, PartialEq)]
#[serde(transparent)]
pub struct BranchesT(pub ::std::vec::Vec<Branch>);
impl ::std::ops::Deref for BranchesT {
type Target = ::std::vec::Vec<Branch>;
fn deref(&self) -> &::std::vec::Vec<Branch> {
&self.0
}
}
impl ::std::convert::From<BranchesT> for ::std::vec::Vec<Branch> {
fn from(value: BranchesT) -> Self {
value.0
}
}
impl ::std::convert::From<::std::vec::Vec<Branch>> for BranchesT {
fn from(value: ::std::vec::Vec<Branch>) -> Self {
Self(value)
}
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum CategoryOfPublisher {
#[serde(rename = "coordinator")]
Coordinator,
#[serde(rename = "discoverer")]
Discoverer,
#[serde(rename = "other")]
Other,
#[serde(rename = "translator")]
Translator,
#[serde(rename = "user")]
User,
#[serde(rename = "vendor")]
Vendor,
}
impl ::std::fmt::Display for CategoryOfPublisher {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Coordinator => f.write_str("coordinator"),
Self::Discoverer => f.write_str("discoverer"),
Self::Other => f.write_str("other"),
Self::Translator => f.write_str("translator"),
Self::User => f.write_str("user"),
Self::Vendor => f.write_str("vendor"),
}
}
}
impl ::std::str::FromStr for CategoryOfPublisher {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"coordinator" => Ok(Self::Coordinator),
"discoverer" => Ok(Self::Discoverer),
"other" => Ok(Self::Other),
"translator" => Ok(Self::Translator),
"user" => Ok(Self::User),
"vendor" => Ok(Self::Vendor),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for CategoryOfPublisher {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for CategoryOfPublisher {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for CategoryOfPublisher {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum CategoryOfReference {
#[serde(rename = "external")]
External,
#[serde(rename = "self")]
Self_,
}
impl ::std::fmt::Display for CategoryOfReference {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::External => f.write_str("external"),
Self::Self_ => f.write_str("self"),
}
}
}
impl ::std::str::FromStr for CategoryOfReference {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"external" => Ok(Self::External),
"self" => Ok(Self::Self_),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for CategoryOfReference {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for CategoryOfReference {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for CategoryOfReference {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::default::Default for CategoryOfReference {
fn default() -> Self {
CategoryOfReference::External
}
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum CategoryOfRestart {
#[serde(rename = "connected")]
Connected,
#[serde(rename = "dependencies")]
Dependencies,
#[serde(rename = "machine")]
Machine,
#[serde(rename = "none")]
None,
#[serde(rename = "parent")]
Parent,
#[serde(rename = "service")]
Service,
#[serde(rename = "system")]
System,
#[serde(rename = "vulnerable_component")]
VulnerableComponent,
#[serde(rename = "zone")]
Zone,
}
impl ::std::fmt::Display for CategoryOfRestart {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Connected => f.write_str("connected"),
Self::Dependencies => f.write_str("dependencies"),
Self::Machine => f.write_str("machine"),
Self::None => f.write_str("none"),
Self::Parent => f.write_str("parent"),
Self::Service => f.write_str("service"),
Self::System => f.write_str("system"),
Self::VulnerableComponent => f.write_str("vulnerable_component"),
Self::Zone => f.write_str("zone"),
}
}
}
impl ::std::str::FromStr for CategoryOfRestart {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"connected" => Ok(Self::Connected),
"dependencies" => Ok(Self::Dependencies),
"machine" => Ok(Self::Machine),
"none" => Ok(Self::None),
"parent" => Ok(Self::Parent),
"service" => Ok(Self::Service),
"system" => Ok(Self::System),
"vulnerable_component" => Ok(Self::VulnerableComponent),
"zone" => Ok(Self::Zone),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for CategoryOfRestart {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for CategoryOfRestart {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for CategoryOfRestart {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum CategoryOfTheBranch {
#[serde(rename = "architecture")]
Architecture,
#[serde(rename = "host_name")]
HostName,
#[serde(rename = "language")]
Language,
#[serde(rename = "legacy")]
Legacy,
#[serde(rename = "patch_level")]
PatchLevel,
#[serde(rename = "product_family")]
ProductFamily,
#[serde(rename = "product_name")]
ProductName,
#[serde(rename = "product_version")]
ProductVersion,
#[serde(rename = "product_version_range")]
ProductVersionRange,
#[serde(rename = "service_pack")]
ServicePack,
#[serde(rename = "specification")]
Specification,
#[serde(rename = "vendor")]
Vendor,
}
impl ::std::fmt::Display for CategoryOfTheBranch {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Architecture => f.write_str("architecture"),
Self::HostName => f.write_str("host_name"),
Self::Language => f.write_str("language"),
Self::Legacy => f.write_str("legacy"),
Self::PatchLevel => f.write_str("patch_level"),
Self::ProductFamily => f.write_str("product_family"),
Self::ProductName => f.write_str("product_name"),
Self::ProductVersion => f.write_str("product_version"),
Self::ProductVersionRange => f.write_str("product_version_range"),
Self::ServicePack => f.write_str("service_pack"),
Self::Specification => f.write_str("specification"),
Self::Vendor => f.write_str("vendor"),
}
}
}
impl ::std::str::FromStr for CategoryOfTheBranch {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"architecture" => Ok(Self::Architecture),
"host_name" => Ok(Self::HostName),
"language" => Ok(Self::Language),
"legacy" => Ok(Self::Legacy),
"patch_level" => Ok(Self::PatchLevel),
"product_family" => Ok(Self::ProductFamily),
"product_name" => Ok(Self::ProductName),
"product_version" => Ok(Self::ProductVersion),
"product_version_range" => Ok(Self::ProductVersionRange),
"service_pack" => Ok(Self::ServicePack),
"specification" => Ok(Self::Specification),
"vendor" => Ok(Self::Vendor),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for CategoryOfTheBranch {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for CategoryOfTheBranch {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for CategoryOfTheBranch {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum CategoryOfTheRemediation {
#[serde(rename = "mitigation")]
Mitigation,
#[serde(rename = "no_fix_planned")]
NoFixPlanned,
#[serde(rename = "none_available")]
NoneAvailable,
#[serde(rename = "vendor_fix")]
VendorFix,
#[serde(rename = "workaround")]
Workaround,
}
impl ::std::fmt::Display for CategoryOfTheRemediation {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Mitigation => f.write_str("mitigation"),
Self::NoFixPlanned => f.write_str("no_fix_planned"),
Self::NoneAvailable => f.write_str("none_available"),
Self::VendorFix => f.write_str("vendor_fix"),
Self::Workaround => f.write_str("workaround"),
}
}
}
impl ::std::str::FromStr for CategoryOfTheRemediation {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"mitigation" => Ok(Self::Mitigation),
"no_fix_planned" => Ok(Self::NoFixPlanned),
"none_available" => Ok(Self::NoneAvailable),
"vendor_fix" => Ok(Self::VendorFix),
"workaround" => Ok(Self::Workaround),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for CategoryOfTheRemediation {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for CategoryOfTheRemediation {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for CategoryOfTheRemediation {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum CategoryOfTheThreat {
#[serde(rename = "exploit_status")]
ExploitStatus,
#[serde(rename = "impact")]
Impact,
#[serde(rename = "target_set")]
TargetSet,
}
impl ::std::fmt::Display for CategoryOfTheThreat {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::ExploitStatus => f.write_str("exploit_status"),
Self::Impact => f.write_str("impact"),
Self::TargetSet => f.write_str("target_set"),
}
}
}
impl ::std::str::FromStr for CategoryOfTheThreat {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"exploit_status" => Ok(Self::ExploitStatus),
"impact" => Ok(Self::Impact),
"target_set" => Ok(Self::TargetSet),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for CategoryOfTheThreat {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for CategoryOfTheThreat {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for CategoryOfTheThreat {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct CommonPlatformEnumerationRepresentation(::std::string::String);
impl ::std::ops::Deref for CommonPlatformEnumerationRepresentation {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<CommonPlatformEnumerationRepresentation>
for ::std::string::String {
fn from(value: CommonPlatformEnumerationRepresentation) -> Self {
value.0
}
}
impl ::std::str::FromStr for CommonPlatformEnumerationRepresentation {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 5usize {
return Err("shorter than 5 characters".into());
}
static PATTERN: ::std::sync::LazyLock<::regress::Regex> = ::std::sync::LazyLock::new(||
{
::regress::Regex::new(
"^(cpe:2\\.3:[aho\\*\\-](:(((\\?*|\\*?)([a-zA-Z0-9\\-\\._]|(\\\\[\\\\\\*\\?!\"#\\$%&'\\(\\)\\+,/:;<=>@\\[\\]\\^`\\{\\|\\}~]))+(\\?*|\\*?))|[\\*\\-])){5}(:(([a-zA-Z]{2,3}(-([a-zA-Z]{2}|[0-9]{3}))?)|[\\*\\-]))(:(((\\?*|\\*?)([a-zA-Z0-9\\-\\._]|(\\\\[\\\\\\*\\?!\"#\\$%&'\\(\\)\\+,/:;<=>@\\[\\]\\^`\\{\\|\\}~]))+(\\?*|\\*?))|[\\*\\-])){4})|([c][pP][eE]:/[AHOaho]?(:[A-Za-z0-9\\._\\-~%]*){0,6})$",
)
.unwrap()
});
if PATTERN.find(value).is_none() {
return Err(
"doesn't match pattern \"^(cpe:2\\.3:[aho\\*\\-](:(((\\?*|\\*?)([a-zA-Z0-9\\-\\._]|(\\\\[\\\\\\*\\?!\"#\\$%&'\\(\\)\\+,/:;<=>@\\[\\]\\^`\\{\\|\\}~]))+(\\?*|\\*?))|[\\*\\-])){5}(:(([a-zA-Z]{2,3}(-([a-zA-Z]{2}|[0-9]{3}))?)|[\\*\\-]))(:(((\\?*|\\*?)([a-zA-Z0-9\\-\\._]|(\\\\[\\\\\\*\\?!\"#\\$%&'\\(\\)\\+,/:;<=>@\\[\\]\\^`\\{\\|\\}~]))+(\\?*|\\*?))|[\\*\\-])){4})|([c][pP][eE]:/[AHOaho]?(:[A-Za-z0-9\\._\\-~%]*){0,6})$\""
.into(),
);
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for CommonPlatformEnumerationRepresentation {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String>
for CommonPlatformEnumerationRepresentation {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String>
for CommonPlatformEnumerationRepresentation {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for CommonPlatformEnumerationRepresentation {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, PartialEq)]
pub struct CommonSecurityAdvisoryFramework {
pub document: DocumentLevelMetaData,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub product_tree: ::std::option::Option<ProductTree>,
#[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
pub vulnerabilities: ::std::vec::Vec<Vulnerability>,
}
impl CommonSecurityAdvisoryFramework {
pub fn builder() -> builder::CommonSecurityAdvisoryFramework {
Default::default()
}
}
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ContactDetails(::std::string::String);
impl ::std::ops::Deref for ContactDetails {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<ContactDetails> for ::std::string::String {
fn from(value: ContactDetails) -> Self {
value.0
}
}
impl ::std::str::FromStr for ContactDetails {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for ContactDetails {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ContactDetails {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ContactDetails {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for ContactDetails {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ContributingOrganization(::std::string::String);
impl ::std::ops::Deref for ContributingOrganization {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<ContributingOrganization> for ::std::string::String {
fn from(value: ContributingOrganization) -> Self {
value.0
}
}
impl ::std::str::FromStr for ContributingOrganization {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for ContributingOrganization {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ContributingOrganization {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ContributingOrganization {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for ContributingOrganization {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, PartialEq)]
pub struct CryptographicHashes {
pub file_hashes: ::std::vec::Vec<FileHash>,
pub filename: Filename,
}
impl CryptographicHashes {
pub fn builder() -> builder::CryptographicHashes {
Default::default()
}
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum CsafVersion {
#[serde(rename = "2.0")]
X20,
}
impl ::std::fmt::Display for CsafVersion {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::X20 => f.write_str("2.0"),
}
}
}
impl ::std::str::FromStr for CsafVersion {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"2.0" => Ok(Self::X20),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for CsafVersion {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for CsafVersion {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for CsafVersion {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct Cve(::std::string::String);
impl ::std::ops::Deref for Cve {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<Cve> for ::std::string::String {
fn from(value: Cve) -> Self {
value.0
}
}
impl ::std::str::FromStr for Cve {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
static PATTERN: ::std::sync::LazyLock<::regress::Regex> = ::std::sync::LazyLock::new(||
{ ::regress::Regex::new("^CVE-[0-9]{4}-[0-9]{4,}$").unwrap() });
if PATTERN.find(value).is_none() {
return Err("doesn't match pattern \"^CVE-[0-9]{4}-[0-9]{4,}$\"".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for Cve {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for Cve {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for Cve {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for Cve {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, PartialEq)]
pub struct Cwe {
pub id: WeaknessId,
pub name: WeaknessName,
}
impl Cwe {
pub fn builder() -> builder::Cwe {
Default::default()
}
}
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct DetailsOfTheRemediation(::std::string::String);
impl ::std::ops::Deref for DetailsOfTheRemediation {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<DetailsOfTheRemediation> for ::std::string::String {
fn from(value: DetailsOfTheRemediation) -> Self {
value.0
}
}
impl ::std::str::FromStr for DetailsOfTheRemediation {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for DetailsOfTheRemediation {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for DetailsOfTheRemediation {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for DetailsOfTheRemediation {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for DetailsOfTheRemediation {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct DetailsOfTheThreat(::std::string::String);
impl ::std::ops::Deref for DetailsOfTheThreat {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<DetailsOfTheThreat> for ::std::string::String {
fn from(value: DetailsOfTheThreat) -> Self {
value.0
}
}
impl ::std::str::FromStr for DetailsOfTheThreat {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for DetailsOfTheThreat {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for DetailsOfTheThreat {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for DetailsOfTheThreat {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for DetailsOfTheThreat {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct DocumentCategory(::std::string::String);
impl ::std::ops::Deref for DocumentCategory {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<DocumentCategory> for ::std::string::String {
fn from(value: DocumentCategory) -> Self {
value.0
}
}
impl ::std::str::FromStr for DocumentCategory {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
static PATTERN: ::std::sync::LazyLock<::regress::Regex> = ::std::sync::LazyLock::new(||
{ ::regress::Regex::new("^[^\\s\\-_\\.](.*[^\\s\\-_\\.])?$").unwrap() });
if PATTERN.find(value).is_none() {
return Err(
"doesn't match pattern \"^[^\\s\\-_\\.](.*[^\\s\\-_\\.])?$\"".into(),
);
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for DocumentCategory {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for DocumentCategory {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for DocumentCategory {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for DocumentCategory {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, PartialEq)]
pub struct DocumentGenerator {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub date: ::std::option::Option<::std::string::String>,
pub engine: EngineOfDocumentGeneration,
}
impl DocumentGenerator {
pub fn builder() -> builder::DocumentGenerator {
Default::default()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, PartialEq)]
pub struct DocumentLevelMetaData {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub acknowledgments: ::std::option::Option<AcknowledgmentsT>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub aggregate_severity: ::std::option::Option<AggregateSeverity>,
pub category: DocumentCategory,
pub csaf_version: CsafVersion,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub distribution: ::std::option::Option<RulesForSharingDocument>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub lang: ::std::option::Option<LangT>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub notes: ::std::option::Option<NotesT>,
pub publisher: Publisher,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub references: ::std::option::Option<ReferencesT>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub source_lang: ::std::option::Option<LangT>,
pub title: TitleOfThisDocument,
pub tracking: Tracking,
}
impl DocumentLevelMetaData {
pub fn builder() -> builder::DocumentLevelMetaData {
Default::default()
}
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum DocumentStatus {
#[serde(rename = "draft")]
Draft,
#[serde(rename = "final")]
Final,
#[serde(rename = "interim")]
Interim,
}
impl ::std::fmt::Display for DocumentStatus {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Draft => f.write_str("draft"),
Self::Final => f.write_str("final"),
Self::Interim => f.write_str("interim"),
}
}
}
impl ::std::str::FromStr for DocumentStatus {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"draft" => Ok(Self::Draft),
"final" => Ok(Self::Final),
"interim" => Ok(Self::Interim),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for DocumentStatus {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for DocumentStatus {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for DocumentStatus {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct EngineName(::std::string::String);
impl ::std::ops::Deref for EngineName {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<EngineName> for ::std::string::String {
fn from(value: EngineName) -> Self {
value.0
}
}
impl ::std::str::FromStr for EngineName {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for EngineName {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for EngineName {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for EngineName {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for EngineName {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, PartialEq)]
pub struct EngineOfDocumentGeneration {
pub name: EngineName,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub version: ::std::option::Option<EngineVersion>,
}
impl EngineOfDocumentGeneration {
pub fn builder() -> builder::EngineOfDocumentGeneration {
Default::default()
}
}
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct EngineVersion(::std::string::String);
impl ::std::ops::Deref for EngineVersion {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<EngineVersion> for ::std::string::String {
fn from(value: EngineVersion) -> Self {
value.0
}
}
impl ::std::str::FromStr for EngineVersion {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for EngineVersion {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for EngineVersion {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for EngineVersion {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for EngineVersion {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct EntitlementOfTheRemediation(::std::string::String);
impl ::std::ops::Deref for EntitlementOfTheRemediation {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<EntitlementOfTheRemediation> for ::std::string::String {
fn from(value: EntitlementOfTheRemediation) -> Self {
value.0
}
}
impl ::std::str::FromStr for EntitlementOfTheRemediation {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for EntitlementOfTheRemediation {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for EntitlementOfTheRemediation {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for EntitlementOfTheRemediation {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for EntitlementOfTheRemediation {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, PartialEq)]
pub struct FileHash {
pub algorithm: AlgorithmOfTheCryptographicHash,
pub value: ValueOfTheCryptographicHash,
}
impl FileHash {
pub fn builder() -> builder::FileHash {
Default::default()
}
}
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct Filename(::std::string::String);
impl ::std::ops::Deref for Filename {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<Filename> for ::std::string::String {
fn from(value: Filename) -> Self {
value.0
}
}
impl ::std::str::FromStr for Filename {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for Filename {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for Filename {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for Filename {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for Filename {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, PartialEq)]
pub struct Flag {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub date: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub group_ids: ::std::option::Option<ProductGroupsT>,
pub label: LabelOfTheFlag,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub product_ids: ::std::option::Option<ProductsT>,
}
impl Flag {
pub fn builder() -> builder::Flag {
Default::default()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, PartialEq)]
pub struct FullProductNameT {
pub name: TextualDescriptionOfTheProduct,
pub product_id: ProductIdT,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub product_identification_helper: ::std::option::Option<HelperToIdentifyTheProduct>,
}
impl FullProductNameT {
pub fn builder() -> builder::FullProductNameT {
Default::default()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, PartialEq)]
pub struct GenericUri {
pub namespace: ::std::string::String,
pub uri: ::std::string::String,
}
impl GenericUri {
pub fn builder() -> builder::GenericUri {
Default::default()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, PartialEq)]
pub struct HelperToIdentifyTheProduct {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub cpe: ::std::option::Option<CommonPlatformEnumerationRepresentation>,
#[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
pub hashes: ::std::vec::Vec<CryptographicHashes>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub model_numbers: ::std::option::Option<Vec<ModelNumber>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub purl: ::std::option::Option<PackageUrlRepresentation>,
#[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
pub sbom_urls: ::std::vec::Vec<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub serial_numbers: ::std::option::Option<Vec<SerialNumber>>,
#[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
pub skus: ::std::vec::Vec<StockKeepingUnit>,
#[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
pub x_generic_uris: ::std::vec::Vec<GenericUri>,
}
impl ::std::default::Default for HelperToIdentifyTheProduct {
fn default() -> Self {
Self {
cpe: Default::default(),
hashes: Default::default(),
model_numbers: Default::default(),
purl: Default::default(),
sbom_urls: Default::default(),
serial_numbers: Default::default(),
skus: Default::default(),
x_generic_uris: Default::default(),
}
}
}
impl HelperToIdentifyTheProduct {
pub fn builder() -> builder::HelperToIdentifyTheProduct {
Default::default()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, PartialEq)]
pub struct Id {
pub system_name: SystemName,
pub text: Text,
}
impl Id {
pub fn builder() -> builder::Id {
Default::default()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, PartialEq)]
pub struct Involvement {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub date: ::std::option::Option<::std::string::String>,
pub party: PartyCategory,
pub status: PartyStatus,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub summary: ::std::option::Option<SummaryOfTheInvolvement>,
}
impl Involvement {
pub fn builder() -> builder::Involvement {
Default::default()
}
}
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct IssuingAuthority(::std::string::String);
impl ::std::ops::Deref for IssuingAuthority {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<IssuingAuthority> for ::std::string::String {
fn from(value: IssuingAuthority) -> Self {
value.0
}
}
impl ::std::str::FromStr for IssuingAuthority {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for IssuingAuthority {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for IssuingAuthority {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for IssuingAuthority {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for IssuingAuthority {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum LabelOfTheFlag {
#[serde(rename = "component_not_present")]
ComponentNotPresent,
#[serde(rename = "inline_mitigations_already_exist")]
InlineMitigationsAlreadyExist,
#[serde(rename = "vulnerable_code_cannot_be_controlled_by_adversary")]
VulnerableCodeCannotBeControlledByAdversary,
#[serde(rename = "vulnerable_code_not_in_execute_path")]
VulnerableCodeNotInExecutePath,
#[serde(rename = "vulnerable_code_not_present")]
VulnerableCodeNotPresent,
}
impl ::std::fmt::Display for LabelOfTheFlag {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::ComponentNotPresent => f.write_str("component_not_present"),
Self::InlineMitigationsAlreadyExist => {
f.write_str("inline_mitigations_already_exist")
}
Self::VulnerableCodeCannotBeControlledByAdversary => {
f.write_str("vulnerable_code_cannot_be_controlled_by_adversary")
}
Self::VulnerableCodeNotInExecutePath => {
f.write_str("vulnerable_code_not_in_execute_path")
}
Self::VulnerableCodeNotPresent => f.write_str("vulnerable_code_not_present"),
}
}
}
impl ::std::str::FromStr for LabelOfTheFlag {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"component_not_present" => Ok(Self::ComponentNotPresent),
"inline_mitigations_already_exist" => Ok(Self::InlineMitigationsAlreadyExist),
"vulnerable_code_cannot_be_controlled_by_adversary" => {
Ok(Self::VulnerableCodeCannotBeControlledByAdversary)
}
"vulnerable_code_not_in_execute_path" => {
Ok(Self::VulnerableCodeNotInExecutePath)
}
"vulnerable_code_not_present" => Ok(Self::VulnerableCodeNotPresent),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for LabelOfTheFlag {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for LabelOfTheFlag {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for LabelOfTheFlag {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum LabelOfTlp {
#[serde(rename = "AMBER")]
Amber,
#[serde(rename = "GREEN")]
Green,
#[serde(rename = "RED")]
Red,
#[serde(rename = "WHITE")]
White,
}
impl ::std::fmt::Display for LabelOfTlp {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Amber => f.write_str("AMBER"),
Self::Green => f.write_str("GREEN"),
Self::Red => f.write_str("RED"),
Self::White => f.write_str("WHITE"),
}
}
}
impl ::std::str::FromStr for LabelOfTlp {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"AMBER" => Ok(Self::Amber),
"GREEN" => Ok(Self::Green),
"RED" => Ok(Self::Red),
"WHITE" => Ok(Self::White),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for LabelOfTlp {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for LabelOfTlp {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for LabelOfTlp {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct LangT(::std::string::String);
impl ::std::ops::Deref for LangT {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<LangT> for ::std::string::String {
fn from(value: LangT) -> Self {
value.0
}
}
impl ::std::str::FromStr for LangT {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
static PATTERN: ::std::sync::LazyLock<::regress::Regex> = ::std::sync::LazyLock::new(||
{
::regress::Regex::new(
"^(([A-Za-z]{2,3}(-[A-Za-z]{3}(-[A-Za-z]{3}){0,2})?|[A-Za-z]{4,8})(-[A-Za-z]{4})?(-([A-Za-z]{2}|[0-9]{3}))?(-([A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-[A-WY-Za-wy-z0-9](-[A-Za-z0-9]{2,8})+)*(-[Xx](-[A-Za-z0-9]{1,8})+)?|[Xx](-[A-Za-z0-9]{1,8})+|[Ii]-[Dd][Ee][Ff][Aa][Uu][Ll][Tt]|[Ii]-[Mm][Ii][Nn][Gg][Oo])$",
)
.unwrap()
});
if PATTERN.find(value).is_none() {
return Err(
"doesn't match pattern \"^(([A-Za-z]{2,3}(-[A-Za-z]{3}(-[A-Za-z]{3}){0,2})?|[A-Za-z]{4,8})(-[A-Za-z]{4})?(-([A-Za-z]{2}|[0-9]{3}))?(-([A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-[A-WY-Za-wy-z0-9](-[A-Za-z0-9]{2,8})+)*(-[Xx](-[A-Za-z0-9]{1,8})+)?|[Xx](-[A-Za-z0-9]{1,8})+|[Ii]-[Dd][Ee][Ff][Aa][Uu][Ll][Tt]|[Ii]-[Mm][Ii][Nn][Gg][Oo])$\""
.into(),
);
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for LangT {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for LangT {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for LangT {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for LangT {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct LegacyVersionOfTheRevision(::std::string::String);
impl ::std::ops::Deref for LegacyVersionOfTheRevision {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<LegacyVersionOfTheRevision> for ::std::string::String {
fn from(value: LegacyVersionOfTheRevision) -> Self {
value.0
}
}
impl ::std::str::FromStr for LegacyVersionOfTheRevision {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for LegacyVersionOfTheRevision {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for LegacyVersionOfTheRevision {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for LegacyVersionOfTheRevision {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for LegacyVersionOfTheRevision {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ModelNumber(::std::string::String);
impl ::std::ops::Deref for ModelNumber {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<ModelNumber> for ::std::string::String {
fn from(value: ModelNumber) -> Self {
value.0
}
}
impl ::std::str::FromStr for ModelNumber {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for ModelNumber {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ModelNumber {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ModelNumber {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for ModelNumber {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct NameOfPublisher(::std::string::String);
impl ::std::ops::Deref for NameOfPublisher {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<NameOfPublisher> for ::std::string::String {
fn from(value: NameOfPublisher) -> Self {
value.0
}
}
impl ::std::str::FromStr for NameOfPublisher {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for NameOfPublisher {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for NameOfPublisher {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for NameOfPublisher {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for NameOfPublisher {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct NameOfTheBranch(::std::string::String);
impl ::std::ops::Deref for NameOfTheBranch {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<NameOfTheBranch> for ::std::string::String {
fn from(value: NameOfTheBranch) -> Self {
value.0
}
}
impl ::std::str::FromStr for NameOfTheBranch {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for NameOfTheBranch {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for NameOfTheBranch {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for NameOfTheBranch {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for NameOfTheBranch {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct NameOfTheContributor(::std::string::String);
impl ::std::ops::Deref for NameOfTheContributor {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<NameOfTheContributor> for ::std::string::String {
fn from(value: NameOfTheContributor) -> Self {
value.0
}
}
impl ::std::str::FromStr for NameOfTheContributor {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for NameOfTheContributor {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for NameOfTheContributor {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for NameOfTheContributor {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for NameOfTheContributor {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, PartialEq)]
pub struct Note {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub audience: ::std::option::Option<AudienceOfNote>,
pub category: NoteCategory,
pub text: NoteContent,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub title: ::std::option::Option<TitleOfNote>,
}
impl Note {
pub fn builder() -> builder::Note {
Default::default()
}
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum NoteCategory {
#[serde(rename = "description")]
Description,
#[serde(rename = "details")]
Details,
#[serde(rename = "faq")]
Faq,
#[serde(rename = "general")]
General,
#[serde(rename = "legal_disclaimer")]
LegalDisclaimer,
#[serde(rename = "other")]
Other,
#[serde(rename = "summary")]
Summary,
}
impl ::std::fmt::Display for NoteCategory {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Description => f.write_str("description"),
Self::Details => f.write_str("details"),
Self::Faq => f.write_str("faq"),
Self::General => f.write_str("general"),
Self::LegalDisclaimer => f.write_str("legal_disclaimer"),
Self::Other => f.write_str("other"),
Self::Summary => f.write_str("summary"),
}
}
}
impl ::std::str::FromStr for NoteCategory {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"description" => Ok(Self::Description),
"details" => Ok(Self::Details),
"faq" => Ok(Self::Faq),
"general" => Ok(Self::General),
"legal_disclaimer" => Ok(Self::LegalDisclaimer),
"other" => Ok(Self::Other),
"summary" => Ok(Self::Summary),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for NoteCategory {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for NoteCategory {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for NoteCategory {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct NoteContent(::std::string::String);
impl ::std::ops::Deref for NoteContent {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<NoteContent> for ::std::string::String {
fn from(value: NoteContent) -> Self {
value.0
}
}
impl ::std::str::FromStr for NoteContent {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for NoteContent {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for NoteContent {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for NoteContent {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for NoteContent {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, PartialEq)]
#[serde(transparent)]
pub struct NotesT(pub ::std::vec::Vec<Note>);
impl ::std::ops::Deref for NotesT {
type Target = ::std::vec::Vec<Note>;
fn deref(&self) -> &::std::vec::Vec<Note> {
&self.0
}
}
impl ::std::convert::From<NotesT> for ::std::vec::Vec<Note> {
fn from(value: NotesT) -> Self {
value.0
}
}
impl ::std::convert::From<::std::vec::Vec<Note>> for NotesT {
fn from(value: ::std::vec::Vec<Note>) -> Self {
Self(value)
}
}
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct PackageUrlRepresentation(::std::string::String);
impl ::std::ops::Deref for PackageUrlRepresentation {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<PackageUrlRepresentation> for ::std::string::String {
fn from(value: PackageUrlRepresentation) -> Self {
value.0
}
}
impl ::std::str::FromStr for PackageUrlRepresentation {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 7usize {
return Err("shorter than 7 characters".into());
}
static PATTERN: ::std::sync::LazyLock<::regress::Regex> = ::std::sync::LazyLock::new(||
{
::regress::Regex::new("^pkg:[A-Za-z\\.\\-\\+][A-Za-z0-9\\.\\-\\+]*/.+")
.unwrap()
});
if PATTERN.find(value).is_none() {
return Err(
"doesn't match pattern \"^pkg:[A-Za-z\\.\\-\\+][A-Za-z0-9\\.\\-\\+]*/.+\""
.into(),
);
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for PackageUrlRepresentation {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for PackageUrlRepresentation {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for PackageUrlRepresentation {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for PackageUrlRepresentation {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum PartyCategory {
#[serde(rename = "coordinator")]
Coordinator,
#[serde(rename = "discoverer")]
Discoverer,
#[serde(rename = "other")]
Other,
#[serde(rename = "user")]
User,
#[serde(rename = "vendor")]
Vendor,
}
impl ::std::fmt::Display for PartyCategory {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Coordinator => f.write_str("coordinator"),
Self::Discoverer => f.write_str("discoverer"),
Self::Other => f.write_str("other"),
Self::User => f.write_str("user"),
Self::Vendor => f.write_str("vendor"),
}
}
}
impl ::std::str::FromStr for PartyCategory {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"coordinator" => Ok(Self::Coordinator),
"discoverer" => Ok(Self::Discoverer),
"other" => Ok(Self::Other),
"user" => Ok(Self::User),
"vendor" => Ok(Self::Vendor),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for PartyCategory {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for PartyCategory {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for PartyCategory {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum PartyStatus {
#[serde(rename = "completed")]
Completed,
#[serde(rename = "contact_attempted")]
ContactAttempted,
#[serde(rename = "disputed")]
Disputed,
#[serde(rename = "in_progress")]
InProgress,
#[serde(rename = "not_contacted")]
NotContacted,
#[serde(rename = "open")]
Open,
}
impl ::std::fmt::Display for PartyStatus {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Completed => f.write_str("completed"),
Self::ContactAttempted => f.write_str("contact_attempted"),
Self::Disputed => f.write_str("disputed"),
Self::InProgress => f.write_str("in_progress"),
Self::NotContacted => f.write_str("not_contacted"),
Self::Open => f.write_str("open"),
}
}
}
impl ::std::str::FromStr for PartyStatus {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"completed" => Ok(Self::Completed),
"contact_attempted" => Ok(Self::ContactAttempted),
"disputed" => Ok(Self::Disputed),
"in_progress" => Ok(Self::InProgress),
"not_contacted" => Ok(Self::NotContacted),
"open" => Ok(Self::Open),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for PartyStatus {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for PartyStatus {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for PartyStatus {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, PartialEq)]
pub struct ProductGroup {
pub group_id: ProductGroupIdT,
pub product_ids: Vec<ProductIdT>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub summary: ::std::option::Option<SummaryOfTheProductGroup>,
}
impl ProductGroup {
pub fn builder() -> builder::ProductGroup {
Default::default()
}
}
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ProductGroupIdT(::std::string::String);
impl ::std::ops::Deref for ProductGroupIdT {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<ProductGroupIdT> for ::std::string::String {
fn from(value: ProductGroupIdT) -> Self {
value.0
}
}
impl ::std::str::FromStr for ProductGroupIdT {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for ProductGroupIdT {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ProductGroupIdT {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ProductGroupIdT {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for ProductGroupIdT {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, PartialEq)]
#[serde(transparent)]
pub struct ProductGroupsT(pub Vec<ProductGroupIdT>);
impl ::std::ops::Deref for ProductGroupsT {
type Target = Vec<ProductGroupIdT>;
fn deref(&self) -> &Vec<ProductGroupIdT> {
&self.0
}
}
impl ::std::convert::From<ProductGroupsT> for Vec<ProductGroupIdT> {
fn from(value: ProductGroupsT) -> Self {
value.0
}
}
impl ::std::convert::From<Vec<ProductGroupIdT>> for ProductGroupsT {
fn from(value: Vec<ProductGroupIdT>) -> Self {
Self(value)
}
}
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ProductIdT(::std::string::String);
impl ::std::ops::Deref for ProductIdT {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<ProductIdT> for ::std::string::String {
fn from(value: ProductIdT) -> Self {
value.0
}
}
impl ::std::str::FromStr for ProductIdT {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for ProductIdT {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ProductIdT {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ProductIdT {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for ProductIdT {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, PartialEq)]
pub struct ProductStatus {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub first_affected: ::std::option::Option<ProductsT>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub first_fixed: ::std::option::Option<ProductsT>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub fixed: ::std::option::Option<ProductsT>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub known_affected: ::std::option::Option<ProductsT>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub known_not_affected: ::std::option::Option<ProductsT>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub last_affected: ::std::option::Option<ProductsT>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub recommended: ::std::option::Option<ProductsT>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub under_investigation: ::std::option::Option<ProductsT>,
}
impl ::std::default::Default for ProductStatus {
fn default() -> Self {
Self {
first_affected: Default::default(),
first_fixed: Default::default(),
fixed: Default::default(),
known_affected: Default::default(),
known_not_affected: Default::default(),
last_affected: Default::default(),
recommended: Default::default(),
under_investigation: Default::default(),
}
}
}
impl ProductStatus {
pub fn builder() -> builder::ProductStatus {
Default::default()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, PartialEq)]
pub struct ProductTree {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub branches: ::std::option::Option<BranchesT>,
#[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
pub full_product_names: ::std::vec::Vec<FullProductNameT>,
#[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
pub product_groups: ::std::vec::Vec<ProductGroup>,
#[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
pub relationships: ::std::vec::Vec<Relationship>,
}
impl ::std::default::Default for ProductTree {
fn default() -> Self {
Self {
branches: Default::default(),
full_product_names: Default::default(),
product_groups: Default::default(),
relationships: Default::default(),
}
}
}
impl ProductTree {
pub fn builder() -> builder::ProductTree {
Default::default()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, PartialEq)]
#[serde(transparent)]
pub struct ProductsT(pub Vec<ProductIdT>);
impl ::std::ops::Deref for ProductsT {
type Target = Vec<ProductIdT>;
fn deref(&self) -> &Vec<ProductIdT> {
&self.0
}
}
impl ::std::convert::From<ProductsT> for Vec<ProductIdT> {
fn from(value: ProductsT) -> Self {
value.0
}
}
impl ::std::convert::From<Vec<ProductIdT>> for ProductsT {
fn from(value: Vec<ProductIdT>) -> Self {
Self(value)
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, PartialEq)]
pub struct Publisher {
pub category: CategoryOfPublisher,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub contact_details: ::std::option::Option<ContactDetails>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub issuing_authority: ::std::option::Option<IssuingAuthority>,
pub name: NameOfPublisher,
pub namespace: ::std::string::String,
}
impl Publisher {
pub fn builder() -> builder::Publisher {
Default::default()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, PartialEq)]
pub struct Reference {
#[serde(default = "defaults::reference_category")]
pub category: CategoryOfReference,
pub summary: SummaryOfTheReference,
pub url: ::std::string::String,
}
impl Reference {
pub fn builder() -> builder::Reference {
Default::default()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, PartialEq)]
#[serde(transparent)]
pub struct ReferencesT(pub ::std::vec::Vec<Reference>);
impl ::std::ops::Deref for ReferencesT {
type Target = ::std::vec::Vec<Reference>;
fn deref(&self) -> &::std::vec::Vec<Reference> {
&self.0
}
}
impl ::std::convert::From<ReferencesT> for ::std::vec::Vec<Reference> {
fn from(value: ReferencesT) -> Self {
value.0
}
}
impl ::std::convert::From<::std::vec::Vec<Reference>> for ReferencesT {
fn from(value: ::std::vec::Vec<Reference>) -> Self {
Self(value)
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, PartialEq)]
pub struct Relationship {
pub category: RelationshipCategory,
pub full_product_name: FullProductNameT,
pub product_reference: ProductIdT,
pub relates_to_product_reference: ProductIdT,
}
impl Relationship {
pub fn builder() -> builder::Relationship {
Default::default()
}
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum RelationshipCategory {
#[serde(rename = "default_component_of")]
DefaultComponentOf,
#[serde(rename = "external_component_of")]
ExternalComponentOf,
#[serde(rename = "installed_on")]
InstalledOn,
#[serde(rename = "installed_with")]
InstalledWith,
#[serde(rename = "optional_component_of")]
OptionalComponentOf,
}
impl ::std::fmt::Display for RelationshipCategory {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::DefaultComponentOf => f.write_str("default_component_of"),
Self::ExternalComponentOf => f.write_str("external_component_of"),
Self::InstalledOn => f.write_str("installed_on"),
Self::InstalledWith => f.write_str("installed_with"),
Self::OptionalComponentOf => f.write_str("optional_component_of"),
}
}
}
impl ::std::str::FromStr for RelationshipCategory {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"default_component_of" => Ok(Self::DefaultComponentOf),
"external_component_of" => Ok(Self::ExternalComponentOf),
"installed_on" => Ok(Self::InstalledOn),
"installed_with" => Ok(Self::InstalledWith),
"optional_component_of" => Ok(Self::OptionalComponentOf),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for RelationshipCategory {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for RelationshipCategory {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for RelationshipCategory {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, PartialEq)]
pub struct Remediation {
pub category: CategoryOfTheRemediation,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub date: ::std::option::Option<::std::string::String>,
pub details: DetailsOfTheRemediation,
#[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
pub entitlements: ::std::vec::Vec<EntitlementOfTheRemediation>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub group_ids: ::std::option::Option<ProductGroupsT>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub product_ids: ::std::option::Option<ProductsT>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub restart_required: ::std::option::Option<RestartRequiredByRemediation>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub url: ::std::option::Option<::std::string::String>,
}
impl Remediation {
pub fn builder() -> builder::Remediation {
Default::default()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, PartialEq)]
pub struct RestartRequiredByRemediation {
pub category: CategoryOfRestart,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub details: ::std::option::Option<AdditionalRestartInformation>,
}
impl RestartRequiredByRemediation {
pub fn builder() -> builder::RestartRequiredByRemediation {
Default::default()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, PartialEq)]
pub struct Revision {
pub date: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub legacy_version: ::std::option::Option<LegacyVersionOfTheRevision>,
pub number: VersionT,
pub summary: SummaryOfTheRevision,
}
impl Revision {
pub fn builder() -> builder::Revision {
Default::default()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, PartialEq)]
pub struct RulesForSharingDocument {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub text: ::std::option::Option<TextualDescription>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub tlp: ::std::option::Option<TrafficLightProtocolTlp>,
}
impl ::std::default::Default for RulesForSharingDocument {
fn default() -> Self {
Self {
text: Default::default(),
tlp: Default::default(),
}
}
}
impl RulesForSharingDocument {
pub fn builder() -> builder::RulesForSharingDocument {
Default::default()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, PartialEq)]
pub struct Score {
#[serde(default, skip_serializing_if = "::serde_json::Map::is_empty")]
pub cvss_v2: ::serde_json::Map<::std::string::String, ::serde_json::Value>,
#[serde(default, skip_serializing_if = "::serde_json::Map::is_empty")]
pub cvss_v3: ::serde_json::Map<::std::string::String, ::serde_json::Value>,
pub products: ProductsT,
}
impl Score {
pub fn builder() -> builder::Score {
Default::default()
}
}
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct SerialNumber(::std::string::String);
impl ::std::ops::Deref for SerialNumber {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<SerialNumber> for ::std::string::String {
fn from(value: SerialNumber) -> Self {
value.0
}
}
impl ::std::str::FromStr for SerialNumber {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for SerialNumber {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for SerialNumber {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for SerialNumber {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for SerialNumber {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct StockKeepingUnit(::std::string::String);
impl ::std::ops::Deref for StockKeepingUnit {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<StockKeepingUnit> for ::std::string::String {
fn from(value: StockKeepingUnit) -> Self {
value.0
}
}
impl ::std::str::FromStr for StockKeepingUnit {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for StockKeepingUnit {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for StockKeepingUnit {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for StockKeepingUnit {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for StockKeepingUnit {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct SummaryOfTheAcknowledgment(::std::string::String);
impl ::std::ops::Deref for SummaryOfTheAcknowledgment {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<SummaryOfTheAcknowledgment> for ::std::string::String {
fn from(value: SummaryOfTheAcknowledgment) -> Self {
value.0
}
}
impl ::std::str::FromStr for SummaryOfTheAcknowledgment {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for SummaryOfTheAcknowledgment {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for SummaryOfTheAcknowledgment {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for SummaryOfTheAcknowledgment {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for SummaryOfTheAcknowledgment {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct SummaryOfTheInvolvement(::std::string::String);
impl ::std::ops::Deref for SummaryOfTheInvolvement {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<SummaryOfTheInvolvement> for ::std::string::String {
fn from(value: SummaryOfTheInvolvement) -> Self {
value.0
}
}
impl ::std::str::FromStr for SummaryOfTheInvolvement {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for SummaryOfTheInvolvement {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for SummaryOfTheInvolvement {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for SummaryOfTheInvolvement {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for SummaryOfTheInvolvement {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct SummaryOfTheProductGroup(::std::string::String);
impl ::std::ops::Deref for SummaryOfTheProductGroup {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<SummaryOfTheProductGroup> for ::std::string::String {
fn from(value: SummaryOfTheProductGroup) -> Self {
value.0
}
}
impl ::std::str::FromStr for SummaryOfTheProductGroup {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for SummaryOfTheProductGroup {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for SummaryOfTheProductGroup {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for SummaryOfTheProductGroup {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for SummaryOfTheProductGroup {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct SummaryOfTheReference(::std::string::String);
impl ::std::ops::Deref for SummaryOfTheReference {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<SummaryOfTheReference> for ::std::string::String {
fn from(value: SummaryOfTheReference) -> Self {
value.0
}
}
impl ::std::str::FromStr for SummaryOfTheReference {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for SummaryOfTheReference {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for SummaryOfTheReference {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for SummaryOfTheReference {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for SummaryOfTheReference {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct SummaryOfTheRevision(::std::string::String);
impl ::std::ops::Deref for SummaryOfTheRevision {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<SummaryOfTheRevision> for ::std::string::String {
fn from(value: SummaryOfTheRevision) -> Self {
value.0
}
}
impl ::std::str::FromStr for SummaryOfTheRevision {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for SummaryOfTheRevision {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for SummaryOfTheRevision {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for SummaryOfTheRevision {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for SummaryOfTheRevision {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct SystemName(::std::string::String);
impl ::std::ops::Deref for SystemName {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<SystemName> for ::std::string::String {
fn from(value: SystemName) -> Self {
value.0
}
}
impl ::std::str::FromStr for SystemName {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for SystemName {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for SystemName {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for SystemName {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for SystemName {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct Text(::std::string::String);
impl ::std::ops::Deref for Text {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<Text> for ::std::string::String {
fn from(value: Text) -> Self {
value.0
}
}
impl ::std::str::FromStr for Text {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for Text {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for Text {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for Text {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for Text {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct TextOfAggregateSeverity(::std::string::String);
impl ::std::ops::Deref for TextOfAggregateSeverity {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<TextOfAggregateSeverity> for ::std::string::String {
fn from(value: TextOfAggregateSeverity) -> Self {
value.0
}
}
impl ::std::str::FromStr for TextOfAggregateSeverity {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for TextOfAggregateSeverity {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for TextOfAggregateSeverity {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for TextOfAggregateSeverity {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for TextOfAggregateSeverity {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct TextualDescription(::std::string::String);
impl ::std::ops::Deref for TextualDescription {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<TextualDescription> for ::std::string::String {
fn from(value: TextualDescription) -> Self {
value.0
}
}
impl ::std::str::FromStr for TextualDescription {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for TextualDescription {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for TextualDescription {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for TextualDescription {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for TextualDescription {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct TextualDescriptionOfTheProduct(::std::string::String);
impl ::std::ops::Deref for TextualDescriptionOfTheProduct {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<TextualDescriptionOfTheProduct> for ::std::string::String {
fn from(value: TextualDescriptionOfTheProduct) -> Self {
value.0
}
}
impl ::std::str::FromStr for TextualDescriptionOfTheProduct {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for TextualDescriptionOfTheProduct {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for TextualDescriptionOfTheProduct {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for TextualDescriptionOfTheProduct {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for TextualDescriptionOfTheProduct {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, PartialEq)]
pub struct Threat {
pub category: CategoryOfTheThreat,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub date: ::std::option::Option<::std::string::String>,
pub details: DetailsOfTheThreat,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub group_ids: ::std::option::Option<ProductGroupsT>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub product_ids: ::std::option::Option<ProductsT>,
}
impl Threat {
pub fn builder() -> builder::Threat {
Default::default()
}
}
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct Title(::std::string::String);
impl ::std::ops::Deref for Title {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<Title> for ::std::string::String {
fn from(value: Title) -> Self {
value.0
}
}
impl ::std::str::FromStr for Title {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for Title {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for Title {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for Title {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for Title {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct TitleOfNote(::std::string::String);
impl ::std::ops::Deref for TitleOfNote {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<TitleOfNote> for ::std::string::String {
fn from(value: TitleOfNote) -> Self {
value.0
}
}
impl ::std::str::FromStr for TitleOfNote {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for TitleOfNote {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for TitleOfNote {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for TitleOfNote {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for TitleOfNote {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct TitleOfThisDocument(::std::string::String);
impl ::std::ops::Deref for TitleOfThisDocument {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<TitleOfThisDocument> for ::std::string::String {
fn from(value: TitleOfThisDocument) -> Self {
value.0
}
}
impl ::std::str::FromStr for TitleOfThisDocument {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for TitleOfThisDocument {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for TitleOfThisDocument {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for TitleOfThisDocument {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for TitleOfThisDocument {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, PartialEq)]
pub struct Tracking {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub aliases: ::std::option::Option<Vec<AlternateName>>,
pub current_release_date: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub generator: ::std::option::Option<DocumentGenerator>,
pub id: UniqueIdentifierForTheDocument,
pub initial_release_date: ::std::string::String,
pub revision_history: ::std::vec::Vec<Revision>,
pub status: DocumentStatus,
pub version: VersionT,
}
impl Tracking {
pub fn builder() -> builder::Tracking {
Default::default()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, PartialEq)]
pub struct TrafficLightProtocolTlp {
pub label: LabelOfTlp,
#[serde(default = "defaults::traffic_light_protocol_tlp_url")]
pub url: ::std::string::String,
}
impl TrafficLightProtocolTlp {
pub fn builder() -> builder::TrafficLightProtocolTlp {
Default::default()
}
}
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct UniqueIdentifierForTheDocument(::std::string::String);
impl ::std::ops::Deref for UniqueIdentifierForTheDocument {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<UniqueIdentifierForTheDocument> for ::std::string::String {
fn from(value: UniqueIdentifierForTheDocument) -> Self {
value.0
}
}
impl ::std::str::FromStr for UniqueIdentifierForTheDocument {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
static PATTERN: ::std::sync::LazyLock<::regress::Regex> = ::std::sync::LazyLock::new(||
{ ::regress::Regex::new("^[\\S](.*[\\S])?$").unwrap() });
if PATTERN.find(value).is_none() {
return Err("doesn't match pattern \"^[\\S](.*[\\S])?$\"".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for UniqueIdentifierForTheDocument {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for UniqueIdentifierForTheDocument {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for UniqueIdentifierForTheDocument {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for UniqueIdentifierForTheDocument {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ValueOfTheCryptographicHash(::std::string::String);
impl ::std::ops::Deref for ValueOfTheCryptographicHash {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<ValueOfTheCryptographicHash> for ::std::string::String {
fn from(value: ValueOfTheCryptographicHash) -> Self {
value.0
}
}
impl ::std::str::FromStr for ValueOfTheCryptographicHash {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 32usize {
return Err("shorter than 32 characters".into());
}
static PATTERN: ::std::sync::LazyLock<::regress::Regex> = ::std::sync::LazyLock::new(||
{ ::regress::Regex::new("^[0-9a-fA-F]{32,}$").unwrap() });
if PATTERN.find(value).is_none() {
return Err("doesn't match pattern \"^[0-9a-fA-F]{32,}$\"".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for ValueOfTheCryptographicHash {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ValueOfTheCryptographicHash {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ValueOfTheCryptographicHash {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for ValueOfTheCryptographicHash {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct VersionT(::std::string::String);
impl ::std::ops::Deref for VersionT {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<VersionT> for ::std::string::String {
fn from(value: VersionT) -> Self {
value.0
}
}
impl ::std::str::FromStr for VersionT {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
static PATTERN: ::std::sync::LazyLock<::regress::Regex> = ::std::sync::LazyLock::new(||
{
::regress::Regex::new(
"^(0|[1-9][0-9]*)$|^((0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)$",
)
.unwrap()
});
if PATTERN.find(value).is_none() {
return Err(
"doesn't match pattern \"^(0|[1-9][0-9]*)$|^((0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)$\""
.into(),
);
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for VersionT {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for VersionT {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for VersionT {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for VersionT {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, PartialEq)]
pub struct Vulnerability {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub acknowledgments: ::std::option::Option<AcknowledgmentsT>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub cve: ::std::option::Option<Cve>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub cwe: ::std::option::Option<Cwe>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub discovery_date: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub flags: ::std::option::Option<Vec<Flag>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub ids: ::std::option::Option<Vec<Id>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub involvements: ::std::option::Option<Vec<Involvement>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub notes: ::std::option::Option<NotesT>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub product_status: ::std::option::Option<ProductStatus>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub references: ::std::option::Option<ReferencesT>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub release_date: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
pub remediations: ::std::vec::Vec<Remediation>,
#[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
pub scores: ::std::vec::Vec<Score>,
#[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
pub threats: ::std::vec::Vec<Threat>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub title: ::std::option::Option<Title>,
}
impl ::std::default::Default for Vulnerability {
fn default() -> Self {
Self {
acknowledgments: Default::default(),
cve: Default::default(),
cwe: Default::default(),
discovery_date: Default::default(),
flags: Default::default(),
ids: Default::default(),
involvements: Default::default(),
notes: Default::default(),
product_status: Default::default(),
references: Default::default(),
release_date: Default::default(),
remediations: Default::default(),
scores: Default::default(),
threats: Default::default(),
title: Default::default(),
}
}
}
impl Vulnerability {
pub fn builder() -> builder::Vulnerability {
Default::default()
}
}
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct WeaknessId(::std::string::String);
impl ::std::ops::Deref for WeaknessId {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<WeaknessId> for ::std::string::String {
fn from(value: WeaknessId) -> Self {
value.0
}
}
impl ::std::str::FromStr for WeaknessId {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
static PATTERN: ::std::sync::LazyLock<::regress::Regex> = ::std::sync::LazyLock::new(||
{ ::regress::Regex::new("^CWE-[1-9]\\d{0,5}$").unwrap() });
if PATTERN.find(value).is_none() {
return Err("doesn't match pattern \"^CWE-[1-9]\\d{0,5}$\"".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for WeaknessId {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for WeaknessId {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for WeaknessId {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for WeaknessId {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct WeaknessName(::std::string::String);
impl ::std::ops::Deref for WeaknessName {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<WeaknessName> for ::std::string::String {
fn from(value: WeaknessName) -> Self {
value.0
}
}
impl ::std::str::FromStr for WeaknessName {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for WeaknessName {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for WeaknessName {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for WeaknessName {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for WeaknessName {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
pub mod builder {
#[derive(Clone, Debug)]
pub struct Acknowledgment {
names: ::std::result::Result<
::std::vec::Vec<super::NameOfTheContributor>,
::std::string::String,
>,
organization: ::std::result::Result<
::std::option::Option<super::ContributingOrganization>,
::std::string::String,
>,
summary: ::std::result::Result<
::std::option::Option<super::SummaryOfTheAcknowledgment>,
::std::string::String,
>,
urls: ::std::result::Result<
::std::vec::Vec<::std::string::String>,
::std::string::String,
>,
}
impl ::std::default::Default for Acknowledgment {
fn default() -> Self {
Self {
names: Ok(Default::default()),
organization: Ok(Default::default()),
summary: Ok(Default::default()),
urls: Ok(Default::default()),
}
}
}
impl Acknowledgment {
pub fn names<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::NameOfTheContributor>>,
T::Error: ::std::fmt::Display,
{
self.names = value
.try_into()
.map_err(|e| format!("error converting supplied value for names: {e}"));
self
}
pub fn organization<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::ContributingOrganization>,
>,
T::Error: ::std::fmt::Display,
{
self.organization = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for organization: {e}")
});
self
}
pub fn summary<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::SummaryOfTheAcknowledgment>,
>,
T::Error: ::std::fmt::Display,
{
self.summary = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for summary: {e}")
});
self
}
pub fn urls<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.urls = value
.try_into()
.map_err(|e| format!("error converting supplied value for urls: {e}"));
self
}
}
impl ::std::convert::TryFrom<Acknowledgment> for super::Acknowledgment {
type Error = super::error::ConversionError;
fn try_from(
value: Acknowledgment,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
names: value.names?,
organization: value.organization?,
summary: value.summary?,
urls: value.urls?,
})
}
}
impl ::std::convert::From<super::Acknowledgment> for Acknowledgment {
fn from(value: super::Acknowledgment) -> Self {
Self {
names: Ok(value.names),
organization: Ok(value.organization),
summary: Ok(value.summary),
urls: Ok(value.urls),
}
}
}
#[derive(Clone, Debug)]
pub struct AggregateSeverity {
namespace: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
text: ::std::result::Result<
super::TextOfAggregateSeverity,
::std::string::String,
>,
}
impl ::std::default::Default for AggregateSeverity {
fn default() -> Self {
Self {
namespace: Ok(Default::default()),
text: Err("no value supplied for text".to_string()),
}
}
}
impl AggregateSeverity {
pub fn namespace<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.namespace = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for namespace: {e}")
});
self
}
pub fn text<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::TextOfAggregateSeverity>,
T::Error: ::std::fmt::Display,
{
self.text = value
.try_into()
.map_err(|e| format!("error converting supplied value for text: {e}"));
self
}
}
impl ::std::convert::TryFrom<AggregateSeverity> for super::AggregateSeverity {
type Error = super::error::ConversionError;
fn try_from(
value: AggregateSeverity,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
namespace: value.namespace?,
text: value.text?,
})
}
}
impl ::std::convert::From<super::AggregateSeverity> for AggregateSeverity {
fn from(value: super::AggregateSeverity) -> Self {
Self {
namespace: Ok(value.namespace),
text: Ok(value.text),
}
}
}
#[derive(Clone, Debug)]
pub struct Branch {
branches: ::std::result::Result<
::std::option::Option<super::BranchesT>,
::std::string::String,
>,
category: ::std::result::Result<
super::CategoryOfTheBranch,
::std::string::String,
>,
name: ::std::result::Result<super::NameOfTheBranch, ::std::string::String>,
product: ::std::result::Result<
::std::option::Option<super::FullProductNameT>,
::std::string::String,
>,
}
impl ::std::default::Default for Branch {
fn default() -> Self {
Self {
branches: Ok(Default::default()),
category: Err("no value supplied for category".to_string()),
name: Err("no value supplied for name".to_string()),
product: Ok(Default::default()),
}
}
}
impl Branch {
pub fn branches<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::BranchesT>>,
T::Error: ::std::fmt::Display,
{
self.branches = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for branches: {e}")
});
self
}
pub fn category<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::CategoryOfTheBranch>,
T::Error: ::std::fmt::Display,
{
self.category = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for category: {e}")
});
self
}
pub fn name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::NameOfTheBranch>,
T::Error: ::std::fmt::Display,
{
self.name = value
.try_into()
.map_err(|e| format!("error converting supplied value for name: {e}"));
self
}
pub fn product<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::FullProductNameT>>,
T::Error: ::std::fmt::Display,
{
self.product = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for product: {e}")
});
self
}
}
impl ::std::convert::TryFrom<Branch> for super::Branch {
type Error = super::error::ConversionError;
fn try_from(
value: Branch,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
branches: value.branches?,
category: value.category?,
name: value.name?,
product: value.product?,
})
}
}
impl ::std::convert::From<super::Branch> for Branch {
fn from(value: super::Branch) -> Self {
Self {
branches: Ok(value.branches),
category: Ok(value.category),
name: Ok(value.name),
product: Ok(value.product),
}
}
}
#[derive(Clone, Debug)]
pub struct CommonSecurityAdvisoryFramework {
document: ::std::result::Result<
super::DocumentLevelMetaData,
::std::string::String,
>,
product_tree: ::std::result::Result<
::std::option::Option<super::ProductTree>,
::std::string::String,
>,
vulnerabilities: ::std::result::Result<
::std::vec::Vec<super::Vulnerability>,
::std::string::String,
>,
}
impl ::std::default::Default for CommonSecurityAdvisoryFramework {
fn default() -> Self {
Self {
document: Err("no value supplied for document".to_string()),
product_tree: Ok(Default::default()),
vulnerabilities: Ok(Default::default()),
}
}
}
impl CommonSecurityAdvisoryFramework {
pub fn document<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::DocumentLevelMetaData>,
T::Error: ::std::fmt::Display,
{
self.document = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for document: {e}")
});
self
}
pub fn product_tree<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::ProductTree>>,
T::Error: ::std::fmt::Display,
{
self.product_tree = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for product_tree: {e}")
});
self
}
pub fn vulnerabilities<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::Vulnerability>>,
T::Error: ::std::fmt::Display,
{
self.vulnerabilities = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for vulnerabilities: {e}")
});
self
}
}
impl ::std::convert::TryFrom<CommonSecurityAdvisoryFramework>
for super::CommonSecurityAdvisoryFramework {
type Error = super::error::ConversionError;
fn try_from(
value: CommonSecurityAdvisoryFramework,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
document: value.document?,
product_tree: value.product_tree?,
vulnerabilities: value.vulnerabilities?,
})
}
}
impl ::std::convert::From<super::CommonSecurityAdvisoryFramework>
for CommonSecurityAdvisoryFramework {
fn from(value: super::CommonSecurityAdvisoryFramework) -> Self {
Self {
document: Ok(value.document),
product_tree: Ok(value.product_tree),
vulnerabilities: Ok(value.vulnerabilities),
}
}
}
#[derive(Clone, Debug)]
pub struct CryptographicHashes {
file_hashes: ::std::result::Result<
::std::vec::Vec<super::FileHash>,
::std::string::String,
>,
filename: ::std::result::Result<super::Filename, ::std::string::String>,
}
impl ::std::default::Default for CryptographicHashes {
fn default() -> Self {
Self {
file_hashes: Err("no value supplied for file_hashes".to_string()),
filename: Err("no value supplied for filename".to_string()),
}
}
}
impl CryptographicHashes {
pub fn file_hashes<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::FileHash>>,
T::Error: ::std::fmt::Display,
{
self.file_hashes = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for file_hashes: {e}")
});
self
}
pub fn filename<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Filename>,
T::Error: ::std::fmt::Display,
{
self.filename = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for filename: {e}")
});
self
}
}
impl ::std::convert::TryFrom<CryptographicHashes> for super::CryptographicHashes {
type Error = super::error::ConversionError;
fn try_from(
value: CryptographicHashes,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
file_hashes: value.file_hashes?,
filename: value.filename?,
})
}
}
impl ::std::convert::From<super::CryptographicHashes> for CryptographicHashes {
fn from(value: super::CryptographicHashes) -> Self {
Self {
file_hashes: Ok(value.file_hashes),
filename: Ok(value.filename),
}
}
}
#[derive(Clone, Debug)]
pub struct Cwe {
id: ::std::result::Result<super::WeaknessId, ::std::string::String>,
name: ::std::result::Result<super::WeaknessName, ::std::string::String>,
}
impl ::std::default::Default for Cwe {
fn default() -> Self {
Self {
id: Err("no value supplied for id".to_string()),
name: Err("no value supplied for name".to_string()),
}
}
}
impl Cwe {
pub fn id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::WeaknessId>,
T::Error: ::std::fmt::Display,
{
self.id = value
.try_into()
.map_err(|e| format!("error converting supplied value for id: {e}"));
self
}
pub fn name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::WeaknessName>,
T::Error: ::std::fmt::Display,
{
self.name = value
.try_into()
.map_err(|e| format!("error converting supplied value for name: {e}"));
self
}
}
impl ::std::convert::TryFrom<Cwe> for super::Cwe {
type Error = super::error::ConversionError;
fn try_from(
value: Cwe,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
id: value.id?,
name: value.name?,
})
}
}
impl ::std::convert::From<super::Cwe> for Cwe {
fn from(value: super::Cwe) -> Self {
Self {
id: Ok(value.id),
name: Ok(value.name),
}
}
}
#[derive(Clone, Debug)]
pub struct DocumentGenerator {
date: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
engine: ::std::result::Result<
super::EngineOfDocumentGeneration,
::std::string::String,
>,
}
impl ::std::default::Default for DocumentGenerator {
fn default() -> Self {
Self {
date: Ok(Default::default()),
engine: Err("no value supplied for engine".to_string()),
}
}
}
impl DocumentGenerator {
pub fn date<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.date = value
.try_into()
.map_err(|e| format!("error converting supplied value for date: {e}"));
self
}
pub fn engine<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::EngineOfDocumentGeneration>,
T::Error: ::std::fmt::Display,
{
self.engine = value
.try_into()
.map_err(|e| format!("error converting supplied value for engine: {e}"));
self
}
}
impl ::std::convert::TryFrom<DocumentGenerator> for super::DocumentGenerator {
type Error = super::error::ConversionError;
fn try_from(
value: DocumentGenerator,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
date: value.date?,
engine: value.engine?,
})
}
}
impl ::std::convert::From<super::DocumentGenerator> for DocumentGenerator {
fn from(value: super::DocumentGenerator) -> Self {
Self {
date: Ok(value.date),
engine: Ok(value.engine),
}
}
}
#[derive(Clone, Debug)]
pub struct DocumentLevelMetaData {
acknowledgments: ::std::result::Result<
::std::option::Option<super::AcknowledgmentsT>,
::std::string::String,
>,
aggregate_severity: ::std::result::Result<
::std::option::Option<super::AggregateSeverity>,
::std::string::String,
>,
category: ::std::result::Result<super::DocumentCategory, ::std::string::String>,
csaf_version: ::std::result::Result<super::CsafVersion, ::std::string::String>,
distribution: ::std::result::Result<
::std::option::Option<super::RulesForSharingDocument>,
::std::string::String,
>,
lang: ::std::result::Result<
::std::option::Option<super::LangT>,
::std::string::String,
>,
notes: ::std::result::Result<
::std::option::Option<super::NotesT>,
::std::string::String,
>,
publisher: ::std::result::Result<super::Publisher, ::std::string::String>,
references: ::std::result::Result<
::std::option::Option<super::ReferencesT>,
::std::string::String,
>,
source_lang: ::std::result::Result<
::std::option::Option<super::LangT>,
::std::string::String,
>,
title: ::std::result::Result<super::TitleOfThisDocument, ::std::string::String>,
tracking: ::std::result::Result<super::Tracking, ::std::string::String>,
}
impl ::std::default::Default for DocumentLevelMetaData {
fn default() -> Self {
Self {
acknowledgments: Ok(Default::default()),
aggregate_severity: Ok(Default::default()),
category: Err("no value supplied for category".to_string()),
csaf_version: Err("no value supplied for csaf_version".to_string()),
distribution: Ok(Default::default()),
lang: Ok(Default::default()),
notes: Ok(Default::default()),
publisher: Err("no value supplied for publisher".to_string()),
references: Ok(Default::default()),
source_lang: Ok(Default::default()),
title: Err("no value supplied for title".to_string()),
tracking: Err("no value supplied for tracking".to_string()),
}
}
}
impl DocumentLevelMetaData {
pub fn acknowledgments<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::AcknowledgmentsT>>,
T::Error: ::std::fmt::Display,
{
self.acknowledgments = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for acknowledgments: {e}")
});
self
}
pub fn aggregate_severity<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::AggregateSeverity>>,
T::Error: ::std::fmt::Display,
{
self.aggregate_severity = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for aggregate_severity: {e}"
)
});
self
}
pub fn category<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::DocumentCategory>,
T::Error: ::std::fmt::Display,
{
self.category = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for category: {e}")
});
self
}
pub fn csaf_version<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::CsafVersion>,
T::Error: ::std::fmt::Display,
{
self.csaf_version = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for csaf_version: {e}")
});
self
}
pub fn distribution<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::RulesForSharingDocument>,
>,
T::Error: ::std::fmt::Display,
{
self.distribution = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for distribution: {e}")
});
self
}
pub fn lang<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::LangT>>,
T::Error: ::std::fmt::Display,
{
self.lang = value
.try_into()
.map_err(|e| format!("error converting supplied value for lang: {e}"));
self
}
pub fn notes<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::NotesT>>,
T::Error: ::std::fmt::Display,
{
self.notes = value
.try_into()
.map_err(|e| format!("error converting supplied value for notes: {e}"));
self
}
pub fn publisher<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Publisher>,
T::Error: ::std::fmt::Display,
{
self.publisher = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for publisher: {e}")
});
self
}
pub fn references<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::ReferencesT>>,
T::Error: ::std::fmt::Display,
{
self.references = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for references: {e}")
});
self
}
pub fn source_lang<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::LangT>>,
T::Error: ::std::fmt::Display,
{
self.source_lang = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for source_lang: {e}")
});
self
}
pub fn title<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::TitleOfThisDocument>,
T::Error: ::std::fmt::Display,
{
self.title = value
.try_into()
.map_err(|e| format!("error converting supplied value for title: {e}"));
self
}
pub fn tracking<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Tracking>,
T::Error: ::std::fmt::Display,
{
self.tracking = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for tracking: {e}")
});
self
}
}
impl ::std::convert::TryFrom<DocumentLevelMetaData>
for super::DocumentLevelMetaData {
type Error = super::error::ConversionError;
fn try_from(
value: DocumentLevelMetaData,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
acknowledgments: value.acknowledgments?,
aggregate_severity: value.aggregate_severity?,
category: value.category?,
csaf_version: value.csaf_version?,
distribution: value.distribution?,
lang: value.lang?,
notes: value.notes?,
publisher: value.publisher?,
references: value.references?,
source_lang: value.source_lang?,
title: value.title?,
tracking: value.tracking?,
})
}
}
impl ::std::convert::From<super::DocumentLevelMetaData> for DocumentLevelMetaData {
fn from(value: super::DocumentLevelMetaData) -> Self {
Self {
acknowledgments: Ok(value.acknowledgments),
aggregate_severity: Ok(value.aggregate_severity),
category: Ok(value.category),
csaf_version: Ok(value.csaf_version),
distribution: Ok(value.distribution),
lang: Ok(value.lang),
notes: Ok(value.notes),
publisher: Ok(value.publisher),
references: Ok(value.references),
source_lang: Ok(value.source_lang),
title: Ok(value.title),
tracking: Ok(value.tracking),
}
}
}
#[derive(Clone, Debug)]
pub struct EngineOfDocumentGeneration {
name: ::std::result::Result<super::EngineName, ::std::string::String>,
version: ::std::result::Result<
::std::option::Option<super::EngineVersion>,
::std::string::String,
>,
}
impl ::std::default::Default for EngineOfDocumentGeneration {
fn default() -> Self {
Self {
name: Err("no value supplied for name".to_string()),
version: Ok(Default::default()),
}
}
}
impl EngineOfDocumentGeneration {
pub fn name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::EngineName>,
T::Error: ::std::fmt::Display,
{
self.name = value
.try_into()
.map_err(|e| format!("error converting supplied value for name: {e}"));
self
}
pub fn version<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::EngineVersion>>,
T::Error: ::std::fmt::Display,
{
self.version = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for version: {e}")
});
self
}
}
impl ::std::convert::TryFrom<EngineOfDocumentGeneration>
for super::EngineOfDocumentGeneration {
type Error = super::error::ConversionError;
fn try_from(
value: EngineOfDocumentGeneration,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
name: value.name?,
version: value.version?,
})
}
}
impl ::std::convert::From<super::EngineOfDocumentGeneration>
for EngineOfDocumentGeneration {
fn from(value: super::EngineOfDocumentGeneration) -> Self {
Self {
name: Ok(value.name),
version: Ok(value.version),
}
}
}
#[derive(Clone, Debug)]
pub struct FileHash {
algorithm: ::std::result::Result<
super::AlgorithmOfTheCryptographicHash,
::std::string::String,
>,
value: ::std::result::Result<
super::ValueOfTheCryptographicHash,
::std::string::String,
>,
}
impl ::std::default::Default for FileHash {
fn default() -> Self {
Self {
algorithm: Err("no value supplied for algorithm".to_string()),
value: Err("no value supplied for value".to_string()),
}
}
}
impl FileHash {
pub fn algorithm<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::AlgorithmOfTheCryptographicHash>,
T::Error: ::std::fmt::Display,
{
self.algorithm = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for algorithm: {e}")
});
self
}
pub fn value<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::ValueOfTheCryptographicHash>,
T::Error: ::std::fmt::Display,
{
self.value = value
.try_into()
.map_err(|e| format!("error converting supplied value for value: {e}"));
self
}
}
impl ::std::convert::TryFrom<FileHash> for super::FileHash {
type Error = super::error::ConversionError;
fn try_from(
value: FileHash,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
algorithm: value.algorithm?,
value: value.value?,
})
}
}
impl ::std::convert::From<super::FileHash> for FileHash {
fn from(value: super::FileHash) -> Self {
Self {
algorithm: Ok(value.algorithm),
value: Ok(value.value),
}
}
}
#[derive(Clone, Debug)]
pub struct Flag {
date: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
group_ids: ::std::result::Result<
::std::option::Option<super::ProductGroupsT>,
::std::string::String,
>,
label: ::std::result::Result<super::LabelOfTheFlag, ::std::string::String>,
product_ids: ::std::result::Result<
::std::option::Option<super::ProductsT>,
::std::string::String,
>,
}
impl ::std::default::Default for Flag {
fn default() -> Self {
Self {
date: Ok(Default::default()),
group_ids: Ok(Default::default()),
label: Err("no value supplied for label".to_string()),
product_ids: Ok(Default::default()),
}
}
}
impl Flag {
pub fn date<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.date = value
.try_into()
.map_err(|e| format!("error converting supplied value for date: {e}"));
self
}
pub fn group_ids<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::ProductGroupsT>>,
T::Error: ::std::fmt::Display,
{
self.group_ids = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for group_ids: {e}")
});
self
}
pub fn label<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::LabelOfTheFlag>,
T::Error: ::std::fmt::Display,
{
self.label = value
.try_into()
.map_err(|e| format!("error converting supplied value for label: {e}"));
self
}
pub fn product_ids<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::ProductsT>>,
T::Error: ::std::fmt::Display,
{
self.product_ids = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for product_ids: {e}")
});
self
}
}
impl ::std::convert::TryFrom<Flag> for super::Flag {
type Error = super::error::ConversionError;
fn try_from(
value: Flag,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
date: value.date?,
group_ids: value.group_ids?,
label: value.label?,
product_ids: value.product_ids?,
})
}
}
impl ::std::convert::From<super::Flag> for Flag {
fn from(value: super::Flag) -> Self {
Self {
date: Ok(value.date),
group_ids: Ok(value.group_ids),
label: Ok(value.label),
product_ids: Ok(value.product_ids),
}
}
}
#[derive(Clone, Debug)]
pub struct FullProductNameT {
name: ::std::result::Result<
super::TextualDescriptionOfTheProduct,
::std::string::String,
>,
product_id: ::std::result::Result<super::ProductIdT, ::std::string::String>,
product_identification_helper: ::std::result::Result<
::std::option::Option<super::HelperToIdentifyTheProduct>,
::std::string::String,
>,
}
impl ::std::default::Default for FullProductNameT {
fn default() -> Self {
Self {
name: Err("no value supplied for name".to_string()),
product_id: Err("no value supplied for product_id".to_string()),
product_identification_helper: Ok(Default::default()),
}
}
}
impl FullProductNameT {
pub fn name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::TextualDescriptionOfTheProduct>,
T::Error: ::std::fmt::Display,
{
self.name = value
.try_into()
.map_err(|e| format!("error converting supplied value for name: {e}"));
self
}
pub fn product_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::ProductIdT>,
T::Error: ::std::fmt::Display,
{
self.product_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for product_id: {e}")
});
self
}
pub fn product_identification_helper<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::HelperToIdentifyTheProduct>,
>,
T::Error: ::std::fmt::Display,
{
self.product_identification_helper = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for product_identification_helper: {e}"
)
});
self
}
}
impl ::std::convert::TryFrom<FullProductNameT> for super::FullProductNameT {
type Error = super::error::ConversionError;
fn try_from(
value: FullProductNameT,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
name: value.name?,
product_id: value.product_id?,
product_identification_helper: value.product_identification_helper?,
})
}
}
impl ::std::convert::From<super::FullProductNameT> for FullProductNameT {
fn from(value: super::FullProductNameT) -> Self {
Self {
name: Ok(value.name),
product_id: Ok(value.product_id),
product_identification_helper: Ok(value.product_identification_helper),
}
}
}
#[derive(Clone, Debug)]
pub struct GenericUri {
namespace: ::std::result::Result<::std::string::String, ::std::string::String>,
uri: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for GenericUri {
fn default() -> Self {
Self {
namespace: Err("no value supplied for namespace".to_string()),
uri: Err("no value supplied for uri".to_string()),
}
}
}
impl GenericUri {
pub fn namespace<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.namespace = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for namespace: {e}")
});
self
}
pub fn uri<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.uri = value
.try_into()
.map_err(|e| format!("error converting supplied value for uri: {e}"));
self
}
}
impl ::std::convert::TryFrom<GenericUri> for super::GenericUri {
type Error = super::error::ConversionError;
fn try_from(
value: GenericUri,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
namespace: value.namespace?,
uri: value.uri?,
})
}
}
impl ::std::convert::From<super::GenericUri> for GenericUri {
fn from(value: super::GenericUri) -> Self {
Self {
namespace: Ok(value.namespace),
uri: Ok(value.uri),
}
}
}
#[derive(Clone, Debug)]
pub struct HelperToIdentifyTheProduct {
cpe: ::std::result::Result<
::std::option::Option<super::CommonPlatformEnumerationRepresentation>,
::std::string::String,
>,
hashes: ::std::result::Result<
::std::vec::Vec<super::CryptographicHashes>,
::std::string::String,
>,
model_numbers: ::std::result::Result<
::std::option::Option<Vec<super::ModelNumber>>,
::std::string::String,
>,
purl: ::std::result::Result<
::std::option::Option<super::PackageUrlRepresentation>,
::std::string::String,
>,
sbom_urls: ::std::result::Result<
::std::vec::Vec<::std::string::String>,
::std::string::String,
>,
serial_numbers: ::std::result::Result<
::std::option::Option<Vec<super::SerialNumber>>,
::std::string::String,
>,
skus: ::std::result::Result<
::std::vec::Vec<super::StockKeepingUnit>,
::std::string::String,
>,
x_generic_uris: ::std::result::Result<
::std::vec::Vec<super::GenericUri>,
::std::string::String,
>,
}
impl ::std::default::Default for HelperToIdentifyTheProduct {
fn default() -> Self {
Self {
cpe: Ok(Default::default()),
hashes: Ok(Default::default()),
model_numbers: Ok(Default::default()),
purl: Ok(Default::default()),
sbom_urls: Ok(Default::default()),
serial_numbers: Ok(Default::default()),
skus: Ok(Default::default()),
x_generic_uris: Ok(Default::default()),
}
}
}
impl HelperToIdentifyTheProduct {
pub fn cpe<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::CommonPlatformEnumerationRepresentation>,
>,
T::Error: ::std::fmt::Display,
{
self.cpe = value
.try_into()
.map_err(|e| format!("error converting supplied value for cpe: {e}"));
self
}
pub fn hashes<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::CryptographicHashes>>,
T::Error: ::std::fmt::Display,
{
self.hashes = value
.try_into()
.map_err(|e| format!("error converting supplied value for hashes: {e}"));
self
}
pub fn model_numbers<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<Vec<super::ModelNumber>>>,
T::Error: ::std::fmt::Display,
{
self.model_numbers = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for model_numbers: {e}")
});
self
}
pub fn purl<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::PackageUrlRepresentation>,
>,
T::Error: ::std::fmt::Display,
{
self.purl = value
.try_into()
.map_err(|e| format!("error converting supplied value for purl: {e}"));
self
}
pub fn sbom_urls<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.sbom_urls = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for sbom_urls: {e}")
});
self
}
pub fn serial_numbers<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<Vec<super::SerialNumber>>>,
T::Error: ::std::fmt::Display,
{
self.serial_numbers = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for serial_numbers: {e}")
});
self
}
pub fn skus<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::StockKeepingUnit>>,
T::Error: ::std::fmt::Display,
{
self.skus = value
.try_into()
.map_err(|e| format!("error converting supplied value for skus: {e}"));
self
}
pub fn x_generic_uris<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::GenericUri>>,
T::Error: ::std::fmt::Display,
{
self.x_generic_uris = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for x_generic_uris: {e}")
});
self
}
}
impl ::std::convert::TryFrom<HelperToIdentifyTheProduct>
for super::HelperToIdentifyTheProduct {
type Error = super::error::ConversionError;
fn try_from(
value: HelperToIdentifyTheProduct,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
cpe: value.cpe?,
hashes: value.hashes?,
model_numbers: value.model_numbers?,
purl: value.purl?,
sbom_urls: value.sbom_urls?,
serial_numbers: value.serial_numbers?,
skus: value.skus?,
x_generic_uris: value.x_generic_uris?,
})
}
}
impl ::std::convert::From<super::HelperToIdentifyTheProduct>
for HelperToIdentifyTheProduct {
fn from(value: super::HelperToIdentifyTheProduct) -> Self {
Self {
cpe: Ok(value.cpe),
hashes: Ok(value.hashes),
model_numbers: Ok(value.model_numbers),
purl: Ok(value.purl),
sbom_urls: Ok(value.sbom_urls),
serial_numbers: Ok(value.serial_numbers),
skus: Ok(value.skus),
x_generic_uris: Ok(value.x_generic_uris),
}
}
}
#[derive(Clone, Debug)]
pub struct Id {
system_name: ::std::result::Result<super::SystemName, ::std::string::String>,
text: ::std::result::Result<super::Text, ::std::string::String>,
}
impl ::std::default::Default for Id {
fn default() -> Self {
Self {
system_name: Err("no value supplied for system_name".to_string()),
text: Err("no value supplied for text".to_string()),
}
}
}
impl Id {
pub fn system_name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::SystemName>,
T::Error: ::std::fmt::Display,
{
self.system_name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for system_name: {e}")
});
self
}
pub fn text<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Text>,
T::Error: ::std::fmt::Display,
{
self.text = value
.try_into()
.map_err(|e| format!("error converting supplied value for text: {e}"));
self
}
}
impl ::std::convert::TryFrom<Id> for super::Id {
type Error = super::error::ConversionError;
fn try_from(
value: Id,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
system_name: value.system_name?,
text: value.text?,
})
}
}
impl ::std::convert::From<super::Id> for Id {
fn from(value: super::Id) -> Self {
Self {
system_name: Ok(value.system_name),
text: Ok(value.text),
}
}
}
#[derive(Clone, Debug)]
pub struct Involvement {
date: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
party: ::std::result::Result<super::PartyCategory, ::std::string::String>,
status: ::std::result::Result<super::PartyStatus, ::std::string::String>,
summary: ::std::result::Result<
::std::option::Option<super::SummaryOfTheInvolvement>,
::std::string::String,
>,
}
impl ::std::default::Default for Involvement {
fn default() -> Self {
Self {
date: Ok(Default::default()),
party: Err("no value supplied for party".to_string()),
status: Err("no value supplied for status".to_string()),
summary: Ok(Default::default()),
}
}
}
impl Involvement {
pub fn date<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.date = value
.try_into()
.map_err(|e| format!("error converting supplied value for date: {e}"));
self
}
pub fn party<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::PartyCategory>,
T::Error: ::std::fmt::Display,
{
self.party = value
.try_into()
.map_err(|e| format!("error converting supplied value for party: {e}"));
self
}
pub fn status<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::PartyStatus>,
T::Error: ::std::fmt::Display,
{
self.status = value
.try_into()
.map_err(|e| format!("error converting supplied value for status: {e}"));
self
}
pub fn summary<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::SummaryOfTheInvolvement>,
>,
T::Error: ::std::fmt::Display,
{
self.summary = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for summary: {e}")
});
self
}
}
impl ::std::convert::TryFrom<Involvement> for super::Involvement {
type Error = super::error::ConversionError;
fn try_from(
value: Involvement,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
date: value.date?,
party: value.party?,
status: value.status?,
summary: value.summary?,
})
}
}
impl ::std::convert::From<super::Involvement> for Involvement {
fn from(value: super::Involvement) -> Self {
Self {
date: Ok(value.date),
party: Ok(value.party),
status: Ok(value.status),
summary: Ok(value.summary),
}
}
}
#[derive(Clone, Debug)]
pub struct Note {
audience: ::std::result::Result<
::std::option::Option<super::AudienceOfNote>,
::std::string::String,
>,
category: ::std::result::Result<super::NoteCategory, ::std::string::String>,
text: ::std::result::Result<super::NoteContent, ::std::string::String>,
title: ::std::result::Result<
::std::option::Option<super::TitleOfNote>,
::std::string::String,
>,
}
impl ::std::default::Default for Note {
fn default() -> Self {
Self {
audience: Ok(Default::default()),
category: Err("no value supplied for category".to_string()),
text: Err("no value supplied for text".to_string()),
title: Ok(Default::default()),
}
}
}
impl Note {
pub fn audience<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::AudienceOfNote>>,
T::Error: ::std::fmt::Display,
{
self.audience = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for audience: {e}")
});
self
}
pub fn category<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::NoteCategory>,
T::Error: ::std::fmt::Display,
{
self.category = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for category: {e}")
});
self
}
pub fn text<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::NoteContent>,
T::Error: ::std::fmt::Display,
{
self.text = value
.try_into()
.map_err(|e| format!("error converting supplied value for text: {e}"));
self
}
pub fn title<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::TitleOfNote>>,
T::Error: ::std::fmt::Display,
{
self.title = value
.try_into()
.map_err(|e| format!("error converting supplied value for title: {e}"));
self
}
}
impl ::std::convert::TryFrom<Note> for super::Note {
type Error = super::error::ConversionError;
fn try_from(
value: Note,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
audience: value.audience?,
category: value.category?,
text: value.text?,
title: value.title?,
})
}
}
impl ::std::convert::From<super::Note> for Note {
fn from(value: super::Note) -> Self {
Self {
audience: Ok(value.audience),
category: Ok(value.category),
text: Ok(value.text),
title: Ok(value.title),
}
}
}
#[derive(Clone, Debug)]
pub struct ProductGroup {
group_id: ::std::result::Result<super::ProductGroupIdT, ::std::string::String>,
product_ids: ::std::result::Result<
Vec<super::ProductIdT>,
::std::string::String,
>,
summary: ::std::result::Result<
::std::option::Option<super::SummaryOfTheProductGroup>,
::std::string::String,
>,
}
impl ::std::default::Default for ProductGroup {
fn default() -> Self {
Self {
group_id: Err("no value supplied for group_id".to_string()),
product_ids: Err("no value supplied for product_ids".to_string()),
summary: Ok(Default::default()),
}
}
}
impl ProductGroup {
pub fn group_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::ProductGroupIdT>,
T::Error: ::std::fmt::Display,
{
self.group_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for group_id: {e}")
});
self
}
pub fn product_ids<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<Vec<super::ProductIdT>>,
T::Error: ::std::fmt::Display,
{
self.product_ids = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for product_ids: {e}")
});
self
}
pub fn summary<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::SummaryOfTheProductGroup>,
>,
T::Error: ::std::fmt::Display,
{
self.summary = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for summary: {e}")
});
self
}
}
impl ::std::convert::TryFrom<ProductGroup> for super::ProductGroup {
type Error = super::error::ConversionError;
fn try_from(
value: ProductGroup,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
group_id: value.group_id?,
product_ids: value.product_ids?,
summary: value.summary?,
})
}
}
impl ::std::convert::From<super::ProductGroup> for ProductGroup {
fn from(value: super::ProductGroup) -> Self {
Self {
group_id: Ok(value.group_id),
product_ids: Ok(value.product_ids),
summary: Ok(value.summary),
}
}
}
#[derive(Clone, Debug)]
pub struct ProductStatus {
first_affected: ::std::result::Result<
::std::option::Option<super::ProductsT>,
::std::string::String,
>,
first_fixed: ::std::result::Result<
::std::option::Option<super::ProductsT>,
::std::string::String,
>,
fixed: ::std::result::Result<
::std::option::Option<super::ProductsT>,
::std::string::String,
>,
known_affected: ::std::result::Result<
::std::option::Option<super::ProductsT>,
::std::string::String,
>,
known_not_affected: ::std::result::Result<
::std::option::Option<super::ProductsT>,
::std::string::String,
>,
last_affected: ::std::result::Result<
::std::option::Option<super::ProductsT>,
::std::string::String,
>,
recommended: ::std::result::Result<
::std::option::Option<super::ProductsT>,
::std::string::String,
>,
under_investigation: ::std::result::Result<
::std::option::Option<super::ProductsT>,
::std::string::String,
>,
}
impl ::std::default::Default for ProductStatus {
fn default() -> Self {
Self {
first_affected: Ok(Default::default()),
first_fixed: Ok(Default::default()),
fixed: Ok(Default::default()),
known_affected: Ok(Default::default()),
known_not_affected: Ok(Default::default()),
last_affected: Ok(Default::default()),
recommended: Ok(Default::default()),
under_investigation: Ok(Default::default()),
}
}
}
impl ProductStatus {
pub fn first_affected<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::ProductsT>>,
T::Error: ::std::fmt::Display,
{
self.first_affected = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for first_affected: {e}")
});
self
}
pub fn first_fixed<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::ProductsT>>,
T::Error: ::std::fmt::Display,
{
self.first_fixed = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for first_fixed: {e}")
});
self
}
pub fn fixed<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::ProductsT>>,
T::Error: ::std::fmt::Display,
{
self.fixed = value
.try_into()
.map_err(|e| format!("error converting supplied value for fixed: {e}"));
self
}
pub fn known_affected<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::ProductsT>>,
T::Error: ::std::fmt::Display,
{
self.known_affected = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for known_affected: {e}")
});
self
}
pub fn known_not_affected<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::ProductsT>>,
T::Error: ::std::fmt::Display,
{
self.known_not_affected = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for known_not_affected: {e}"
)
});
self
}
pub fn last_affected<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::ProductsT>>,
T::Error: ::std::fmt::Display,
{
self.last_affected = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for last_affected: {e}")
});
self
}
pub fn recommended<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::ProductsT>>,
T::Error: ::std::fmt::Display,
{
self.recommended = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for recommended: {e}")
});
self
}
pub fn under_investigation<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::ProductsT>>,
T::Error: ::std::fmt::Display,
{
self.under_investigation = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for under_investigation: {e}"
)
});
self
}
}
impl ::std::convert::TryFrom<ProductStatus> for super::ProductStatus {
type Error = super::error::ConversionError;
fn try_from(
value: ProductStatus,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
first_affected: value.first_affected?,
first_fixed: value.first_fixed?,
fixed: value.fixed?,
known_affected: value.known_affected?,
known_not_affected: value.known_not_affected?,
last_affected: value.last_affected?,
recommended: value.recommended?,
under_investigation: value.under_investigation?,
})
}
}
impl ::std::convert::From<super::ProductStatus> for ProductStatus {
fn from(value: super::ProductStatus) -> Self {
Self {
first_affected: Ok(value.first_affected),
first_fixed: Ok(value.first_fixed),
fixed: Ok(value.fixed),
known_affected: Ok(value.known_affected),
known_not_affected: Ok(value.known_not_affected),
last_affected: Ok(value.last_affected),
recommended: Ok(value.recommended),
under_investigation: Ok(value.under_investigation),
}
}
}
#[derive(Clone, Debug)]
pub struct ProductTree {
branches: ::std::result::Result<
::std::option::Option<super::BranchesT>,
::std::string::String,
>,
full_product_names: ::std::result::Result<
::std::vec::Vec<super::FullProductNameT>,
::std::string::String,
>,
product_groups: ::std::result::Result<
::std::vec::Vec<super::ProductGroup>,
::std::string::String,
>,
relationships: ::std::result::Result<
::std::vec::Vec<super::Relationship>,
::std::string::String,
>,
}
impl ::std::default::Default for ProductTree {
fn default() -> Self {
Self {
branches: Ok(Default::default()),
full_product_names: Ok(Default::default()),
product_groups: Ok(Default::default()),
relationships: Ok(Default::default()),
}
}
}
impl ProductTree {
pub fn branches<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::BranchesT>>,
T::Error: ::std::fmt::Display,
{
self.branches = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for branches: {e}")
});
self
}
pub fn full_product_names<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::FullProductNameT>>,
T::Error: ::std::fmt::Display,
{
self.full_product_names = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for full_product_names: {e}"
)
});
self
}
pub fn product_groups<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::ProductGroup>>,
T::Error: ::std::fmt::Display,
{
self.product_groups = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for product_groups: {e}")
});
self
}
pub fn relationships<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::Relationship>>,
T::Error: ::std::fmt::Display,
{
self.relationships = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for relationships: {e}")
});
self
}
}
impl ::std::convert::TryFrom<ProductTree> for super::ProductTree {
type Error = super::error::ConversionError;
fn try_from(
value: ProductTree,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
branches: value.branches?,
full_product_names: value.full_product_names?,
product_groups: value.product_groups?,
relationships: value.relationships?,
})
}
}
impl ::std::convert::From<super::ProductTree> for ProductTree {
fn from(value: super::ProductTree) -> Self {
Self {
branches: Ok(value.branches),
full_product_names: Ok(value.full_product_names),
product_groups: Ok(value.product_groups),
relationships: Ok(value.relationships),
}
}
}
#[derive(Clone, Debug)]
pub struct Publisher {
category: ::std::result::Result<
super::CategoryOfPublisher,
::std::string::String,
>,
contact_details: ::std::result::Result<
::std::option::Option<super::ContactDetails>,
::std::string::String,
>,
issuing_authority: ::std::result::Result<
::std::option::Option<super::IssuingAuthority>,
::std::string::String,
>,
name: ::std::result::Result<super::NameOfPublisher, ::std::string::String>,
namespace: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for Publisher {
fn default() -> Self {
Self {
category: Err("no value supplied for category".to_string()),
contact_details: Ok(Default::default()),
issuing_authority: Ok(Default::default()),
name: Err("no value supplied for name".to_string()),
namespace: Err("no value supplied for namespace".to_string()),
}
}
}
impl Publisher {
pub fn category<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::CategoryOfPublisher>,
T::Error: ::std::fmt::Display,
{
self.category = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for category: {e}")
});
self
}
pub fn contact_details<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::ContactDetails>>,
T::Error: ::std::fmt::Display,
{
self.contact_details = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for contact_details: {e}")
});
self
}
pub fn issuing_authority<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::IssuingAuthority>>,
T::Error: ::std::fmt::Display,
{
self.issuing_authority = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for issuing_authority: {e}")
});
self
}
pub fn name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::NameOfPublisher>,
T::Error: ::std::fmt::Display,
{
self.name = value
.try_into()
.map_err(|e| format!("error converting supplied value for name: {e}"));
self
}
pub fn namespace<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.namespace = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for namespace: {e}")
});
self
}
}
impl ::std::convert::TryFrom<Publisher> for super::Publisher {
type Error = super::error::ConversionError;
fn try_from(
value: Publisher,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
category: value.category?,
contact_details: value.contact_details?,
issuing_authority: value.issuing_authority?,
name: value.name?,
namespace: value.namespace?,
})
}
}
impl ::std::convert::From<super::Publisher> for Publisher {
fn from(value: super::Publisher) -> Self {
Self {
category: Ok(value.category),
contact_details: Ok(value.contact_details),
issuing_authority: Ok(value.issuing_authority),
name: Ok(value.name),
namespace: Ok(value.namespace),
}
}
}
#[derive(Clone, Debug)]
pub struct Reference {
category: ::std::result::Result<
super::CategoryOfReference,
::std::string::String,
>,
summary: ::std::result::Result<
super::SummaryOfTheReference,
::std::string::String,
>,
url: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for Reference {
fn default() -> Self {
Self {
category: Ok(super::defaults::reference_category()),
summary: Err("no value supplied for summary".to_string()),
url: Err("no value supplied for url".to_string()),
}
}
}
impl Reference {
pub fn category<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::CategoryOfReference>,
T::Error: ::std::fmt::Display,
{
self.category = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for category: {e}")
});
self
}
pub fn summary<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::SummaryOfTheReference>,
T::Error: ::std::fmt::Display,
{
self.summary = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for summary: {e}")
});
self
}
pub fn url<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.url = value
.try_into()
.map_err(|e| format!("error converting supplied value for url: {e}"));
self
}
}
impl ::std::convert::TryFrom<Reference> for super::Reference {
type Error = super::error::ConversionError;
fn try_from(
value: Reference,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
category: value.category?,
summary: value.summary?,
url: value.url?,
})
}
}
impl ::std::convert::From<super::Reference> for Reference {
fn from(value: super::Reference) -> Self {
Self {
category: Ok(value.category),
summary: Ok(value.summary),
url: Ok(value.url),
}
}
}
#[derive(Clone, Debug)]
pub struct Relationship {
category: ::std::result::Result<
super::RelationshipCategory,
::std::string::String,
>,
full_product_name: ::std::result::Result<
super::FullProductNameT,
::std::string::String,
>,
product_reference: ::std::result::Result<
super::ProductIdT,
::std::string::String,
>,
relates_to_product_reference: ::std::result::Result<
super::ProductIdT,
::std::string::String,
>,
}
impl ::std::default::Default for Relationship {
fn default() -> Self {
Self {
category: Err("no value supplied for category".to_string()),
full_product_name: Err(
"no value supplied for full_product_name".to_string(),
),
product_reference: Err(
"no value supplied for product_reference".to_string(),
),
relates_to_product_reference: Err(
"no value supplied for relates_to_product_reference".to_string(),
),
}
}
}
impl Relationship {
pub fn category<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::RelationshipCategory>,
T::Error: ::std::fmt::Display,
{
self.category = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for category: {e}")
});
self
}
pub fn full_product_name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::FullProductNameT>,
T::Error: ::std::fmt::Display,
{
self.full_product_name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for full_product_name: {e}")
});
self
}
pub fn product_reference<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::ProductIdT>,
T::Error: ::std::fmt::Display,
{
self.product_reference = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for product_reference: {e}")
});
self
}
pub fn relates_to_product_reference<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::ProductIdT>,
T::Error: ::std::fmt::Display,
{
self.relates_to_product_reference = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for relates_to_product_reference: {e}"
)
});
self
}
}
impl ::std::convert::TryFrom<Relationship> for super::Relationship {
type Error = super::error::ConversionError;
fn try_from(
value: Relationship,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
category: value.category?,
full_product_name: value.full_product_name?,
product_reference: value.product_reference?,
relates_to_product_reference: value.relates_to_product_reference?,
})
}
}
impl ::std::convert::From<super::Relationship> for Relationship {
fn from(value: super::Relationship) -> Self {
Self {
category: Ok(value.category),
full_product_name: Ok(value.full_product_name),
product_reference: Ok(value.product_reference),
relates_to_product_reference: Ok(value.relates_to_product_reference),
}
}
}
#[derive(Clone, Debug)]
pub struct Remediation {
category: ::std::result::Result<
super::CategoryOfTheRemediation,
::std::string::String,
>,
date: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
details: ::std::result::Result<
super::DetailsOfTheRemediation,
::std::string::String,
>,
entitlements: ::std::result::Result<
::std::vec::Vec<super::EntitlementOfTheRemediation>,
::std::string::String,
>,
group_ids: ::std::result::Result<
::std::option::Option<super::ProductGroupsT>,
::std::string::String,
>,
product_ids: ::std::result::Result<
::std::option::Option<super::ProductsT>,
::std::string::String,
>,
restart_required: ::std::result::Result<
::std::option::Option<super::RestartRequiredByRemediation>,
::std::string::String,
>,
url: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
}
impl ::std::default::Default for Remediation {
fn default() -> Self {
Self {
category: Err("no value supplied for category".to_string()),
date: Ok(Default::default()),
details: Err("no value supplied for details".to_string()),
entitlements: Ok(Default::default()),
group_ids: Ok(Default::default()),
product_ids: Ok(Default::default()),
restart_required: Ok(Default::default()),
url: Ok(Default::default()),
}
}
}
impl Remediation {
pub fn category<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::CategoryOfTheRemediation>,
T::Error: ::std::fmt::Display,
{
self.category = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for category: {e}")
});
self
}
pub fn date<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.date = value
.try_into()
.map_err(|e| format!("error converting supplied value for date: {e}"));
self
}
pub fn details<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::DetailsOfTheRemediation>,
T::Error: ::std::fmt::Display,
{
self.details = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for details: {e}")
});
self
}
pub fn entitlements<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::vec::Vec<super::EntitlementOfTheRemediation>,
>,
T::Error: ::std::fmt::Display,
{
self.entitlements = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for entitlements: {e}")
});
self
}
pub fn group_ids<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::ProductGroupsT>>,
T::Error: ::std::fmt::Display,
{
self.group_ids = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for group_ids: {e}")
});
self
}
pub fn product_ids<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::ProductsT>>,
T::Error: ::std::fmt::Display,
{
self.product_ids = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for product_ids: {e}")
});
self
}
pub fn restart_required<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::RestartRequiredByRemediation>,
>,
T::Error: ::std::fmt::Display,
{
self.restart_required = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for restart_required: {e}")
});
self
}
pub fn url<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.url = value
.try_into()
.map_err(|e| format!("error converting supplied value for url: {e}"));
self
}
}
impl ::std::convert::TryFrom<Remediation> for super::Remediation {
type Error = super::error::ConversionError;
fn try_from(
value: Remediation,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
category: value.category?,
date: value.date?,
details: value.details?,
entitlements: value.entitlements?,
group_ids: value.group_ids?,
product_ids: value.product_ids?,
restart_required: value.restart_required?,
url: value.url?,
})
}
}
impl ::std::convert::From<super::Remediation> for Remediation {
fn from(value: super::Remediation) -> Self {
Self {
category: Ok(value.category),
date: Ok(value.date),
details: Ok(value.details),
entitlements: Ok(value.entitlements),
group_ids: Ok(value.group_ids),
product_ids: Ok(value.product_ids),
restart_required: Ok(value.restart_required),
url: Ok(value.url),
}
}
}
#[derive(Clone, Debug)]
pub struct RestartRequiredByRemediation {
category: ::std::result::Result<super::CategoryOfRestart, ::std::string::String>,
details: ::std::result::Result<
::std::option::Option<super::AdditionalRestartInformation>,
::std::string::String,
>,
}
impl ::std::default::Default for RestartRequiredByRemediation {
fn default() -> Self {
Self {
category: Err("no value supplied for category".to_string()),
details: Ok(Default::default()),
}
}
}
impl RestartRequiredByRemediation {
pub fn category<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::CategoryOfRestart>,
T::Error: ::std::fmt::Display,
{
self.category = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for category: {e}")
});
self
}
pub fn details<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::AdditionalRestartInformation>,
>,
T::Error: ::std::fmt::Display,
{
self.details = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for details: {e}")
});
self
}
}
impl ::std::convert::TryFrom<RestartRequiredByRemediation>
for super::RestartRequiredByRemediation {
type Error = super::error::ConversionError;
fn try_from(
value: RestartRequiredByRemediation,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
category: value.category?,
details: value.details?,
})
}
}
impl ::std::convert::From<super::RestartRequiredByRemediation>
for RestartRequiredByRemediation {
fn from(value: super::RestartRequiredByRemediation) -> Self {
Self {
category: Ok(value.category),
details: Ok(value.details),
}
}
}
#[derive(Clone, Debug)]
pub struct Revision {
date: ::std::result::Result<::std::string::String, ::std::string::String>,
legacy_version: ::std::result::Result<
::std::option::Option<super::LegacyVersionOfTheRevision>,
::std::string::String,
>,
number: ::std::result::Result<super::VersionT, ::std::string::String>,
summary: ::std::result::Result<
super::SummaryOfTheRevision,
::std::string::String,
>,
}
impl ::std::default::Default for Revision {
fn default() -> Self {
Self {
date: Err("no value supplied for date".to_string()),
legacy_version: Ok(Default::default()),
number: Err("no value supplied for number".to_string()),
summary: Err("no value supplied for summary".to_string()),
}
}
}
impl Revision {
pub fn date<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.date = value
.try_into()
.map_err(|e| format!("error converting supplied value for date: {e}"));
self
}
pub fn legacy_version<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::LegacyVersionOfTheRevision>,
>,
T::Error: ::std::fmt::Display,
{
self.legacy_version = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for legacy_version: {e}")
});
self
}
pub fn number<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::VersionT>,
T::Error: ::std::fmt::Display,
{
self.number = value
.try_into()
.map_err(|e| format!("error converting supplied value for number: {e}"));
self
}
pub fn summary<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::SummaryOfTheRevision>,
T::Error: ::std::fmt::Display,
{
self.summary = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for summary: {e}")
});
self
}
}
impl ::std::convert::TryFrom<Revision> for super::Revision {
type Error = super::error::ConversionError;
fn try_from(
value: Revision,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
date: value.date?,
legacy_version: value.legacy_version?,
number: value.number?,
summary: value.summary?,
})
}
}
impl ::std::convert::From<super::Revision> for Revision {
fn from(value: super::Revision) -> Self {
Self {
date: Ok(value.date),
legacy_version: Ok(value.legacy_version),
number: Ok(value.number),
summary: Ok(value.summary),
}
}
}
#[derive(Clone, Debug)]
pub struct RulesForSharingDocument {
text: ::std::result::Result<
::std::option::Option<super::TextualDescription>,
::std::string::String,
>,
tlp: ::std::result::Result<
::std::option::Option<super::TrafficLightProtocolTlp>,
::std::string::String,
>,
}
impl ::std::default::Default for RulesForSharingDocument {
fn default() -> Self {
Self {
text: Ok(Default::default()),
tlp: Ok(Default::default()),
}
}
}
impl RulesForSharingDocument {
pub fn text<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::TextualDescription>>,
T::Error: ::std::fmt::Display,
{
self.text = value
.try_into()
.map_err(|e| format!("error converting supplied value for text: {e}"));
self
}
pub fn tlp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::TrafficLightProtocolTlp>,
>,
T::Error: ::std::fmt::Display,
{
self.tlp = value
.try_into()
.map_err(|e| format!("error converting supplied value for tlp: {e}"));
self
}
}
impl ::std::convert::TryFrom<RulesForSharingDocument>
for super::RulesForSharingDocument {
type Error = super::error::ConversionError;
fn try_from(
value: RulesForSharingDocument,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
text: value.text?,
tlp: value.tlp?,
})
}
}
impl ::std::convert::From<super::RulesForSharingDocument>
for RulesForSharingDocument {
fn from(value: super::RulesForSharingDocument) -> Self {
Self {
text: Ok(value.text),
tlp: Ok(value.tlp),
}
}
}
#[derive(Clone, Debug)]
pub struct Score {
cvss_v2: ::std::result::Result<
::serde_json::Map<::std::string::String, ::serde_json::Value>,
::std::string::String,
>,
cvss_v3: ::std::result::Result<
::serde_json::Map<::std::string::String, ::serde_json::Value>,
::std::string::String,
>,
products: ::std::result::Result<super::ProductsT, ::std::string::String>,
}
impl ::std::default::Default for Score {
fn default() -> Self {
Self {
cvss_v2: Ok(Default::default()),
cvss_v3: Ok(Default::default()),
products: Err("no value supplied for products".to_string()),
}
}
}
impl Score {
pub fn cvss_v2<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::serde_json::Map<::std::string::String, ::serde_json::Value>,
>,
T::Error: ::std::fmt::Display,
{
self.cvss_v2 = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for cvss_v2: {e}")
});
self
}
pub fn cvss_v3<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::serde_json::Map<::std::string::String, ::serde_json::Value>,
>,
T::Error: ::std::fmt::Display,
{
self.cvss_v3 = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for cvss_v3: {e}")
});
self
}
pub fn products<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::ProductsT>,
T::Error: ::std::fmt::Display,
{
self.products = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for products: {e}")
});
self
}
}
impl ::std::convert::TryFrom<Score> for super::Score {
type Error = super::error::ConversionError;
fn try_from(
value: Score,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
cvss_v2: value.cvss_v2?,
cvss_v3: value.cvss_v3?,
products: value.products?,
})
}
}
impl ::std::convert::From<super::Score> for Score {
fn from(value: super::Score) -> Self {
Self {
cvss_v2: Ok(value.cvss_v2),
cvss_v3: Ok(value.cvss_v3),
products: Ok(value.products),
}
}
}
#[derive(Clone, Debug)]
pub struct Threat {
category: ::std::result::Result<
super::CategoryOfTheThreat,
::std::string::String,
>,
date: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
details: ::std::result::Result<super::DetailsOfTheThreat, ::std::string::String>,
group_ids: ::std::result::Result<
::std::option::Option<super::ProductGroupsT>,
::std::string::String,
>,
product_ids: ::std::result::Result<
::std::option::Option<super::ProductsT>,
::std::string::String,
>,
}
impl ::std::default::Default for Threat {
fn default() -> Self {
Self {
category: Err("no value supplied for category".to_string()),
date: Ok(Default::default()),
details: Err("no value supplied for details".to_string()),
group_ids: Ok(Default::default()),
product_ids: Ok(Default::default()),
}
}
}
impl Threat {
pub fn category<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::CategoryOfTheThreat>,
T::Error: ::std::fmt::Display,
{
self.category = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for category: {e}")
});
self
}
pub fn date<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.date = value
.try_into()
.map_err(|e| format!("error converting supplied value for date: {e}"));
self
}
pub fn details<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::DetailsOfTheThreat>,
T::Error: ::std::fmt::Display,
{
self.details = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for details: {e}")
});
self
}
pub fn group_ids<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::ProductGroupsT>>,
T::Error: ::std::fmt::Display,
{
self.group_ids = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for group_ids: {e}")
});
self
}
pub fn product_ids<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::ProductsT>>,
T::Error: ::std::fmt::Display,
{
self.product_ids = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for product_ids: {e}")
});
self
}
}
impl ::std::convert::TryFrom<Threat> for super::Threat {
type Error = super::error::ConversionError;
fn try_from(
value: Threat,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
category: value.category?,
date: value.date?,
details: value.details?,
group_ids: value.group_ids?,
product_ids: value.product_ids?,
})
}
}
impl ::std::convert::From<super::Threat> for Threat {
fn from(value: super::Threat) -> Self {
Self {
category: Ok(value.category),
date: Ok(value.date),
details: Ok(value.details),
group_ids: Ok(value.group_ids),
product_ids: Ok(value.product_ids),
}
}
}
#[derive(Clone, Debug)]
pub struct Tracking {
aliases: ::std::result::Result<
::std::option::Option<Vec<super::AlternateName>>,
::std::string::String,
>,
current_release_date: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
generator: ::std::result::Result<
::std::option::Option<super::DocumentGenerator>,
::std::string::String,
>,
id: ::std::result::Result<
super::UniqueIdentifierForTheDocument,
::std::string::String,
>,
initial_release_date: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
revision_history: ::std::result::Result<
::std::vec::Vec<super::Revision>,
::std::string::String,
>,
status: ::std::result::Result<super::DocumentStatus, ::std::string::String>,
version: ::std::result::Result<super::VersionT, ::std::string::String>,
}
impl ::std::default::Default for Tracking {
fn default() -> Self {
Self {
aliases: Ok(Default::default()),
current_release_date: Err(
"no value supplied for current_release_date".to_string(),
),
generator: Ok(Default::default()),
id: Err("no value supplied for id".to_string()),
initial_release_date: Err(
"no value supplied for initial_release_date".to_string(),
),
revision_history: Err(
"no value supplied for revision_history".to_string(),
),
status: Err("no value supplied for status".to_string()),
version: Err("no value supplied for version".to_string()),
}
}
}
impl Tracking {
pub fn aliases<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<Vec<super::AlternateName>>>,
T::Error: ::std::fmt::Display,
{
self.aliases = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for aliases: {e}")
});
self
}
pub fn current_release_date<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.current_release_date = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for current_release_date: {e}"
)
});
self
}
pub fn generator<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::DocumentGenerator>>,
T::Error: ::std::fmt::Display,
{
self.generator = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for generator: {e}")
});
self
}
pub fn id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::UniqueIdentifierForTheDocument>,
T::Error: ::std::fmt::Display,
{
self.id = value
.try_into()
.map_err(|e| format!("error converting supplied value for id: {e}"));
self
}
pub fn initial_release_date<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.initial_release_date = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for initial_release_date: {e}"
)
});
self
}
pub fn revision_history<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::Revision>>,
T::Error: ::std::fmt::Display,
{
self.revision_history = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for revision_history: {e}")
});
self
}
pub fn status<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::DocumentStatus>,
T::Error: ::std::fmt::Display,
{
self.status = value
.try_into()
.map_err(|e| format!("error converting supplied value for status: {e}"));
self
}
pub fn version<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::VersionT>,
T::Error: ::std::fmt::Display,
{
self.version = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for version: {e}")
});
self
}
}
impl ::std::convert::TryFrom<Tracking> for super::Tracking {
type Error = super::error::ConversionError;
fn try_from(
value: Tracking,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
aliases: value.aliases?,
current_release_date: value.current_release_date?,
generator: value.generator?,
id: value.id?,
initial_release_date: value.initial_release_date?,
revision_history: value.revision_history?,
status: value.status?,
version: value.version?,
})
}
}
impl ::std::convert::From<super::Tracking> for Tracking {
fn from(value: super::Tracking) -> Self {
Self {
aliases: Ok(value.aliases),
current_release_date: Ok(value.current_release_date),
generator: Ok(value.generator),
id: Ok(value.id),
initial_release_date: Ok(value.initial_release_date),
revision_history: Ok(value.revision_history),
status: Ok(value.status),
version: Ok(value.version),
}
}
}
#[derive(Clone, Debug)]
pub struct TrafficLightProtocolTlp {
label: ::std::result::Result<super::LabelOfTlp, ::std::string::String>,
url: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for TrafficLightProtocolTlp {
fn default() -> Self {
Self {
label: Err("no value supplied for label".to_string()),
url: Ok(super::defaults::traffic_light_protocol_tlp_url()),
}
}
}
impl TrafficLightProtocolTlp {
pub fn label<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::LabelOfTlp>,
T::Error: ::std::fmt::Display,
{
self.label = value
.try_into()
.map_err(|e| format!("error converting supplied value for label: {e}"));
self
}
pub fn url<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.url = value
.try_into()
.map_err(|e| format!("error converting supplied value for url: {e}"));
self
}
}
impl ::std::convert::TryFrom<TrafficLightProtocolTlp>
for super::TrafficLightProtocolTlp {
type Error = super::error::ConversionError;
fn try_from(
value: TrafficLightProtocolTlp,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
label: value.label?,
url: value.url?,
})
}
}
impl ::std::convert::From<super::TrafficLightProtocolTlp>
for TrafficLightProtocolTlp {
fn from(value: super::TrafficLightProtocolTlp) -> Self {
Self {
label: Ok(value.label),
url: Ok(value.url),
}
}
}
#[derive(Clone, Debug)]
pub struct Vulnerability {
acknowledgments: ::std::result::Result<
::std::option::Option<super::AcknowledgmentsT>,
::std::string::String,
>,
cve: ::std::result::Result<
::std::option::Option<super::Cve>,
::std::string::String,
>,
cwe: ::std::result::Result<
::std::option::Option<super::Cwe>,
::std::string::String,
>,
discovery_date: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
flags: ::std::result::Result<
::std::option::Option<Vec<super::Flag>>,
::std::string::String,
>,
ids: ::std::result::Result<
::std::option::Option<Vec<super::Id>>,
::std::string::String,
>,
involvements: ::std::result::Result<
::std::option::Option<Vec<super::Involvement>>,
::std::string::String,
>,
notes: ::std::result::Result<
::std::option::Option<super::NotesT>,
::std::string::String,
>,
product_status: ::std::result::Result<
::std::option::Option<super::ProductStatus>,
::std::string::String,
>,
references: ::std::result::Result<
::std::option::Option<super::ReferencesT>,
::std::string::String,
>,
release_date: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
remediations: ::std::result::Result<
::std::vec::Vec<super::Remediation>,
::std::string::String,
>,
scores: ::std::result::Result<
::std::vec::Vec<super::Score>,
::std::string::String,
>,
threats: ::std::result::Result<
::std::vec::Vec<super::Threat>,
::std::string::String,
>,
title: ::std::result::Result<
::std::option::Option<super::Title>,
::std::string::String,
>,
}
impl ::std::default::Default for Vulnerability {
fn default() -> Self {
Self {
acknowledgments: Ok(Default::default()),
cve: Ok(Default::default()),
cwe: Ok(Default::default()),
discovery_date: Ok(Default::default()),
flags: Ok(Default::default()),
ids: Ok(Default::default()),
involvements: Ok(Default::default()),
notes: Ok(Default::default()),
product_status: Ok(Default::default()),
references: Ok(Default::default()),
release_date: Ok(Default::default()),
remediations: Ok(Default::default()),
scores: Ok(Default::default()),
threats: Ok(Default::default()),
title: Ok(Default::default()),
}
}
}
impl Vulnerability {
pub fn acknowledgments<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::AcknowledgmentsT>>,
T::Error: ::std::fmt::Display,
{
self.acknowledgments = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for acknowledgments: {e}")
});
self
}
pub fn cve<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::Cve>>,
T::Error: ::std::fmt::Display,
{
self.cve = value
.try_into()
.map_err(|e| format!("error converting supplied value for cve: {e}"));
self
}
pub fn cwe<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::Cwe>>,
T::Error: ::std::fmt::Display,
{
self.cwe = value
.try_into()
.map_err(|e| format!("error converting supplied value for cwe: {e}"));
self
}
pub fn discovery_date<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.discovery_date = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for discovery_date: {e}")
});
self
}
pub fn flags<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<Vec<super::Flag>>>,
T::Error: ::std::fmt::Display,
{
self.flags = value
.try_into()
.map_err(|e| format!("error converting supplied value for flags: {e}"));
self
}
pub fn ids<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<Vec<super::Id>>>,
T::Error: ::std::fmt::Display,
{
self.ids = value
.try_into()
.map_err(|e| format!("error converting supplied value for ids: {e}"));
self
}
pub fn involvements<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<Vec<super::Involvement>>>,
T::Error: ::std::fmt::Display,
{
self.involvements = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for involvements: {e}")
});
self
}
pub fn notes<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::NotesT>>,
T::Error: ::std::fmt::Display,
{
self.notes = value
.try_into()
.map_err(|e| format!("error converting supplied value for notes: {e}"));
self
}
pub fn product_status<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::ProductStatus>>,
T::Error: ::std::fmt::Display,
{
self.product_status = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for product_status: {e}")
});
self
}
pub fn references<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::ReferencesT>>,
T::Error: ::std::fmt::Display,
{
self.references = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for references: {e}")
});
self
}
pub fn release_date<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.release_date = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for release_date: {e}")
});
self
}
pub fn remediations<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::Remediation>>,
T::Error: ::std::fmt::Display,
{
self.remediations = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for remediations: {e}")
});
self
}
pub fn scores<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::Score>>,
T::Error: ::std::fmt::Display,
{
self.scores = value
.try_into()
.map_err(|e| format!("error converting supplied value for scores: {e}"));
self
}
pub fn threats<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::Threat>>,
T::Error: ::std::fmt::Display,
{
self.threats = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for threats: {e}")
});
self
}
pub fn title<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::Title>>,
T::Error: ::std::fmt::Display,
{
self.title = value
.try_into()
.map_err(|e| format!("error converting supplied value for title: {e}"));
self
}
}
impl ::std::convert::TryFrom<Vulnerability> for super::Vulnerability {
type Error = super::error::ConversionError;
fn try_from(
value: Vulnerability,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
acknowledgments: value.acknowledgments?,
cve: value.cve?,
cwe: value.cwe?,
discovery_date: value.discovery_date?,
flags: value.flags?,
ids: value.ids?,
involvements: value.involvements?,
notes: value.notes?,
product_status: value.product_status?,
references: value.references?,
release_date: value.release_date?,
remediations: value.remediations?,
scores: value.scores?,
threats: value.threats?,
title: value.title?,
})
}
}
impl ::std::convert::From<super::Vulnerability> for Vulnerability {
fn from(value: super::Vulnerability) -> Self {
Self {
acknowledgments: Ok(value.acknowledgments),
cve: Ok(value.cve),
cwe: Ok(value.cwe),
discovery_date: Ok(value.discovery_date),
flags: Ok(value.flags),
ids: Ok(value.ids),
involvements: Ok(value.involvements),
notes: Ok(value.notes),
product_status: Ok(value.product_status),
references: Ok(value.references),
release_date: Ok(value.release_date),
remediations: Ok(value.remediations),
scores: Ok(value.scores),
threats: Ok(value.threats),
title: Ok(value.title),
}
}
}
}
pub mod defaults {
pub(super) fn reference_category() -> super::CategoryOfReference {
super::CategoryOfReference::External
}
pub(super) fn traffic_light_protocol_tlp_url() -> ::std::string::String {
"https://www.first.org/tlp/".to_string()
}
}