/* * 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.
*
* 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. To perform both forms and table analysis, add TABLES and FORMS to
* FeatureTypes
. To detect signatures within form data and table data, add SIGNATURES to either TABLES
* or FORMS. All lines and words detected in the document are included in the response (including text that isn't
* related to the value of 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; /** ** 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.
*
* 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.
*
* 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.
*
* 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. To perform both forms and table analysis, add TABLES and FORMS to
* FeatureTypes
. To detect signatures within form data and table data, add SIGNATURES to either TABLES
* or FORMS. All lines and words detected in the document are included in the response (including text that isn't
* related to the value of FeatureTypes
).
*
FeatureTypes
. To detect signatures within form data and table data, add SIGNATURES to either
* TABLES or FORMS. 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
* 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. To perform both forms and table analysis, add TABLES and FORMS to
* FeatureTypes
. To detect signatures within form data and table data, add SIGNATURES to either TABLES
* or FORMS. All lines and words detected in the document are included in the response (including text that isn't
* related to the value of FeatureTypes
).
*
FeatureTypes
. To detect signatures within form data and table data, add SIGNATURES to either
* TABLES or FORMS. 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
* 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. To perform both forms and table analysis, add TABLES and FORMS to
* FeatureTypes
. To detect signatures within form data and table data, add SIGNATURES to either TABLES
* or FORMS. 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. To perform both forms and table analysis, add TABLES and FORMS to *FeatureTypes
. To detect signatures within form data and table data, add SIGNATURES to either
* TABLES or FORMS. 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
* 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. To perform both forms and table analysis, add TABLES and FORMS to
* FeatureTypes
. To detect signatures within form data and table data, add SIGNATURES to either TABLES
* or FORMS. All lines and words detected in the document are included in the response (including text that isn't
* related to the value of FeatureTypes
).
*
FeatureTypes
. To detect signatures within form data and table data, add SIGNATURES to either
* TABLES or FORMS. 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
* 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. To perform both forms and table analysis, add TABLES and FORMS to
* FeatureTypes
. To detect signatures within form data and table data, add SIGNATURES to either TABLES
* or FORMS. All lines and words detected in the document are included in the response (including text that isn't
* related to the value of FeatureTypes
).
*
FeatureTypes
. To detect signatures within form data and table data, add SIGNATURES to either
* TABLES or FORMS. 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* 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; } /** * 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()); 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; 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()); return hashCode; } @Override public AnalyzeDocumentRequest clone() { return (AnalyzeDocumentRequest) super.clone(); } }