{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.Rekognition.Types.PersonDetection where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Rekognition.Types.PersonDetail
data PersonDetection = PersonDetection'
{
PersonDetection -> Maybe PersonDetail
person :: Prelude.Maybe PersonDetail,
PersonDetection -> Maybe Integer
timestamp :: Prelude.Maybe Prelude.Integer
}
deriving (PersonDetection -> PersonDetection -> Bool
(PersonDetection -> PersonDetection -> Bool)
-> (PersonDetection -> PersonDetection -> Bool)
-> Eq PersonDetection
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PersonDetection -> PersonDetection -> Bool
$c/= :: PersonDetection -> PersonDetection -> Bool
== :: PersonDetection -> PersonDetection -> Bool
$c== :: PersonDetection -> PersonDetection -> Bool
Prelude.Eq, ReadPrec [PersonDetection]
ReadPrec PersonDetection
Int -> ReadS PersonDetection
ReadS [PersonDetection]
(Int -> ReadS PersonDetection)
-> ReadS [PersonDetection]
-> ReadPrec PersonDetection
-> ReadPrec [PersonDetection]
-> Read PersonDetection
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PersonDetection]
$creadListPrec :: ReadPrec [PersonDetection]
readPrec :: ReadPrec PersonDetection
$creadPrec :: ReadPrec PersonDetection
readList :: ReadS [PersonDetection]
$creadList :: ReadS [PersonDetection]
readsPrec :: Int -> ReadS PersonDetection
$creadsPrec :: Int -> ReadS PersonDetection
Prelude.Read, Int -> PersonDetection -> ShowS
[PersonDetection] -> ShowS
PersonDetection -> String
(Int -> PersonDetection -> ShowS)
-> (PersonDetection -> String)
-> ([PersonDetection] -> ShowS)
-> Show PersonDetection
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PersonDetection] -> ShowS
$cshowList :: [PersonDetection] -> ShowS
show :: PersonDetection -> String
$cshow :: PersonDetection -> String
showsPrec :: Int -> PersonDetection -> ShowS
$cshowsPrec :: Int -> PersonDetection -> ShowS
Prelude.Show, (forall x. PersonDetection -> Rep PersonDetection x)
-> (forall x. Rep PersonDetection x -> PersonDetection)
-> Generic PersonDetection
forall x. Rep PersonDetection x -> PersonDetection
forall x. PersonDetection -> Rep PersonDetection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PersonDetection x -> PersonDetection
$cfrom :: forall x. PersonDetection -> Rep PersonDetection x
Prelude.Generic)
newPersonDetection ::
PersonDetection
newPersonDetection :: PersonDetection
newPersonDetection =
PersonDetection' :: Maybe PersonDetail -> Maybe Integer -> PersonDetection
PersonDetection'
{ $sel:person:PersonDetection' :: Maybe PersonDetail
person = Maybe PersonDetail
forall a. Maybe a
Prelude.Nothing,
$sel:timestamp:PersonDetection' :: Maybe Integer
timestamp = Maybe Integer
forall a. Maybe a
Prelude.Nothing
}
personDetection_person :: Lens.Lens' PersonDetection (Prelude.Maybe PersonDetail)
personDetection_person :: (Maybe PersonDetail -> f (Maybe PersonDetail))
-> PersonDetection -> f PersonDetection
personDetection_person = (PersonDetection -> Maybe PersonDetail)
-> (PersonDetection -> Maybe PersonDetail -> PersonDetection)
-> Lens
PersonDetection
PersonDetection
(Maybe PersonDetail)
(Maybe PersonDetail)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PersonDetection' {Maybe PersonDetail
person :: Maybe PersonDetail
$sel:person:PersonDetection' :: PersonDetection -> Maybe PersonDetail
person} -> Maybe PersonDetail
person) (\s :: PersonDetection
s@PersonDetection' {} Maybe PersonDetail
a -> PersonDetection
s {$sel:person:PersonDetection' :: Maybe PersonDetail
person = Maybe PersonDetail
a} :: PersonDetection)
personDetection_timestamp :: Lens.Lens' PersonDetection (Prelude.Maybe Prelude.Integer)
personDetection_timestamp :: (Maybe Integer -> f (Maybe Integer))
-> PersonDetection -> f PersonDetection
personDetection_timestamp = (PersonDetection -> Maybe Integer)
-> (PersonDetection -> Maybe Integer -> PersonDetection)
-> Lens
PersonDetection PersonDetection (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PersonDetection' {Maybe Integer
timestamp :: Maybe Integer
$sel:timestamp:PersonDetection' :: PersonDetection -> Maybe Integer
timestamp} -> Maybe Integer
timestamp) (\s :: PersonDetection
s@PersonDetection' {} Maybe Integer
a -> PersonDetection
s {$sel:timestamp:PersonDetection' :: Maybe Integer
timestamp = Maybe Integer
a} :: PersonDetection)
instance Core.FromJSON PersonDetection where
parseJSON :: Value -> Parser PersonDetection
parseJSON =
String
-> (Object -> Parser PersonDetection)
-> Value
-> Parser PersonDetection
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"PersonDetection"
( \Object
x ->
Maybe PersonDetail -> Maybe Integer -> PersonDetection
PersonDetection'
(Maybe PersonDetail -> Maybe Integer -> PersonDetection)
-> Parser (Maybe PersonDetail)
-> Parser (Maybe Integer -> PersonDetection)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe PersonDetail)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Person")
Parser (Maybe Integer -> PersonDetection)
-> Parser (Maybe Integer) -> Parser PersonDetection
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Timestamp")
)
instance Prelude.Hashable PersonDetection
instance Prelude.NFData PersonDetection