{-# 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.GetPersonTracking
-- 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)
--
-- Gets the path tracking results of a Amazon Rekognition Video analysis
-- started by StartPersonTracking.
--
-- The person path tracking operation is started by a call to
-- @StartPersonTracking@ which returns a job identifier (@JobId@). When the
-- operation finishes, Amazon Rekognition Video publishes a completion
-- status to the Amazon Simple Notification Service topic registered in the
-- initial call to @StartPersonTracking@.
--
-- To get the results of the person path tracking operation, first check
-- that the status value published to the Amazon SNS topic is @SUCCEEDED@.
-- If so, call GetPersonTracking and pass the job identifier (@JobId@) from
-- the initial call to @StartPersonTracking@.
--
-- @GetPersonTracking@ returns an array, @Persons@, of tracked persons and
-- the time(s) their paths were tracked in the video.
--
-- @GetPersonTracking@ only returns the default facial attributes
-- (@BoundingBox@, @Confidence@, @Landmarks@, @Pose@, and @Quality@). The
-- other facial attributes listed in the @Face@ object of the following
-- response syntax are not returned.
--
-- For more information, see FaceDetail in the Amazon Rekognition Developer
-- Guide.
--
-- By default, the array is sorted by the time(s) a person\'s path is
-- tracked in the video. You can sort by tracked persons by specifying
-- @INDEX@ for the @SortBy@ input parameter.
--
-- Use the @MaxResults@ parameter to limit the number of items 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
-- @GetPersonTracking@ and populate the @NextToken@ request parameter with
-- the token value returned from the previous call to @GetPersonTracking@.
module Amazonka.Rekognition.GetPersonTracking
  ( -- * Creating a Request
    GetPersonTracking (..),
    newGetPersonTracking,

    -- * Request Lenses
    getPersonTracking_nextToken,
    getPersonTracking_maxResults,
    getPersonTracking_sortBy,
    getPersonTracking_jobId,

    -- * Destructuring the Response
    GetPersonTrackingResponse (..),
    newGetPersonTrackingResponse,

    -- * Response Lenses
    getPersonTrackingResponse_nextToken,
    getPersonTrackingResponse_videoMetadata,
    getPersonTrackingResponse_statusMessage,
    getPersonTrackingResponse_jobStatus,
    getPersonTrackingResponse_persons,
    getPersonTrackingResponse_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:/ 'newGetPersonTracking' smart constructor.
data GetPersonTracking = GetPersonTracking'
  { -- | If the previous response was incomplete (because there are more persons
    -- to retrieve), Amazon Rekognition Video returns a pagination token in the
    -- response. You can use this pagination token to retrieve the next set of
    -- persons.
    GetPersonTracking -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Maximum number of results to return per paginated call. The largest
    -- value you can specify is 1000. If you specify a value greater than 1000,
    -- a maximum of 1000 results is returned. The default value is 1000.
    GetPersonTracking -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | Sort to use for elements in the @Persons@ array. Use @TIMESTAMP@ to sort
    -- array elements by the time persons are detected. Use @INDEX@ to sort by
    -- the tracked persons. If you sort by @INDEX@, the array elements for each
    -- person are sorted by detection confidence. The default sort is by
    -- @TIMESTAMP@.
    GetPersonTracking -> Maybe PersonTrackingSortBy
sortBy :: Prelude.Maybe PersonTrackingSortBy,
    -- | The identifier for a job that tracks persons in a video. You get the
    -- @JobId@ from a call to @StartPersonTracking@.
    GetPersonTracking -> Text
jobId :: Prelude.Text
  }
  deriving (GetPersonTracking -> GetPersonTracking -> Bool
(GetPersonTracking -> GetPersonTracking -> Bool)
-> (GetPersonTracking -> GetPersonTracking -> Bool)
-> Eq GetPersonTracking
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetPersonTracking -> GetPersonTracking -> Bool
$c/= :: GetPersonTracking -> GetPersonTracking -> Bool
== :: GetPersonTracking -> GetPersonTracking -> Bool
$c== :: GetPersonTracking -> GetPersonTracking -> Bool
Prelude.Eq, ReadPrec [GetPersonTracking]
ReadPrec GetPersonTracking
Int -> ReadS GetPersonTracking
ReadS [GetPersonTracking]
(Int -> ReadS GetPersonTracking)
-> ReadS [GetPersonTracking]
-> ReadPrec GetPersonTracking
-> ReadPrec [GetPersonTracking]
-> Read GetPersonTracking
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetPersonTracking]
$creadListPrec :: ReadPrec [GetPersonTracking]
readPrec :: ReadPrec GetPersonTracking
$creadPrec :: ReadPrec GetPersonTracking
readList :: ReadS [GetPersonTracking]
$creadList :: ReadS [GetPersonTracking]
readsPrec :: Int -> ReadS GetPersonTracking
$creadsPrec :: Int -> ReadS GetPersonTracking
Prelude.Read, Int -> GetPersonTracking -> ShowS
[GetPersonTracking] -> ShowS
GetPersonTracking -> String
(Int -> GetPersonTracking -> ShowS)
-> (GetPersonTracking -> String)
-> ([GetPersonTracking] -> ShowS)
-> Show GetPersonTracking
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetPersonTracking] -> ShowS
$cshowList :: [GetPersonTracking] -> ShowS
show :: GetPersonTracking -> String
$cshow :: GetPersonTracking -> String
showsPrec :: Int -> GetPersonTracking -> ShowS
$cshowsPrec :: Int -> GetPersonTracking -> ShowS
Prelude.Show, (forall x. GetPersonTracking -> Rep GetPersonTracking x)
-> (forall x. Rep GetPersonTracking x -> GetPersonTracking)
-> Generic GetPersonTracking
forall x. Rep GetPersonTracking x -> GetPersonTracking
forall x. GetPersonTracking -> Rep GetPersonTracking x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetPersonTracking x -> GetPersonTracking
$cfrom :: forall x. GetPersonTracking -> Rep GetPersonTracking x
Prelude.Generic)

-- |
-- Create a value of 'GetPersonTracking' 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:
--
-- 'nextToken', 'getPersonTracking_nextToken' - If the previous response was incomplete (because there are more persons
-- to retrieve), Amazon Rekognition Video returns a pagination token in the
-- response. You can use this pagination token to retrieve the next set of
-- persons.
--
-- 'maxResults', 'getPersonTracking_maxResults' - Maximum number of results to return per paginated call. The largest
-- value you can specify is 1000. If you specify a value greater than 1000,
-- a maximum of 1000 results is returned. The default value is 1000.
--
-- 'sortBy', 'getPersonTracking_sortBy' - Sort to use for elements in the @Persons@ array. Use @TIMESTAMP@ to sort
-- array elements by the time persons are detected. Use @INDEX@ to sort by
-- the tracked persons. If you sort by @INDEX@, the array elements for each
-- person are sorted by detection confidence. The default sort is by
-- @TIMESTAMP@.
--
-- 'jobId', 'getPersonTracking_jobId' - The identifier for a job that tracks persons in a video. You get the
-- @JobId@ from a call to @StartPersonTracking@.
newGetPersonTracking ::
  -- | 'jobId'
  Prelude.Text ->
  GetPersonTracking
newGetPersonTracking :: Text -> GetPersonTracking
newGetPersonTracking Text
pJobId_ =
  GetPersonTracking' :: Maybe Text
-> Maybe Natural
-> Maybe PersonTrackingSortBy
-> Text
-> GetPersonTracking
GetPersonTracking'
    { $sel:nextToken:GetPersonTracking' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetPersonTracking' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:sortBy:GetPersonTracking' :: Maybe PersonTrackingSortBy
sortBy = Maybe PersonTrackingSortBy
forall a. Maybe a
Prelude.Nothing,
      $sel:jobId:GetPersonTracking' :: Text
jobId = Text
pJobId_
    }

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

-- | Maximum number of results to return per paginated call. The largest
-- value you can specify is 1000. If you specify a value greater than 1000,
-- a maximum of 1000 results is returned. The default value is 1000.
getPersonTracking_maxResults :: Lens.Lens' GetPersonTracking (Prelude.Maybe Prelude.Natural)
getPersonTracking_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> GetPersonTracking -> f GetPersonTracking
getPersonTracking_maxResults = (GetPersonTracking -> Maybe Natural)
-> (GetPersonTracking -> Maybe Natural -> GetPersonTracking)
-> Lens
     GetPersonTracking GetPersonTracking (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPersonTracking' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetPersonTracking' :: GetPersonTracking -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetPersonTracking
s@GetPersonTracking' {} Maybe Natural
a -> GetPersonTracking
s {$sel:maxResults:GetPersonTracking' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetPersonTracking)

-- | Sort to use for elements in the @Persons@ array. Use @TIMESTAMP@ to sort
-- array elements by the time persons are detected. Use @INDEX@ to sort by
-- the tracked persons. If you sort by @INDEX@, the array elements for each
-- person are sorted by detection confidence. The default sort is by
-- @TIMESTAMP@.
getPersonTracking_sortBy :: Lens.Lens' GetPersonTracking (Prelude.Maybe PersonTrackingSortBy)
getPersonTracking_sortBy :: (Maybe PersonTrackingSortBy -> f (Maybe PersonTrackingSortBy))
-> GetPersonTracking -> f GetPersonTracking
getPersonTracking_sortBy = (GetPersonTracking -> Maybe PersonTrackingSortBy)
-> (GetPersonTracking
    -> Maybe PersonTrackingSortBy -> GetPersonTracking)
-> Lens
     GetPersonTracking
     GetPersonTracking
     (Maybe PersonTrackingSortBy)
     (Maybe PersonTrackingSortBy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPersonTracking' {Maybe PersonTrackingSortBy
sortBy :: Maybe PersonTrackingSortBy
$sel:sortBy:GetPersonTracking' :: GetPersonTracking -> Maybe PersonTrackingSortBy
sortBy} -> Maybe PersonTrackingSortBy
sortBy) (\s :: GetPersonTracking
s@GetPersonTracking' {} Maybe PersonTrackingSortBy
a -> GetPersonTracking
s {$sel:sortBy:GetPersonTracking' :: Maybe PersonTrackingSortBy
sortBy = Maybe PersonTrackingSortBy
a} :: GetPersonTracking)

-- | The identifier for a job that tracks persons in a video. You get the
-- @JobId@ from a call to @StartPersonTracking@.
getPersonTracking_jobId :: Lens.Lens' GetPersonTracking Prelude.Text
getPersonTracking_jobId :: (Text -> f Text) -> GetPersonTracking -> f GetPersonTracking
getPersonTracking_jobId = (GetPersonTracking -> Text)
-> (GetPersonTracking -> Text -> GetPersonTracking)
-> Lens GetPersonTracking GetPersonTracking Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPersonTracking' {Text
jobId :: Text
$sel:jobId:GetPersonTracking' :: GetPersonTracking -> Text
jobId} -> Text
jobId) (\s :: GetPersonTracking
s@GetPersonTracking' {} Text
a -> GetPersonTracking
s {$sel:jobId:GetPersonTracking' :: Text
jobId = Text
a} :: GetPersonTracking)

instance Core.AWSRequest GetPersonTracking where
  type
    AWSResponse GetPersonTracking =
      GetPersonTrackingResponse
  request :: GetPersonTracking -> Request GetPersonTracking
request = Service -> GetPersonTracking -> Request GetPersonTracking
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GetPersonTracking
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetPersonTracking)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetPersonTracking))
-> Logger
-> Service
-> Proxy GetPersonTracking
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetPersonTracking)))
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
-> Maybe VideoMetadata
-> Maybe Text
-> Maybe VideoJobStatus
-> Maybe [PersonDetection]
-> Int
-> GetPersonTrackingResponse
GetPersonTrackingResponse'
            (Maybe Text
 -> Maybe VideoMetadata
 -> Maybe Text
 -> Maybe VideoJobStatus
 -> Maybe [PersonDetection]
 -> Int
 -> GetPersonTrackingResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe VideoMetadata
      -> Maybe Text
      -> Maybe VideoJobStatus
      -> Maybe [PersonDetection]
      -> Int
      -> GetPersonTrackingResponse)
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
"NextToken")
            Either
  String
  (Maybe VideoMetadata
   -> Maybe Text
   -> Maybe VideoJobStatus
   -> Maybe [PersonDetection]
   -> Int
   -> GetPersonTrackingResponse)
-> Either String (Maybe VideoMetadata)
-> Either
     String
     (Maybe Text
      -> Maybe VideoJobStatus
      -> Maybe [PersonDetection]
      -> Int
      -> GetPersonTrackingResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe VideoMetadata)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"VideoMetadata")
            Either
  String
  (Maybe Text
   -> Maybe VideoJobStatus
   -> Maybe [PersonDetection]
   -> Int
   -> GetPersonTrackingResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe VideoJobStatus
      -> Maybe [PersonDetection] -> Int -> GetPersonTrackingResponse)
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
"StatusMessage")
            Either
  String
  (Maybe VideoJobStatus
   -> Maybe [PersonDetection] -> Int -> GetPersonTrackingResponse)
-> Either String (Maybe VideoJobStatus)
-> Either
     String
     (Maybe [PersonDetection] -> Int -> GetPersonTrackingResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe VideoJobStatus)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"JobStatus")
            Either
  String
  (Maybe [PersonDetection] -> Int -> GetPersonTrackingResponse)
-> Either String (Maybe [PersonDetection])
-> Either String (Int -> GetPersonTrackingResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [PersonDetection]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Persons" Either String (Maybe (Maybe [PersonDetection]))
-> Maybe [PersonDetection]
-> Either String (Maybe [PersonDetection])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [PersonDetection]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> GetPersonTrackingResponse)
-> Either String Int -> Either String GetPersonTrackingResponse
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 GetPersonTracking

instance Prelude.NFData GetPersonTracking

instance Core.ToHeaders GetPersonTracking where
  toHeaders :: GetPersonTracking -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetPersonTracking -> 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.GetPersonTracking" ::
                          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 GetPersonTracking where
  toJSON :: GetPersonTracking -> Value
toJSON GetPersonTracking' {Maybe Natural
Maybe Text
Maybe PersonTrackingSortBy
Text
jobId :: Text
sortBy :: Maybe PersonTrackingSortBy
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:jobId:GetPersonTracking' :: GetPersonTracking -> Text
$sel:sortBy:GetPersonTracking' :: GetPersonTracking -> Maybe PersonTrackingSortBy
$sel:maxResults:GetPersonTracking' :: GetPersonTracking -> Maybe Natural
$sel:nextToken:GetPersonTracking' :: GetPersonTracking -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"NextToken" 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
nextToken,
            (Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            (Text
"SortBy" Text -> PersonTrackingSortBy -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (PersonTrackingSortBy -> Pair)
-> Maybe PersonTrackingSortBy -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PersonTrackingSortBy
sortBy,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"JobId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
jobId)
          ]
      )

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

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

-- | /See:/ 'newGetPersonTrackingResponse' smart constructor.
data GetPersonTrackingResponse = GetPersonTrackingResponse'
  { -- | 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 persons.
    GetPersonTrackingResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Information about a video that Amazon Rekognition Video analyzed.
    -- @Videometadata@ is returned in every page of paginated responses from a
    -- Amazon Rekognition Video operation.
    GetPersonTrackingResponse -> Maybe VideoMetadata
videoMetadata :: Prelude.Maybe VideoMetadata,
    -- | If the job fails, @StatusMessage@ provides a descriptive error message.
    GetPersonTrackingResponse -> Maybe Text
statusMessage :: Prelude.Maybe Prelude.Text,
    -- | The current status of the person tracking job.
    GetPersonTrackingResponse -> Maybe VideoJobStatus
jobStatus :: Prelude.Maybe VideoJobStatus,
    -- | An array of the persons detected in the video and the time(s) their path
    -- was tracked throughout the video. An array element will exist for each
    -- time a person\'s path is tracked.
    GetPersonTrackingResponse -> Maybe [PersonDetection]
persons :: Prelude.Maybe [PersonDetection],
    -- | The response's http status code.
    GetPersonTrackingResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetPersonTrackingResponse -> GetPersonTrackingResponse -> Bool
(GetPersonTrackingResponse -> GetPersonTrackingResponse -> Bool)
-> (GetPersonTrackingResponse -> GetPersonTrackingResponse -> Bool)
-> Eq GetPersonTrackingResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetPersonTrackingResponse -> GetPersonTrackingResponse -> Bool
$c/= :: GetPersonTrackingResponse -> GetPersonTrackingResponse -> Bool
== :: GetPersonTrackingResponse -> GetPersonTrackingResponse -> Bool
$c== :: GetPersonTrackingResponse -> GetPersonTrackingResponse -> Bool
Prelude.Eq, ReadPrec [GetPersonTrackingResponse]
ReadPrec GetPersonTrackingResponse
Int -> ReadS GetPersonTrackingResponse
ReadS [GetPersonTrackingResponse]
(Int -> ReadS GetPersonTrackingResponse)
-> ReadS [GetPersonTrackingResponse]
-> ReadPrec GetPersonTrackingResponse
-> ReadPrec [GetPersonTrackingResponse]
-> Read GetPersonTrackingResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetPersonTrackingResponse]
$creadListPrec :: ReadPrec [GetPersonTrackingResponse]
readPrec :: ReadPrec GetPersonTrackingResponse
$creadPrec :: ReadPrec GetPersonTrackingResponse
readList :: ReadS [GetPersonTrackingResponse]
$creadList :: ReadS [GetPersonTrackingResponse]
readsPrec :: Int -> ReadS GetPersonTrackingResponse
$creadsPrec :: Int -> ReadS GetPersonTrackingResponse
Prelude.Read, Int -> GetPersonTrackingResponse -> ShowS
[GetPersonTrackingResponse] -> ShowS
GetPersonTrackingResponse -> String
(Int -> GetPersonTrackingResponse -> ShowS)
-> (GetPersonTrackingResponse -> String)
-> ([GetPersonTrackingResponse] -> ShowS)
-> Show GetPersonTrackingResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetPersonTrackingResponse] -> ShowS
$cshowList :: [GetPersonTrackingResponse] -> ShowS
show :: GetPersonTrackingResponse -> String
$cshow :: GetPersonTrackingResponse -> String
showsPrec :: Int -> GetPersonTrackingResponse -> ShowS
$cshowsPrec :: Int -> GetPersonTrackingResponse -> ShowS
Prelude.Show, (forall x.
 GetPersonTrackingResponse -> Rep GetPersonTrackingResponse x)
-> (forall x.
    Rep GetPersonTrackingResponse x -> GetPersonTrackingResponse)
-> Generic GetPersonTrackingResponse
forall x.
Rep GetPersonTrackingResponse x -> GetPersonTrackingResponse
forall x.
GetPersonTrackingResponse -> Rep GetPersonTrackingResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetPersonTrackingResponse x -> GetPersonTrackingResponse
$cfrom :: forall x.
GetPersonTrackingResponse -> Rep GetPersonTrackingResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetPersonTrackingResponse' 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:
--
-- 'nextToken', 'getPersonTrackingResponse_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 persons.
--
-- 'videoMetadata', 'getPersonTrackingResponse_videoMetadata' - Information about a video that Amazon Rekognition Video analyzed.
-- @Videometadata@ is returned in every page of paginated responses from a
-- Amazon Rekognition Video operation.
--
-- 'statusMessage', 'getPersonTrackingResponse_statusMessage' - If the job fails, @StatusMessage@ provides a descriptive error message.
--
-- 'jobStatus', 'getPersonTrackingResponse_jobStatus' - The current status of the person tracking job.
--
-- 'persons', 'getPersonTrackingResponse_persons' - An array of the persons detected in the video and the time(s) their path
-- was tracked throughout the video. An array element will exist for each
-- time a person\'s path is tracked.
--
-- 'httpStatus', 'getPersonTrackingResponse_httpStatus' - The response's http status code.
newGetPersonTrackingResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetPersonTrackingResponse
newGetPersonTrackingResponse :: Int -> GetPersonTrackingResponse
newGetPersonTrackingResponse Int
pHttpStatus_ =
  GetPersonTrackingResponse' :: Maybe Text
-> Maybe VideoMetadata
-> Maybe Text
-> Maybe VideoJobStatus
-> Maybe [PersonDetection]
-> Int
-> GetPersonTrackingResponse
GetPersonTrackingResponse'
    { $sel:nextToken:GetPersonTrackingResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:videoMetadata:GetPersonTrackingResponse' :: Maybe VideoMetadata
videoMetadata = Maybe VideoMetadata
forall a. Maybe a
Prelude.Nothing,
      $sel:statusMessage:GetPersonTrackingResponse' :: Maybe Text
statusMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:jobStatus:GetPersonTrackingResponse' :: Maybe VideoJobStatus
jobStatus = Maybe VideoJobStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:persons:GetPersonTrackingResponse' :: Maybe [PersonDetection]
persons = Maybe [PersonDetection]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetPersonTrackingResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | 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 persons.
getPersonTrackingResponse_nextToken :: Lens.Lens' GetPersonTrackingResponse (Prelude.Maybe Prelude.Text)
getPersonTrackingResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetPersonTrackingResponse -> f GetPersonTrackingResponse
getPersonTrackingResponse_nextToken = (GetPersonTrackingResponse -> Maybe Text)
-> (GetPersonTrackingResponse
    -> Maybe Text -> GetPersonTrackingResponse)
-> Lens
     GetPersonTrackingResponse
     GetPersonTrackingResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPersonTrackingResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetPersonTrackingResponse' :: GetPersonTrackingResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetPersonTrackingResponse
s@GetPersonTrackingResponse' {} Maybe Text
a -> GetPersonTrackingResponse
s {$sel:nextToken:GetPersonTrackingResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetPersonTrackingResponse)

-- | Information about a video that Amazon Rekognition Video analyzed.
-- @Videometadata@ is returned in every page of paginated responses from a
-- Amazon Rekognition Video operation.
getPersonTrackingResponse_videoMetadata :: Lens.Lens' GetPersonTrackingResponse (Prelude.Maybe VideoMetadata)
getPersonTrackingResponse_videoMetadata :: (Maybe VideoMetadata -> f (Maybe VideoMetadata))
-> GetPersonTrackingResponse -> f GetPersonTrackingResponse
getPersonTrackingResponse_videoMetadata = (GetPersonTrackingResponse -> Maybe VideoMetadata)
-> (GetPersonTrackingResponse
    -> Maybe VideoMetadata -> GetPersonTrackingResponse)
-> Lens
     GetPersonTrackingResponse
     GetPersonTrackingResponse
     (Maybe VideoMetadata)
     (Maybe VideoMetadata)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPersonTrackingResponse' {Maybe VideoMetadata
videoMetadata :: Maybe VideoMetadata
$sel:videoMetadata:GetPersonTrackingResponse' :: GetPersonTrackingResponse -> Maybe VideoMetadata
videoMetadata} -> Maybe VideoMetadata
videoMetadata) (\s :: GetPersonTrackingResponse
s@GetPersonTrackingResponse' {} Maybe VideoMetadata
a -> GetPersonTrackingResponse
s {$sel:videoMetadata:GetPersonTrackingResponse' :: Maybe VideoMetadata
videoMetadata = Maybe VideoMetadata
a} :: GetPersonTrackingResponse)

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

-- | The current status of the person tracking job.
getPersonTrackingResponse_jobStatus :: Lens.Lens' GetPersonTrackingResponse (Prelude.Maybe VideoJobStatus)
getPersonTrackingResponse_jobStatus :: (Maybe VideoJobStatus -> f (Maybe VideoJobStatus))
-> GetPersonTrackingResponse -> f GetPersonTrackingResponse
getPersonTrackingResponse_jobStatus = (GetPersonTrackingResponse -> Maybe VideoJobStatus)
-> (GetPersonTrackingResponse
    -> Maybe VideoJobStatus -> GetPersonTrackingResponse)
-> Lens
     GetPersonTrackingResponse
     GetPersonTrackingResponse
     (Maybe VideoJobStatus)
     (Maybe VideoJobStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPersonTrackingResponse' {Maybe VideoJobStatus
jobStatus :: Maybe VideoJobStatus
$sel:jobStatus:GetPersonTrackingResponse' :: GetPersonTrackingResponse -> Maybe VideoJobStatus
jobStatus} -> Maybe VideoJobStatus
jobStatus) (\s :: GetPersonTrackingResponse
s@GetPersonTrackingResponse' {} Maybe VideoJobStatus
a -> GetPersonTrackingResponse
s {$sel:jobStatus:GetPersonTrackingResponse' :: Maybe VideoJobStatus
jobStatus = Maybe VideoJobStatus
a} :: GetPersonTrackingResponse)

-- | An array of the persons detected in the video and the time(s) their path
-- was tracked throughout the video. An array element will exist for each
-- time a person\'s path is tracked.
getPersonTrackingResponse_persons :: Lens.Lens' GetPersonTrackingResponse (Prelude.Maybe [PersonDetection])
getPersonTrackingResponse_persons :: (Maybe [PersonDetection] -> f (Maybe [PersonDetection]))
-> GetPersonTrackingResponse -> f GetPersonTrackingResponse
getPersonTrackingResponse_persons = (GetPersonTrackingResponse -> Maybe [PersonDetection])
-> (GetPersonTrackingResponse
    -> Maybe [PersonDetection] -> GetPersonTrackingResponse)
-> Lens
     GetPersonTrackingResponse
     GetPersonTrackingResponse
     (Maybe [PersonDetection])
     (Maybe [PersonDetection])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPersonTrackingResponse' {Maybe [PersonDetection]
persons :: Maybe [PersonDetection]
$sel:persons:GetPersonTrackingResponse' :: GetPersonTrackingResponse -> Maybe [PersonDetection]
persons} -> Maybe [PersonDetection]
persons) (\s :: GetPersonTrackingResponse
s@GetPersonTrackingResponse' {} Maybe [PersonDetection]
a -> GetPersonTrackingResponse
s {$sel:persons:GetPersonTrackingResponse' :: Maybe [PersonDetection]
persons = Maybe [PersonDetection]
a} :: GetPersonTrackingResponse) ((Maybe [PersonDetection] -> f (Maybe [PersonDetection]))
 -> GetPersonTrackingResponse -> f GetPersonTrackingResponse)
-> ((Maybe [PersonDetection] -> f (Maybe [PersonDetection]))
    -> Maybe [PersonDetection] -> f (Maybe [PersonDetection]))
-> (Maybe [PersonDetection] -> f (Maybe [PersonDetection]))
-> GetPersonTrackingResponse
-> f GetPersonTrackingResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [PersonDetection]
  [PersonDetection]
  [PersonDetection]
  [PersonDetection]
-> Iso
     (Maybe [PersonDetection])
     (Maybe [PersonDetection])
     (Maybe [PersonDetection])
     (Maybe [PersonDetection])
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
  [PersonDetection]
  [PersonDetection]
  [PersonDetection]
  [PersonDetection]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData GetPersonTrackingResponse