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
// 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 AnalyzeDocumentInput {
/// <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>
/// <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>
pub document: ::std::option::Option<crate::types::Document>,
/// <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>
pub feature_types: ::std::option::Option<::std::vec::Vec<crate::types::FeatureType>>,
/// <p>Sets the configuration for the human in the loop workflow for analyzing documents.</p>
pub human_loop_config: ::std::option::Option<crate::types::HumanLoopConfig>,
/// <p>Contains Queries and the alias for those Queries, as determined by the input. </p>
pub queries_config: ::std::option::Option<crate::types::QueriesConfig>,
/// <p>Specifies the adapter to be used when analyzing a document.</p>
pub adapters_config: ::std::option::Option<crate::types::AdaptersConfig>,
}
impl AnalyzeDocumentInput {
/// <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>
/// <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>
pub fn document(&self) -> ::std::option::Option<&crate::types::Document> {
self.document.as_ref()
}
/// <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>
///
/// 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()`.
pub fn feature_types(&self) -> &[crate::types::FeatureType] {
self.feature_types.as_deref().unwrap_or_default()
}
/// <p>Sets the configuration for the human in the loop workflow for analyzing documents.</p>
pub fn human_loop_config(&self) -> ::std::option::Option<&crate::types::HumanLoopConfig> {
self.human_loop_config.as_ref()
}
/// <p>Contains Queries and the alias for those Queries, as determined by the input. </p>
pub fn queries_config(&self) -> ::std::option::Option<&crate::types::QueriesConfig> {
self.queries_config.as_ref()
}
/// <p>Specifies the adapter to be used when analyzing a document.</p>
pub fn adapters_config(&self) -> ::std::option::Option<&crate::types::AdaptersConfig> {
self.adapters_config.as_ref()
}
}
impl AnalyzeDocumentInput {
/// Creates a new builder-style object to manufacture [`AnalyzeDocumentInput`](crate::operation::analyze_document::AnalyzeDocumentInput).
pub fn builder() -> crate::operation::analyze_document::builders::AnalyzeDocumentInputBuilder {
crate::operation::analyze_document::builders::AnalyzeDocumentInputBuilder::default()
}
}
/// A builder for [`AnalyzeDocumentInput`](crate::operation::analyze_document::AnalyzeDocumentInput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct AnalyzeDocumentInputBuilder {
pub(crate) document: ::std::option::Option<crate::types::Document>,
pub(crate) feature_types: ::std::option::Option<::std::vec::Vec<crate::types::FeatureType>>,
pub(crate) human_loop_config: ::std::option::Option<crate::types::HumanLoopConfig>,
pub(crate) queries_config: ::std::option::Option<crate::types::QueriesConfig>,
pub(crate) adapters_config: ::std::option::Option<crate::types::AdaptersConfig>,
}
impl AnalyzeDocumentInputBuilder {
/// <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>
/// <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>
/// This field is required.
pub fn document(mut self, input: crate::types::Document) -> Self {
self.document = ::std::option::Option::Some(input);
self
}
/// <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>
/// <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>
pub fn set_document(mut self, input: ::std::option::Option<crate::types::Document>) -> Self {
self.document = input;
self
}
/// <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>
/// <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>
pub fn get_document(&self) -> &::std::option::Option<crate::types::Document> {
&self.document
}
/// Appends an item to `feature_types`.
///
/// To override the contents of this collection use [`set_feature_types`](Self::set_feature_types).
///
/// <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>
pub fn feature_types(mut self, input: crate::types::FeatureType) -> Self {
let mut v = self.feature_types.unwrap_or_default();
v.push(input);
self.feature_types = ::std::option::Option::Some(v);
self
}
/// <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>
pub fn set_feature_types(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::FeatureType>>) -> Self {
self.feature_types = input;
self
}
/// <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>
pub fn get_feature_types(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::FeatureType>> {
&self.feature_types
}
/// <p>Sets the configuration for the human in the loop workflow for analyzing documents.</p>
pub fn human_loop_config(mut self, input: crate::types::HumanLoopConfig) -> Self {
self.human_loop_config = ::std::option::Option::Some(input);
self
}
/// <p>Sets the configuration for the human in the loop workflow for analyzing documents.</p>
pub fn set_human_loop_config(mut self, input: ::std::option::Option<crate::types::HumanLoopConfig>) -> Self {
self.human_loop_config = input;
self
}
/// <p>Sets the configuration for the human in the loop workflow for analyzing documents.</p>
pub fn get_human_loop_config(&self) -> &::std::option::Option<crate::types::HumanLoopConfig> {
&self.human_loop_config
}
/// <p>Contains Queries and the alias for those Queries, as determined by the input. </p>
pub fn queries_config(mut self, input: crate::types::QueriesConfig) -> Self {
self.queries_config = ::std::option::Option::Some(input);
self
}
/// <p>Contains Queries and the alias for those Queries, as determined by the input. </p>
pub fn set_queries_config(mut self, input: ::std::option::Option<crate::types::QueriesConfig>) -> Self {
self.queries_config = input;
self
}
/// <p>Contains Queries and the alias for those Queries, as determined by the input. </p>
pub fn get_queries_config(&self) -> &::std::option::Option<crate::types::QueriesConfig> {
&self.queries_config
}
/// <p>Specifies the adapter to be used when analyzing a document.</p>
pub fn adapters_config(mut self, input: crate::types::AdaptersConfig) -> Self {
self.adapters_config = ::std::option::Option::Some(input);
self
}
/// <p>Specifies the adapter to be used when analyzing a document.</p>
pub fn set_adapters_config(mut self, input: ::std::option::Option<crate::types::AdaptersConfig>) -> Self {
self.adapters_config = input;
self
}
/// <p>Specifies the adapter to be used when analyzing a document.</p>
pub fn get_adapters_config(&self) -> &::std::option::Option<crate::types::AdaptersConfig> {
&self.adapters_config
}
/// Consumes the builder and constructs a [`AnalyzeDocumentInput`](crate::operation::analyze_document::AnalyzeDocumentInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::analyze_document::AnalyzeDocumentInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::analyze_document::AnalyzeDocumentInput {
document: self.document,
feature_types: self.feature_types,
human_loop_config: self.human_loop_config,
queries_config: self.queries_config,
adapters_config: self.adapters_config,
})
}
}