Struct aws_sdk_securityhub::model::vulnerability::Builder
source · pub struct Builder { /* private fields */ }
Expand description
A builder for Vulnerability
.
Implementations§
source§impl Builder
impl Builder
sourcepub fn set_id(self, input: Option<String>) -> Self
pub fn set_id(self, input: Option<String>) -> Self
The identifier of the vulnerability.
Examples found in repository?
7661 7662 7663 7664 7665 7666 7667 7668 7669 7670 7671 7672 7673 7674 7675 7676 7677 7678 7679 7680 7681 7682 7683 7684 7685 7686 7687 7688 7689 7690 7691 7692 7693 7694 7695 7696 7697 7698 7699 7700 7701 7702 7703 7704 7705 7706 7707 7708 7709 7710 7711 7712 7713 7714 7715 7716 7717 7718 7719 7720 7721 7722 7723 7724 7725 7726 7727 7728 7729 7730 7731 7732 7733 7734 7735 7736 7737 7738 7739 7740 7741 7742 7743 7744 7745 7746 7747 7748 7749 7750 7751 7752 7753 7754 7755
pub(crate) fn deser_structure_crate_model_vulnerability<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::Vulnerability>,
aws_smithy_json::deserialize::error::DeserializeError,
>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::model::vulnerability::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"Id" => {
builder = builder.set_id(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"VulnerablePackages" => {
builder = builder.set_vulnerable_packages(
crate::json_deser::deser_list_com_amazonaws_securityhub_software_package_list(tokens)?
);
}
"Cvss" => {
builder = builder.set_cvss(
crate::json_deser::deser_list_com_amazonaws_securityhub_cvss_list(tokens)?
);
}
"RelatedVulnerabilities" => {
builder = builder.set_related_vulnerabilities(
crate::json_deser::deser_list_com_amazonaws_securityhub_string_list(tokens)?
);
}
"Vendor" => {
builder = builder.set_vendor(
crate::json_deser::deser_structure_crate_model_vulnerability_vendor(tokens)?
);
}
"ReferenceUrls" => {
builder = builder.set_reference_urls(
crate::json_deser::deser_list_com_amazonaws_securityhub_string_list(tokens)?
);
}
"FixAvailable" => {
builder = builder.set_fix_available(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| {
s.to_unescaped().map(|u| {
crate::model::VulnerabilityFixAvailable::from(
u.as_ref(),
)
})
})
.transpose()?,
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}
sourcepub fn vulnerable_packages(self, input: SoftwarePackage) -> Self
pub fn vulnerable_packages(self, input: SoftwarePackage) -> Self
Appends an item to vulnerable_packages
.
To override the contents of this collection use set_vulnerable_packages
.
List of software packages that have the vulnerability.
sourcepub fn set_vulnerable_packages(self, input: Option<Vec<SoftwarePackage>>) -> Self
pub fn set_vulnerable_packages(self, input: Option<Vec<SoftwarePackage>>) -> Self
List of software packages that have the vulnerability.
Examples found in repository?
7661 7662 7663 7664 7665 7666 7667 7668 7669 7670 7671 7672 7673 7674 7675 7676 7677 7678 7679 7680 7681 7682 7683 7684 7685 7686 7687 7688 7689 7690 7691 7692 7693 7694 7695 7696 7697 7698 7699 7700 7701 7702 7703 7704 7705 7706 7707 7708 7709 7710 7711 7712 7713 7714 7715 7716 7717 7718 7719 7720 7721 7722 7723 7724 7725 7726 7727 7728 7729 7730 7731 7732 7733 7734 7735 7736 7737 7738 7739 7740 7741 7742 7743 7744 7745 7746 7747 7748 7749 7750 7751 7752 7753 7754 7755
pub(crate) fn deser_structure_crate_model_vulnerability<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::Vulnerability>,
aws_smithy_json::deserialize::error::DeserializeError,
>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::model::vulnerability::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"Id" => {
builder = builder.set_id(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"VulnerablePackages" => {
builder = builder.set_vulnerable_packages(
crate::json_deser::deser_list_com_amazonaws_securityhub_software_package_list(tokens)?
);
}
"Cvss" => {
builder = builder.set_cvss(
crate::json_deser::deser_list_com_amazonaws_securityhub_cvss_list(tokens)?
);
}
"RelatedVulnerabilities" => {
builder = builder.set_related_vulnerabilities(
crate::json_deser::deser_list_com_amazonaws_securityhub_string_list(tokens)?
);
}
"Vendor" => {
builder = builder.set_vendor(
crate::json_deser::deser_structure_crate_model_vulnerability_vendor(tokens)?
);
}
"ReferenceUrls" => {
builder = builder.set_reference_urls(
crate::json_deser::deser_list_com_amazonaws_securityhub_string_list(tokens)?
);
}
"FixAvailable" => {
builder = builder.set_fix_available(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| {
s.to_unescaped().map(|u| {
crate::model::VulnerabilityFixAvailable::from(
u.as_ref(),
)
})
})
.transpose()?,
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}
sourcepub fn cvss(self, input: Cvss) -> Self
pub fn cvss(self, input: Cvss) -> Self
Appends an item to cvss
.
To override the contents of this collection use set_cvss
.
CVSS scores from the advisory related to the vulnerability.
sourcepub fn set_cvss(self, input: Option<Vec<Cvss>>) -> Self
pub fn set_cvss(self, input: Option<Vec<Cvss>>) -> Self
CVSS scores from the advisory related to the vulnerability.
Examples found in repository?
7661 7662 7663 7664 7665 7666 7667 7668 7669 7670 7671 7672 7673 7674 7675 7676 7677 7678 7679 7680 7681 7682 7683 7684 7685 7686 7687 7688 7689 7690 7691 7692 7693 7694 7695 7696 7697 7698 7699 7700 7701 7702 7703 7704 7705 7706 7707 7708 7709 7710 7711 7712 7713 7714 7715 7716 7717 7718 7719 7720 7721 7722 7723 7724 7725 7726 7727 7728 7729 7730 7731 7732 7733 7734 7735 7736 7737 7738 7739 7740 7741 7742 7743 7744 7745 7746 7747 7748 7749 7750 7751 7752 7753 7754 7755
pub(crate) fn deser_structure_crate_model_vulnerability<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::Vulnerability>,
aws_smithy_json::deserialize::error::DeserializeError,
>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::model::vulnerability::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"Id" => {
builder = builder.set_id(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"VulnerablePackages" => {
builder = builder.set_vulnerable_packages(
crate::json_deser::deser_list_com_amazonaws_securityhub_software_package_list(tokens)?
);
}
"Cvss" => {
builder = builder.set_cvss(
crate::json_deser::deser_list_com_amazonaws_securityhub_cvss_list(tokens)?
);
}
"RelatedVulnerabilities" => {
builder = builder.set_related_vulnerabilities(
crate::json_deser::deser_list_com_amazonaws_securityhub_string_list(tokens)?
);
}
"Vendor" => {
builder = builder.set_vendor(
crate::json_deser::deser_structure_crate_model_vulnerability_vendor(tokens)?
);
}
"ReferenceUrls" => {
builder = builder.set_reference_urls(
crate::json_deser::deser_list_com_amazonaws_securityhub_string_list(tokens)?
);
}
"FixAvailable" => {
builder = builder.set_fix_available(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| {
s.to_unescaped().map(|u| {
crate::model::VulnerabilityFixAvailable::from(
u.as_ref(),
)
})
})
.transpose()?,
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}
Appends an item to related_vulnerabilities
.
To override the contents of this collection use set_related_vulnerabilities
.
List of vulnerabilities that are related to this vulnerability.
List of vulnerabilities that are related to this vulnerability.
Examples found in repository?
7661 7662 7663 7664 7665 7666 7667 7668 7669 7670 7671 7672 7673 7674 7675 7676 7677 7678 7679 7680 7681 7682 7683 7684 7685 7686 7687 7688 7689 7690 7691 7692 7693 7694 7695 7696 7697 7698 7699 7700 7701 7702 7703 7704 7705 7706 7707 7708 7709 7710 7711 7712 7713 7714 7715 7716 7717 7718 7719 7720 7721 7722 7723 7724 7725 7726 7727 7728 7729 7730 7731 7732 7733 7734 7735 7736 7737 7738 7739 7740 7741 7742 7743 7744 7745 7746 7747 7748 7749 7750 7751 7752 7753 7754 7755
pub(crate) fn deser_structure_crate_model_vulnerability<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::Vulnerability>,
aws_smithy_json::deserialize::error::DeserializeError,
>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::model::vulnerability::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"Id" => {
builder = builder.set_id(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"VulnerablePackages" => {
builder = builder.set_vulnerable_packages(
crate::json_deser::deser_list_com_amazonaws_securityhub_software_package_list(tokens)?
);
}
"Cvss" => {
builder = builder.set_cvss(
crate::json_deser::deser_list_com_amazonaws_securityhub_cvss_list(tokens)?
);
}
"RelatedVulnerabilities" => {
builder = builder.set_related_vulnerabilities(
crate::json_deser::deser_list_com_amazonaws_securityhub_string_list(tokens)?
);
}
"Vendor" => {
builder = builder.set_vendor(
crate::json_deser::deser_structure_crate_model_vulnerability_vendor(tokens)?
);
}
"ReferenceUrls" => {
builder = builder.set_reference_urls(
crate::json_deser::deser_list_com_amazonaws_securityhub_string_list(tokens)?
);
}
"FixAvailable" => {
builder = builder.set_fix_available(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| {
s.to_unescaped().map(|u| {
crate::model::VulnerabilityFixAvailable::from(
u.as_ref(),
)
})
})
.transpose()?,
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}
sourcepub fn vendor(self, input: VulnerabilityVendor) -> Self
pub fn vendor(self, input: VulnerabilityVendor) -> Self
Information about the vendor that generates the vulnerability report.
sourcepub fn set_vendor(self, input: Option<VulnerabilityVendor>) -> Self
pub fn set_vendor(self, input: Option<VulnerabilityVendor>) -> Self
Information about the vendor that generates the vulnerability report.
Examples found in repository?
7661 7662 7663 7664 7665 7666 7667 7668 7669 7670 7671 7672 7673 7674 7675 7676 7677 7678 7679 7680 7681 7682 7683 7684 7685 7686 7687 7688 7689 7690 7691 7692 7693 7694 7695 7696 7697 7698 7699 7700 7701 7702 7703 7704 7705 7706 7707 7708 7709 7710 7711 7712 7713 7714 7715 7716 7717 7718 7719 7720 7721 7722 7723 7724 7725 7726 7727 7728 7729 7730 7731 7732 7733 7734 7735 7736 7737 7738 7739 7740 7741 7742 7743 7744 7745 7746 7747 7748 7749 7750 7751 7752 7753 7754 7755
pub(crate) fn deser_structure_crate_model_vulnerability<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::Vulnerability>,
aws_smithy_json::deserialize::error::DeserializeError,
>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::model::vulnerability::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"Id" => {
builder = builder.set_id(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"VulnerablePackages" => {
builder = builder.set_vulnerable_packages(
crate::json_deser::deser_list_com_amazonaws_securityhub_software_package_list(tokens)?
);
}
"Cvss" => {
builder = builder.set_cvss(
crate::json_deser::deser_list_com_amazonaws_securityhub_cvss_list(tokens)?
);
}
"RelatedVulnerabilities" => {
builder = builder.set_related_vulnerabilities(
crate::json_deser::deser_list_com_amazonaws_securityhub_string_list(tokens)?
);
}
"Vendor" => {
builder = builder.set_vendor(
crate::json_deser::deser_structure_crate_model_vulnerability_vendor(tokens)?
);
}
"ReferenceUrls" => {
builder = builder.set_reference_urls(
crate::json_deser::deser_list_com_amazonaws_securityhub_string_list(tokens)?
);
}
"FixAvailable" => {
builder = builder.set_fix_available(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| {
s.to_unescaped().map(|u| {
crate::model::VulnerabilityFixAvailable::from(
u.as_ref(),
)
})
})
.transpose()?,
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}
sourcepub fn reference_urls(self, input: impl Into<String>) -> Self
pub fn reference_urls(self, input: impl Into<String>) -> Self
Appends an item to reference_urls
.
To override the contents of this collection use set_reference_urls
.
A list of URLs that provide additional information about the vulnerability.
sourcepub fn set_reference_urls(self, input: Option<Vec<String>>) -> Self
pub fn set_reference_urls(self, input: Option<Vec<String>>) -> Self
A list of URLs that provide additional information about the vulnerability.
Examples found in repository?
7661 7662 7663 7664 7665 7666 7667 7668 7669 7670 7671 7672 7673 7674 7675 7676 7677 7678 7679 7680 7681 7682 7683 7684 7685 7686 7687 7688 7689 7690 7691 7692 7693 7694 7695 7696 7697 7698 7699 7700 7701 7702 7703 7704 7705 7706 7707 7708 7709 7710 7711 7712 7713 7714 7715 7716 7717 7718 7719 7720 7721 7722 7723 7724 7725 7726 7727 7728 7729 7730 7731 7732 7733 7734 7735 7736 7737 7738 7739 7740 7741 7742 7743 7744 7745 7746 7747 7748 7749 7750 7751 7752 7753 7754 7755
pub(crate) fn deser_structure_crate_model_vulnerability<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::Vulnerability>,
aws_smithy_json::deserialize::error::DeserializeError,
>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::model::vulnerability::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"Id" => {
builder = builder.set_id(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"VulnerablePackages" => {
builder = builder.set_vulnerable_packages(
crate::json_deser::deser_list_com_amazonaws_securityhub_software_package_list(tokens)?
);
}
"Cvss" => {
builder = builder.set_cvss(
crate::json_deser::deser_list_com_amazonaws_securityhub_cvss_list(tokens)?
);
}
"RelatedVulnerabilities" => {
builder = builder.set_related_vulnerabilities(
crate::json_deser::deser_list_com_amazonaws_securityhub_string_list(tokens)?
);
}
"Vendor" => {
builder = builder.set_vendor(
crate::json_deser::deser_structure_crate_model_vulnerability_vendor(tokens)?
);
}
"ReferenceUrls" => {
builder = builder.set_reference_urls(
crate::json_deser::deser_list_com_amazonaws_securityhub_string_list(tokens)?
);
}
"FixAvailable" => {
builder = builder.set_fix_available(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| {
s.to_unescaped().map(|u| {
crate::model::VulnerabilityFixAvailable::from(
u.as_ref(),
)
})
})
.transpose()?,
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}
sourcepub fn fix_available(self, input: VulnerabilityFixAvailable) -> Self
pub fn fix_available(self, input: VulnerabilityFixAvailable) -> Self
Specifies if all vulnerable packages in a finding have a value for FixedInVersion
and Remediation
. This field is evaluated for each vulnerability Id
based on the number of vulnerable packages that have a value for both FixedInVersion
and Remediation
. Valid values are as follows:
-
YES
if all vulnerable packages have a value for bothFixedInVersion
andRemediation
-
NO
if no vulnerable packages have a value forFixedInVersion
andRemediation
-
PARTIAL
otherwise
sourcepub fn set_fix_available(self, input: Option<VulnerabilityFixAvailable>) -> Self
pub fn set_fix_available(self, input: Option<VulnerabilityFixAvailable>) -> Self
Specifies if all vulnerable packages in a finding have a value for FixedInVersion
and Remediation
. This field is evaluated for each vulnerability Id
based on the number of vulnerable packages that have a value for both FixedInVersion
and Remediation
. Valid values are as follows:
-
YES
if all vulnerable packages have a value for bothFixedInVersion
andRemediation
-
NO
if no vulnerable packages have a value forFixedInVersion
andRemediation
-
PARTIAL
otherwise
Examples found in repository?
7661 7662 7663 7664 7665 7666 7667 7668 7669 7670 7671 7672 7673 7674 7675 7676 7677 7678 7679 7680 7681 7682 7683 7684 7685 7686 7687 7688 7689 7690 7691 7692 7693 7694 7695 7696 7697 7698 7699 7700 7701 7702 7703 7704 7705 7706 7707 7708 7709 7710 7711 7712 7713 7714 7715 7716 7717 7718 7719 7720 7721 7722 7723 7724 7725 7726 7727 7728 7729 7730 7731 7732 7733 7734 7735 7736 7737 7738 7739 7740 7741 7742 7743 7744 7745 7746 7747 7748 7749 7750 7751 7752 7753 7754 7755
pub(crate) fn deser_structure_crate_model_vulnerability<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::Vulnerability>,
aws_smithy_json::deserialize::error::DeserializeError,
>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::model::vulnerability::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"Id" => {
builder = builder.set_id(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"VulnerablePackages" => {
builder = builder.set_vulnerable_packages(
crate::json_deser::deser_list_com_amazonaws_securityhub_software_package_list(tokens)?
);
}
"Cvss" => {
builder = builder.set_cvss(
crate::json_deser::deser_list_com_amazonaws_securityhub_cvss_list(tokens)?
);
}
"RelatedVulnerabilities" => {
builder = builder.set_related_vulnerabilities(
crate::json_deser::deser_list_com_amazonaws_securityhub_string_list(tokens)?
);
}
"Vendor" => {
builder = builder.set_vendor(
crate::json_deser::deser_structure_crate_model_vulnerability_vendor(tokens)?
);
}
"ReferenceUrls" => {
builder = builder.set_reference_urls(
crate::json_deser::deser_list_com_amazonaws_securityhub_string_list(tokens)?
);
}
"FixAvailable" => {
builder = builder.set_fix_available(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| {
s.to_unescaped().map(|u| {
crate::model::VulnerabilityFixAvailable::from(
u.as_ref(),
)
})
})
.transpose()?,
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}
sourcepub fn build(self) -> Vulnerability
pub fn build(self) -> Vulnerability
Consumes the builder and constructs a Vulnerability
.
Examples found in repository?
7661 7662 7663 7664 7665 7666 7667 7668 7669 7670 7671 7672 7673 7674 7675 7676 7677 7678 7679 7680 7681 7682 7683 7684 7685 7686 7687 7688 7689 7690 7691 7692 7693 7694 7695 7696 7697 7698 7699 7700 7701 7702 7703 7704 7705 7706 7707 7708 7709 7710 7711 7712 7713 7714 7715 7716 7717 7718 7719 7720 7721 7722 7723 7724 7725 7726 7727 7728 7729 7730 7731 7732 7733 7734 7735 7736 7737 7738 7739 7740 7741 7742 7743 7744 7745 7746 7747 7748 7749 7750 7751 7752 7753 7754 7755
pub(crate) fn deser_structure_crate_model_vulnerability<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::Vulnerability>,
aws_smithy_json::deserialize::error::DeserializeError,
>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::model::vulnerability::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"Id" => {
builder = builder.set_id(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"VulnerablePackages" => {
builder = builder.set_vulnerable_packages(
crate::json_deser::deser_list_com_amazonaws_securityhub_software_package_list(tokens)?
);
}
"Cvss" => {
builder = builder.set_cvss(
crate::json_deser::deser_list_com_amazonaws_securityhub_cvss_list(tokens)?
);
}
"RelatedVulnerabilities" => {
builder = builder.set_related_vulnerabilities(
crate::json_deser::deser_list_com_amazonaws_securityhub_string_list(tokens)?
);
}
"Vendor" => {
builder = builder.set_vendor(
crate::json_deser::deser_structure_crate_model_vulnerability_vendor(tokens)?
);
}
"ReferenceUrls" => {
builder = builder.set_reference_urls(
crate::json_deser::deser_list_com_amazonaws_securityhub_string_list(tokens)?
);
}
"FixAvailable" => {
builder = builder.set_fix_available(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| {
s.to_unescaped().map(|u| {
crate::model::VulnerabilityFixAvailable::from(
u.as_ref(),
)
})
})
.transpose()?,
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}