aws-sdk-textract 1.28.0

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

/// <p>Holds the structured data returned by AnalyzeDocument for lending documents.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct LendingDocument {
    /// <p>An array of LendingField objects.</p>
    pub lending_fields: ::std::option::Option<::std::vec::Vec<crate::types::LendingField>>,
    /// <p>A list of signatures detected in a lending document.</p>
    pub signature_detections: ::std::option::Option<::std::vec::Vec<crate::types::SignatureDetection>>,
}
impl LendingDocument {
    /// <p>An array of LendingField objects.</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 `.lending_fields.is_none()`.
    pub fn lending_fields(&self) -> &[crate::types::LendingField] {
        self.lending_fields.as_deref().unwrap_or_default()
    }
    /// <p>A list of signatures detected in a lending document.</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 `.signature_detections.is_none()`.
    pub fn signature_detections(&self) -> &[crate::types::SignatureDetection] {
        self.signature_detections.as_deref().unwrap_or_default()
    }
}
impl LendingDocument {
    /// Creates a new builder-style object to manufacture [`LendingDocument`](crate::types::LendingDocument).
    pub fn builder() -> crate::types::builders::LendingDocumentBuilder {
        crate::types::builders::LendingDocumentBuilder::default()
    }
}

/// A builder for [`LendingDocument`](crate::types::LendingDocument).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct LendingDocumentBuilder {
    pub(crate) lending_fields: ::std::option::Option<::std::vec::Vec<crate::types::LendingField>>,
    pub(crate) signature_detections: ::std::option::Option<::std::vec::Vec<crate::types::SignatureDetection>>,
}
impl LendingDocumentBuilder {
    /// Appends an item to `lending_fields`.
    ///
    /// To override the contents of this collection use [`set_lending_fields`](Self::set_lending_fields).
    ///
    /// <p>An array of LendingField objects.</p>
    pub fn lending_fields(mut self, input: crate::types::LendingField) -> Self {
        let mut v = self.lending_fields.unwrap_or_default();
        v.push(input);
        self.lending_fields = ::std::option::Option::Some(v);
        self
    }
    /// <p>An array of LendingField objects.</p>
    pub fn set_lending_fields(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::LendingField>>) -> Self {
        self.lending_fields = input;
        self
    }
    /// <p>An array of LendingField objects.</p>
    pub fn get_lending_fields(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::LendingField>> {
        &self.lending_fields
    }
    /// Appends an item to `signature_detections`.
    ///
    /// To override the contents of this collection use [`set_signature_detections`](Self::set_signature_detections).
    ///
    /// <p>A list of signatures detected in a lending document.</p>
    pub fn signature_detections(mut self, input: crate::types::SignatureDetection) -> Self {
        let mut v = self.signature_detections.unwrap_or_default();
        v.push(input);
        self.signature_detections = ::std::option::Option::Some(v);
        self
    }
    /// <p>A list of signatures detected in a lending document.</p>
    pub fn set_signature_detections(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SignatureDetection>>) -> Self {
        self.signature_detections = input;
        self
    }
    /// <p>A list of signatures detected in a lending document.</p>
    pub fn get_signature_detections(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SignatureDetection>> {
        &self.signature_detections
    }
    /// Consumes the builder and constructs a [`LendingDocument`](crate::types::LendingDocument).
    pub fn build(self) -> crate::types::LendingDocument {
        crate::types::LendingDocument {
            lending_fields: self.lending_fields,
            signature_detections: self.signature_detections,
        }
    }
}