{-# 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.StartTextDetection
-- 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)
--
-- Starts asynchronous detection of text in a stored video.
--
-- Amazon Rekognition Video can detect text in a video stored in an Amazon
-- S3 bucket. Use Video to specify the bucket name and the filename of the
-- video. @StartTextDetection@ returns a job identifier (@JobId@) which you
-- use to get the results of the operation. When text detection is
-- finished, Amazon Rekognition Video publishes a completion status to the
-- Amazon Simple Notification Service topic that you specify in
-- @NotificationChannel@.
--
-- 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 to @StartTextDetection@.
module Amazonka.Rekognition.StartTextDetection
  ( -- * Creating a Request
    StartTextDetection (..),
    newStartTextDetection,

    -- * Request Lenses
    startTextDetection_jobTag,
    startTextDetection_filters,
    startTextDetection_notificationChannel,
    startTextDetection_clientRequestToken,
    startTextDetection_video,

    -- * Destructuring the Response
    StartTextDetectionResponse (..),
    newStartTextDetectionResponse,

    -- * Response Lenses
    startTextDetectionResponse_jobId,
    startTextDetectionResponse_httpStatus,
  )
where

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

-- | /See:/ 'newStartTextDetection' smart constructor.
data StartTextDetection = StartTextDetection'
  { -- | An identifier returned in the completion status published by your Amazon
    -- Simple Notification Service topic. For example, you can use @JobTag@ to
    -- group related jobs and identify them in the completion notification.
    StartTextDetection -> Maybe Text
jobTag :: Prelude.Maybe Prelude.Text,
    -- | Optional parameters that let you set criteria the text must meet to be
    -- included in your response.
    StartTextDetection -> Maybe StartTextDetectionFilters
filters :: Prelude.Maybe StartTextDetectionFilters,
    StartTextDetection -> Maybe NotificationChannel
notificationChannel :: Prelude.Maybe NotificationChannel,
    -- | Idempotent token used to identify the start request. If you use the same
    -- token with multiple @StartTextDetection@ requests, the same @JobId@ is
    -- returned. Use @ClientRequestToken@ to prevent the same job from being
    -- accidentaly started more than once.
    StartTextDetection -> Maybe Text
clientRequestToken :: Prelude.Maybe Prelude.Text,
    StartTextDetection -> Video
video :: Video
  }
  deriving (StartTextDetection -> StartTextDetection -> Bool
(StartTextDetection -> StartTextDetection -> Bool)
-> (StartTextDetection -> StartTextDetection -> Bool)
-> Eq StartTextDetection
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartTextDetection -> StartTextDetection -> Bool
$c/= :: StartTextDetection -> StartTextDetection -> Bool
== :: StartTextDetection -> StartTextDetection -> Bool
$c== :: StartTextDetection -> StartTextDetection -> Bool
Prelude.Eq, ReadPrec [StartTextDetection]
ReadPrec StartTextDetection
Int -> ReadS StartTextDetection
ReadS [StartTextDetection]
(Int -> ReadS StartTextDetection)
-> ReadS [StartTextDetection]
-> ReadPrec StartTextDetection
-> ReadPrec [StartTextDetection]
-> Read StartTextDetection
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartTextDetection]
$creadListPrec :: ReadPrec [StartTextDetection]
readPrec :: ReadPrec StartTextDetection
$creadPrec :: ReadPrec StartTextDetection
readList :: ReadS [StartTextDetection]
$creadList :: ReadS [StartTextDetection]
readsPrec :: Int -> ReadS StartTextDetection
$creadsPrec :: Int -> ReadS StartTextDetection
Prelude.Read, Int -> StartTextDetection -> ShowS
[StartTextDetection] -> ShowS
StartTextDetection -> String
(Int -> StartTextDetection -> ShowS)
-> (StartTextDetection -> String)
-> ([StartTextDetection] -> ShowS)
-> Show StartTextDetection
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartTextDetection] -> ShowS
$cshowList :: [StartTextDetection] -> ShowS
show :: StartTextDetection -> String
$cshow :: StartTextDetection -> String
showsPrec :: Int -> StartTextDetection -> ShowS
$cshowsPrec :: Int -> StartTextDetection -> ShowS
Prelude.Show, (forall x. StartTextDetection -> Rep StartTextDetection x)
-> (forall x. Rep StartTextDetection x -> StartTextDetection)
-> Generic StartTextDetection
forall x. Rep StartTextDetection x -> StartTextDetection
forall x. StartTextDetection -> Rep StartTextDetection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartTextDetection x -> StartTextDetection
$cfrom :: forall x. StartTextDetection -> Rep StartTextDetection x
Prelude.Generic)

-- |
-- Create a value of 'StartTextDetection' 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:
--
-- 'jobTag', 'startTextDetection_jobTag' - An identifier returned in the completion status published by your Amazon
-- Simple Notification Service topic. For example, you can use @JobTag@ to
-- group related jobs and identify them in the completion notification.
--
-- 'filters', 'startTextDetection_filters' - Optional parameters that let you set criteria the text must meet to be
-- included in your response.
--
-- 'notificationChannel', 'startTextDetection_notificationChannel' - Undocumented member.
--
-- 'clientRequestToken', 'startTextDetection_clientRequestToken' - Idempotent token used to identify the start request. If you use the same
-- token with multiple @StartTextDetection@ requests, the same @JobId@ is
-- returned. Use @ClientRequestToken@ to prevent the same job from being
-- accidentaly started more than once.
--
-- 'video', 'startTextDetection_video' - Undocumented member.
newStartTextDetection ::
  -- | 'video'
  Video ->
  StartTextDetection
newStartTextDetection :: Video -> StartTextDetection
newStartTextDetection Video
pVideo_ =
  StartTextDetection' :: Maybe Text
-> Maybe StartTextDetectionFilters
-> Maybe NotificationChannel
-> Maybe Text
-> Video
-> StartTextDetection
StartTextDetection'
    { $sel:jobTag:StartTextDetection' :: Maybe Text
jobTag = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:filters:StartTextDetection' :: Maybe StartTextDetectionFilters
filters = Maybe StartTextDetectionFilters
forall a. Maybe a
Prelude.Nothing,
      $sel:notificationChannel:StartTextDetection' :: Maybe NotificationChannel
notificationChannel = Maybe NotificationChannel
forall a. Maybe a
Prelude.Nothing,
      $sel:clientRequestToken:StartTextDetection' :: Maybe Text
clientRequestToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:video:StartTextDetection' :: Video
video = Video
pVideo_
    }

-- | An identifier returned in the completion status published by your Amazon
-- Simple Notification Service topic. For example, you can use @JobTag@ to
-- group related jobs and identify them in the completion notification.
startTextDetection_jobTag :: Lens.Lens' StartTextDetection (Prelude.Maybe Prelude.Text)
startTextDetection_jobTag :: (Maybe Text -> f (Maybe Text))
-> StartTextDetection -> f StartTextDetection
startTextDetection_jobTag = (StartTextDetection -> Maybe Text)
-> (StartTextDetection -> Maybe Text -> StartTextDetection)
-> Lens
     StartTextDetection StartTextDetection (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTextDetection' {Maybe Text
jobTag :: Maybe Text
$sel:jobTag:StartTextDetection' :: StartTextDetection -> Maybe Text
jobTag} -> Maybe Text
jobTag) (\s :: StartTextDetection
s@StartTextDetection' {} Maybe Text
a -> StartTextDetection
s {$sel:jobTag:StartTextDetection' :: Maybe Text
jobTag = Maybe Text
a} :: StartTextDetection)

-- | Optional parameters that let you set criteria the text must meet to be
-- included in your response.
startTextDetection_filters :: Lens.Lens' StartTextDetection (Prelude.Maybe StartTextDetectionFilters)
startTextDetection_filters :: (Maybe StartTextDetectionFilters
 -> f (Maybe StartTextDetectionFilters))
-> StartTextDetection -> f StartTextDetection
startTextDetection_filters = (StartTextDetection -> Maybe StartTextDetectionFilters)
-> (StartTextDetection
    -> Maybe StartTextDetectionFilters -> StartTextDetection)
-> Lens
     StartTextDetection
     StartTextDetection
     (Maybe StartTextDetectionFilters)
     (Maybe StartTextDetectionFilters)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTextDetection' {Maybe StartTextDetectionFilters
filters :: Maybe StartTextDetectionFilters
$sel:filters:StartTextDetection' :: StartTextDetection -> Maybe StartTextDetectionFilters
filters} -> Maybe StartTextDetectionFilters
filters) (\s :: StartTextDetection
s@StartTextDetection' {} Maybe StartTextDetectionFilters
a -> StartTextDetection
s {$sel:filters:StartTextDetection' :: Maybe StartTextDetectionFilters
filters = Maybe StartTextDetectionFilters
a} :: StartTextDetection)

-- | Undocumented member.
startTextDetection_notificationChannel :: Lens.Lens' StartTextDetection (Prelude.Maybe NotificationChannel)
startTextDetection_notificationChannel :: (Maybe NotificationChannel -> f (Maybe NotificationChannel))
-> StartTextDetection -> f StartTextDetection
startTextDetection_notificationChannel = (StartTextDetection -> Maybe NotificationChannel)
-> (StartTextDetection
    -> Maybe NotificationChannel -> StartTextDetection)
-> Lens
     StartTextDetection
     StartTextDetection
     (Maybe NotificationChannel)
     (Maybe NotificationChannel)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTextDetection' {Maybe NotificationChannel
notificationChannel :: Maybe NotificationChannel
$sel:notificationChannel:StartTextDetection' :: StartTextDetection -> Maybe NotificationChannel
notificationChannel} -> Maybe NotificationChannel
notificationChannel) (\s :: StartTextDetection
s@StartTextDetection' {} Maybe NotificationChannel
a -> StartTextDetection
s {$sel:notificationChannel:StartTextDetection' :: Maybe NotificationChannel
notificationChannel = Maybe NotificationChannel
a} :: StartTextDetection)

-- | Idempotent token used to identify the start request. If you use the same
-- token with multiple @StartTextDetection@ requests, the same @JobId@ is
-- returned. Use @ClientRequestToken@ to prevent the same job from being
-- accidentaly started more than once.
startTextDetection_clientRequestToken :: Lens.Lens' StartTextDetection (Prelude.Maybe Prelude.Text)
startTextDetection_clientRequestToken :: (Maybe Text -> f (Maybe Text))
-> StartTextDetection -> f StartTextDetection
startTextDetection_clientRequestToken = (StartTextDetection -> Maybe Text)
-> (StartTextDetection -> Maybe Text -> StartTextDetection)
-> Lens
     StartTextDetection StartTextDetection (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTextDetection' {Maybe Text
clientRequestToken :: Maybe Text
$sel:clientRequestToken:StartTextDetection' :: StartTextDetection -> Maybe Text
clientRequestToken} -> Maybe Text
clientRequestToken) (\s :: StartTextDetection
s@StartTextDetection' {} Maybe Text
a -> StartTextDetection
s {$sel:clientRequestToken:StartTextDetection' :: Maybe Text
clientRequestToken = Maybe Text
a} :: StartTextDetection)

-- | Undocumented member.
startTextDetection_video :: Lens.Lens' StartTextDetection Video
startTextDetection_video :: (Video -> f Video) -> StartTextDetection -> f StartTextDetection
startTextDetection_video = (StartTextDetection -> Video)
-> (StartTextDetection -> Video -> StartTextDetection)
-> Lens StartTextDetection StartTextDetection Video Video
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTextDetection' {Video
video :: Video
$sel:video:StartTextDetection' :: StartTextDetection -> Video
video} -> Video
video) (\s :: StartTextDetection
s@StartTextDetection' {} Video
a -> StartTextDetection
s {$sel:video:StartTextDetection' :: Video
video = Video
a} :: StartTextDetection)

instance Core.AWSRequest StartTextDetection where
  type
    AWSResponse StartTextDetection =
      StartTextDetectionResponse
  request :: StartTextDetection -> Request StartTextDetection
request = Service -> StartTextDetection -> Request StartTextDetection
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy StartTextDetection
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse StartTextDetection)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse StartTextDetection))
-> Logger
-> Service
-> Proxy StartTextDetection
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse StartTextDetection)))
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 Text -> Int -> StartTextDetectionResponse
StartTextDetectionResponse'
            (Maybe Text -> Int -> StartTextDetectionResponse)
-> Either String (Maybe Text)
-> Either String (Int -> StartTextDetectionResponse)
forall (f :: * -> *) a b. Functor 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
"JobId")
            Either String (Int -> StartTextDetectionResponse)
-> Either String Int -> Either String StartTextDetectionResponse
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 StartTextDetection

instance Prelude.NFData StartTextDetection

instance Core.ToHeaders StartTextDetection where
  toHeaders :: StartTextDetection -> ResponseHeaders
toHeaders =
    ResponseHeaders -> StartTextDetection -> 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
"RekognitionService.StartTextDetection" ::
                          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 StartTextDetection where
  toJSON :: StartTextDetection -> Value
toJSON StartTextDetection' {Maybe Text
Maybe NotificationChannel
Maybe StartTextDetectionFilters
Video
video :: Video
clientRequestToken :: Maybe Text
notificationChannel :: Maybe NotificationChannel
filters :: Maybe StartTextDetectionFilters
jobTag :: Maybe Text
$sel:video:StartTextDetection' :: StartTextDetection -> Video
$sel:clientRequestToken:StartTextDetection' :: StartTextDetection -> Maybe Text
$sel:notificationChannel:StartTextDetection' :: StartTextDetection -> Maybe NotificationChannel
$sel:filters:StartTextDetection' :: StartTextDetection -> Maybe StartTextDetectionFilters
$sel:jobTag:StartTextDetection' :: StartTextDetection -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"JobTag" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
jobTag,
            (Text
"Filters" Text -> StartTextDetectionFilters -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (StartTextDetectionFilters -> Pair)
-> Maybe StartTextDetectionFilters -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe StartTextDetectionFilters
filters,
            (Text
"NotificationChannel" Text -> NotificationChannel -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (NotificationChannel -> Pair)
-> Maybe NotificationChannel -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe NotificationChannel
notificationChannel,
            (Text
"ClientRequestToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
clientRequestToken,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Video" Text -> Video -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Video
video)
          ]
      )

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

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

-- | /See:/ 'newStartTextDetectionResponse' smart constructor.
data StartTextDetectionResponse = StartTextDetectionResponse'
  { -- | Identifier for the text detection job. Use @JobId@ to identify the job
    -- in a subsequent call to @GetTextDetection@.
    StartTextDetectionResponse -> Maybe Text
jobId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    StartTextDetectionResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (StartTextDetectionResponse -> StartTextDetectionResponse -> Bool
(StartTextDetectionResponse -> StartTextDetectionResponse -> Bool)
-> (StartTextDetectionResponse
    -> StartTextDetectionResponse -> Bool)
-> Eq StartTextDetectionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartTextDetectionResponse -> StartTextDetectionResponse -> Bool
$c/= :: StartTextDetectionResponse -> StartTextDetectionResponse -> Bool
== :: StartTextDetectionResponse -> StartTextDetectionResponse -> Bool
$c== :: StartTextDetectionResponse -> StartTextDetectionResponse -> Bool
Prelude.Eq, ReadPrec [StartTextDetectionResponse]
ReadPrec StartTextDetectionResponse
Int -> ReadS StartTextDetectionResponse
ReadS [StartTextDetectionResponse]
(Int -> ReadS StartTextDetectionResponse)
-> ReadS [StartTextDetectionResponse]
-> ReadPrec StartTextDetectionResponse
-> ReadPrec [StartTextDetectionResponse]
-> Read StartTextDetectionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartTextDetectionResponse]
$creadListPrec :: ReadPrec [StartTextDetectionResponse]
readPrec :: ReadPrec StartTextDetectionResponse
$creadPrec :: ReadPrec StartTextDetectionResponse
readList :: ReadS [StartTextDetectionResponse]
$creadList :: ReadS [StartTextDetectionResponse]
readsPrec :: Int -> ReadS StartTextDetectionResponse
$creadsPrec :: Int -> ReadS StartTextDetectionResponse
Prelude.Read, Int -> StartTextDetectionResponse -> ShowS
[StartTextDetectionResponse] -> ShowS
StartTextDetectionResponse -> String
(Int -> StartTextDetectionResponse -> ShowS)
-> (StartTextDetectionResponse -> String)
-> ([StartTextDetectionResponse] -> ShowS)
-> Show StartTextDetectionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartTextDetectionResponse] -> ShowS
$cshowList :: [StartTextDetectionResponse] -> ShowS
show :: StartTextDetectionResponse -> String
$cshow :: StartTextDetectionResponse -> String
showsPrec :: Int -> StartTextDetectionResponse -> ShowS
$cshowsPrec :: Int -> StartTextDetectionResponse -> ShowS
Prelude.Show, (forall x.
 StartTextDetectionResponse -> Rep StartTextDetectionResponse x)
-> (forall x.
    Rep StartTextDetectionResponse x -> StartTextDetectionResponse)
-> Generic StartTextDetectionResponse
forall x.
Rep StartTextDetectionResponse x -> StartTextDetectionResponse
forall x.
StartTextDetectionResponse -> Rep StartTextDetectionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartTextDetectionResponse x -> StartTextDetectionResponse
$cfrom :: forall x.
StartTextDetectionResponse -> Rep StartTextDetectionResponse x
Prelude.Generic)

-- |
-- Create a value of 'StartTextDetectionResponse' 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:
--
-- 'jobId', 'startTextDetectionResponse_jobId' - Identifier for the text detection job. Use @JobId@ to identify the job
-- in a subsequent call to @GetTextDetection@.
--
-- 'httpStatus', 'startTextDetectionResponse_httpStatus' - The response's http status code.
newStartTextDetectionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  StartTextDetectionResponse
newStartTextDetectionResponse :: Int -> StartTextDetectionResponse
newStartTextDetectionResponse Int
pHttpStatus_ =
  StartTextDetectionResponse' :: Maybe Text -> Int -> StartTextDetectionResponse
StartTextDetectionResponse'
    { $sel:jobId:StartTextDetectionResponse' :: Maybe Text
jobId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:StartTextDetectionResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Identifier for the text detection job. Use @JobId@ to identify the job
-- in a subsequent call to @GetTextDetection@.
startTextDetectionResponse_jobId :: Lens.Lens' StartTextDetectionResponse (Prelude.Maybe Prelude.Text)
startTextDetectionResponse_jobId :: (Maybe Text -> f (Maybe Text))
-> StartTextDetectionResponse -> f StartTextDetectionResponse
startTextDetectionResponse_jobId = (StartTextDetectionResponse -> Maybe Text)
-> (StartTextDetectionResponse
    -> Maybe Text -> StartTextDetectionResponse)
-> Lens
     StartTextDetectionResponse
     StartTextDetectionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTextDetectionResponse' {Maybe Text
jobId :: Maybe Text
$sel:jobId:StartTextDetectionResponse' :: StartTextDetectionResponse -> Maybe Text
jobId} -> Maybe Text
jobId) (\s :: StartTextDetectionResponse
s@StartTextDetectionResponse' {} Maybe Text
a -> StartTextDetectionResponse
s {$sel:jobId:StartTextDetectionResponse' :: Maybe Text
jobId = Maybe Text
a} :: StartTextDetectionResponse)

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

instance Prelude.NFData StartTextDetectionResponse