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 GetDocumentAnalysisOutput {
/// <p>Information about a document that Amazon Textract processed. <code>DocumentMetadata</code> is returned in every page of paginated responses from an Amazon Textract video 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 results of the text-analysis operation.</p>
pub blocks: ::std::option::Option<::std::vec::Vec<crate::types::Block>>,
/// <p>A list of warnings that occurred during the document-analysis operation.</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></p>
pub analyze_document_model_version: ::std::option::Option<::std::string::String>,
_request_id: Option<String>,
}
impl GetDocumentAnalysisOutput {
/// <p>Information about a document that Amazon Textract processed. <code>DocumentMetadata</code> is returned in every page of paginated responses from an Amazon Textract video 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 results of the text-analysis operation.</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 `.blocks.is_none()`.
pub fn blocks(&self) -> &[crate::types::Block] {
self.blocks.as_deref().unwrap_or_default()
}
/// <p>A list of warnings that occurred during the document-analysis operation.</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></p>
pub fn analyze_document_model_version(&self) -> ::std::option::Option<&str> {
self.analyze_document_model_version.as_deref()
}
}
impl ::aws_types::request_id::RequestId for GetDocumentAnalysisOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl GetDocumentAnalysisOutput {
/// Creates a new builder-style object to manufacture [`GetDocumentAnalysisOutput`](crate::operation::get_document_analysis::GetDocumentAnalysisOutput).
pub fn builder() -> crate::operation::get_document_analysis::builders::GetDocumentAnalysisOutputBuilder {
crate::operation::get_document_analysis::builders::GetDocumentAnalysisOutputBuilder::default()
}
}
/// A builder for [`GetDocumentAnalysisOutput`](crate::operation::get_document_analysis::GetDocumentAnalysisOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetDocumentAnalysisOutputBuilder {
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) blocks: ::std::option::Option<::std::vec::Vec<crate::types::Block>>,
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_document_model_version: ::std::option::Option<::std::string::String>,
_request_id: Option<String>,
}
impl GetDocumentAnalysisOutputBuilder {
/// <p>Information about a document that Amazon Textract processed. <code>DocumentMetadata</code> is returned in every page of paginated responses from an Amazon Textract video 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 video 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 video 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 `blocks`.
///
/// To override the contents of this collection use [`set_blocks`](Self::set_blocks).
///
/// <p>The results of the text-analysis operation.</p>
pub fn blocks(mut self, input: crate::types::Block) -> Self {
let mut v = self.blocks.unwrap_or_default();
v.push(input);
self.blocks = ::std::option::Option::Some(v);
self
}
/// <p>The results of the text-analysis operation.</p>
pub fn set_blocks(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Block>>) -> Self {
self.blocks = input;
self
}
/// <p>The results of the text-analysis operation.</p>
pub fn get_blocks(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Block>> {
&self.blocks
}
/// 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 document-analysis operation.</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 document-analysis operation.</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 document-analysis operation.</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></p>
pub fn analyze_document_model_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.analyze_document_model_version = ::std::option::Option::Some(input.into());
self
}
/// <p></p>
pub fn set_analyze_document_model_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.analyze_document_model_version = input;
self
}
/// <p></p>
pub fn get_analyze_document_model_version(&self) -> &::std::option::Option<::std::string::String> {
&self.analyze_document_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 [`GetDocumentAnalysisOutput`](crate::operation::get_document_analysis::GetDocumentAnalysisOutput).
pub fn build(self) -> crate::operation::get_document_analysis::GetDocumentAnalysisOutput {
crate::operation::get_document_analysis::GetDocumentAnalysisOutput {
document_metadata: self.document_metadata,
job_status: self.job_status,
next_token: self.next_token,
blocks: self.blocks,
warnings: self.warnings,
status_message: self.status_message,
analyze_document_model_version: self.analyze_document_model_version,
_request_id: self._request_id,
}
}
}