com.amazonaws.services.textract.model.AnalyzeDocumentRequest Maven / Gradle / Ivy
/*
* Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.textract.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AnalyzeDocumentRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* 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.
*
*
* 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 Bytes
field.
*
*/
private Document document;
/**
*
* 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 FeatureTypes
).
*
*/
private java.util.List featureTypes;
/**
*
* Sets the configuration for the human in the loop workflow for analyzing documents.
*
*/
private HumanLoopConfig humanLoopConfig;
/**
*
* Contains Queries and the alias for those Queries, as determined by the input.
*
*/
private QueriesConfig queriesConfig;
/**
*
* Specifies the adapter to be used when analyzing a document.
*
*/
private AdaptersConfig adaptersConfig;
/**
*
* 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.
*
*
* 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 Bytes
field.
*
*
* @param document
* 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.
*
* 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 Bytes
field.
*/
public void setDocument(Document document) {
this.document = document;
}
/**
*
* 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.
*
*
* 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 Bytes
field.
*
*
* @return 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.
*
* 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 Bytes
field.
*/
public Document getDocument() {
return this.document;
}
/**
*
* 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.
*
*
* 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 Bytes
field.
*
*
* @param document
* 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.
*
* 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 Bytes
field.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AnalyzeDocumentRequest withDocument(Document document) {
setDocument(document);
return this;
}
/**
*
* 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 FeatureTypes
).
*
*
* @return 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 FeatureTypes
).
* @see FeatureType
*/
public java.util.List getFeatureTypes() {
return featureTypes;
}
/**
*
* 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 FeatureTypes
).
*
*
* @param featureTypes
* 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 FeatureTypes
).
* @see FeatureType
*/
public void setFeatureTypes(java.util.Collection featureTypes) {
if (featureTypes == null) {
this.featureTypes = null;
return;
}
this.featureTypes = new java.util.ArrayList(featureTypes);
}
/**
*
* 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 FeatureTypes
).
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setFeatureTypes(java.util.Collection)} or {@link #withFeatureTypes(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param featureTypes
* 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 FeatureTypes
).
* @return Returns a reference to this object so that method calls can be chained together.
* @see FeatureType
*/
public AnalyzeDocumentRequest withFeatureTypes(String... featureTypes) {
if (this.featureTypes == null) {
setFeatureTypes(new java.util.ArrayList(featureTypes.length));
}
for (String ele : featureTypes) {
this.featureTypes.add(ele);
}
return this;
}
/**
*
* 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 FeatureTypes
).
*
*
* @param featureTypes
* 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 FeatureTypes
).
* @return Returns a reference to this object so that method calls can be chained together.
* @see FeatureType
*/
public AnalyzeDocumentRequest withFeatureTypes(java.util.Collection featureTypes) {
setFeatureTypes(featureTypes);
return this;
}
/**
*
* 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 FeatureTypes
).
*
*
* @param featureTypes
* 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 FeatureTypes
).
* @return Returns a reference to this object so that method calls can be chained together.
* @see FeatureType
*/
public AnalyzeDocumentRequest withFeatureTypes(FeatureType... featureTypes) {
java.util.ArrayList featureTypesCopy = new java.util.ArrayList(featureTypes.length);
for (FeatureType value : featureTypes) {
featureTypesCopy.add(value.toString());
}
if (getFeatureTypes() == null) {
setFeatureTypes(featureTypesCopy);
} else {
getFeatureTypes().addAll(featureTypesCopy);
}
return this;
}
/**
*
* Sets the configuration for the human in the loop workflow for analyzing documents.
*
*
* @param humanLoopConfig
* Sets the configuration for the human in the loop workflow for analyzing documents.
*/
public void setHumanLoopConfig(HumanLoopConfig humanLoopConfig) {
this.humanLoopConfig = humanLoopConfig;
}
/**
*
* Sets the configuration for the human in the loop workflow for analyzing documents.
*
*
* @return Sets the configuration for the human in the loop workflow for analyzing documents.
*/
public HumanLoopConfig getHumanLoopConfig() {
return this.humanLoopConfig;
}
/**
*
* Sets the configuration for the human in the loop workflow for analyzing documents.
*
*
* @param humanLoopConfig
* Sets the configuration for the human in the loop workflow for analyzing documents.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AnalyzeDocumentRequest withHumanLoopConfig(HumanLoopConfig humanLoopConfig) {
setHumanLoopConfig(humanLoopConfig);
return this;
}
/**
*
* Contains Queries and the alias for those Queries, as determined by the input.
*
*
* @param queriesConfig
* Contains Queries and the alias for those Queries, as determined by the input.
*/
public void setQueriesConfig(QueriesConfig queriesConfig) {
this.queriesConfig = queriesConfig;
}
/**
*
* Contains Queries and the alias for those Queries, as determined by the input.
*
*
* @return Contains Queries and the alias for those Queries, as determined by the input.
*/
public QueriesConfig getQueriesConfig() {
return this.queriesConfig;
}
/**
*
* Contains Queries and the alias for those Queries, as determined by the input.
*
*
* @param queriesConfig
* Contains Queries and the alias for those Queries, as determined by the input.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AnalyzeDocumentRequest withQueriesConfig(QueriesConfig queriesConfig) {
setQueriesConfig(queriesConfig);
return this;
}
/**
*
* Specifies the adapter to be used when analyzing a document.
*
*
* @param adaptersConfig
* Specifies the adapter to be used when analyzing a document.
*/
public void setAdaptersConfig(AdaptersConfig adaptersConfig) {
this.adaptersConfig = adaptersConfig;
}
/**
*
* Specifies the adapter to be used when analyzing a document.
*
*
* @return Specifies the adapter to be used when analyzing a document.
*/
public AdaptersConfig getAdaptersConfig() {
return this.adaptersConfig;
}
/**
*
* Specifies the adapter to be used when analyzing a document.
*
*
* @param adaptersConfig
* Specifies the adapter to be used when analyzing a document.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AnalyzeDocumentRequest withAdaptersConfig(AdaptersConfig adaptersConfig) {
setAdaptersConfig(adaptersConfig);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getDocument() != null)
sb.append("Document: ").append(getDocument()).append(",");
if (getFeatureTypes() != null)
sb.append("FeatureTypes: ").append(getFeatureTypes()).append(",");
if (getHumanLoopConfig() != null)
sb.append("HumanLoopConfig: ").append(getHumanLoopConfig()).append(",");
if (getQueriesConfig() != null)
sb.append("QueriesConfig: ").append(getQueriesConfig()).append(",");
if (getAdaptersConfig() != null)
sb.append("AdaptersConfig: ").append(getAdaptersConfig());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof AnalyzeDocumentRequest == false)
return false;
AnalyzeDocumentRequest other = (AnalyzeDocumentRequest) obj;
if (other.getDocument() == null ^ this.getDocument() == null)
return false;
if (other.getDocument() != null && other.getDocument().equals(this.getDocument()) == false)
return false;
if (other.getFeatureTypes() == null ^ this.getFeatureTypes() == null)
return false;
if (other.getFeatureTypes() != null && other.getFeatureTypes().equals(this.getFeatureTypes()) == false)
return false;
if (other.getHumanLoopConfig() == null ^ this.getHumanLoopConfig() == null)
return false;
if (other.getHumanLoopConfig() != null && other.getHumanLoopConfig().equals(this.getHumanLoopConfig()) == false)
return false;
if (other.getQueriesConfig() == null ^ this.getQueriesConfig() == null)
return false;
if (other.getQueriesConfig() != null && other.getQueriesConfig().equals(this.getQueriesConfig()) == false)
return false;
if (other.getAdaptersConfig() == null ^ this.getAdaptersConfig() == null)
return false;
if (other.getAdaptersConfig() != null && other.getAdaptersConfig().equals(this.getAdaptersConfig()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getDocument() == null) ? 0 : getDocument().hashCode());
hashCode = prime * hashCode + ((getFeatureTypes() == null) ? 0 : getFeatureTypes().hashCode());
hashCode = prime * hashCode + ((getHumanLoopConfig() == null) ? 0 : getHumanLoopConfig().hashCode());
hashCode = prime * hashCode + ((getQueriesConfig() == null) ? 0 : getQueriesConfig().hashCode());
hashCode = prime * hashCode + ((getAdaptersConfig() == null) ? 0 : getAdaptersConfig().hashCode());
return hashCode;
}
@Override
public AnalyzeDocumentRequest clone() {
return (AnalyzeDocumentRequest) super.clone();
}
}