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