1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetExpenseAnalysisOutput {
/// <p>Information about a document that Amazon Textract processed. <code>DocumentMetadata</code> is returned in every page of paginated responses from an Amazon Textract operation.</p>
pub document_metadata: ::std::option::Option<crate::types::DocumentMetadata>,
/// <p>The current status of the text detection job.</p>
pub job_status: ::std::option::Option<crate::types::JobStatus>,
/// <p>If the response is truncated, Amazon Textract returns this token. You can use this token in the subsequent request to retrieve the next set of text-detection results.</p>
pub next_token: ::std::option::Option<::std::string::String>,
/// <p>The expenses detected by Amazon Textract.</p>
pub expense_documents: ::std::option::Option<::std::vec::Vec<crate::types::ExpenseDocument>>,
/// <p>A list of warnings that occurred during the text-detection operation for the document.</p>
pub warnings: ::std::option::Option<::std::vec::Vec<crate::types::Warning>>,
/// <p>Returns if the detection job could not be completed. Contains explanation for what error occured.</p>
pub status_message: ::std::option::Option<::std::string::String>,
/// <p>The current model version of AnalyzeExpense.</p>
pub analyze_expense_model_version: ::std::option::Option<::std::string::String>,
_request_id: Option<String>,
}
impl GetExpenseAnalysisOutput {
/// <p>Information about a document that Amazon Textract processed. <code>DocumentMetadata</code> is returned in every page of paginated responses from an Amazon Textract operation.</p>
pub fn document_metadata(&self) -> ::std::option::Option<&crate::types::DocumentMetadata> {
self.document_metadata.as_ref()
}
/// <p>The current status of the text detection job.</p>
pub fn job_status(&self) -> ::std::option::Option<&crate::types::JobStatus> {
self.job_status.as_ref()
}
/// <p>If the response is truncated, Amazon Textract returns this token. You can use this token in the subsequent request to retrieve the next set of text-detection results.</p>
pub fn next_token(&self) -> ::std::option::Option<&str> {
self.next_token.as_deref()
}
/// <p>The expenses detected by Amazon Textract.</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 `.expense_documents.is_none()`.
pub fn expense_documents(&self) -> &[crate::types::ExpenseDocument] {
self.expense_documents.as_deref().unwrap_or_default()
}
/// <p>A list of warnings that occurred during the text-detection operation for the 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 `.warnings.is_none()`.
pub fn warnings(&self) -> &[crate::types::Warning] {
self.warnings.as_deref().unwrap_or_default()
}
/// <p>Returns if the detection job could not be completed. Contains explanation for what error occured.</p>
pub fn status_message(&self) -> ::std::option::Option<&str> {
self.status_message.as_deref()
}
/// <p>The current model version of AnalyzeExpense.</p>
pub fn analyze_expense_model_version(&self) -> ::std::option::Option<&str> {
self.analyze_expense_model_version.as_deref()
}
}
impl ::aws_types::request_id::RequestId for GetExpenseAnalysisOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl GetExpenseAnalysisOutput {
/// Creates a new builder-style object to manufacture [`GetExpenseAnalysisOutput`](crate::operation::get_expense_analysis::GetExpenseAnalysisOutput).
pub fn builder() -> crate::operation::get_expense_analysis::builders::GetExpenseAnalysisOutputBuilder {
crate::operation::get_expense_analysis::builders::GetExpenseAnalysisOutputBuilder::default()
}
}
/// A builder for [`GetExpenseAnalysisOutput`](crate::operation::get_expense_analysis::GetExpenseAnalysisOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetExpenseAnalysisOutputBuilder {
pub(crate) document_metadata: ::std::option::Option<crate::types::DocumentMetadata>,
pub(crate) job_status: ::std::option::Option<crate::types::JobStatus>,
pub(crate) next_token: ::std::option::Option<::std::string::String>,
pub(crate) expense_documents: ::std::option::Option<::std::vec::Vec<crate::types::ExpenseDocument>>,
pub(crate) warnings: ::std::option::Option<::std::vec::Vec<crate::types::Warning>>,
pub(crate) status_message: ::std::option::Option<::std::string::String>,
pub(crate) analyze_expense_model_version: ::std::option::Option<::std::string::String>,
_request_id: Option<String>,
}
impl GetExpenseAnalysisOutputBuilder {
/// <p>Information about a document that Amazon Textract processed. <code>DocumentMetadata</code> is returned in every page of paginated responses from an Amazon Textract operation.</p>
pub fn document_metadata(mut self, input: crate::types::DocumentMetadata) -> Self {
self.document_metadata = ::std::option::Option::Some(input);
self
}
/// <p>Information about a document that Amazon Textract processed. <code>DocumentMetadata</code> is returned in every page of paginated responses from an Amazon Textract operation.</p>
pub fn set_document_metadata(mut self, input: ::std::option::Option<crate::types::DocumentMetadata>) -> Self {
self.document_metadata = input;
self
}
/// <p>Information about a document that Amazon Textract processed. <code>DocumentMetadata</code> is returned in every page of paginated responses from an Amazon Textract operation.</p>
pub fn get_document_metadata(&self) -> &::std::option::Option<crate::types::DocumentMetadata> {
&self.document_metadata
}
/// <p>The current status of the text detection job.</p>
pub fn job_status(mut self, input: crate::types::JobStatus) -> Self {
self.job_status = ::std::option::Option::Some(input);
self
}
/// <p>The current status of the text detection job.</p>
pub fn set_job_status(mut self, input: ::std::option::Option<crate::types::JobStatus>) -> Self {
self.job_status = input;
self
}
/// <p>The current status of the text detection job.</p>
pub fn get_job_status(&self) -> &::std::option::Option<crate::types::JobStatus> {
&self.job_status
}
/// <p>If the response is truncated, Amazon Textract returns this token. You can use this token in the subsequent request to retrieve the next set of text-detection results.</p>
pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.next_token = ::std::option::Option::Some(input.into());
self
}
/// <p>If the response is truncated, Amazon Textract returns this token. You can use this token in the subsequent request to retrieve the next set of text-detection results.</p>
pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.next_token = input;
self
}
/// <p>If the response is truncated, Amazon Textract returns this token. You can use this token in the subsequent request to retrieve the next set of text-detection results.</p>
pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
&self.next_token
}
/// Appends an item to `expense_documents`.
///
/// To override the contents of this collection use [`set_expense_documents`](Self::set_expense_documents).
///
/// <p>The expenses detected by Amazon Textract.</p>
pub fn expense_documents(mut self, input: crate::types::ExpenseDocument) -> Self {
let mut v = self.expense_documents.unwrap_or_default();
v.push(input);
self.expense_documents = ::std::option::Option::Some(v);
self
}
/// <p>The expenses detected by Amazon Textract.</p>
pub fn set_expense_documents(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ExpenseDocument>>) -> Self {
self.expense_documents = input;
self
}
/// <p>The expenses detected by Amazon Textract.</p>
pub fn get_expense_documents(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ExpenseDocument>> {
&self.expense_documents
}
/// Appends an item to `warnings`.
///
/// To override the contents of this collection use [`set_warnings`](Self::set_warnings).
///
/// <p>A list of warnings that occurred during the text-detection operation for the document.</p>
pub fn warnings(mut self, input: crate::types::Warning) -> Self {
let mut v = self.warnings.unwrap_or_default();
v.push(input);
self.warnings = ::std::option::Option::Some(v);
self
}
/// <p>A list of warnings that occurred during the text-detection operation for the document.</p>
pub fn set_warnings(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Warning>>) -> Self {
self.warnings = input;
self
}
/// <p>A list of warnings that occurred during the text-detection operation for the document.</p>
pub fn get_warnings(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Warning>> {
&self.warnings
}
/// <p>Returns if the detection job could not be completed. Contains explanation for what error occured.</p>
pub fn status_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.status_message = ::std::option::Option::Some(input.into());
self
}
/// <p>Returns if the detection job could not be completed. Contains explanation for what error occured.</p>
pub fn set_status_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.status_message = input;
self
}
/// <p>Returns if the detection job could not be completed. Contains explanation for what error occured.</p>
pub fn get_status_message(&self) -> &::std::option::Option<::std::string::String> {
&self.status_message
}
/// <p>The current model version of AnalyzeExpense.</p>
pub fn analyze_expense_model_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.analyze_expense_model_version = ::std::option::Option::Some(input.into());
self
}
/// <p>The current model version of AnalyzeExpense.</p>
pub fn set_analyze_expense_model_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.analyze_expense_model_version = input;
self
}
/// <p>The current model version of AnalyzeExpense.</p>
pub fn get_analyze_expense_model_version(&self) -> &::std::option::Option<::std::string::String> {
&self.analyze_expense_model_version
}
pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
self._request_id = Some(request_id.into());
self
}
pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
self._request_id = request_id;
self
}
/// Consumes the builder and constructs a [`GetExpenseAnalysisOutput`](crate::operation::get_expense_analysis::GetExpenseAnalysisOutput).
pub fn build(self) -> crate::operation::get_expense_analysis::GetExpenseAnalysisOutput {
crate::operation::get_expense_analysis::GetExpenseAnalysisOutput {
document_metadata: self.document_metadata,
job_status: self.job_status,
next_token: self.next_token,
expense_documents: self.expense_documents,
warnings: self.warnings,
status_message: self.status_message,
analyze_expense_model_version: self.analyze_expense_model_version,
_request_id: self._request_id,
}
}
}