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.Types.Document

Description

 
Synopsis

Documentation

data Document Source #

The input document, either as bytes or as an S3 object.

You pass image bytes to an Amazon Textract API operation by using the Bytes property. For example, you would use the Bytes property to pass a document loaded from a local file system. Image bytes passed by using the Bytes property must be base64 encoded. Your code might not need to encode document file bytes if you're using an AWS SDK to call Amazon Textract API operations.

You pass images stored in an S3 bucket to an Amazon Textract API operation by using the S3Object property. Documents stored in an S3 bucket don't need to be base64 encoded.

The AWS Region for the S3 bucket that contains the S3 object must match the AWS Region that you use for Amazon Textract operations.

If you use the AWS CLI to call Amazon Textract operations, passing image bytes using the Bytes property isn't supported. You must first upload the document to an Amazon S3 bucket, and then call the operation using the S3Object property.

For Amazon Textract to process an S3 object, the user must have permission to access the S3 object.

See: newDocument smart constructor.

Constructors

Document' 

Fields

  • s3Object :: Maybe S3Object

    Identifies an S3 object as the document source. The maximum size of a document that's stored in an S3 bucket is 5 MB.

  • bytes :: Maybe Base64

    A blob of base64-encoded document bytes. The maximum size of a document that's provided in a blob of bytes is 5 MB. The document bytes must be in PNG or JPEG format.

    If you're using an AWS SDK to call Amazon Textract, you might not need to base64-encode image bytes passed using the Bytes field.

Instances

Instances details
Eq Document Source # 
Instance details

Defined in Amazonka.Textract.Types.Document

Read Document Source # 
Instance details

Defined in Amazonka.Textract.Types.Document

Show Document Source # 
Instance details

Defined in Amazonka.Textract.Types.Document

Generic Document Source # 
Instance details

Defined in Amazonka.Textract.Types.Document

Associated Types

type Rep Document :: Type -> Type #

Methods

from :: Document -> Rep Document x #

to :: Rep Document x -> Document #

NFData Document Source # 
Instance details

Defined in Amazonka.Textract.Types.Document

Methods

rnf :: Document -> () #

Hashable Document Source # 
Instance details

Defined in Amazonka.Textract.Types.Document

Methods

hashWithSalt :: Int -> Document -> Int #

hash :: Document -> Int #

ToJSON Document Source # 
Instance details

Defined in Amazonka.Textract.Types.Document

type Rep Document Source # 
Instance details

Defined in Amazonka.Textract.Types.Document

type Rep Document = D1 ('MetaData "Document" "Amazonka.Textract.Types.Document" "libZSservicesZSamazonka-textractZSamazonka-textract" 'False) (C1 ('MetaCons "Document'" 'PrefixI 'True) (S1 ('MetaSel ('Just "s3Object") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe S3Object)) :*: S1 ('MetaSel ('Just "bytes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Base64))))

newDocument :: Document Source #

Create a value of Document 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:s3Object:Document', document_s3Object - Identifies an S3 object as the document source. The maximum size of a document that's stored in an S3 bucket is 5 MB.

$sel:bytes:Document', document_bytes - A blob of base64-encoded document bytes. The maximum size of a document that's provided in a blob of bytes is 5 MB. The document bytes must be in PNG or JPEG format.

If you're using an AWS SDK to call Amazon Textract, you might not need to base64-encode image bytes passed using the Bytes field.-- -- Note: This Lens automatically encodes and decodes Base64 data. -- The underlying isomorphism will encode to Base64 representation during -- serialisation, and decode from Base64 representation during deserialisation. -- This Lens accepts and returns only raw unencoded data.

document_s3Object :: Lens' Document (Maybe S3Object) Source #

Identifies an S3 object as the document source. The maximum size of a document that's stored in an S3 bucket is 5 MB.

document_bytes :: Lens' Document (Maybe ByteString) Source #

A blob of base64-encoded document bytes. The maximum size of a document that's provided in a blob of bytes is 5 MB. The document bytes must be in PNG or JPEG format.

If you're using an AWS SDK to call Amazon Textract, you might not need to base64-encode image bytes passed using the Bytes field.-- -- Note: This Lens automatically encodes and decodes Base64 data. -- The underlying isomorphism will encode to Base64 representation during -- serialisation, and decode from Base64 representation during deserialisation. -- This Lens accepts and returns only raw unencoded data.