{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Textract.DetectDocumentText
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- 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 JPEG or PNG format. @DetectDocumentText@ returns the
-- detected text in 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.
--
-- @DetectDocumentText@ is a synchronous operation. To analyze documents
-- asynchronously, use StartDocumentTextDetection.
--
-- For more information, see
-- <https://docs.aws.amazon.com/textract/latest/dg/how-it-works-detecting.html Document Text Detection>.
module Amazonka.Textract.DetectDocumentText
  ( -- * Creating a Request
    DetectDocumentText (..),
    newDetectDocumentText,

    -- * Request Lenses
    detectDocumentText_document,

    -- * Destructuring the Response
    DetectDocumentTextResponse (..),
    newDetectDocumentTextResponse,

    -- * Response Lenses
    detectDocumentTextResponse_documentMetadata,
    detectDocumentTextResponse_blocks,
    detectDocumentTextResponse_detectDocumentTextModelVersion,
    detectDocumentTextResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.Textract.Types

-- | /See:/ 'newDetectDocumentText' smart constructor.
data DetectDocumentText = DetectDocumentText'
  { -- | The input document as base64-encoded bytes or an Amazon S3 object. If
    -- you use the AWS CLI to call Amazon Textract operations, you can\'t pass
    -- image bytes. The document must be an image in JPEG or PNG format.
    --
    -- If you\'re using an AWS SDK to call Amazon Textract, you might not need
    -- to base64-encode image bytes that are passed using the @Bytes@ field.
    DetectDocumentText -> Document
document :: Document
  }
  deriving (DetectDocumentText -> DetectDocumentText -> Bool
(DetectDocumentText -> DetectDocumentText -> Bool)
-> (DetectDocumentText -> DetectDocumentText -> Bool)
-> Eq DetectDocumentText
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DetectDocumentText -> DetectDocumentText -> Bool
$c/= :: DetectDocumentText -> DetectDocumentText -> Bool
== :: DetectDocumentText -> DetectDocumentText -> Bool
$c== :: DetectDocumentText -> DetectDocumentText -> Bool
Prelude.Eq, ReadPrec [DetectDocumentText]
ReadPrec DetectDocumentText
Int -> ReadS DetectDocumentText
ReadS [DetectDocumentText]
(Int -> ReadS DetectDocumentText)
-> ReadS [DetectDocumentText]
-> ReadPrec DetectDocumentText
-> ReadPrec [DetectDocumentText]
-> Read DetectDocumentText
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DetectDocumentText]
$creadListPrec :: ReadPrec [DetectDocumentText]
readPrec :: ReadPrec DetectDocumentText
$creadPrec :: ReadPrec DetectDocumentText
readList :: ReadS [DetectDocumentText]
$creadList :: ReadS [DetectDocumentText]
readsPrec :: Int -> ReadS DetectDocumentText
$creadsPrec :: Int -> ReadS DetectDocumentText
Prelude.Read, Int -> DetectDocumentText -> ShowS
[DetectDocumentText] -> ShowS
DetectDocumentText -> String
(Int -> DetectDocumentText -> ShowS)
-> (DetectDocumentText -> String)
-> ([DetectDocumentText] -> ShowS)
-> Show DetectDocumentText
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DetectDocumentText] -> ShowS
$cshowList :: [DetectDocumentText] -> ShowS
show :: DetectDocumentText -> String
$cshow :: DetectDocumentText -> String
showsPrec :: Int -> DetectDocumentText -> ShowS
$cshowsPrec :: Int -> DetectDocumentText -> ShowS
Prelude.Show, (forall x. DetectDocumentText -> Rep DetectDocumentText x)
-> (forall x. Rep DetectDocumentText x -> DetectDocumentText)
-> Generic DetectDocumentText
forall x. Rep DetectDocumentText x -> DetectDocumentText
forall x. DetectDocumentText -> Rep DetectDocumentText x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DetectDocumentText x -> DetectDocumentText
$cfrom :: forall x. DetectDocumentText -> Rep DetectDocumentText x
Prelude.Generic)

-- |
-- Create a value of 'DetectDocumentText' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'document', 'detectDocumentText_document' - The input document as base64-encoded bytes or an Amazon S3 object. If
-- you use the AWS CLI to call Amazon Textract operations, you can\'t pass
-- image bytes. The document must be an image in JPEG or PNG format.
--
-- If you\'re using an AWS SDK to call Amazon Textract, you might not need
-- to base64-encode image bytes that are passed using the @Bytes@ field.
newDetectDocumentText ::
  -- | 'document'
  Document ->
  DetectDocumentText
newDetectDocumentText :: Document -> DetectDocumentText
newDetectDocumentText Document
pDocument_ =
  DetectDocumentText' :: Document -> DetectDocumentText
DetectDocumentText' {$sel:document:DetectDocumentText' :: Document
document = Document
pDocument_}

-- | The input document as base64-encoded bytes or an Amazon S3 object. If
-- you use the AWS CLI to call Amazon Textract operations, you can\'t pass
-- image bytes. The document must be an image in JPEG or PNG format.
--
-- If you\'re using an AWS SDK to call Amazon Textract, you might not need
-- to base64-encode image bytes that are passed using the @Bytes@ field.
detectDocumentText_document :: Lens.Lens' DetectDocumentText Document
detectDocumentText_document :: (Document -> f Document)
-> DetectDocumentText -> f DetectDocumentText
detectDocumentText_document = (DetectDocumentText -> Document)
-> (DetectDocumentText -> Document -> DetectDocumentText)
-> Lens DetectDocumentText DetectDocumentText Document Document
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectDocumentText' {Document
document :: Document
$sel:document:DetectDocumentText' :: DetectDocumentText -> Document
document} -> Document
document) (\s :: DetectDocumentText
s@DetectDocumentText' {} Document
a -> DetectDocumentText
s {$sel:document:DetectDocumentText' :: Document
document = Document
a} :: DetectDocumentText)

instance Core.AWSRequest DetectDocumentText where
  type
    AWSResponse DetectDocumentText =
      DetectDocumentTextResponse
  request :: DetectDocumentText -> Request DetectDocumentText
request = Service -> DetectDocumentText -> Request DetectDocumentText
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DetectDocumentText
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DetectDocumentText)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DetectDocumentText))
-> Logger
-> Service
-> Proxy DetectDocumentText
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DetectDocumentText)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe DocumentMetadata
-> Maybe [Block] -> Maybe Text -> Int -> DetectDocumentTextResponse
DetectDocumentTextResponse'
            (Maybe DocumentMetadata
 -> Maybe [Block]
 -> Maybe Text
 -> Int
 -> DetectDocumentTextResponse)
-> Either String (Maybe DocumentMetadata)
-> Either
     String
     (Maybe [Block] -> Maybe Text -> Int -> DetectDocumentTextResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe DocumentMetadata)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"DocumentMetadata")
            Either
  String
  (Maybe [Block] -> Maybe Text -> Int -> DetectDocumentTextResponse)
-> Either String (Maybe [Block])
-> Either String (Maybe Text -> Int -> DetectDocumentTextResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [Block]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Blocks" Either String (Maybe (Maybe [Block]))
-> Maybe [Block] -> Either String (Maybe [Block])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Block]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Maybe Text -> Int -> DetectDocumentTextResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DetectDocumentTextResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"DetectDocumentTextModelVersion")
            Either String (Int -> DetectDocumentTextResponse)
-> Either String Int -> Either String DetectDocumentTextResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DetectDocumentText

instance Prelude.NFData DetectDocumentText

instance Core.ToHeaders DetectDocumentText where
  toHeaders :: DetectDocumentText -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DetectDocumentText -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"Textract.DetectDocumentText" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON DetectDocumentText where
  toJSON :: DetectDocumentText -> Value
toJSON DetectDocumentText' {Document
document :: Document
$sel:document:DetectDocumentText' :: DetectDocumentText -> Document
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Document" Text -> Document -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Document
document)]
      )

instance Core.ToPath DetectDocumentText where
  toPath :: DetectDocumentText -> ByteString
toPath = ByteString -> DetectDocumentText -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery DetectDocumentText where
  toQuery :: DetectDocumentText -> QueryString
toQuery = QueryString -> DetectDocumentText -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newDetectDocumentTextResponse' smart constructor.
data DetectDocumentTextResponse = DetectDocumentTextResponse'
  { -- | Metadata about the document. It contains the number of pages that are
    -- detected in the document.
    DetectDocumentTextResponse -> Maybe DocumentMetadata
documentMetadata :: Prelude.Maybe DocumentMetadata,
    -- | An array of @Block@ objects that contain the text that\'s detected in
    -- the document.
    DetectDocumentTextResponse -> Maybe [Block]
blocks :: Prelude.Maybe [Block],
    DetectDocumentTextResponse -> Maybe Text
detectDocumentTextModelVersion :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DetectDocumentTextResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DetectDocumentTextResponse -> DetectDocumentTextResponse -> Bool
(DetectDocumentTextResponse -> DetectDocumentTextResponse -> Bool)
-> (DetectDocumentTextResponse
    -> DetectDocumentTextResponse -> Bool)
-> Eq DetectDocumentTextResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DetectDocumentTextResponse -> DetectDocumentTextResponse -> Bool
$c/= :: DetectDocumentTextResponse -> DetectDocumentTextResponse -> Bool
== :: DetectDocumentTextResponse -> DetectDocumentTextResponse -> Bool
$c== :: DetectDocumentTextResponse -> DetectDocumentTextResponse -> Bool
Prelude.Eq, ReadPrec [DetectDocumentTextResponse]
ReadPrec DetectDocumentTextResponse
Int -> ReadS DetectDocumentTextResponse
ReadS [DetectDocumentTextResponse]
(Int -> ReadS DetectDocumentTextResponse)
-> ReadS [DetectDocumentTextResponse]
-> ReadPrec DetectDocumentTextResponse
-> ReadPrec [DetectDocumentTextResponse]
-> Read DetectDocumentTextResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DetectDocumentTextResponse]
$creadListPrec :: ReadPrec [DetectDocumentTextResponse]
readPrec :: ReadPrec DetectDocumentTextResponse
$creadPrec :: ReadPrec DetectDocumentTextResponse
readList :: ReadS [DetectDocumentTextResponse]
$creadList :: ReadS [DetectDocumentTextResponse]
readsPrec :: Int -> ReadS DetectDocumentTextResponse
$creadsPrec :: Int -> ReadS DetectDocumentTextResponse
Prelude.Read, Int -> DetectDocumentTextResponse -> ShowS
[DetectDocumentTextResponse] -> ShowS
DetectDocumentTextResponse -> String
(Int -> DetectDocumentTextResponse -> ShowS)
-> (DetectDocumentTextResponse -> String)
-> ([DetectDocumentTextResponse] -> ShowS)
-> Show DetectDocumentTextResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DetectDocumentTextResponse] -> ShowS
$cshowList :: [DetectDocumentTextResponse] -> ShowS
show :: DetectDocumentTextResponse -> String
$cshow :: DetectDocumentTextResponse -> String
showsPrec :: Int -> DetectDocumentTextResponse -> ShowS
$cshowsPrec :: Int -> DetectDocumentTextResponse -> ShowS
Prelude.Show, (forall x.
 DetectDocumentTextResponse -> Rep DetectDocumentTextResponse x)
-> (forall x.
    Rep DetectDocumentTextResponse x -> DetectDocumentTextResponse)
-> Generic DetectDocumentTextResponse
forall x.
Rep DetectDocumentTextResponse x -> DetectDocumentTextResponse
forall x.
DetectDocumentTextResponse -> Rep DetectDocumentTextResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DetectDocumentTextResponse x -> DetectDocumentTextResponse
$cfrom :: forall x.
DetectDocumentTextResponse -> Rep DetectDocumentTextResponse x
Prelude.Generic)

-- |
-- Create a value of 'DetectDocumentTextResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'documentMetadata', 'detectDocumentTextResponse_documentMetadata' - Metadata about the document. It contains the number of pages that are
-- detected in the document.
--
-- 'blocks', 'detectDocumentTextResponse_blocks' - An array of @Block@ objects that contain the text that\'s detected in
-- the document.
--
-- 'detectDocumentTextModelVersion', 'detectDocumentTextResponse_detectDocumentTextModelVersion' -
--
-- 'httpStatus', 'detectDocumentTextResponse_httpStatus' - The response's http status code.
newDetectDocumentTextResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DetectDocumentTextResponse
newDetectDocumentTextResponse :: Int -> DetectDocumentTextResponse
newDetectDocumentTextResponse Int
pHttpStatus_ =
  DetectDocumentTextResponse' :: Maybe DocumentMetadata
-> Maybe [Block] -> Maybe Text -> Int -> DetectDocumentTextResponse
DetectDocumentTextResponse'
    { $sel:documentMetadata:DetectDocumentTextResponse' :: Maybe DocumentMetadata
documentMetadata =
        Maybe DocumentMetadata
forall a. Maybe a
Prelude.Nothing,
      $sel:blocks:DetectDocumentTextResponse' :: Maybe [Block]
blocks = Maybe [Block]
forall a. Maybe a
Prelude.Nothing,
      $sel:detectDocumentTextModelVersion:DetectDocumentTextResponse' :: Maybe Text
detectDocumentTextModelVersion =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DetectDocumentTextResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Metadata about the document. It contains the number of pages that are
-- detected in the document.
detectDocumentTextResponse_documentMetadata :: Lens.Lens' DetectDocumentTextResponse (Prelude.Maybe DocumentMetadata)
detectDocumentTextResponse_documentMetadata :: (Maybe DocumentMetadata -> f (Maybe DocumentMetadata))
-> DetectDocumentTextResponse -> f DetectDocumentTextResponse
detectDocumentTextResponse_documentMetadata = (DetectDocumentTextResponse -> Maybe DocumentMetadata)
-> (DetectDocumentTextResponse
    -> Maybe DocumentMetadata -> DetectDocumentTextResponse)
-> Lens
     DetectDocumentTextResponse
     DetectDocumentTextResponse
     (Maybe DocumentMetadata)
     (Maybe DocumentMetadata)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectDocumentTextResponse' {Maybe DocumentMetadata
documentMetadata :: Maybe DocumentMetadata
$sel:documentMetadata:DetectDocumentTextResponse' :: DetectDocumentTextResponse -> Maybe DocumentMetadata
documentMetadata} -> Maybe DocumentMetadata
documentMetadata) (\s :: DetectDocumentTextResponse
s@DetectDocumentTextResponse' {} Maybe DocumentMetadata
a -> DetectDocumentTextResponse
s {$sel:documentMetadata:DetectDocumentTextResponse' :: Maybe DocumentMetadata
documentMetadata = Maybe DocumentMetadata
a} :: DetectDocumentTextResponse)

-- | An array of @Block@ objects that contain the text that\'s detected in
-- the document.
detectDocumentTextResponse_blocks :: Lens.Lens' DetectDocumentTextResponse (Prelude.Maybe [Block])
detectDocumentTextResponse_blocks :: (Maybe [Block] -> f (Maybe [Block]))
-> DetectDocumentTextResponse -> f DetectDocumentTextResponse
detectDocumentTextResponse_blocks = (DetectDocumentTextResponse -> Maybe [Block])
-> (DetectDocumentTextResponse
    -> Maybe [Block] -> DetectDocumentTextResponse)
-> Lens
     DetectDocumentTextResponse
     DetectDocumentTextResponse
     (Maybe [Block])
     (Maybe [Block])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectDocumentTextResponse' {Maybe [Block]
blocks :: Maybe [Block]
$sel:blocks:DetectDocumentTextResponse' :: DetectDocumentTextResponse -> Maybe [Block]
blocks} -> Maybe [Block]
blocks) (\s :: DetectDocumentTextResponse
s@DetectDocumentTextResponse' {} Maybe [Block]
a -> DetectDocumentTextResponse
s {$sel:blocks:DetectDocumentTextResponse' :: Maybe [Block]
blocks = Maybe [Block]
a} :: DetectDocumentTextResponse) ((Maybe [Block] -> f (Maybe [Block]))
 -> DetectDocumentTextResponse -> f DetectDocumentTextResponse)
-> ((Maybe [Block] -> f (Maybe [Block]))
    -> Maybe [Block] -> f (Maybe [Block]))
-> (Maybe [Block] -> f (Maybe [Block]))
-> DetectDocumentTextResponse
-> f DetectDocumentTextResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Block] [Block] [Block] [Block]
-> Iso
     (Maybe [Block]) (Maybe [Block]) (Maybe [Block]) (Maybe [Block])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Block] [Block] [Block] [Block]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- |
detectDocumentTextResponse_detectDocumentTextModelVersion :: Lens.Lens' DetectDocumentTextResponse (Prelude.Maybe Prelude.Text)
detectDocumentTextResponse_detectDocumentTextModelVersion :: (Maybe Text -> f (Maybe Text))
-> DetectDocumentTextResponse -> f DetectDocumentTextResponse
detectDocumentTextResponse_detectDocumentTextModelVersion = (DetectDocumentTextResponse -> Maybe Text)
-> (DetectDocumentTextResponse
    -> Maybe Text -> DetectDocumentTextResponse)
-> Lens
     DetectDocumentTextResponse
     DetectDocumentTextResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectDocumentTextResponse' {Maybe Text
detectDocumentTextModelVersion :: Maybe Text
$sel:detectDocumentTextModelVersion:DetectDocumentTextResponse' :: DetectDocumentTextResponse -> Maybe Text
detectDocumentTextModelVersion} -> Maybe Text
detectDocumentTextModelVersion) (\s :: DetectDocumentTextResponse
s@DetectDocumentTextResponse' {} Maybe Text
a -> DetectDocumentTextResponse
s {$sel:detectDocumentTextModelVersion:DetectDocumentTextResponse' :: Maybe Text
detectDocumentTextModelVersion = Maybe Text
a} :: DetectDocumentTextResponse)

-- | The response's http status code.
detectDocumentTextResponse_httpStatus :: Lens.Lens' DetectDocumentTextResponse Prelude.Int
detectDocumentTextResponse_httpStatus :: (Int -> f Int)
-> DetectDocumentTextResponse -> f DetectDocumentTextResponse
detectDocumentTextResponse_httpStatus = (DetectDocumentTextResponse -> Int)
-> (DetectDocumentTextResponse
    -> Int -> DetectDocumentTextResponse)
-> Lens
     DetectDocumentTextResponse DetectDocumentTextResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectDocumentTextResponse' {Int
httpStatus :: Int
$sel:httpStatus:DetectDocumentTextResponse' :: DetectDocumentTextResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DetectDocumentTextResponse
s@DetectDocumentTextResponse' {} Int
a -> DetectDocumentTextResponse
s {$sel:httpStatus:DetectDocumentTextResponse' :: Int
httpStatus = Int
a} :: DetectDocumentTextResponse)

instance Prelude.NFData DetectDocumentTextResponse