aws-sdk-securityhub 1.110.0

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

/// <p>The detected occurrences of sensitive data.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Occurrences {
    /// <p>Occurrences of sensitive data detected in a non-binary text file or a Microsoft Word file. Non-binary text files include files such as HTML, XML, JSON, and TXT files.</p>
    pub line_ranges: ::std::option::Option<::std::vec::Vec<crate::types::Range>>,
    /// <p>Occurrences of sensitive data detected in a binary text file.</p>
    pub offset_ranges: ::std::option::Option<::std::vec::Vec<crate::types::Range>>,
    /// <p>Occurrences of sensitive data in an Adobe Portable Document Format (PDF) file.</p>
    pub pages: ::std::option::Option<::std::vec::Vec<crate::types::Page>>,
    /// <p>Occurrences of sensitive data in an Apache Avro object container or an Apache Parquet file.</p>
    pub records: ::std::option::Option<::std::vec::Vec<crate::types::Record>>,
    /// <p>Occurrences of sensitive data detected in Microsoft Excel workbooks, comma-separated value (CSV) files, or tab-separated value (TSV) files.</p>
    pub cells: ::std::option::Option<::std::vec::Vec<crate::types::Cell>>,
}
impl Occurrences {
    /// <p>Occurrences of sensitive data detected in a non-binary text file or a Microsoft Word file. Non-binary text files include files such as HTML, XML, JSON, and TXT files.</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 `.line_ranges.is_none()`.
    pub fn line_ranges(&self) -> &[crate::types::Range] {
        self.line_ranges.as_deref().unwrap_or_default()
    }
    /// <p>Occurrences of sensitive data detected in a binary text file.</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 `.offset_ranges.is_none()`.
    pub fn offset_ranges(&self) -> &[crate::types::Range] {
        self.offset_ranges.as_deref().unwrap_or_default()
    }
    /// <p>Occurrences of sensitive data in an Adobe Portable Document Format (PDF) file.</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 `.pages.is_none()`.
    pub fn pages(&self) -> &[crate::types::Page] {
        self.pages.as_deref().unwrap_or_default()
    }
    /// <p>Occurrences of sensitive data in an Apache Avro object container or an Apache Parquet file.</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 `.records.is_none()`.
    pub fn records(&self) -> &[crate::types::Record] {
        self.records.as_deref().unwrap_or_default()
    }
    /// <p>Occurrences of sensitive data detected in Microsoft Excel workbooks, comma-separated value (CSV) files, or tab-separated value (TSV) files.</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 `.cells.is_none()`.
    pub fn cells(&self) -> &[crate::types::Cell] {
        self.cells.as_deref().unwrap_or_default()
    }
}
impl Occurrences {
    /// Creates a new builder-style object to manufacture [`Occurrences`](crate::types::Occurrences).
    pub fn builder() -> crate::types::builders::OccurrencesBuilder {
        crate::types::builders::OccurrencesBuilder::default()
    }
}

/// A builder for [`Occurrences`](crate::types::Occurrences).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct OccurrencesBuilder {
    pub(crate) line_ranges: ::std::option::Option<::std::vec::Vec<crate::types::Range>>,
    pub(crate) offset_ranges: ::std::option::Option<::std::vec::Vec<crate::types::Range>>,
    pub(crate) pages: ::std::option::Option<::std::vec::Vec<crate::types::Page>>,
    pub(crate) records: ::std::option::Option<::std::vec::Vec<crate::types::Record>>,
    pub(crate) cells: ::std::option::Option<::std::vec::Vec<crate::types::Cell>>,
}
impl OccurrencesBuilder {
    /// Appends an item to `line_ranges`.
    ///
    /// To override the contents of this collection use [`set_line_ranges`](Self::set_line_ranges).
    ///
    /// <p>Occurrences of sensitive data detected in a non-binary text file or a Microsoft Word file. Non-binary text files include files such as HTML, XML, JSON, and TXT files.</p>
    pub fn line_ranges(mut self, input: crate::types::Range) -> Self {
        let mut v = self.line_ranges.unwrap_or_default();
        v.push(input);
        self.line_ranges = ::std::option::Option::Some(v);
        self
    }
    /// <p>Occurrences of sensitive data detected in a non-binary text file or a Microsoft Word file. Non-binary text files include files such as HTML, XML, JSON, and TXT files.</p>
    pub fn set_line_ranges(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Range>>) -> Self {
        self.line_ranges = input;
        self
    }
    /// <p>Occurrences of sensitive data detected in a non-binary text file or a Microsoft Word file. Non-binary text files include files such as HTML, XML, JSON, and TXT files.</p>
    pub fn get_line_ranges(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Range>> {
        &self.line_ranges
    }
    /// Appends an item to `offset_ranges`.
    ///
    /// To override the contents of this collection use [`set_offset_ranges`](Self::set_offset_ranges).
    ///
    /// <p>Occurrences of sensitive data detected in a binary text file.</p>
    pub fn offset_ranges(mut self, input: crate::types::Range) -> Self {
        let mut v = self.offset_ranges.unwrap_or_default();
        v.push(input);
        self.offset_ranges = ::std::option::Option::Some(v);
        self
    }
    /// <p>Occurrences of sensitive data detected in a binary text file.</p>
    pub fn set_offset_ranges(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Range>>) -> Self {
        self.offset_ranges = input;
        self
    }
    /// <p>Occurrences of sensitive data detected in a binary text file.</p>
    pub fn get_offset_ranges(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Range>> {
        &self.offset_ranges
    }
    /// Appends an item to `pages`.
    ///
    /// To override the contents of this collection use [`set_pages`](Self::set_pages).
    ///
    /// <p>Occurrences of sensitive data in an Adobe Portable Document Format (PDF) file.</p>
    pub fn pages(mut self, input: crate::types::Page) -> Self {
        let mut v = self.pages.unwrap_or_default();
        v.push(input);
        self.pages = ::std::option::Option::Some(v);
        self
    }
    /// <p>Occurrences of sensitive data in an Adobe Portable Document Format (PDF) file.</p>
    pub fn set_pages(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Page>>) -> Self {
        self.pages = input;
        self
    }
    /// <p>Occurrences of sensitive data in an Adobe Portable Document Format (PDF) file.</p>
    pub fn get_pages(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Page>> {
        &self.pages
    }
    /// Appends an item to `records`.
    ///
    /// To override the contents of this collection use [`set_records`](Self::set_records).
    ///
    /// <p>Occurrences of sensitive data in an Apache Avro object container or an Apache Parquet file.</p>
    pub fn records(mut self, input: crate::types::Record) -> Self {
        let mut v = self.records.unwrap_or_default();
        v.push(input);
        self.records = ::std::option::Option::Some(v);
        self
    }
    /// <p>Occurrences of sensitive data in an Apache Avro object container or an Apache Parquet file.</p>
    pub fn set_records(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Record>>) -> Self {
        self.records = input;
        self
    }
    /// <p>Occurrences of sensitive data in an Apache Avro object container or an Apache Parquet file.</p>
    pub fn get_records(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Record>> {
        &self.records
    }
    /// Appends an item to `cells`.
    ///
    /// To override the contents of this collection use [`set_cells`](Self::set_cells).
    ///
    /// <p>Occurrences of sensitive data detected in Microsoft Excel workbooks, comma-separated value (CSV) files, or tab-separated value (TSV) files.</p>
    pub fn cells(mut self, input: crate::types::Cell) -> Self {
        let mut v = self.cells.unwrap_or_default();
        v.push(input);
        self.cells = ::std::option::Option::Some(v);
        self
    }
    /// <p>Occurrences of sensitive data detected in Microsoft Excel workbooks, comma-separated value (CSV) files, or tab-separated value (TSV) files.</p>
    pub fn set_cells(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Cell>>) -> Self {
        self.cells = input;
        self
    }
    /// <p>Occurrences of sensitive data detected in Microsoft Excel workbooks, comma-separated value (CSV) files, or tab-separated value (TSV) files.</p>
    pub fn get_cells(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Cell>> {
        &self.cells
    }
    /// Consumes the builder and constructs a [`Occurrences`](crate::types::Occurrences).
    pub fn build(self) -> crate::types::Occurrences {
        crate::types::Occurrences {
            line_ranges: self.line_ranges,
            offset_ranges: self.offset_ranges,
            pages: self.pages,
            records: self.records,
            cells: self.cells,
        }
    }
}