libZSservicesZSamazonka-textractZSamazonka-textract
Copyright(c) 2013-2021 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone

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

  • 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.

  • 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.

  • 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
Eq GetDocumentTextDetection Source # 
Instance details

Defined in Amazonka.Textract.GetDocumentTextDetection

Read GetDocumentTextDetection Source # 
Instance details

Defined in Amazonka.Textract.GetDocumentTextDetection

Show 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 #

NFData GetDocumentTextDetection Source # 
Instance details

Defined in Amazonka.Textract.GetDocumentTextDetection

Hashable GetDocumentTextDetection Source # 
Instance details

Defined in Amazonka.Textract.GetDocumentTextDetection

ToJSON GetDocumentTextDetection Source # 
Instance details

Defined in Amazonka.Textract.GetDocumentTextDetection

AWSRequest 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

type Rep GetDocumentTextDetection Source # 
Instance details

Defined in Amazonka.Textract.GetDocumentTextDetection

type Rep GetDocumentTextDetection = D1 ('MetaData "GetDocumentTextDetection" "Amazonka.Textract.GetDocumentTextDetection" "libZSservicesZSamazonka-textractZSamazonka-textract" 'False) (C1 ('MetaCons "GetDocumentTextDetection'" 'PrefixI 'True) (S1 ('MetaSel ('Just "nextToken") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "maxResults") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Natural)) :*: S1 ('MetaSel ('Just "jobId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text))))
type AWSResponse GetDocumentTextDetection Source # 
Instance details

Defined in Amazonka.Textract.GetDocumentTextDetection

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:nextToken: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: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.

$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_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_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_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
Eq GetDocumentTextDetectionResponse Source # 
Instance details

Defined in Amazonka.Textract.GetDocumentTextDetection

Read GetDocumentTextDetectionResponse Source # 
Instance details

Defined in Amazonka.Textract.GetDocumentTextDetection

Show GetDocumentTextDetectionResponse Source # 
Instance details

Defined in Amazonka.Textract.GetDocumentTextDetection

Generic GetDocumentTextDetectionResponse Source # 
Instance details

Defined in Amazonka.Textract.GetDocumentTextDetection

Associated Types

type Rep GetDocumentTextDetectionResponse :: Type -> Type #

NFData 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" "libZSservicesZSamazonka-textractZSamazonka-textract" 'False) (C1 ('MetaCons "GetDocumentTextDetectionResponse'" 'PrefixI 'True) (((S1 ('MetaSel ('Just "documentMetadata") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe DocumentMetadata)) :*: S1 ('MetaSel ('Just "blocks") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [Block]))) :*: (S1 ('MetaSel ('Just "warnings") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [Warning])) :*: S1 ('MetaSel ('Just "nextToken") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)))) :*: ((S1 ('MetaSel ('Just "statusMessage") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "detectDocumentTextModelVersion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text))) :*: (S1 ('MetaSel ('Just "jobStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe JobStatus)) :*: 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:

$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:blocks:GetDocumentTextDetectionResponse', getDocumentTextDetectionResponse_blocks - The results of the text-detection operation.

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

$sel:nextToken: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:detectDocumentTextModelVersion:GetDocumentTextDetectionResponse', getDocumentTextDetectionResponse_detectDocumentTextModelVersion -

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

$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_warnings :: Lens' GetDocumentTextDetectionResponse (Maybe [Warning]) Source #

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

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.