aws-sdk-codegurusecurity 1.98.0

AWS SDK for Amazon CodeGuru Security
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Information about a security vulnerability that Amazon CodeGuru Security detected.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Vulnerability {
    /// <p>One or more URL addresses that contain details about a vulnerability.</p>
    pub reference_urls: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>One or more vulnerabilities that are related to the vulnerability being described.</p>
    pub related_vulnerabilities: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>The identifier for the vulnerability.</p>
    pub id: ::std::option::Option<::std::string::String>,
    /// <p>An object that describes the location of the detected security vulnerability in your code.</p>
    pub file_path: ::std::option::Option<crate::types::FilePath>,
    /// <p>The number of times the vulnerability appears in your code.</p>
    #[deprecated(note = "This shape is not used.")]
    pub item_count: ::std::option::Option<i32>,
}
impl Vulnerability {
    /// <p>One or more URL addresses that contain details about a vulnerability.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.reference_urls.is_none()`.
    pub fn reference_urls(&self) -> &[::std::string::String] {
        self.reference_urls.as_deref().unwrap_or_default()
    }
    /// <p>One or more vulnerabilities that are related to the vulnerability being described.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.related_vulnerabilities.is_none()`.
    pub fn related_vulnerabilities(&self) -> &[::std::string::String] {
        self.related_vulnerabilities.as_deref().unwrap_or_default()
    }
    /// <p>The identifier for the vulnerability.</p>
    pub fn id(&self) -> ::std::option::Option<&str> {
        self.id.as_deref()
    }
    /// <p>An object that describes the location of the detected security vulnerability in your code.</p>
    pub fn file_path(&self) -> ::std::option::Option<&crate::types::FilePath> {
        self.file_path.as_ref()
    }
    /// <p>The number of times the vulnerability appears in your code.</p>
    #[deprecated(note = "This shape is not used.")]
    pub fn item_count(&self) -> ::std::option::Option<i32> {
        self.item_count
    }
}
impl Vulnerability {
    /// Creates a new builder-style object to manufacture [`Vulnerability`](crate::types::Vulnerability).
    pub fn builder() -> crate::types::builders::VulnerabilityBuilder {
        crate::types::builders::VulnerabilityBuilder::default()
    }
}

/// A builder for [`Vulnerability`](crate::types::Vulnerability).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct VulnerabilityBuilder {
    pub(crate) reference_urls: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) related_vulnerabilities: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) id: ::std::option::Option<::std::string::String>,
    pub(crate) file_path: ::std::option::Option<crate::types::FilePath>,
    pub(crate) item_count: ::std::option::Option<i32>,
}
impl VulnerabilityBuilder {
    /// Appends an item to `reference_urls`.
    ///
    /// To override the contents of this collection use [`set_reference_urls`](Self::set_reference_urls).
    ///
    /// <p>One or more URL addresses that contain details about a vulnerability.</p>
    pub fn reference_urls(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.reference_urls.unwrap_or_default();
        v.push(input.into());
        self.reference_urls = ::std::option::Option::Some(v);
        self
    }
    /// <p>One or more URL addresses that contain details about a vulnerability.</p>
    pub fn set_reference_urls(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.reference_urls = input;
        self
    }
    /// <p>One or more URL addresses that contain details about a vulnerability.</p>
    pub fn get_reference_urls(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.reference_urls
    }
    /// Appends an item to `related_vulnerabilities`.
    ///
    /// To override the contents of this collection use [`set_related_vulnerabilities`](Self::set_related_vulnerabilities).
    ///
    /// <p>One or more vulnerabilities that are related to the vulnerability being described.</p>
    pub fn related_vulnerabilities(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.related_vulnerabilities.unwrap_or_default();
        v.push(input.into());
        self.related_vulnerabilities = ::std::option::Option::Some(v);
        self
    }
    /// <p>One or more vulnerabilities that are related to the vulnerability being described.</p>
    pub fn set_related_vulnerabilities(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.related_vulnerabilities = input;
        self
    }
    /// <p>One or more vulnerabilities that are related to the vulnerability being described.</p>
    pub fn get_related_vulnerabilities(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.related_vulnerabilities
    }
    /// <p>The identifier for the vulnerability.</p>
    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier for the vulnerability.</p>
    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.id = input;
        self
    }
    /// <p>The identifier for the vulnerability.</p>
    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.id
    }
    /// <p>An object that describes the location of the detected security vulnerability in your code.</p>
    pub fn file_path(mut self, input: crate::types::FilePath) -> Self {
        self.file_path = ::std::option::Option::Some(input);
        self
    }
    /// <p>An object that describes the location of the detected security vulnerability in your code.</p>
    pub fn set_file_path(mut self, input: ::std::option::Option<crate::types::FilePath>) -> Self {
        self.file_path = input;
        self
    }
    /// <p>An object that describes the location of the detected security vulnerability in your code.</p>
    pub fn get_file_path(&self) -> &::std::option::Option<crate::types::FilePath> {
        &self.file_path
    }
    /// <p>The number of times the vulnerability appears in your code.</p>
    #[deprecated(note = "This shape is not used.")]
    pub fn item_count(mut self, input: i32) -> Self {
        self.item_count = ::std::option::Option::Some(input);
        self
    }
    /// <p>The number of times the vulnerability appears in your code.</p>
    #[deprecated(note = "This shape is not used.")]
    pub fn set_item_count(mut self, input: ::std::option::Option<i32>) -> Self {
        self.item_count = input;
        self
    }
    /// <p>The number of times the vulnerability appears in your code.</p>
    #[deprecated(note = "This shape is not used.")]
    pub fn get_item_count(&self) -> &::std::option::Option<i32> {
        &self.item_count
    }
    /// Consumes the builder and constructs a [`Vulnerability`](crate::types::Vulnerability).
    pub fn build(self) -> crate::types::Vulnerability {
        crate::types::Vulnerability {
            reference_urls: self.reference_urls,
            related_vulnerabilities: self.related_vulnerabilities,
            id: self.id,
            file_path: self.file_path,
            item_count: self.item_count,
        }
    }
}