
software.amazon.awssdk.services.textract.TextractAsyncClient Maven / Gradle / Ivy
/*
* Copyright 2014-2019 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 software.amazon.awssdk.services.textract;
import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkClient;
import software.amazon.awssdk.services.textract.model.AnalyzeDocumentRequest;
import software.amazon.awssdk.services.textract.model.AnalyzeDocumentResponse;
import software.amazon.awssdk.services.textract.model.DetectDocumentTextRequest;
import software.amazon.awssdk.services.textract.model.DetectDocumentTextResponse;
import software.amazon.awssdk.services.textract.model.GetDocumentAnalysisRequest;
import software.amazon.awssdk.services.textract.model.GetDocumentAnalysisResponse;
import software.amazon.awssdk.services.textract.model.GetDocumentTextDetectionRequest;
import software.amazon.awssdk.services.textract.model.GetDocumentTextDetectionResponse;
import software.amazon.awssdk.services.textract.model.StartDocumentAnalysisRequest;
import software.amazon.awssdk.services.textract.model.StartDocumentAnalysisResponse;
import software.amazon.awssdk.services.textract.model.StartDocumentTextDetectionRequest;
import software.amazon.awssdk.services.textract.model.StartDocumentTextDetectionResponse;
/**
* Service client for accessing Amazon Textract asynchronously. This can be created using the static {@link #builder()}
* method.
*
*
* Amazon Textract detects and analyzes text in documents and converts it into machine-readable text. This is the API
* reference documentation for Amazon Textract.
*
*/
@Generated("software.amazon.awssdk:codegen")
public interface TextractAsyncClient extends SdkClient {
String SERVICE_NAME = "textract";
/**
* Create a {@link TextractAsyncClient} with the region loaded from the
* {@link software.amazon.awssdk.regions.providers.DefaultAwsRegionProviderChain} and credentials loaded from the
* {@link software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider}.
*/
static TextractAsyncClient create() {
return builder().build();
}
/**
* Create a builder that can be used to configure and create a {@link TextractAsyncClient}.
*/
static TextractAsyncClientBuilder builder() {
return new DefaultTextractAsyncClientBuilder();
}
/**
*
* Analyzes an input document for relationships in the detected text and tables.
*
*
* Two types of information are returned:
*
*
* -
*
* Words and lines that are related to nearby lines and words. The related information is returned in two
* Block objects: a KEY Block object and a VALUE Block object. For example, Name: Ana Silva Carolina
* contains a key and value. Name: is the key. Ana Silva Carolina is the value.
*
*
* -
*
* Table and table cell data. A TABLE Block contains information about a detected table. A CELL block is returned
* for each cell in a table.
*
*
*
*
* You can choose which type of analysis to perform by specifying the FeatureTypes
list.
*
*
* The output is returned in a list of BLOCK
objects (Blocks). For more information, see
* how-it-works-analyzing.
*
*
* AnalyzeDocument
is a synchronous operation. To analyze documents asynchronously, use
* StartDocumentAnalysis.
*
*
* @param analyzeDocumentRequest
* @return A Java Future containing the result of the AnalyzeDocument operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidParameterException An input parameter violated a constraint. For example, in synchronous
* operations, an
InvalidParameterException
exception occurs when neither of the
* S3Object
or Bytes
values are supplied in the Document
request
* parameter. Validate your parameter before calling the API operation again.
* - InvalidS3ObjectException Amazon Textract is unable to access the S3 object that's specified in the
* request.
* - UnsupportedDocumentException The format of the input document isn't supported. Amazon Textract
* supports documents that are .png or .jpg format.
* - DocumentTooLargeException The document can't be processed because it's too large. The maximum
* document size for synchronous operations 5 MB. The maximum document size for asynchronous operations is
* 500 MB for PDF format files.
* - BadDocumentException Amazon Textract isn't able to read the document.
* - AccessDeniedException You aren't authorized to perform the action.
* - ProvisionedThroughputExceededException The number of requests exceeded your throughput limit. If you
* want to increase this limit, contact Amazon Textract.
* - InternalServerErrorException Amazon Textract experienced a service issue. Try your call again.
* - ThrottlingException Amazon Textract is temporarily unable to process the request. Try your call
* again.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - TextractException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample TextractAsyncClient.AnalyzeDocument
* @see AWS API
* Documentation
*/
default CompletableFuture analyzeDocument(AnalyzeDocumentRequest analyzeDocumentRequest) {
throw new UnsupportedOperationException();
}
/**
*
* Analyzes an input document for relationships in the detected text and tables.
*
*
* Two types of information are returned:
*
*
* -
*
* Words and lines that are related to nearby lines and words. The related information is returned in two
* Block objects: a KEY Block object and a VALUE Block object. For example, Name: Ana Silva Carolina
* contains a key and value. Name: is the key. Ana Silva Carolina is the value.
*
*
* -
*
* Table and table cell data. A TABLE Block contains information about a detected table. A CELL block is returned
* for each cell in a table.
*
*
*
*
* You can choose which type of analysis to perform by specifying the FeatureTypes
list.
*
*
* The output is returned in a list of BLOCK
objects (Blocks). For more information, see
* how-it-works-analyzing.
*
*
* AnalyzeDocument
is a synchronous operation. To analyze documents asynchronously, use
* StartDocumentAnalysis.
*
*
*
* This is a convenience which creates an instance of the {@link AnalyzeDocumentRequest.Builder} avoiding the need
* to create one manually via {@link AnalyzeDocumentRequest#builder()}
*
*
* @param analyzeDocumentRequest
* A {@link Consumer} that will call methods on {@link AnalyzeDocumentRequest.Builder} to create a request.
* @return A Java Future containing the result of the AnalyzeDocument operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidParameterException An input parameter violated a constraint. For example, in synchronous
* operations, an
InvalidParameterException
exception occurs when neither of the
* S3Object
or Bytes
values are supplied in the Document
request
* parameter. Validate your parameter before calling the API operation again.
* - InvalidS3ObjectException Amazon Textract is unable to access the S3 object that's specified in the
* request.
* - UnsupportedDocumentException The format of the input document isn't supported. Amazon Textract
* supports documents that are .png or .jpg format.
* - DocumentTooLargeException The document can't be processed because it's too large. The maximum
* document size for synchronous operations 5 MB. The maximum document size for asynchronous operations is
* 500 MB for PDF format files.
* - BadDocumentException Amazon Textract isn't able to read the document.
* - AccessDeniedException You aren't authorized to perform the action.
* - ProvisionedThroughputExceededException The number of requests exceeded your throughput limit. If you
* want to increase this limit, contact Amazon Textract.
* - InternalServerErrorException Amazon Textract experienced a service issue. Try your call again.
* - ThrottlingException Amazon Textract is temporarily unable to process the request. Try your call
* again.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - TextractException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample TextractAsyncClient.AnalyzeDocument
* @see AWS API
* Documentation
*/
default CompletableFuture analyzeDocument(
Consumer analyzeDocumentRequest) {
return analyzeDocument(AnalyzeDocumentRequest.builder().applyMutation(analyzeDocumentRequest).build());
}
/**
*
* Detects text in the input document. Amazon Textract can detect lines of text and the words that make up a line of
* text. The input document must be an image in JPG or PNG format. DetectDocumentText
returns the
* detected text in an array of Block objects. For more information, see how-it-works-detecting.
*
*
* DetectDocumentText
is a synchronous operation. To analyze documents asynchronously, use
* StartDocumentTextDetection.
*
*
* @param detectDocumentTextRequest
* @return A Java Future containing the result of the DetectDocumentText operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidParameterException An input parameter violated a constraint. For example, in synchronous
* operations, an
InvalidParameterException
exception occurs when neither of the
* S3Object
or Bytes
values are supplied in the Document
request
* parameter. Validate your parameter before calling the API operation again.
* - InvalidS3ObjectException Amazon Textract is unable to access the S3 object that's specified in the
* request.
* - UnsupportedDocumentException The format of the input document isn't supported. Amazon Textract
* supports documents that are .png or .jpg format.
* - DocumentTooLargeException The document can't be processed because it's too large. The maximum
* document size for synchronous operations 5 MB. The maximum document size for asynchronous operations is
* 500 MB for PDF format files.
* - BadDocumentException Amazon Textract isn't able to read the document.
* - AccessDeniedException You aren't authorized to perform the action.
* - ProvisionedThroughputExceededException The number of requests exceeded your throughput limit. If you
* want to increase this limit, contact Amazon Textract.
* - InternalServerErrorException Amazon Textract experienced a service issue. Try your call again.
* - ThrottlingException Amazon Textract is temporarily unable to process the request. Try your call
* again.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - TextractException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample TextractAsyncClient.DetectDocumentText
* @see AWS
* API Documentation
*/
default CompletableFuture detectDocumentText(DetectDocumentTextRequest detectDocumentTextRequest) {
throw new UnsupportedOperationException();
}
/**
*
* Detects text in the input document. Amazon Textract can detect lines of text and the words that make up a line of
* text. The input document must be an image in JPG or PNG format. DetectDocumentText
returns the
* detected text in an array of Block objects. For more information, see how-it-works-detecting.
*
*
* DetectDocumentText
is a synchronous operation. To analyze documents asynchronously, use
* StartDocumentTextDetection.
*
*
*
* This is a convenience which creates an instance of the {@link DetectDocumentTextRequest.Builder} avoiding the
* need to create one manually via {@link DetectDocumentTextRequest#builder()}
*
*
* @param detectDocumentTextRequest
* A {@link Consumer} that will call methods on {@link DetectDocumentTextRequest.Builder} to create a
* request.
* @return A Java Future containing the result of the DetectDocumentText operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidParameterException An input parameter violated a constraint. For example, in synchronous
* operations, an
InvalidParameterException
exception occurs when neither of the
* S3Object
or Bytes
values are supplied in the Document
request
* parameter. Validate your parameter before calling the API operation again.
* - InvalidS3ObjectException Amazon Textract is unable to access the S3 object that's specified in the
* request.
* - UnsupportedDocumentException The format of the input document isn't supported. Amazon Textract
* supports documents that are .png or .jpg format.
* - DocumentTooLargeException The document can't be processed because it's too large. The maximum
* document size for synchronous operations 5 MB. The maximum document size for asynchronous operations is
* 500 MB for PDF format files.
* - BadDocumentException Amazon Textract isn't able to read the document.
* - AccessDeniedException You aren't authorized to perform the action.
* - ProvisionedThroughputExceededException The number of requests exceeded your throughput limit. If you
* want to increase this limit, contact Amazon Textract.
* - InternalServerErrorException Amazon Textract experienced a service issue. Try your call again.
* - ThrottlingException Amazon Textract is temporarily unable to process the request. Try your call
* again.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - TextractException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample TextractAsyncClient.DetectDocumentText
* @see AWS
* API Documentation
*/
default CompletableFuture detectDocumentText(
Consumer detectDocumentTextRequest) {
return detectDocumentText(DetectDocumentTextRequest.builder().applyMutation(detectDocumentTextRequest).build());
}
/**
*
* Gets the results for an Amazon Textract asynchronous operation that analyzes text in a document image.
*
*
* You start asynchronous text analysis by calling StartDocumentAnalysis, which returns a job identifier (
* JobId
). When the text analysis operation finishes, Amazon Textract publishes a completion status to
* the Amazon Simple Notification Service (Amazon SNS) topic that's registered in the initial call to
* StartDocumentAnalysis
. To get the results of the text-detection operation, first check that the
* status value published to the Amazon SNS topic is SUCCEEDED
. If so, call
* GetDocumentAnalysis
, and pass the job identifier (JobId
) from the initial call to
* StartDocumentAnalysis
.
*
*
* GetDocumentAnalysis
returns an array of Block objects. For more information, see
* how-it-works-analyzing.
*
*
* Use the MaxResults
parameter to limit the number of blocks returned. If there are more results than
* specified in MaxResults
, the value of NextToken
in the operation response contains a
* pagination token for getting the next set of results. To get the next page of results, call
* GetDocumentAnalysis
, and populate the NextToken
request parameter with the token value
* that's returned from the previous call to GetDocumentAnalysis
.
*
*
* @param getDocumentAnalysisRequest
* @return A Java Future containing the result of the GetDocumentAnalysis operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidParameterException An input parameter violated a constraint. For example, in synchronous
* operations, an
InvalidParameterException
exception occurs when neither of the
* S3Object
or Bytes
values are supplied in the Document
request
* parameter. Validate your parameter before calling the API operation again.
* - AccessDeniedException You aren't authorized to perform the action.
* - ProvisionedThroughputExceededException The number of requests exceeded your throughput limit. If you
* want to increase this limit, contact Amazon Textract.
* - InvalidJobIdException An invalid job identifier was passed to GetDocumentAnalysis or to
* GetDocumentAnalysis.
* - InternalServerErrorException Amazon Textract experienced a service issue. Try your call again.
* - ThrottlingException Amazon Textract is temporarily unable to process the request. Try your call
* again.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - TextractException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample TextractAsyncClient.GetDocumentAnalysis
* @see AWS
* API Documentation
*/
default CompletableFuture getDocumentAnalysis(
GetDocumentAnalysisRequest getDocumentAnalysisRequest) {
throw new UnsupportedOperationException();
}
/**
*
* Gets the results for an Amazon Textract asynchronous operation that analyzes text in a document image.
*
*
* You start asynchronous text analysis by calling StartDocumentAnalysis, which returns a job identifier (
* JobId
). When the text analysis operation finishes, Amazon Textract publishes a completion status to
* the Amazon Simple Notification Service (Amazon SNS) topic that's registered in the initial call to
* StartDocumentAnalysis
. To get the results of the text-detection operation, first check that the
* status value published to the Amazon SNS topic is SUCCEEDED
. If so, call
* GetDocumentAnalysis
, and pass the job identifier (JobId
) from the initial call to
* StartDocumentAnalysis
.
*
*
* GetDocumentAnalysis
returns an array of Block objects. For more information, see
* how-it-works-analyzing.
*
*
* Use the MaxResults
parameter to limit the number of blocks returned. If there are more results than
* specified in MaxResults
, the value of NextToken
in the operation response contains a
* pagination token for getting the next set of results. To get the next page of results, call
* GetDocumentAnalysis
, and populate the NextToken
request parameter with the token value
* that's returned from the previous call to GetDocumentAnalysis
.
*
*
*
* This is a convenience which creates an instance of the {@link GetDocumentAnalysisRequest.Builder} avoiding the
* need to create one manually via {@link GetDocumentAnalysisRequest#builder()}
*
*
* @param getDocumentAnalysisRequest
* A {@link Consumer} that will call methods on {@link GetDocumentAnalysisRequest.Builder} to create a
* request.
* @return A Java Future containing the result of the GetDocumentAnalysis operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidParameterException An input parameter violated a constraint. For example, in synchronous
* operations, an
InvalidParameterException
exception occurs when neither of the
* S3Object
or Bytes
values are supplied in the Document
request
* parameter. Validate your parameter before calling the API operation again.
* - AccessDeniedException You aren't authorized to perform the action.
* - ProvisionedThroughputExceededException The number of requests exceeded your throughput limit. If you
* want to increase this limit, contact Amazon Textract.
* - InvalidJobIdException An invalid job identifier was passed to GetDocumentAnalysis or to
* GetDocumentAnalysis.
* - InternalServerErrorException Amazon Textract experienced a service issue. Try your call again.
* - ThrottlingException Amazon Textract is temporarily unable to process the request. Try your call
* again.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - TextractException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample TextractAsyncClient.GetDocumentAnalysis
* @see AWS
* API Documentation
*/
default CompletableFuture getDocumentAnalysis(
Consumer getDocumentAnalysisRequest) {
return getDocumentAnalysis(GetDocumentAnalysisRequest.builder().applyMutation(getDocumentAnalysisRequest).build());
}
/**
*
* Gets the results for an Amazon Textract asynchronous operation that detects text in a document image. Amazon
* Textract can detect lines of text and the words that make up a line of text.
*
*
* You start asynchronous text detection by calling StartDocumentTextDetection, which returns a job
* identifier (JobId
). When the text detection operation finishes, Amazon Textract publishes a
* completion status to the Amazon Simple Notification Service (Amazon SNS) topic that's registered in the initial
* call to StartDocumentTextDetection
. To get the results of the text-detection operation, first check
* that the status value published to the Amazon SNS topic is SUCCEEDED
. If so, call
* GetDocumentTextDetection
, and pass the job identifier (JobId
) from the initial call to
* StartDocumentTextDetection
.
*
*
* GetDocumentTextDetection
returns an array of Block objects. For more information, see
* how-it-works-detecting.
*
*
* Use the MaxResults parameter to limit the number of blocks that are returned. If there are more results than
* specified in MaxResults
, the value of NextToken
in the operation response contains a
* pagination token for getting the next set of results. To get the next page of results, call
* GetDocumentTextDetection
, and populate the NextToken
request parameter with the token
* value that's returned from the previous call to GetDocumentTextDetection
.
*
*
* For more information, see Document Text Detection in the Amazon Textract Developer Guide.
*
*
* @param getDocumentTextDetectionRequest
* @return A Java Future containing the result of the GetDocumentTextDetection operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidParameterException An input parameter violated a constraint. For example, in synchronous
* operations, an
InvalidParameterException
exception occurs when neither of the
* S3Object
or Bytes
values are supplied in the Document
request
* parameter. Validate your parameter before calling the API operation again.
* - AccessDeniedException You aren't authorized to perform the action.
* - ProvisionedThroughputExceededException The number of requests exceeded your throughput limit. If you
* want to increase this limit, contact Amazon Textract.
* - InvalidJobIdException An invalid job identifier was passed to GetDocumentAnalysis or to
* GetDocumentAnalysis.
* - InternalServerErrorException Amazon Textract experienced a service issue. Try your call again.
* - ThrottlingException Amazon Textract is temporarily unable to process the request. Try your call
* again.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - TextractException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample TextractAsyncClient.GetDocumentTextDetection
* @see AWS API Documentation
*/
default CompletableFuture getDocumentTextDetection(
GetDocumentTextDetectionRequest getDocumentTextDetectionRequest) {
throw new UnsupportedOperationException();
}
/**
*
* Gets the results for an Amazon Textract asynchronous operation that detects text in a document image. Amazon
* Textract can detect lines of text and the words that make up a line of text.
*
*
* You start asynchronous text detection by calling StartDocumentTextDetection, which returns a job
* identifier (JobId
). When the text detection operation finishes, Amazon Textract publishes a
* completion status to the Amazon Simple Notification Service (Amazon SNS) topic that's registered in the initial
* call to StartDocumentTextDetection
. To get the results of the text-detection operation, first check
* that the status value published to the Amazon SNS topic is SUCCEEDED
. If so, call
* GetDocumentTextDetection
, and pass the job identifier (JobId
) from the initial call to
* StartDocumentTextDetection
.
*
*
* GetDocumentTextDetection
returns an array of Block objects. For more information, see
* how-it-works-detecting.
*
*
* Use the MaxResults parameter to limit the number of blocks that are returned. If there are more results than
* specified in MaxResults
, the value of NextToken
in the operation response contains a
* pagination token for getting the next set of results. To get the next page of results, call
* GetDocumentTextDetection
, and populate the NextToken
request parameter with the token
* value that's returned from the previous call to GetDocumentTextDetection
.
*
*
* For more information, see Document Text Detection in the Amazon Textract Developer Guide.
*
*
*
* This is a convenience which creates an instance of the {@link GetDocumentTextDetectionRequest.Builder} avoiding
* the need to create one manually via {@link GetDocumentTextDetectionRequest#builder()}
*
*
* @param getDocumentTextDetectionRequest
* A {@link Consumer} that will call methods on {@link GetDocumentTextDetectionRequest.Builder} to create a
* request.
* @return A Java Future containing the result of the GetDocumentTextDetection operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidParameterException An input parameter violated a constraint. For example, in synchronous
* operations, an
InvalidParameterException
exception occurs when neither of the
* S3Object
or Bytes
values are supplied in the Document
request
* parameter. Validate your parameter before calling the API operation again.
* - AccessDeniedException You aren't authorized to perform the action.
* - ProvisionedThroughputExceededException The number of requests exceeded your throughput limit. If you
* want to increase this limit, contact Amazon Textract.
* - InvalidJobIdException An invalid job identifier was passed to GetDocumentAnalysis or to
* GetDocumentAnalysis.
* - InternalServerErrorException Amazon Textract experienced a service issue. Try your call again.
* - ThrottlingException Amazon Textract is temporarily unable to process the request. Try your call
* again.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - TextractException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample TextractAsyncClient.GetDocumentTextDetection
* @see AWS API Documentation
*/
default CompletableFuture getDocumentTextDetection(
Consumer getDocumentTextDetectionRequest) {
return getDocumentTextDetection(GetDocumentTextDetectionRequest.builder().applyMutation(getDocumentTextDetectionRequest)
.build());
}
/**
*
* Starts asynchronous analysis of text for relationships in the text and tables that are detected in a document.
* Amazon Textract returns for two types of information:
*
*
* -
*
* Words and lines that are related to nearby lines and words. The related information is returned in two
* Block objects: A KEY Block object and a VALUE Block object. For example, Name: Ana Silva Carolina
* contains a key and value. Name: is the key. Ana Silva Carolina is the value.
*
*
* -
*
* Table and table cell data. A TABLE block contains information about a detected table. A CELL block is returned
* for each cell in a table.
*
*
*
*
* Amazon Textract can analyze text in document images and PDF files that are stored in an Amazon S3 bucket. Use
* DocumentLocation to specify the bucket name and file name of the document image.
*
*
* StartDocumentAnalysis
returns a job identifier (JobId
) that you use to get the results
* of the operation. When text analysis is finished, Amazon Textract publishes a completion status to the Amazon
* Simple Notification Service (Amazon SNS) topic that you specify in NotificationChannel
. To get the
* results of the text analysis operation, first check that the status value published to the Amazon SNS topic is
* SUCCEEDED
. If so, call GetDocumentAnalysis, and pass the job identifier (JobId
)
* from the initial call to StartDocumentAnalysis
.
*
*
* @param startDocumentAnalysisRequest
* @return A Java Future containing the result of the StartDocumentAnalysis operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidParameterException An input parameter violated a constraint. For example, in synchronous
* operations, an
InvalidParameterException
exception occurs when neither of the
* S3Object
or Bytes
values are supplied in the Document
request
* parameter. Validate your parameter before calling the API operation again.
* - InvalidS3ObjectException Amazon Textract is unable to access the S3 object that's specified in the
* request.
* - UnsupportedDocumentException The format of the input document isn't supported. Amazon Textract
* supports documents that are .png or .jpg format.
* - DocumentTooLargeException The document can't be processed because it's too large. The maximum
* document size for synchronous operations 5 MB. The maximum document size for asynchronous operations is
* 500 MB for PDF format files.
* - BadDocumentException Amazon Textract isn't able to read the document.
* - AccessDeniedException You aren't authorized to perform the action.
* - ProvisionedThroughputExceededException The number of requests exceeded your throughput limit. If you
* want to increase this limit, contact Amazon Textract.
* - InternalServerErrorException Amazon Textract experienced a service issue. Try your call again.
* - IdempotentParameterMismatchException A
ClientRequestToken
input parameter was reused
* with an operation, but at least one of the other input parameters is different from the previous call to
* the operation.
* - ThrottlingException Amazon Textract is temporarily unable to process the request. Try your call
* again.
* - LimitExceededException An Amazon Textract service limit was exceeded. For example, if you start too
* many asynchronous jobs concurrently, calls to start operations (
StartDocumentTextDetection
,
* for example) raise a LimitExceededException exception (HTTP status code: 400) until the number of
* concurrently running jobs is below the Amazon Textract service limit.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - TextractException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample TextractAsyncClient.StartDocumentAnalysis
* @see AWS
* API Documentation
*/
default CompletableFuture startDocumentAnalysis(
StartDocumentAnalysisRequest startDocumentAnalysisRequest) {
throw new UnsupportedOperationException();
}
/**
*
* Starts asynchronous analysis of text for relationships in the text and tables that are detected in a document.
* Amazon Textract returns for two types of information:
*
*
* -
*
* Words and lines that are related to nearby lines and words. The related information is returned in two
* Block objects: A KEY Block object and a VALUE Block object. For example, Name: Ana Silva Carolina
* contains a key and value. Name: is the key. Ana Silva Carolina is the value.
*
*
* -
*
* Table and table cell data. A TABLE block contains information about a detected table. A CELL block is returned
* for each cell in a table.
*
*
*
*
* Amazon Textract can analyze text in document images and PDF files that are stored in an Amazon S3 bucket. Use
* DocumentLocation to specify the bucket name and file name of the document image.
*
*
* StartDocumentAnalysis
returns a job identifier (JobId
) that you use to get the results
* of the operation. When text analysis is finished, Amazon Textract publishes a completion status to the Amazon
* Simple Notification Service (Amazon SNS) topic that you specify in NotificationChannel
. To get the
* results of the text analysis operation, first check that the status value published to the Amazon SNS topic is
* SUCCEEDED
. If so, call GetDocumentAnalysis, and pass the job identifier (JobId
)
* from the initial call to StartDocumentAnalysis
.
*
*
*
* This is a convenience which creates an instance of the {@link StartDocumentAnalysisRequest.Builder} avoiding the
* need to create one manually via {@link StartDocumentAnalysisRequest#builder()}
*
*
* @param startDocumentAnalysisRequest
* A {@link Consumer} that will call methods on {@link StartDocumentAnalysisRequest.Builder} to create a
* request.
* @return A Java Future containing the result of the StartDocumentAnalysis operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidParameterException An input parameter violated a constraint. For example, in synchronous
* operations, an
InvalidParameterException
exception occurs when neither of the
* S3Object
or Bytes
values are supplied in the Document
request
* parameter. Validate your parameter before calling the API operation again.
* - InvalidS3ObjectException Amazon Textract is unable to access the S3 object that's specified in the
* request.
* - UnsupportedDocumentException The format of the input document isn't supported. Amazon Textract
* supports documents that are .png or .jpg format.
* - DocumentTooLargeException The document can't be processed because it's too large. The maximum
* document size for synchronous operations 5 MB. The maximum document size for asynchronous operations is
* 500 MB for PDF format files.
* - BadDocumentException Amazon Textract isn't able to read the document.
* - AccessDeniedException You aren't authorized to perform the action.
* - ProvisionedThroughputExceededException The number of requests exceeded your throughput limit. If you
* want to increase this limit, contact Amazon Textract.
* - InternalServerErrorException Amazon Textract experienced a service issue. Try your call again.
* - IdempotentParameterMismatchException A
ClientRequestToken
input parameter was reused
* with an operation, but at least one of the other input parameters is different from the previous call to
* the operation.
* - ThrottlingException Amazon Textract is temporarily unable to process the request. Try your call
* again.
* - LimitExceededException An Amazon Textract service limit was exceeded. For example, if you start too
* many asynchronous jobs concurrently, calls to start operations (
StartDocumentTextDetection
,
* for example) raise a LimitExceededException exception (HTTP status code: 400) until the number of
* concurrently running jobs is below the Amazon Textract service limit.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - TextractException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample TextractAsyncClient.StartDocumentAnalysis
* @see AWS
* API Documentation
*/
default CompletableFuture startDocumentAnalysis(
Consumer startDocumentAnalysisRequest) {
return startDocumentAnalysis(StartDocumentAnalysisRequest.builder().applyMutation(startDocumentAnalysisRequest).build());
}
/**
*
* Starts the asynchronous detection of text in a document. Amazon Textract can detect lines of text and the words
* that make up a line of text.
*
*
* Amazon Textract can detect text in document images and PDF files that are stored in an Amazon S3 bucket. Use
* DocumentLocation to specify the bucket name and the file name of the document image.
*
*
* StartTextDetection
returns a job identifier (JobId
) that you use to get the results of
* the operation. When text detection is finished, Amazon Textract publishes a completion status to the Amazon
* Simple Notification Service (Amazon SNS) topic that you specify in NotificationChannel
. To get the
* results of the text detection operation, first check that the status value published to the Amazon SNS topic is
* SUCCEEDED
. If so, call GetDocumentTextDetection, and pass the job identifier (
* JobId
) from the initial call to StartDocumentTextDetection
.
*
*
* For more information, see Document Text Detection in the Amazon Textract Developer Guide.
*
*
* @param startDocumentTextDetectionRequest
* @return A Java Future containing the result of the StartDocumentTextDetection operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidParameterException An input parameter violated a constraint. For example, in synchronous
* operations, an
InvalidParameterException
exception occurs when neither of the
* S3Object
or Bytes
values are supplied in the Document
request
* parameter. Validate your parameter before calling the API operation again.
* - InvalidS3ObjectException Amazon Textract is unable to access the S3 object that's specified in the
* request.
* - UnsupportedDocumentException The format of the input document isn't supported. Amazon Textract
* supports documents that are .png or .jpg format.
* - DocumentTooLargeException The document can't be processed because it's too large. The maximum
* document size for synchronous operations 5 MB. The maximum document size for asynchronous operations is
* 500 MB for PDF format files.
* - BadDocumentException Amazon Textract isn't able to read the document.
* - AccessDeniedException You aren't authorized to perform the action.
* - ProvisionedThroughputExceededException The number of requests exceeded your throughput limit. If you
* want to increase this limit, contact Amazon Textract.
* - InternalServerErrorException Amazon Textract experienced a service issue. Try your call again.
* - IdempotentParameterMismatchException A
ClientRequestToken
input parameter was reused
* with an operation, but at least one of the other input parameters is different from the previous call to
* the operation.
* - ThrottlingException Amazon Textract is temporarily unable to process the request. Try your call
* again.
* - LimitExceededException An Amazon Textract service limit was exceeded. For example, if you start too
* many asynchronous jobs concurrently, calls to start operations (
StartDocumentTextDetection
,
* for example) raise a LimitExceededException exception (HTTP status code: 400) until the number of
* concurrently running jobs is below the Amazon Textract service limit.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - TextractException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample TextractAsyncClient.StartDocumentTextDetection
* @see AWS API Documentation
*/
default CompletableFuture startDocumentTextDetection(
StartDocumentTextDetectionRequest startDocumentTextDetectionRequest) {
throw new UnsupportedOperationException();
}
/**
*
* Starts the asynchronous detection of text in a document. Amazon Textract can detect lines of text and the words
* that make up a line of text.
*
*
* Amazon Textract can detect text in document images and PDF files that are stored in an Amazon S3 bucket. Use
* DocumentLocation to specify the bucket name and the file name of the document image.
*
*
* StartTextDetection
returns a job identifier (JobId
) that you use to get the results of
* the operation. When text detection is finished, Amazon Textract publishes a completion status to the Amazon
* Simple Notification Service (Amazon SNS) topic that you specify in NotificationChannel
. To get the
* results of the text detection operation, first check that the status value published to the Amazon SNS topic is
* SUCCEEDED
. If so, call GetDocumentTextDetection, and pass the job identifier (
* JobId
) from the initial call to StartDocumentTextDetection
.
*
*
* For more information, see Document Text Detection in the Amazon Textract Developer Guide.
*
*
*
* This is a convenience which creates an instance of the {@link StartDocumentTextDetectionRequest.Builder} avoiding
* the need to create one manually via {@link StartDocumentTextDetectionRequest#builder()}
*
*
* @param startDocumentTextDetectionRequest
* A {@link Consumer} that will call methods on {@link StartDocumentTextDetectionRequest.Builder} to create a
* request.
* @return A Java Future containing the result of the StartDocumentTextDetection operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidParameterException An input parameter violated a constraint. For example, in synchronous
* operations, an
InvalidParameterException
exception occurs when neither of the
* S3Object
or Bytes
values are supplied in the Document
request
* parameter. Validate your parameter before calling the API operation again.
* - InvalidS3ObjectException Amazon Textract is unable to access the S3 object that's specified in the
* request.
* - UnsupportedDocumentException The format of the input document isn't supported. Amazon Textract
* supports documents that are .png or .jpg format.
* - DocumentTooLargeException The document can't be processed because it's too large. The maximum
* document size for synchronous operations 5 MB. The maximum document size for asynchronous operations is
* 500 MB for PDF format files.
* - BadDocumentException Amazon Textract isn't able to read the document.
* - AccessDeniedException You aren't authorized to perform the action.
* - ProvisionedThroughputExceededException The number of requests exceeded your throughput limit. If you
* want to increase this limit, contact Amazon Textract.
* - InternalServerErrorException Amazon Textract experienced a service issue. Try your call again.
* - IdempotentParameterMismatchException A
ClientRequestToken
input parameter was reused
* with an operation, but at least one of the other input parameters is different from the previous call to
* the operation.
* - ThrottlingException Amazon Textract is temporarily unable to process the request. Try your call
* again.
* - LimitExceededException An Amazon Textract service limit was exceeded. For example, if you start too
* many asynchronous jobs concurrently, calls to start operations (
StartDocumentTextDetection
,
* for example) raise a LimitExceededException exception (HTTP status code: 400) until the number of
* concurrently running jobs is below the Amazon Textract service limit.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - TextractException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample TextractAsyncClient.StartDocumentTextDetection
* @see AWS API Documentation
*/
default CompletableFuture startDocumentTextDetection(
Consumer startDocumentTextDetectionRequest) {
return startDocumentTextDetection(StartDocumentTextDetectionRequest.builder()
.applyMutation(startDocumentTextDetectionRequest).build());
}
}