aws_sdk_textract/operation/analyze_expense/
_analyze_expense_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct AnalyzeExpenseOutput {
6    /// <p>Information about the input document.</p>
7    pub document_metadata: ::std::option::Option<crate::types::DocumentMetadata>,
8    /// <p>The expenses detected by Amazon Textract.</p>
9    pub expense_documents: ::std::option::Option<::std::vec::Vec<crate::types::ExpenseDocument>>,
10    _request_id: Option<String>,
11}
12impl AnalyzeExpenseOutput {
13    /// <p>Information about the input document.</p>
14    pub fn document_metadata(&self) -> ::std::option::Option<&crate::types::DocumentMetadata> {
15        self.document_metadata.as_ref()
16    }
17    /// <p>The expenses detected by Amazon Textract.</p>
18    ///
19    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.expense_documents.is_none()`.
20    pub fn expense_documents(&self) -> &[crate::types::ExpenseDocument] {
21        self.expense_documents.as_deref().unwrap_or_default()
22    }
23}
24impl ::aws_types::request_id::RequestId for AnalyzeExpenseOutput {
25    fn request_id(&self) -> Option<&str> {
26        self._request_id.as_deref()
27    }
28}
29impl AnalyzeExpenseOutput {
30    /// Creates a new builder-style object to manufacture [`AnalyzeExpenseOutput`](crate::operation::analyze_expense::AnalyzeExpenseOutput).
31    pub fn builder() -> crate::operation::analyze_expense::builders::AnalyzeExpenseOutputBuilder {
32        crate::operation::analyze_expense::builders::AnalyzeExpenseOutputBuilder::default()
33    }
34}
35
36/// A builder for [`AnalyzeExpenseOutput`](crate::operation::analyze_expense::AnalyzeExpenseOutput).
37#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct AnalyzeExpenseOutputBuilder {
40    pub(crate) document_metadata: ::std::option::Option<crate::types::DocumentMetadata>,
41    pub(crate) expense_documents: ::std::option::Option<::std::vec::Vec<crate::types::ExpenseDocument>>,
42    _request_id: Option<String>,
43}
44impl AnalyzeExpenseOutputBuilder {
45    /// <p>Information about the input document.</p>
46    pub fn document_metadata(mut self, input: crate::types::DocumentMetadata) -> Self {
47        self.document_metadata = ::std::option::Option::Some(input);
48        self
49    }
50    /// <p>Information about the input document.</p>
51    pub fn set_document_metadata(mut self, input: ::std::option::Option<crate::types::DocumentMetadata>) -> Self {
52        self.document_metadata = input;
53        self
54    }
55    /// <p>Information about the input document.</p>
56    pub fn get_document_metadata(&self) -> &::std::option::Option<crate::types::DocumentMetadata> {
57        &self.document_metadata
58    }
59    /// Appends an item to `expense_documents`.
60    ///
61    /// To override the contents of this collection use [`set_expense_documents`](Self::set_expense_documents).
62    ///
63    /// <p>The expenses detected by Amazon Textract.</p>
64    pub fn expense_documents(mut self, input: crate::types::ExpenseDocument) -> Self {
65        let mut v = self.expense_documents.unwrap_or_default();
66        v.push(input);
67        self.expense_documents = ::std::option::Option::Some(v);
68        self
69    }
70    /// <p>The expenses detected by Amazon Textract.</p>
71    pub fn set_expense_documents(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ExpenseDocument>>) -> Self {
72        self.expense_documents = input;
73        self
74    }
75    /// <p>The expenses detected by Amazon Textract.</p>
76    pub fn get_expense_documents(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ExpenseDocument>> {
77        &self.expense_documents
78    }
79    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
80        self._request_id = Some(request_id.into());
81        self
82    }
83
84    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
85        self._request_id = request_id;
86        self
87    }
88    /// Consumes the builder and constructs a [`AnalyzeExpenseOutput`](crate::operation::analyze_expense::AnalyzeExpenseOutput).
89    pub fn build(self) -> crate::operation::analyze_expense::AnalyzeExpenseOutput {
90        crate::operation::analyze_expense::AnalyzeExpenseOutput {
91            document_metadata: self.document_metadata,
92            expense_documents: self.expense_documents,
93            _request_id: self._request_id,
94        }
95    }
96}