amazonka-textract-2.0: Amazon Textract SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.Textract.GetDocumentTextDetection

Description

Gets the results for an Amazon Textract asynchronous operation that detects text in a document. 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.

Each document page has as an associated Block of type PAGE. Each PAGE Block object is the parent of LINE Block objects that represent the lines of detected text on a page. A LINE Block object is a parent for each word that makes up the line. Words are represented by Block objects of type WORD.

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.

Synopsis

Creating a Request

data GetDocumentTextDetection Source #

See: newGetDocumentTextDetection smart constructor.

Constructors

GetDocumentTextDetection' 

Fields

  • maxResults :: Maybe Natural

    The maximum number of results to return per paginated call. The largest value you can specify is 1,000. If you specify a value greater than 1,000, a maximum of 1,000 results is returned. The default value is 1,000.

  • nextToken :: Maybe Text

    If the previous response was incomplete (because there are more blocks to retrieve), Amazon Textract returns a pagination token in the response. You can use this pagination token to retrieve the next set of blocks.

  • jobId :: Text

    A unique identifier for the text detection job. The JobId is returned from StartDocumentTextDetection. A JobId value is only valid for 7 days.

Instances

Instances details
ToJSON GetDocumentTextDetection Source # 
Instance details

Defined in Amazonka.Textract.GetDocumentTextDetection

ToHeaders GetDocumentTextDetection Source # 
Instance details

Defined in Amazonka.Textract.GetDocumentTextDetection

ToPath GetDocumentTextDetection Source # 
Instance details

Defined in Amazonka.Textract.GetDocumentTextDetection

ToQuery GetDocumentTextDetection Source # 
Instance details

Defined in Amazonka.Textract.GetDocumentTextDetection

AWSRequest GetDocumentTextDetection Source # 
Instance details

Defined in Amazonka.Textract.GetDocumentTextDetection

Generic GetDocumentTextDetection Source # 
Instance details

Defined in Amazonka.Textract.GetDocumentTextDetection

Associated Types

type Rep GetDocumentTextDetection :: Type -> Type #

Read GetDocumentTextDetection Source # 
Instance details

Defined in Amazonka.Textract.GetDocumentTextDetection

Show GetDocumentTextDetection Source # 
Instance details

Defined in Amazonka.Textract.GetDocumentTextDetection

NFData GetDocumentTextDetection Source # 
Instance details

Defined in Amazonka.Textract.GetDocumentTextDetection

Eq GetDocumentTextDetection Source # 
Instance details

Defined in Amazonka.Textract.GetDocumentTextDetection

Hashable GetDocumentTextDetection Source # 
Instance details

Defined in Amazonka.Textract.GetDocumentTextDetection

type AWSResponse GetDocumentTextDetection Source # 
Instance details

Defined in Amazonka.Textract.GetDocumentTextDetection

type Rep GetDocumentTextDetection Source # 
Instance details

Defined in Amazonka.Textract.GetDocumentTextDetection

type Rep GetDocumentTextDetection = D1 ('MetaData "GetDocumentTextDetection" "Amazonka.Textract.GetDocumentTextDetection" "amazonka-textract-2.0-6i5mJlqzS4xCepXxXFK6UK" 'False) (C1 ('MetaCons "GetDocumentTextDetection'" 'PrefixI 'True) (S1 ('MetaSel ('Just "maxResults") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Natural)) :*: (S1 ('MetaSel ('Just "nextToken") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "jobId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text))))

newGetDocumentTextDetection Source #

Create a value of GetDocumentTextDetection with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:maxResults:GetDocumentTextDetection', getDocumentTextDetection_maxResults - The maximum number of results to return per paginated call. The largest value you can specify is 1,000. If you specify a value greater than 1,000, a maximum of 1,000 results is returned. The default value is 1,000.

GetDocumentTextDetection, getDocumentTextDetection_nextToken - If the previous response was incomplete (because there are more blocks to retrieve), Amazon Textract returns a pagination token in the response. You can use this pagination token to retrieve the next set of blocks.

$sel:jobId:GetDocumentTextDetection', getDocumentTextDetection_jobId - A unique identifier for the text detection job. The JobId is returned from StartDocumentTextDetection. A JobId value is only valid for 7 days.

Request Lenses

getDocumentTextDetection_maxResults :: Lens' GetDocumentTextDetection (Maybe Natural) Source #

The maximum number of results to return per paginated call. The largest value you can specify is 1,000. If you specify a value greater than 1,000, a maximum of 1,000 results is returned. The default value is 1,000.

getDocumentTextDetection_nextToken :: Lens' GetDocumentTextDetection (Maybe Text) Source #

If the previous response was incomplete (because there are more blocks to retrieve), Amazon Textract returns a pagination token in the response. You can use this pagination token to retrieve the next set of blocks.

getDocumentTextDetection_jobId :: Lens' GetDocumentTextDetection Text Source #

A unique identifier for the text detection job. The JobId is returned from StartDocumentTextDetection. A JobId value is only valid for 7 days.

Destructuring the Response

data GetDocumentTextDetectionResponse Source #

See: newGetDocumentTextDetectionResponse smart constructor.

Constructors

GetDocumentTextDetectionResponse' 

Fields

Instances

Instances details
Generic GetDocumentTextDetectionResponse Source # 
Instance details

Defined in Amazonka.Textract.GetDocumentTextDetection

Associated Types

type Rep GetDocumentTextDetectionResponse :: Type -> Type #

Read GetDocumentTextDetectionResponse Source # 
Instance details

Defined in Amazonka.Textract.GetDocumentTextDetection

Show GetDocumentTextDetectionResponse Source # 
Instance details

Defined in Amazonka.Textract.GetDocumentTextDetection

NFData GetDocumentTextDetectionResponse Source # 
Instance details

Defined in Amazonka.Textract.GetDocumentTextDetection

Eq GetDocumentTextDetectionResponse Source # 
Instance details

Defined in Amazonka.Textract.GetDocumentTextDetection

type Rep GetDocumentTextDetectionResponse Source # 
Instance details

Defined in Amazonka.Textract.GetDocumentTextDetection

type Rep GetDocumentTextDetectionResponse = D1 ('MetaData "GetDocumentTextDetectionResponse" "Amazonka.Textract.GetDocumentTextDetection" "amazonka-textract-2.0-6i5mJlqzS4xCepXxXFK6UK" 'False) (C1 ('MetaCons "GetDocumentTextDetectionResponse'" 'PrefixI 'True) (((S1 ('MetaSel ('Just "blocks") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [Block])) :*: S1 ('MetaSel ('Just "detectDocumentTextModelVersion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text))) :*: (S1 ('MetaSel ('Just "documentMetadata") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe DocumentMetadata)) :*: S1 ('MetaSel ('Just "jobStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe JobStatus)))) :*: ((S1 ('MetaSel ('Just "nextToken") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "statusMessage") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text))) :*: (S1 ('MetaSel ('Just "warnings") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [Warning])) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)))))

newGetDocumentTextDetectionResponse Source #

Create a value of GetDocumentTextDetectionResponse with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

GetDocumentTextDetectionResponse, getDocumentTextDetectionResponse_blocks - The results of the text-detection operation.

$sel:detectDocumentTextModelVersion:GetDocumentTextDetectionResponse', getDocumentTextDetectionResponse_detectDocumentTextModelVersion -

$sel:documentMetadata:GetDocumentTextDetectionResponse', getDocumentTextDetectionResponse_documentMetadata - Information about a document that Amazon Textract processed. DocumentMetadata is returned in every page of paginated responses from an Amazon Textract video operation.

$sel:jobStatus:GetDocumentTextDetectionResponse', getDocumentTextDetectionResponse_jobStatus - The current status of the text detection job.

GetDocumentTextDetection, getDocumentTextDetectionResponse_nextToken - If the response is truncated, Amazon Textract returns this token. You can use this token in the subsequent request to retrieve the next set of text-detection results.

$sel:statusMessage:GetDocumentTextDetectionResponse', getDocumentTextDetectionResponse_statusMessage - Returns if the detection job could not be completed. Contains explanation for what error occured.

$sel:warnings:GetDocumentTextDetectionResponse', getDocumentTextDetectionResponse_warnings - A list of warnings that occurred during the text-detection operation for the document.

$sel:httpStatus:GetDocumentTextDetectionResponse', getDocumentTextDetectionResponse_httpStatus - The response's http status code.

Response Lenses

getDocumentTextDetectionResponse_documentMetadata :: Lens' GetDocumentTextDetectionResponse (Maybe DocumentMetadata) Source #

Information about a document that Amazon Textract processed. DocumentMetadata is returned in every page of paginated responses from an Amazon Textract video operation.

getDocumentTextDetectionResponse_nextToken :: Lens' GetDocumentTextDetectionResponse (Maybe Text) Source #

If the response is truncated, Amazon Textract returns this token. You can use this token in the subsequent request to retrieve the next set of text-detection results.

getDocumentTextDetectionResponse_statusMessage :: Lens' GetDocumentTextDetectionResponse (Maybe Text) Source #

Returns if the detection job could not be completed. Contains explanation for what error occured.

getDocumentTextDetectionResponse_warnings :: Lens' GetDocumentTextDetectionResponse (Maybe [Warning]) Source #

A list of warnings that occurred during the text-detection operation for the document.