aws-sdk-macie2 1.106.0

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

/// <p>Specifies the location of 1-15 occurrences of sensitive data that was detected by a managed data identifier or a custom data identifier and produced a sensitive data finding.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Occurrences {
    /// <p>An array of objects, one for each occurrence of sensitive data in a Microsoft Excel workbook, CSV file, or TSV file. This value is null for all other types of files.</p>
    /// <p>Each Cell object specifies a cell or field that contains the sensitive data.</p>
    pub cells: ::std::option::Option<::std::vec::Vec<crate::types::Cell>>,
    /// <p>An array of objects, one for each occurrence of sensitive data in an email message or a non-binary text file such as an HTML, TXT, or XML file. Each Range object specifies a line or inclusive range of lines that contains the sensitive data, and the position of the data on the specified line or lines.</p>
    /// <p>This value is often null for file types that are supported by Cell, Page, or Record objects. Exceptions are the location of sensitive data in: unstructured sections of an otherwise structured file, such as a comment in a file; a malformed file that Amazon Macie analyzes as plain text; and, a CSV or TSV file that has any column names that contain sensitive data.</p>
    pub line_ranges: ::std::option::Option<::std::vec::Vec<crate::types::Range>>,
    /// <p>Reserved for future use.</p>
    pub offset_ranges: ::std::option::Option<::std::vec::Vec<crate::types::Range>>,
    /// <p>An array of objects, one for each occurrence of sensitive data in an Adobe Portable Document Format file. This value is null for all other types of files.</p>
    /// <p>Each Page object specifies a page that contains the sensitive data.</p>
    pub pages: ::std::option::Option<::std::vec::Vec<crate::types::Page>>,
    /// <p>An array of objects, one for each occurrence of sensitive data in an Apache Avro object container, Apache Parquet file, JSON file, or JSON Lines file. This value is null for all other types of files.</p>
    /// <p>For an Avro object container or Parquet file, each Record object specifies a record index and the path to a field in a record that contains the sensitive data. For a JSON or JSON Lines file, each Record object specifies the path to a field or array that contains the sensitive data. For a JSON Lines file, it also specifies the index of the line that contains the data.</p>
    pub records: ::std::option::Option<::std::vec::Vec<crate::types::Record>>,
}
impl Occurrences {
    /// <p>An array of objects, one for each occurrence of sensitive data in a Microsoft Excel workbook, CSV file, or TSV file. This value is null for all other types of files.</p>
    /// <p>Each Cell object specifies a cell or field that contains the sensitive data.</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()
    }
    /// <p>An array of objects, one for each occurrence of sensitive data in an email message or a non-binary text file such as an HTML, TXT, or XML file. Each Range object specifies a line or inclusive range of lines that contains the sensitive data, and the position of the data on the specified line or lines.</p>
    /// <p>This value is often null for file types that are supported by Cell, Page, or Record objects. Exceptions are the location of sensitive data in: unstructured sections of an otherwise structured file, such as a comment in a file; a malformed file that Amazon Macie analyzes as plain text; and, a CSV or TSV file that has any column names that contain sensitive data.</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>Reserved for future use.</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>An array of objects, one for each occurrence of sensitive data in an Adobe Portable Document Format file. This value is null for all other types of files.</p>
    /// <p>Each Page object specifies a page that contains the sensitive data.</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>An array of objects, one for each occurrence of sensitive data in an Apache Avro object container, Apache Parquet file, JSON file, or JSON Lines file. This value is null for all other types of files.</p>
    /// <p>For an Avro object container or Parquet file, each Record object specifies a record index and the path to a field in a record that contains the sensitive data. For a JSON or JSON Lines file, each Record object specifies the path to a field or array that contains the sensitive data. For a JSON Lines file, it also specifies the index of the line that contains the data.</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()
    }
}
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) cells: ::std::option::Option<::std::vec::Vec<crate::types::Cell>>,
    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>>,
}
impl OccurrencesBuilder {
    /// Appends an item to `cells`.
    ///
    /// To override the contents of this collection use [`set_cells`](Self::set_cells).
    ///
    /// <p>An array of objects, one for each occurrence of sensitive data in a Microsoft Excel workbook, CSV file, or TSV file. This value is null for all other types of files.</p>
    /// <p>Each Cell object specifies a cell or field that contains the sensitive data.</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>An array of objects, one for each occurrence of sensitive data in a Microsoft Excel workbook, CSV file, or TSV file. This value is null for all other types of files.</p>
    /// <p>Each Cell object specifies a cell or field that contains the sensitive data.</p>
    pub fn set_cells(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Cell>>) -> Self {
        self.cells = input;
        self
    }
    /// <p>An array of objects, one for each occurrence of sensitive data in a Microsoft Excel workbook, CSV file, or TSV file. This value is null for all other types of files.</p>
    /// <p>Each Cell object specifies a cell or field that contains the sensitive data.</p>
    pub fn get_cells(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Cell>> {
        &self.cells
    }
    /// Appends an item to `line_ranges`.
    ///
    /// To override the contents of this collection use [`set_line_ranges`](Self::set_line_ranges).
    ///
    /// <p>An array of objects, one for each occurrence of sensitive data in an email message or a non-binary text file such as an HTML, TXT, or XML file. Each Range object specifies a line or inclusive range of lines that contains the sensitive data, and the position of the data on the specified line or lines.</p>
    /// <p>This value is often null for file types that are supported by Cell, Page, or Record objects. Exceptions are the location of sensitive data in: unstructured sections of an otherwise structured file, such as a comment in a file; a malformed file that Amazon Macie analyzes as plain text; and, a CSV or TSV file that has any column names that contain sensitive data.</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>An array of objects, one for each occurrence of sensitive data in an email message or a non-binary text file such as an HTML, TXT, or XML file. Each Range object specifies a line or inclusive range of lines that contains the sensitive data, and the position of the data on the specified line or lines.</p>
    /// <p>This value is often null for file types that are supported by Cell, Page, or Record objects. Exceptions are the location of sensitive data in: unstructured sections of an otherwise structured file, such as a comment in a file; a malformed file that Amazon Macie analyzes as plain text; and, a CSV or TSV file that has any column names that contain sensitive data.</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>An array of objects, one for each occurrence of sensitive data in an email message or a non-binary text file such as an HTML, TXT, or XML file. Each Range object specifies a line or inclusive range of lines that contains the sensitive data, and the position of the data on the specified line or lines.</p>
    /// <p>This value is often null for file types that are supported by Cell, Page, or Record objects. Exceptions are the location of sensitive data in: unstructured sections of an otherwise structured file, such as a comment in a file; a malformed file that Amazon Macie analyzes as plain text; and, a CSV or TSV file that has any column names that contain sensitive data.</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>Reserved for future use.</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>Reserved for future use.</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>Reserved for future use.</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>An array of objects, one for each occurrence of sensitive data in an Adobe Portable Document Format file. This value is null for all other types of files.</p>
    /// <p>Each Page object specifies a page that contains the sensitive data.</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>An array of objects, one for each occurrence of sensitive data in an Adobe Portable Document Format file. This value is null for all other types of files.</p>
    /// <p>Each Page object specifies a page that contains the sensitive data.</p>
    pub fn set_pages(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Page>>) -> Self {
        self.pages = input;
        self
    }
    /// <p>An array of objects, one for each occurrence of sensitive data in an Adobe Portable Document Format file. This value is null for all other types of files.</p>
    /// <p>Each Page object specifies a page that contains the sensitive data.</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>An array of objects, one for each occurrence of sensitive data in an Apache Avro object container, Apache Parquet file, JSON file, or JSON Lines file. This value is null for all other types of files.</p>
    /// <p>For an Avro object container or Parquet file, each Record object specifies a record index and the path to a field in a record that contains the sensitive data. For a JSON or JSON Lines file, each Record object specifies the path to a field or array that contains the sensitive data. For a JSON Lines file, it also specifies the index of the line that contains the data.</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>An array of objects, one for each occurrence of sensitive data in an Apache Avro object container, Apache Parquet file, JSON file, or JSON Lines file. This value is null for all other types of files.</p>
    /// <p>For an Avro object container or Parquet file, each Record object specifies a record index and the path to a field in a record that contains the sensitive data. For a JSON or JSON Lines file, each Record object specifies the path to a field or array that contains the sensitive data. For a JSON Lines file, it also specifies the index of the line that contains the data.</p>
    pub fn set_records(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Record>>) -> Self {
        self.records = input;
        self
    }
    /// <p>An array of objects, one for each occurrence of sensitive data in an Apache Avro object container, Apache Parquet file, JSON file, or JSON Lines file. This value is null for all other types of files.</p>
    /// <p>For an Avro object container or Parquet file, each Record object specifies a record index and the path to a field in a record that contains the sensitive data. For a JSON or JSON Lines file, each Record object specifies the path to a field or array that contains the sensitive data. For a JSON Lines file, it also specifies the index of the line that contains the data.</p>
    pub fn get_records(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Record>> {
        &self.records
    }
    /// Consumes the builder and constructs a [`Occurrences`](crate::types::Occurrences).
    pub fn build(self) -> crate::types::Occurrences {
        crate::types::Occurrences {
            cells: self.cells,
            line_ranges: self.line_ranges,
            offset_ranges: self.offset_ranges,
            pages: self.pages,
            records: self.records,
        }
    }
}