{-# 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.PersonMatch where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Rekognition.Types.FaceMatch
import Amazonka.Rekognition.Types.PersonDetail
data PersonMatch = PersonMatch'
{
PersonMatch -> Maybe [FaceMatch]
faceMatches :: Prelude.Maybe [FaceMatch],
PersonMatch -> Maybe PersonDetail
person :: Prelude.Maybe PersonDetail,
PersonMatch -> Maybe Integer
timestamp :: Prelude.Maybe Prelude.Integer
}
deriving (PersonMatch -> PersonMatch -> Bool
(PersonMatch -> PersonMatch -> Bool)
-> (PersonMatch -> PersonMatch -> Bool) -> Eq PersonMatch
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PersonMatch -> PersonMatch -> Bool
$c/= :: PersonMatch -> PersonMatch -> Bool
== :: PersonMatch -> PersonMatch -> Bool
$c== :: PersonMatch -> PersonMatch -> Bool
Prelude.Eq, ReadPrec [PersonMatch]
ReadPrec PersonMatch
Int -> ReadS PersonMatch
ReadS [PersonMatch]
(Int -> ReadS PersonMatch)
-> ReadS [PersonMatch]
-> ReadPrec PersonMatch
-> ReadPrec [PersonMatch]
-> Read PersonMatch
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PersonMatch]
$creadListPrec :: ReadPrec [PersonMatch]
readPrec :: ReadPrec PersonMatch
$creadPrec :: ReadPrec PersonMatch
readList :: ReadS [PersonMatch]
$creadList :: ReadS [PersonMatch]
readsPrec :: Int -> ReadS PersonMatch
$creadsPrec :: Int -> ReadS PersonMatch
Prelude.Read, Int -> PersonMatch -> ShowS
[PersonMatch] -> ShowS
PersonMatch -> String
(Int -> PersonMatch -> ShowS)
-> (PersonMatch -> String)
-> ([PersonMatch] -> ShowS)
-> Show PersonMatch
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PersonMatch] -> ShowS
$cshowList :: [PersonMatch] -> ShowS
show :: PersonMatch -> String
$cshow :: PersonMatch -> String
showsPrec :: Int -> PersonMatch -> ShowS
$cshowsPrec :: Int -> PersonMatch -> ShowS
Prelude.Show, (forall x. PersonMatch -> Rep PersonMatch x)
-> (forall x. Rep PersonMatch x -> PersonMatch)
-> Generic PersonMatch
forall x. Rep PersonMatch x -> PersonMatch
forall x. PersonMatch -> Rep PersonMatch x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PersonMatch x -> PersonMatch
$cfrom :: forall x. PersonMatch -> Rep PersonMatch x
Prelude.Generic)
newPersonMatch ::
PersonMatch
newPersonMatch :: PersonMatch
newPersonMatch =
PersonMatch' :: Maybe [FaceMatch]
-> Maybe PersonDetail -> Maybe Integer -> PersonMatch
PersonMatch'
{ $sel:faceMatches:PersonMatch' :: Maybe [FaceMatch]
faceMatches = Maybe [FaceMatch]
forall a. Maybe a
Prelude.Nothing,
$sel:person:PersonMatch' :: Maybe PersonDetail
person = Maybe PersonDetail
forall a. Maybe a
Prelude.Nothing,
$sel:timestamp:PersonMatch' :: Maybe Integer
timestamp = Maybe Integer
forall a. Maybe a
Prelude.Nothing
}
personMatch_faceMatches :: Lens.Lens' PersonMatch (Prelude.Maybe [FaceMatch])
personMatch_faceMatches :: (Maybe [FaceMatch] -> f (Maybe [FaceMatch]))
-> PersonMatch -> f PersonMatch
personMatch_faceMatches = (PersonMatch -> Maybe [FaceMatch])
-> (PersonMatch -> Maybe [FaceMatch] -> PersonMatch)
-> Lens
PersonMatch PersonMatch (Maybe [FaceMatch]) (Maybe [FaceMatch])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PersonMatch' {Maybe [FaceMatch]
faceMatches :: Maybe [FaceMatch]
$sel:faceMatches:PersonMatch' :: PersonMatch -> Maybe [FaceMatch]
faceMatches} -> Maybe [FaceMatch]
faceMatches) (\s :: PersonMatch
s@PersonMatch' {} Maybe [FaceMatch]
a -> PersonMatch
s {$sel:faceMatches:PersonMatch' :: Maybe [FaceMatch]
faceMatches = Maybe [FaceMatch]
a} :: PersonMatch) ((Maybe [FaceMatch] -> f (Maybe [FaceMatch]))
-> PersonMatch -> f PersonMatch)
-> ((Maybe [FaceMatch] -> f (Maybe [FaceMatch]))
-> Maybe [FaceMatch] -> f (Maybe [FaceMatch]))
-> (Maybe [FaceMatch] -> f (Maybe [FaceMatch]))
-> PersonMatch
-> f PersonMatch
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [FaceMatch] [FaceMatch] [FaceMatch] [FaceMatch]
-> Iso
(Maybe [FaceMatch])
(Maybe [FaceMatch])
(Maybe [FaceMatch])
(Maybe [FaceMatch])
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 [FaceMatch] [FaceMatch] [FaceMatch] [FaceMatch]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
personMatch_person :: Lens.Lens' PersonMatch (Prelude.Maybe PersonDetail)
personMatch_person :: (Maybe PersonDetail -> f (Maybe PersonDetail))
-> PersonMatch -> f PersonMatch
personMatch_person = (PersonMatch -> Maybe PersonDetail)
-> (PersonMatch -> Maybe PersonDetail -> PersonMatch)
-> Lens
PersonMatch PersonMatch (Maybe PersonDetail) (Maybe PersonDetail)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PersonMatch' {Maybe PersonDetail
person :: Maybe PersonDetail
$sel:person:PersonMatch' :: PersonMatch -> Maybe PersonDetail
person} -> Maybe PersonDetail
person) (\s :: PersonMatch
s@PersonMatch' {} Maybe PersonDetail
a -> PersonMatch
s {$sel:person:PersonMatch' :: Maybe PersonDetail
person = Maybe PersonDetail
a} :: PersonMatch)
personMatch_timestamp :: Lens.Lens' PersonMatch (Prelude.Maybe Prelude.Integer)
personMatch_timestamp :: (Maybe Integer -> f (Maybe Integer))
-> PersonMatch -> f PersonMatch
personMatch_timestamp = (PersonMatch -> Maybe Integer)
-> (PersonMatch -> Maybe Integer -> PersonMatch)
-> Lens PersonMatch PersonMatch (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PersonMatch' {Maybe Integer
timestamp :: Maybe Integer
$sel:timestamp:PersonMatch' :: PersonMatch -> Maybe Integer
timestamp} -> Maybe Integer
timestamp) (\s :: PersonMatch
s@PersonMatch' {} Maybe Integer
a -> PersonMatch
s {$sel:timestamp:PersonMatch' :: Maybe Integer
timestamp = Maybe Integer
a} :: PersonMatch)
instance Core.FromJSON PersonMatch where
parseJSON :: Value -> Parser PersonMatch
parseJSON =
String
-> (Object -> Parser PersonMatch) -> Value -> Parser PersonMatch
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"PersonMatch"
( \Object
x ->
Maybe [FaceMatch]
-> Maybe PersonDetail -> Maybe Integer -> PersonMatch
PersonMatch'
(Maybe [FaceMatch]
-> Maybe PersonDetail -> Maybe Integer -> PersonMatch)
-> Parser (Maybe [FaceMatch])
-> Parser (Maybe PersonDetail -> Maybe Integer -> PersonMatch)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [FaceMatch]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"FaceMatches" Parser (Maybe (Maybe [FaceMatch]))
-> Maybe [FaceMatch] -> Parser (Maybe [FaceMatch])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [FaceMatch]
forall a. Monoid a => a
Prelude.mempty)
Parser (Maybe PersonDetail -> Maybe Integer -> PersonMatch)
-> Parser (Maybe PersonDetail)
-> Parser (Maybe Integer -> PersonMatch)
forall (f :: * -> *) a b. Applicative f => 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 -> PersonMatch)
-> Parser (Maybe Integer) -> Parser PersonMatch
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 PersonMatch
instance Prelude.NFData PersonMatch