{-# 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.FaceDetection where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Rekognition.Types.FaceDetail
data FaceDetection = FaceDetection'
{
FaceDetection -> Maybe Integer
timestamp :: Prelude.Maybe Prelude.Integer,
FaceDetection -> Maybe FaceDetail
face :: Prelude.Maybe FaceDetail
}
deriving (FaceDetection -> FaceDetection -> Bool
(FaceDetection -> FaceDetection -> Bool)
-> (FaceDetection -> FaceDetection -> Bool) -> Eq FaceDetection
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FaceDetection -> FaceDetection -> Bool
$c/= :: FaceDetection -> FaceDetection -> Bool
== :: FaceDetection -> FaceDetection -> Bool
$c== :: FaceDetection -> FaceDetection -> Bool
Prelude.Eq, ReadPrec [FaceDetection]
ReadPrec FaceDetection
Int -> ReadS FaceDetection
ReadS [FaceDetection]
(Int -> ReadS FaceDetection)
-> ReadS [FaceDetection]
-> ReadPrec FaceDetection
-> ReadPrec [FaceDetection]
-> Read FaceDetection
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FaceDetection]
$creadListPrec :: ReadPrec [FaceDetection]
readPrec :: ReadPrec FaceDetection
$creadPrec :: ReadPrec FaceDetection
readList :: ReadS [FaceDetection]
$creadList :: ReadS [FaceDetection]
readsPrec :: Int -> ReadS FaceDetection
$creadsPrec :: Int -> ReadS FaceDetection
Prelude.Read, Int -> FaceDetection -> ShowS
[FaceDetection] -> ShowS
FaceDetection -> String
(Int -> FaceDetection -> ShowS)
-> (FaceDetection -> String)
-> ([FaceDetection] -> ShowS)
-> Show FaceDetection
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FaceDetection] -> ShowS
$cshowList :: [FaceDetection] -> ShowS
show :: FaceDetection -> String
$cshow :: FaceDetection -> String
showsPrec :: Int -> FaceDetection -> ShowS
$cshowsPrec :: Int -> FaceDetection -> ShowS
Prelude.Show, (forall x. FaceDetection -> Rep FaceDetection x)
-> (forall x. Rep FaceDetection x -> FaceDetection)
-> Generic FaceDetection
forall x. Rep FaceDetection x -> FaceDetection
forall x. FaceDetection -> Rep FaceDetection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FaceDetection x -> FaceDetection
$cfrom :: forall x. FaceDetection -> Rep FaceDetection x
Prelude.Generic)
newFaceDetection ::
FaceDetection
newFaceDetection :: FaceDetection
newFaceDetection =
FaceDetection' :: Maybe Integer -> Maybe FaceDetail -> FaceDetection
FaceDetection'
{ $sel:timestamp:FaceDetection' :: Maybe Integer
timestamp = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:face:FaceDetection' :: Maybe FaceDetail
face = Maybe FaceDetail
forall a. Maybe a
Prelude.Nothing
}
faceDetection_timestamp :: Lens.Lens' FaceDetection (Prelude.Maybe Prelude.Integer)
faceDetection_timestamp :: (Maybe Integer -> f (Maybe Integer))
-> FaceDetection -> f FaceDetection
faceDetection_timestamp = (FaceDetection -> Maybe Integer)
-> (FaceDetection -> Maybe Integer -> FaceDetection)
-> Lens FaceDetection FaceDetection (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FaceDetection' {Maybe Integer
timestamp :: Maybe Integer
$sel:timestamp:FaceDetection' :: FaceDetection -> Maybe Integer
timestamp} -> Maybe Integer
timestamp) (\s :: FaceDetection
s@FaceDetection' {} Maybe Integer
a -> FaceDetection
s {$sel:timestamp:FaceDetection' :: Maybe Integer
timestamp = Maybe Integer
a} :: FaceDetection)
faceDetection_face :: Lens.Lens' FaceDetection (Prelude.Maybe FaceDetail)
faceDetection_face :: (Maybe FaceDetail -> f (Maybe FaceDetail))
-> FaceDetection -> f FaceDetection
faceDetection_face = (FaceDetection -> Maybe FaceDetail)
-> (FaceDetection -> Maybe FaceDetail -> FaceDetection)
-> Lens
FaceDetection FaceDetection (Maybe FaceDetail) (Maybe FaceDetail)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FaceDetection' {Maybe FaceDetail
face :: Maybe FaceDetail
$sel:face:FaceDetection' :: FaceDetection -> Maybe FaceDetail
face} -> Maybe FaceDetail
face) (\s :: FaceDetection
s@FaceDetection' {} Maybe FaceDetail
a -> FaceDetection
s {$sel:face:FaceDetection' :: Maybe FaceDetail
face = Maybe FaceDetail
a} :: FaceDetection)
instance Core.FromJSON FaceDetection where
parseJSON :: Value -> Parser FaceDetection
parseJSON =
String
-> (Object -> Parser FaceDetection)
-> Value
-> Parser FaceDetection
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"FaceDetection"
( \Object
x ->
Maybe Integer -> Maybe FaceDetail -> FaceDetection
FaceDetection'
(Maybe Integer -> Maybe FaceDetail -> FaceDetection)
-> Parser (Maybe Integer)
-> Parser (Maybe FaceDetail -> FaceDetection)
forall (f :: * -> *) a b. Functor 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")
Parser (Maybe FaceDetail -> FaceDetection)
-> Parser (Maybe FaceDetail) -> Parser FaceDetection
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe FaceDetail)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Face")
)
instance Prelude.Hashable FaceDetection
instance Prelude.NFData FaceDetection