aws_sdk_textract/operation/analyze_document/
_analyze_document_input.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 AnalyzeDocumentInput {
6    /// <p>The input document as base64-encoded bytes or an Amazon S3 object. If you use the AWS CLI to call Amazon Textract operations, you can't pass image bytes. The document must be an image in JPEG, PNG, PDF, or TIFF format.</p>
7    /// <p>If you're using an AWS SDK to call Amazon Textract, you might not need to base64-encode image bytes that are passed using the <code>Bytes</code> field.</p>
8    pub document: ::std::option::Option<crate::types::Document>,
9    /// <p>A list of the types of analysis to perform. Add TABLES to the list to return information about the tables that are detected in the input document. Add FORMS to return detected form data. Add SIGNATURES to return the locations of detected signatures. Add LAYOUT to the list to return information about the layout of the document. All lines and words detected in the document are included in the response (including text that isn't related to the value of <code>FeatureTypes</code>).</p>
10    pub feature_types: ::std::option::Option<::std::vec::Vec<crate::types::FeatureType>>,
11    /// <p>Sets the configuration for the human in the loop workflow for analyzing documents.</p>
12    pub human_loop_config: ::std::option::Option<crate::types::HumanLoopConfig>,
13    /// <p>Contains Queries and the alias for those Queries, as determined by the input.</p>
14    pub queries_config: ::std::option::Option<crate::types::QueriesConfig>,
15    /// <p>Specifies the adapter to be used when analyzing a document.</p>
16    pub adapters_config: ::std::option::Option<crate::types::AdaptersConfig>,
17}
18impl AnalyzeDocumentInput {
19    /// <p>The input document as base64-encoded bytes or an Amazon S3 object. If you use the AWS CLI to call Amazon Textract operations, you can't pass image bytes. The document must be an image in JPEG, PNG, PDF, or TIFF format.</p>
20    /// <p>If you're using an AWS SDK to call Amazon Textract, you might not need to base64-encode image bytes that are passed using the <code>Bytes</code> field.</p>
21    pub fn document(&self) -> ::std::option::Option<&crate::types::Document> {
22        self.document.as_ref()
23    }
24    /// <p>A list of the types of analysis to perform. Add TABLES to the list to return information about the tables that are detected in the input document. Add FORMS to return detected form data. Add SIGNATURES to return the locations of detected signatures. Add LAYOUT to the list to return information about the layout of the document. All lines and words detected in the document are included in the response (including text that isn't related to the value of <code>FeatureTypes</code>).</p>
25    ///
26    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.feature_types.is_none()`.
27    pub fn feature_types(&self) -> &[crate::types::FeatureType] {
28        self.feature_types.as_deref().unwrap_or_default()
29    }
30    /// <p>Sets the configuration for the human in the loop workflow for analyzing documents.</p>
31    pub fn human_loop_config(&self) -> ::std::option::Option<&crate::types::HumanLoopConfig> {
32        self.human_loop_config.as_ref()
33    }
34    /// <p>Contains Queries and the alias for those Queries, as determined by the input.</p>
35    pub fn queries_config(&self) -> ::std::option::Option<&crate::types::QueriesConfig> {
36        self.queries_config.as_ref()
37    }
38    /// <p>Specifies the adapter to be used when analyzing a document.</p>
39    pub fn adapters_config(&self) -> ::std::option::Option<&crate::types::AdaptersConfig> {
40        self.adapters_config.as_ref()
41    }
42}
43impl AnalyzeDocumentInput {
44    /// Creates a new builder-style object to manufacture [`AnalyzeDocumentInput`](crate::operation::analyze_document::AnalyzeDocumentInput).
45    pub fn builder() -> crate::operation::analyze_document::builders::AnalyzeDocumentInputBuilder {
46        crate::operation::analyze_document::builders::AnalyzeDocumentInputBuilder::default()
47    }
48}
49
50/// A builder for [`AnalyzeDocumentInput`](crate::operation::analyze_document::AnalyzeDocumentInput).
51#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
52#[non_exhaustive]
53pub struct AnalyzeDocumentInputBuilder {
54    pub(crate) document: ::std::option::Option<crate::types::Document>,
55    pub(crate) feature_types: ::std::option::Option<::std::vec::Vec<crate::types::FeatureType>>,
56    pub(crate) human_loop_config: ::std::option::Option<crate::types::HumanLoopConfig>,
57    pub(crate) queries_config: ::std::option::Option<crate::types::QueriesConfig>,
58    pub(crate) adapters_config: ::std::option::Option<crate::types::AdaptersConfig>,
59}
60impl AnalyzeDocumentInputBuilder {
61    /// <p>The input document as base64-encoded bytes or an Amazon S3 object. If you use the AWS CLI to call Amazon Textract operations, you can't pass image bytes. The document must be an image in JPEG, PNG, PDF, or TIFF format.</p>
62    /// <p>If you're using an AWS SDK to call Amazon Textract, you might not need to base64-encode image bytes that are passed using the <code>Bytes</code> field.</p>
63    /// This field is required.
64    pub fn document(mut self, input: crate::types::Document) -> Self {
65        self.document = ::std::option::Option::Some(input);
66        self
67    }
68    /// <p>The input document as base64-encoded bytes or an Amazon S3 object. If you use the AWS CLI to call Amazon Textract operations, you can't pass image bytes. The document must be an image in JPEG, PNG, PDF, or TIFF format.</p>
69    /// <p>If you're using an AWS SDK to call Amazon Textract, you might not need to base64-encode image bytes that are passed using the <code>Bytes</code> field.</p>
70    pub fn set_document(mut self, input: ::std::option::Option<crate::types::Document>) -> Self {
71        self.document = input;
72        self
73    }
74    /// <p>The input document as base64-encoded bytes or an Amazon S3 object. If you use the AWS CLI to call Amazon Textract operations, you can't pass image bytes. The document must be an image in JPEG, PNG, PDF, or TIFF format.</p>
75    /// <p>If you're using an AWS SDK to call Amazon Textract, you might not need to base64-encode image bytes that are passed using the <code>Bytes</code> field.</p>
76    pub fn get_document(&self) -> &::std::option::Option<crate::types::Document> {
77        &self.document
78    }
79    /// Appends an item to `feature_types`.
80    ///
81    /// To override the contents of this collection use [`set_feature_types`](Self::set_feature_types).
82    ///
83    /// <p>A list of the types of analysis to perform. Add TABLES to the list to return information about the tables that are detected in the input document. Add FORMS to return detected form data. Add SIGNATURES to return the locations of detected signatures. Add LAYOUT to the list to return information about the layout of the document. All lines and words detected in the document are included in the response (including text that isn't related to the value of <code>FeatureTypes</code>).</p>
84    pub fn feature_types(mut self, input: crate::types::FeatureType) -> Self {
85        let mut v = self.feature_types.unwrap_or_default();
86        v.push(input);
87        self.feature_types = ::std::option::Option::Some(v);
88        self
89    }
90    /// <p>A list of the types of analysis to perform. Add TABLES to the list to return information about the tables that are detected in the input document. Add FORMS to return detected form data. Add SIGNATURES to return the locations of detected signatures. Add LAYOUT to the list to return information about the layout of the document. All lines and words detected in the document are included in the response (including text that isn't related to the value of <code>FeatureTypes</code>).</p>
91    pub fn set_feature_types(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::FeatureType>>) -> Self {
92        self.feature_types = input;
93        self
94    }
95    /// <p>A list of the types of analysis to perform. Add TABLES to the list to return information about the tables that are detected in the input document. Add FORMS to return detected form data. Add SIGNATURES to return the locations of detected signatures. Add LAYOUT to the list to return information about the layout of the document. All lines and words detected in the document are included in the response (including text that isn't related to the value of <code>FeatureTypes</code>).</p>
96    pub fn get_feature_types(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::FeatureType>> {
97        &self.feature_types
98    }
99    /// <p>Sets the configuration for the human in the loop workflow for analyzing documents.</p>
100    pub fn human_loop_config(mut self, input: crate::types::HumanLoopConfig) -> Self {
101        self.human_loop_config = ::std::option::Option::Some(input);
102        self
103    }
104    /// <p>Sets the configuration for the human in the loop workflow for analyzing documents.</p>
105    pub fn set_human_loop_config(mut self, input: ::std::option::Option<crate::types::HumanLoopConfig>) -> Self {
106        self.human_loop_config = input;
107        self
108    }
109    /// <p>Sets the configuration for the human in the loop workflow for analyzing documents.</p>
110    pub fn get_human_loop_config(&self) -> &::std::option::Option<crate::types::HumanLoopConfig> {
111        &self.human_loop_config
112    }
113    /// <p>Contains Queries and the alias for those Queries, as determined by the input.</p>
114    pub fn queries_config(mut self, input: crate::types::QueriesConfig) -> Self {
115        self.queries_config = ::std::option::Option::Some(input);
116        self
117    }
118    /// <p>Contains Queries and the alias for those Queries, as determined by the input.</p>
119    pub fn set_queries_config(mut self, input: ::std::option::Option<crate::types::QueriesConfig>) -> Self {
120        self.queries_config = input;
121        self
122    }
123    /// <p>Contains Queries and the alias for those Queries, as determined by the input.</p>
124    pub fn get_queries_config(&self) -> &::std::option::Option<crate::types::QueriesConfig> {
125        &self.queries_config
126    }
127    /// <p>Specifies the adapter to be used when analyzing a document.</p>
128    pub fn adapters_config(mut self, input: crate::types::AdaptersConfig) -> Self {
129        self.adapters_config = ::std::option::Option::Some(input);
130        self
131    }
132    /// <p>Specifies the adapter to be used when analyzing a document.</p>
133    pub fn set_adapters_config(mut self, input: ::std::option::Option<crate::types::AdaptersConfig>) -> Self {
134        self.adapters_config = input;
135        self
136    }
137    /// <p>Specifies the adapter to be used when analyzing a document.</p>
138    pub fn get_adapters_config(&self) -> &::std::option::Option<crate::types::AdaptersConfig> {
139        &self.adapters_config
140    }
141    /// Consumes the builder and constructs a [`AnalyzeDocumentInput`](crate::operation::analyze_document::AnalyzeDocumentInput).
142    pub fn build(
143        self,
144    ) -> ::std::result::Result<crate::operation::analyze_document::AnalyzeDocumentInput, ::aws_smithy_types::error::operation::BuildError> {
145        ::std::result::Result::Ok(crate::operation::analyze_document::AnalyzeDocumentInput {
146            document: self.document,
147            feature_types: self.feature_types,
148            human_loop_config: self.human_loop_config,
149            queries_config: self.queries_config,
150            adapters_config: self.adapters_config,
151        })
152    }
153}