import { Command as $Command } from "@smithy/smithy-client"; import { MetadataBearer as __MetadataBearer } from "@smithy/types"; import { GetDocumentAnalysisRequest, GetDocumentAnalysisResponse } from "../models/models_0"; import { ServiceInputTypes, ServiceOutputTypes, TextractClientResolvedConfig } from "../TextractClient"; /** * @public */ export type { __MetadataBearer }; export { $Command }; /** * @public * * The input for {@link GetDocumentAnalysisCommand}. */ export interface GetDocumentAnalysisCommandInput extends GetDocumentAnalysisRequest { } /** * @public * * The output of {@link GetDocumentAnalysisCommand}. */ export interface GetDocumentAnalysisCommandOutput extends GetDocumentAnalysisResponse, __MetadataBearer { } declare const GetDocumentAnalysisCommand_base: { new (input: GetDocumentAnalysisCommandInput): import("@smithy/smithy-client").CommandImpl; new (input: GetDocumentAnalysisCommandInput): import("@smithy/smithy-client").CommandImpl; getEndpointParameterInstructions(): import("@smithy/middleware-endpoint").EndpointParameterInstructions; }; /** *

Gets the results for an Amazon Textract asynchronous operation that analyzes text in a * document.

*

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. * The following types of information are returned:

* * *

While processing a document with queries, look out for * INVALID_REQUEST_PARAMETERS output. This indicates that either the per * page query limit has been exceeded or that the operation is trying to query a page in * the document which doesn’t exist.

*
*

Selection elements such as check boxes and option buttons (radio buttons) can be * detected in form data and in tables. A SELECTION_ELEMENT Block object contains * information about a selection element, including the selection status.

*

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 * GetDocumentAnalysis, and populate the NextToken request * parameter with the token value that's returned from the previous call to * GetDocumentAnalysis.

*

For more information, see Document Text * Analysis.

* @example * Use a bare-bones client and the command you need to make an API call. * ```javascript * import { TextractClient, GetDocumentAnalysisCommand } from "@aws-sdk/client-textract"; // ES Modules import * // const { TextractClient, GetDocumentAnalysisCommand } = require("@aws-sdk/client-textract"); // CommonJS import * const client = new TextractClient(config); * const input = { // GetDocumentAnalysisRequest * JobId: "STRING_VALUE", // required * MaxResults: Number("int"), * NextToken: "STRING_VALUE", * }; * const command = new GetDocumentAnalysisCommand(input); * const response = await client.send(command); * // { // GetDocumentAnalysisResponse * // DocumentMetadata: { // DocumentMetadata * // Pages: Number("int"), * // }, * // JobStatus: "IN_PROGRESS" || "SUCCEEDED" || "FAILED" || "PARTIAL_SUCCESS", * // NextToken: "STRING_VALUE", * // Blocks: [ // BlockList * // { // Block * // BlockType: "KEY_VALUE_SET" || "PAGE" || "LINE" || "WORD" || "TABLE" || "CELL" || "SELECTION_ELEMENT" || "MERGED_CELL" || "TITLE" || "QUERY" || "QUERY_RESULT" || "SIGNATURE" || "TABLE_TITLE" || "TABLE_FOOTER" || "LAYOUT_TEXT" || "LAYOUT_TITLE" || "LAYOUT_HEADER" || "LAYOUT_FOOTER" || "LAYOUT_SECTION_HEADER" || "LAYOUT_PAGE_NUMBER" || "LAYOUT_LIST" || "LAYOUT_FIGURE" || "LAYOUT_TABLE" || "LAYOUT_KEY_VALUE", * // Confidence: Number("float"), * // Text: "STRING_VALUE", * // TextType: "HANDWRITING" || "PRINTED", * // RowIndex: Number("int"), * // ColumnIndex: Number("int"), * // RowSpan: Number("int"), * // ColumnSpan: Number("int"), * // Geometry: { // Geometry * // BoundingBox: { // BoundingBox * // Width: Number("float"), * // Height: Number("float"), * // Left: Number("float"), * // Top: Number("float"), * // }, * // Polygon: [ // Polygon * // { // Point * // X: Number("float"), * // Y: Number("float"), * // }, * // ], * // RotationAngle: Number("float"), * // }, * // Id: "STRING_VALUE", * // Relationships: [ // RelationshipList * // { // Relationship * // Type: "VALUE" || "CHILD" || "COMPLEX_FEATURES" || "MERGED_CELL" || "TITLE" || "ANSWER" || "TABLE" || "TABLE_TITLE" || "TABLE_FOOTER", * // Ids: [ // IdList * // "STRING_VALUE", * // ], * // }, * // ], * // EntityTypes: [ // EntityTypes * // "KEY" || "VALUE" || "COLUMN_HEADER" || "TABLE_TITLE" || "TABLE_FOOTER" || "TABLE_SECTION_TITLE" || "TABLE_SUMMARY" || "STRUCTURED_TABLE" || "SEMI_STRUCTURED_TABLE", * // ], * // SelectionStatus: "SELECTED" || "NOT_SELECTED", * // Page: Number("int"), * // Query: { // Query * // Text: "STRING_VALUE", // required * // Alias: "STRING_VALUE", * // Pages: [ // QueryPages * // "STRING_VALUE", * // ], * // }, * // }, * // ], * // Warnings: [ // Warnings * // { // Warning * // ErrorCode: "STRING_VALUE", * // Pages: [ // Pages * // Number("int"), * // ], * // }, * // ], * // StatusMessage: "STRING_VALUE", * // AnalyzeDocumentModelVersion: "STRING_VALUE", * // }; * * ``` * * @param GetDocumentAnalysisCommandInput - {@link GetDocumentAnalysisCommandInput} * @returns {@link GetDocumentAnalysisCommandOutput} * @see {@link GetDocumentAnalysisCommandInput} for command's `input` shape. * @see {@link GetDocumentAnalysisCommandOutput} for command's `response` shape. * @see {@link TextractClientResolvedConfig | config} for TextractClient's `config` shape. * * @throws {@link AccessDeniedException} (client fault) *

You aren't authorized to perform the action. Use the Amazon Resource Name (ARN) * of an authorized user or IAM role to perform the operation.

* * @throws {@link InternalServerError} (server fault) *

Amazon Textract experienced a service issue. Try your call again.

* * @throws {@link InvalidJobIdException} (client fault) *

An invalid job identifier was passed to an asynchronous analysis operation.

* * @throws {@link InvalidKMSKeyException} (client fault) *

Indicates you do not have decrypt permissions with the KMS key entered, or the KMS key * was entered incorrectly.

* * @throws {@link InvalidParameterException} (client fault) *

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.

* * @throws {@link InvalidS3ObjectException} (client fault) *

Amazon Textract is unable to access the S3 object that's specified in the request. * for more information, Configure Access to Amazon S3 * For troubleshooting information, see Troubleshooting Amazon S3 *

* * @throws {@link ProvisionedThroughputExceededException} (client fault) *

The number of requests exceeded your throughput limit. If you want to increase this limit, * contact Amazon Textract.

* * @throws {@link ThrottlingException} (server fault) *

Amazon Textract is temporarily unable to process the request. Try your call again.

* * @throws {@link TextractServiceException} *

Base exception class for all service exceptions from Textract service.

* * * @public */ export declare class GetDocumentAnalysisCommand extends GetDocumentAnalysisCommand_base { /** @internal type navigation helper, not in runtime. */ protected static __types: { api: { input: GetDocumentAnalysisRequest; output: GetDocumentAnalysisResponse; }; sdk: { input: GetDocumentAnalysisCommandInput; output: GetDocumentAnalysisCommandOutput; }; }; }