{-# 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.Rekognition.GetTextDetection
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Gets the text detection results of a Amazon Rekognition Video analysis
-- started by StartTextDetection.
--
-- Text detection with Amazon Rekognition Video is an asynchronous
-- operation. You start text detection by calling StartTextDetection which
-- returns a job identifier (@JobId@) When the text detection operation
-- finishes, Amazon Rekognition publishes a completion status to the Amazon
-- Simple Notification Service topic registered in the initial call to
-- @StartTextDetection@. 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 @GetTextDetection@ and pass the job
-- identifier (@JobId@) from the initial call of @StartLabelDetection@.
--
-- @GetTextDetection@ returns an array of detected text (@TextDetections@)
-- sorted by the time the text was detected, up to 50 words per frame of
-- video.
--
-- Each element of the array includes the detected text, the precentage
-- confidence in the acuracy of the detected text, the time the text was
-- detected, bounding box information for where the text was located, and
-- unique identifiers for words and their lines.
--
-- Use MaxResults parameter to limit the number of text detections
-- 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 @GetTextDetection@ and populate the @NextToken@ request
-- parameter with the token value returned from the previous call to
-- @GetTextDetection@.
module Amazonka.Rekognition.GetTextDetection
  ( -- * Creating a Request
    GetTextDetection (..),
    newGetTextDetection,

    -- * Request Lenses
    getTextDetection_maxResults,
    getTextDetection_nextToken,
    getTextDetection_jobId,

    -- * Destructuring the Response
    GetTextDetectionResponse (..),
    newGetTextDetectionResponse,

    -- * Response Lenses
    getTextDetectionResponse_jobStatus,
    getTextDetectionResponse_nextToken,
    getTextDetectionResponse_statusMessage,
    getTextDetectionResponse_textDetections,
    getTextDetectionResponse_textModelVersion,
    getTextDetectionResponse_videoMetadata,
    getTextDetectionResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.Rekognition.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newGetTextDetection' smart constructor.
data GetTextDetection = GetTextDetection'
  { -- | Maximum number of results to return per paginated call. The largest
    -- value you can specify is 1000.
    GetTextDetection -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | If the previous response was incomplete (because there are more labels
    -- to retrieve), Amazon Rekognition Video returns a pagination token in the
    -- response. You can use this pagination token to retrieve the next set of
    -- text.
    GetTextDetection -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Job identifier for the text detection operation for which you want
    -- results returned. You get the job identifer from an initial call to
    -- @StartTextDetection@.
    GetTextDetection -> Text
jobId :: Prelude.Text
  }
  deriving (GetTextDetection -> GetTextDetection -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetTextDetection -> GetTextDetection -> Bool
$c/= :: GetTextDetection -> GetTextDetection -> Bool
== :: GetTextDetection -> GetTextDetection -> Bool
$c== :: GetTextDetection -> GetTextDetection -> Bool
Prelude.Eq, ReadPrec [GetTextDetection]
ReadPrec GetTextDetection
Int -> ReadS GetTextDetection
ReadS [GetTextDetection]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetTextDetection]
$creadListPrec :: ReadPrec [GetTextDetection]
readPrec :: ReadPrec GetTextDetection
$creadPrec :: ReadPrec GetTextDetection
readList :: ReadS [GetTextDetection]
$creadList :: ReadS [GetTextDetection]
readsPrec :: Int -> ReadS GetTextDetection
$creadsPrec :: Int -> ReadS GetTextDetection
Prelude.Read, Int -> GetTextDetection -> ShowS
[GetTextDetection] -> ShowS
GetTextDetection -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetTextDetection] -> ShowS
$cshowList :: [GetTextDetection] -> ShowS
show :: GetTextDetection -> String
$cshow :: GetTextDetection -> String
showsPrec :: Int -> GetTextDetection -> ShowS
$cshowsPrec :: Int -> GetTextDetection -> ShowS
Prelude.Show, forall x. Rep GetTextDetection x -> GetTextDetection
forall x. GetTextDetection -> Rep GetTextDetection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetTextDetection x -> GetTextDetection
$cfrom :: forall x. GetTextDetection -> Rep GetTextDetection x
Prelude.Generic)

-- |
-- Create a value of 'GetTextDetection' 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:
--
-- 'maxResults', 'getTextDetection_maxResults' - Maximum number of results to return per paginated call. The largest
-- value you can specify is 1000.
--
-- 'nextToken', 'getTextDetection_nextToken' - If the previous response was incomplete (because there are more labels
-- to retrieve), Amazon Rekognition Video returns a pagination token in the
-- response. You can use this pagination token to retrieve the next set of
-- text.
--
-- 'jobId', 'getTextDetection_jobId' - Job identifier for the text detection operation for which you want
-- results returned. You get the job identifer from an initial call to
-- @StartTextDetection@.
newGetTextDetection ::
  -- | 'jobId'
  Prelude.Text ->
  GetTextDetection
newGetTextDetection :: Text -> GetTextDetection
newGetTextDetection Text
pJobId_ =
  GetTextDetection'
    { $sel:maxResults:GetTextDetection' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetTextDetection' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:jobId:GetTextDetection' :: Text
jobId = Text
pJobId_
    }

-- | Maximum number of results to return per paginated call. The largest
-- value you can specify is 1000.
getTextDetection_maxResults :: Lens.Lens' GetTextDetection (Prelude.Maybe Prelude.Natural)
getTextDetection_maxResults :: Lens' GetTextDetection (Maybe Natural)
getTextDetection_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTextDetection' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetTextDetection' :: GetTextDetection -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetTextDetection
s@GetTextDetection' {} Maybe Natural
a -> GetTextDetection
s {$sel:maxResults:GetTextDetection' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetTextDetection)

-- | If the previous response was incomplete (because there are more labels
-- to retrieve), Amazon Rekognition Video returns a pagination token in the
-- response. You can use this pagination token to retrieve the next set of
-- text.
getTextDetection_nextToken :: Lens.Lens' GetTextDetection (Prelude.Maybe Prelude.Text)
getTextDetection_nextToken :: Lens' GetTextDetection (Maybe Text)
getTextDetection_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTextDetection' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetTextDetection' :: GetTextDetection -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetTextDetection
s@GetTextDetection' {} Maybe Text
a -> GetTextDetection
s {$sel:nextToken:GetTextDetection' :: Maybe Text
nextToken = Maybe Text
a} :: GetTextDetection)

-- | Job identifier for the text detection operation for which you want
-- results returned. You get the job identifer from an initial call to
-- @StartTextDetection@.
getTextDetection_jobId :: Lens.Lens' GetTextDetection Prelude.Text
getTextDetection_jobId :: Lens' GetTextDetection Text
getTextDetection_jobId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTextDetection' {Text
jobId :: Text
$sel:jobId:GetTextDetection' :: GetTextDetection -> Text
jobId} -> Text
jobId) (\s :: GetTextDetection
s@GetTextDetection' {} Text
a -> GetTextDetection
s {$sel:jobId:GetTextDetection' :: Text
jobId = Text
a} :: GetTextDetection)

instance Core.AWSRequest GetTextDetection where
  type
    AWSResponse GetTextDetection =
      GetTextDetectionResponse
  request :: (Service -> Service)
-> GetTextDetection -> Request GetTextDetection
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetTextDetection
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetTextDetection)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe VideoJobStatus
-> Maybe Text
-> Maybe Text
-> Maybe [TextDetectionResult]
-> Maybe Text
-> Maybe VideoMetadata
-> Int
-> GetTextDetectionResponse
GetTextDetectionResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"JobStatus")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"StatusMessage")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"TextDetections" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"TextModelVersion")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"VideoMetadata")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable GetTextDetection where
  hashWithSalt :: Int -> GetTextDetection -> Int
hashWithSalt Int
_salt GetTextDetection' {Maybe Natural
Maybe Text
Text
jobId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:jobId:GetTextDetection' :: GetTextDetection -> Text
$sel:nextToken:GetTextDetection' :: GetTextDetection -> Maybe Text
$sel:maxResults:GetTextDetection' :: GetTextDetection -> Maybe Natural
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
jobId

instance Prelude.NFData GetTextDetection where
  rnf :: GetTextDetection -> ()
rnf GetTextDetection' {Maybe Natural
Maybe Text
Text
jobId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:jobId:GetTextDetection' :: GetTextDetection -> Text
$sel:nextToken:GetTextDetection' :: GetTextDetection -> Maybe Text
$sel:maxResults:GetTextDetection' :: GetTextDetection -> Maybe Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
jobId

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

instance Data.ToJSON GetTextDetection where
  toJSON :: GetTextDetection -> Value
toJSON GetTextDetection' {Maybe Natural
Maybe Text
Text
jobId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:jobId:GetTextDetection' :: GetTextDetection -> Text
$sel:nextToken:GetTextDetection' :: GetTextDetection -> Maybe Text
$sel:maxResults:GetTextDetection' :: GetTextDetection -> Maybe Natural
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"MaxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            (Key
"NextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            forall a. a -> Maybe a
Prelude.Just (Key
"JobId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
jobId)
          ]
      )

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

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

-- | /See:/ 'newGetTextDetectionResponse' smart constructor.
data GetTextDetectionResponse = GetTextDetectionResponse'
  { -- | Current status of the text detection job.
    GetTextDetectionResponse -> Maybe VideoJobStatus
jobStatus :: Prelude.Maybe VideoJobStatus,
    -- | If the response is truncated, Amazon Rekognition Video returns this
    -- token that you can use in the subsequent request to retrieve the next
    -- set of text.
    GetTextDetectionResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | If the job fails, @StatusMessage@ provides a descriptive error message.
    GetTextDetectionResponse -> Maybe Text
statusMessage :: Prelude.Maybe Prelude.Text,
    -- | An array of text detected in the video. Each element contains the
    -- detected text, the time in milliseconds from the start of the video that
    -- the text was detected, and where it was detected on the screen.
    GetTextDetectionResponse -> Maybe [TextDetectionResult]
textDetections :: Prelude.Maybe [TextDetectionResult],
    -- | Version number of the text detection model that was used to detect text.
    GetTextDetectionResponse -> Maybe Text
textModelVersion :: Prelude.Maybe Prelude.Text,
    GetTextDetectionResponse -> Maybe VideoMetadata
videoMetadata :: Prelude.Maybe VideoMetadata,
    -- | The response's http status code.
    GetTextDetectionResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetTextDetectionResponse -> GetTextDetectionResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetTextDetectionResponse -> GetTextDetectionResponse -> Bool
$c/= :: GetTextDetectionResponse -> GetTextDetectionResponse -> Bool
== :: GetTextDetectionResponse -> GetTextDetectionResponse -> Bool
$c== :: GetTextDetectionResponse -> GetTextDetectionResponse -> Bool
Prelude.Eq, ReadPrec [GetTextDetectionResponse]
ReadPrec GetTextDetectionResponse
Int -> ReadS GetTextDetectionResponse
ReadS [GetTextDetectionResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetTextDetectionResponse]
$creadListPrec :: ReadPrec [GetTextDetectionResponse]
readPrec :: ReadPrec GetTextDetectionResponse
$creadPrec :: ReadPrec GetTextDetectionResponse
readList :: ReadS [GetTextDetectionResponse]
$creadList :: ReadS [GetTextDetectionResponse]
readsPrec :: Int -> ReadS GetTextDetectionResponse
$creadsPrec :: Int -> ReadS GetTextDetectionResponse
Prelude.Read, Int -> GetTextDetectionResponse -> ShowS
[GetTextDetectionResponse] -> ShowS
GetTextDetectionResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetTextDetectionResponse] -> ShowS
$cshowList :: [GetTextDetectionResponse] -> ShowS
show :: GetTextDetectionResponse -> String
$cshow :: GetTextDetectionResponse -> String
showsPrec :: Int -> GetTextDetectionResponse -> ShowS
$cshowsPrec :: Int -> GetTextDetectionResponse -> ShowS
Prelude.Show, forall x.
Rep GetTextDetectionResponse x -> GetTextDetectionResponse
forall x.
GetTextDetectionResponse -> Rep GetTextDetectionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetTextDetectionResponse x -> GetTextDetectionResponse
$cfrom :: forall x.
GetTextDetectionResponse -> Rep GetTextDetectionResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetTextDetectionResponse' 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:
--
-- 'jobStatus', 'getTextDetectionResponse_jobStatus' - Current status of the text detection job.
--
-- 'nextToken', 'getTextDetectionResponse_nextToken' - If the response is truncated, Amazon Rekognition Video returns this
-- token that you can use in the subsequent request to retrieve the next
-- set of text.
--
-- 'statusMessage', 'getTextDetectionResponse_statusMessage' - If the job fails, @StatusMessage@ provides a descriptive error message.
--
-- 'textDetections', 'getTextDetectionResponse_textDetections' - An array of text detected in the video. Each element contains the
-- detected text, the time in milliseconds from the start of the video that
-- the text was detected, and where it was detected on the screen.
--
-- 'textModelVersion', 'getTextDetectionResponse_textModelVersion' - Version number of the text detection model that was used to detect text.
--
-- 'videoMetadata', 'getTextDetectionResponse_videoMetadata' - Undocumented member.
--
-- 'httpStatus', 'getTextDetectionResponse_httpStatus' - The response's http status code.
newGetTextDetectionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetTextDetectionResponse
newGetTextDetectionResponse :: Int -> GetTextDetectionResponse
newGetTextDetectionResponse Int
pHttpStatus_ =
  GetTextDetectionResponse'
    { $sel:jobStatus:GetTextDetectionResponse' :: Maybe VideoJobStatus
jobStatus =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetTextDetectionResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:statusMessage:GetTextDetectionResponse' :: Maybe Text
statusMessage = forall a. Maybe a
Prelude.Nothing,
      $sel:textDetections:GetTextDetectionResponse' :: Maybe [TextDetectionResult]
textDetections = forall a. Maybe a
Prelude.Nothing,
      $sel:textModelVersion:GetTextDetectionResponse' :: Maybe Text
textModelVersion = forall a. Maybe a
Prelude.Nothing,
      $sel:videoMetadata:GetTextDetectionResponse' :: Maybe VideoMetadata
videoMetadata = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetTextDetectionResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Current status of the text detection job.
getTextDetectionResponse_jobStatus :: Lens.Lens' GetTextDetectionResponse (Prelude.Maybe VideoJobStatus)
getTextDetectionResponse_jobStatus :: Lens' GetTextDetectionResponse (Maybe VideoJobStatus)
getTextDetectionResponse_jobStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTextDetectionResponse' {Maybe VideoJobStatus
jobStatus :: Maybe VideoJobStatus
$sel:jobStatus:GetTextDetectionResponse' :: GetTextDetectionResponse -> Maybe VideoJobStatus
jobStatus} -> Maybe VideoJobStatus
jobStatus) (\s :: GetTextDetectionResponse
s@GetTextDetectionResponse' {} Maybe VideoJobStatus
a -> GetTextDetectionResponse
s {$sel:jobStatus:GetTextDetectionResponse' :: Maybe VideoJobStatus
jobStatus = Maybe VideoJobStatus
a} :: GetTextDetectionResponse)

-- | If the response is truncated, Amazon Rekognition Video returns this
-- token that you can use in the subsequent request to retrieve the next
-- set of text.
getTextDetectionResponse_nextToken :: Lens.Lens' GetTextDetectionResponse (Prelude.Maybe Prelude.Text)
getTextDetectionResponse_nextToken :: Lens' GetTextDetectionResponse (Maybe Text)
getTextDetectionResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTextDetectionResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetTextDetectionResponse' :: GetTextDetectionResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetTextDetectionResponse
s@GetTextDetectionResponse' {} Maybe Text
a -> GetTextDetectionResponse
s {$sel:nextToken:GetTextDetectionResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetTextDetectionResponse)

-- | If the job fails, @StatusMessage@ provides a descriptive error message.
getTextDetectionResponse_statusMessage :: Lens.Lens' GetTextDetectionResponse (Prelude.Maybe Prelude.Text)
getTextDetectionResponse_statusMessage :: Lens' GetTextDetectionResponse (Maybe Text)
getTextDetectionResponse_statusMessage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTextDetectionResponse' {Maybe Text
statusMessage :: Maybe Text
$sel:statusMessage:GetTextDetectionResponse' :: GetTextDetectionResponse -> Maybe Text
statusMessage} -> Maybe Text
statusMessage) (\s :: GetTextDetectionResponse
s@GetTextDetectionResponse' {} Maybe Text
a -> GetTextDetectionResponse
s {$sel:statusMessage:GetTextDetectionResponse' :: Maybe Text
statusMessage = Maybe Text
a} :: GetTextDetectionResponse)

-- | An array of text detected in the video. Each element contains the
-- detected text, the time in milliseconds from the start of the video that
-- the text was detected, and where it was detected on the screen.
getTextDetectionResponse_textDetections :: Lens.Lens' GetTextDetectionResponse (Prelude.Maybe [TextDetectionResult])
getTextDetectionResponse_textDetections :: Lens' GetTextDetectionResponse (Maybe [TextDetectionResult])
getTextDetectionResponse_textDetections = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTextDetectionResponse' {Maybe [TextDetectionResult]
textDetections :: Maybe [TextDetectionResult]
$sel:textDetections:GetTextDetectionResponse' :: GetTextDetectionResponse -> Maybe [TextDetectionResult]
textDetections} -> Maybe [TextDetectionResult]
textDetections) (\s :: GetTextDetectionResponse
s@GetTextDetectionResponse' {} Maybe [TextDetectionResult]
a -> GetTextDetectionResponse
s {$sel:textDetections:GetTextDetectionResponse' :: Maybe [TextDetectionResult]
textDetections = Maybe [TextDetectionResult]
a} :: GetTextDetectionResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Version number of the text detection model that was used to detect text.
getTextDetectionResponse_textModelVersion :: Lens.Lens' GetTextDetectionResponse (Prelude.Maybe Prelude.Text)
getTextDetectionResponse_textModelVersion :: Lens' GetTextDetectionResponse (Maybe Text)
getTextDetectionResponse_textModelVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTextDetectionResponse' {Maybe Text
textModelVersion :: Maybe Text
$sel:textModelVersion:GetTextDetectionResponse' :: GetTextDetectionResponse -> Maybe Text
textModelVersion} -> Maybe Text
textModelVersion) (\s :: GetTextDetectionResponse
s@GetTextDetectionResponse' {} Maybe Text
a -> GetTextDetectionResponse
s {$sel:textModelVersion:GetTextDetectionResponse' :: Maybe Text
textModelVersion = Maybe Text
a} :: GetTextDetectionResponse)

-- | Undocumented member.
getTextDetectionResponse_videoMetadata :: Lens.Lens' GetTextDetectionResponse (Prelude.Maybe VideoMetadata)
getTextDetectionResponse_videoMetadata :: Lens' GetTextDetectionResponse (Maybe VideoMetadata)
getTextDetectionResponse_videoMetadata = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTextDetectionResponse' {Maybe VideoMetadata
videoMetadata :: Maybe VideoMetadata
$sel:videoMetadata:GetTextDetectionResponse' :: GetTextDetectionResponse -> Maybe VideoMetadata
videoMetadata} -> Maybe VideoMetadata
videoMetadata) (\s :: GetTextDetectionResponse
s@GetTextDetectionResponse' {} Maybe VideoMetadata
a -> GetTextDetectionResponse
s {$sel:videoMetadata:GetTextDetectionResponse' :: Maybe VideoMetadata
videoMetadata = Maybe VideoMetadata
a} :: GetTextDetectionResponse)

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

instance Prelude.NFData GetTextDetectionResponse where
  rnf :: GetTextDetectionResponse -> ()
rnf GetTextDetectionResponse' {Int
Maybe [TextDetectionResult]
Maybe Text
Maybe VideoJobStatus
Maybe VideoMetadata
httpStatus :: Int
videoMetadata :: Maybe VideoMetadata
textModelVersion :: Maybe Text
textDetections :: Maybe [TextDetectionResult]
statusMessage :: Maybe Text
nextToken :: Maybe Text
jobStatus :: Maybe VideoJobStatus
$sel:httpStatus:GetTextDetectionResponse' :: GetTextDetectionResponse -> Int
$sel:videoMetadata:GetTextDetectionResponse' :: GetTextDetectionResponse -> Maybe VideoMetadata
$sel:textModelVersion:GetTextDetectionResponse' :: GetTextDetectionResponse -> Maybe Text
$sel:textDetections:GetTextDetectionResponse' :: GetTextDetectionResponse -> Maybe [TextDetectionResult]
$sel:statusMessage:GetTextDetectionResponse' :: GetTextDetectionResponse -> Maybe Text
$sel:nextToken:GetTextDetectionResponse' :: GetTextDetectionResponse -> Maybe Text
$sel:jobStatus:GetTextDetectionResponse' :: GetTextDetectionResponse -> Maybe VideoJobStatus
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe VideoJobStatus
jobStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
statusMessage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [TextDetectionResult]
textDetections
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
textModelVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe VideoMetadata
videoMetadata
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus