{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.Rekognition.Types.Face
import Amazonka.Rekognition.Types.FaceDetail
data FaceRecord = FaceRecord'
{
FaceRecord -> Maybe Face
face :: Prelude.Maybe Face,
FaceRecord -> Maybe FaceDetail
faceDetail :: Prelude.Maybe FaceDetail
}
deriving (FaceRecord -> FaceRecord -> Bool
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]
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
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. 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'
{ $sel:face:FaceRecord' :: Maybe Face
face = forall a. Maybe a
Prelude.Nothing,
$sel:faceDetail:FaceRecord' :: Maybe FaceDetail
faceDetail = forall a. Maybe a
Prelude.Nothing
}
faceRecord_face :: Lens.Lens' FaceRecord (Prelude.Maybe Face)
faceRecord_face :: Lens' FaceRecord (Maybe Face)
faceRecord_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)
faceRecord_faceDetail :: Lens.Lens' FaceRecord (Prelude.Maybe FaceDetail)
faceRecord_faceDetail :: Lens' FaceRecord (Maybe FaceDetail)
faceRecord_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)
instance Data.FromJSON FaceRecord where
parseJSON :: Value -> Parser FaceRecord
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"FaceRecord"
( \Object
x ->
Maybe Face -> Maybe FaceDetail -> FaceRecord
FaceRecord'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Face")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"FaceDetail")
)
instance Prelude.Hashable FaceRecord where
hashWithSalt :: Int -> FaceRecord -> Int
hashWithSalt Int
_salt FaceRecord' {Maybe Face
Maybe FaceDetail
faceDetail :: Maybe FaceDetail
face :: Maybe Face
$sel:faceDetail:FaceRecord' :: FaceRecord -> Maybe FaceDetail
$sel:face:FaceRecord' :: FaceRecord -> Maybe Face
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Face
face
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe FaceDetail
faceDetail
instance Prelude.NFData FaceRecord where
rnf :: FaceRecord -> ()
rnf FaceRecord' {Maybe Face
Maybe FaceDetail
faceDetail :: Maybe FaceDetail
face :: Maybe Face
$sel:faceDetail:FaceRecord' :: FaceRecord -> Maybe FaceDetail
$sel:face:FaceRecord' :: FaceRecord -> Maybe Face
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Face
face
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe FaceDetail
faceDetail