{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
{ $sel:faceMatches:PersonMatch' :: Maybe [FaceMatch]
faceMatches = forall a. Maybe a
Prelude.Nothing,
$sel:person:PersonMatch' :: Maybe PersonDetail
person = forall a. Maybe a
Prelude.Nothing,
$sel:timestamp:PersonMatch' :: Maybe Integer
timestamp = forall a. Maybe a
Prelude.Nothing
}
personMatch_faceMatches :: Lens.Lens' PersonMatch (Prelude.Maybe [FaceMatch])
personMatch_faceMatches :: Lens' PersonMatch (Maybe [FaceMatch])
personMatch_faceMatches = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 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 :: Lens' PersonMatch (Maybe PersonDetail)
personMatch_person = 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 :: Lens' PersonMatch (Maybe Integer)
personMatch_timestamp = 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 Data.FromJSON PersonMatch where
parseJSON :: Value -> Parser PersonMatch
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"PersonMatch"
( \Object
x ->
Maybe [FaceMatch]
-> Maybe PersonDetail -> Maybe Integer -> PersonMatch
PersonMatch'
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
"FaceMatches" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
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
"Person")
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
"Timestamp")
)
instance Prelude.Hashable PersonMatch where
hashWithSalt :: Int -> PersonMatch -> Int
hashWithSalt Int
_salt PersonMatch' {Maybe Integer
Maybe [FaceMatch]
Maybe PersonDetail
timestamp :: Maybe Integer
person :: Maybe PersonDetail
faceMatches :: Maybe [FaceMatch]
$sel:timestamp:PersonMatch' :: PersonMatch -> Maybe Integer
$sel:person:PersonMatch' :: PersonMatch -> Maybe PersonDetail
$sel:faceMatches:PersonMatch' :: PersonMatch -> Maybe [FaceMatch]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [FaceMatch]
faceMatches
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe PersonDetail
person
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
timestamp
instance Prelude.NFData PersonMatch where
rnf :: PersonMatch -> ()
rnf PersonMatch' {Maybe Integer
Maybe [FaceMatch]
Maybe PersonDetail
timestamp :: Maybe Integer
person :: Maybe PersonDetail
faceMatches :: Maybe [FaceMatch]
$sel:timestamp:PersonMatch' :: PersonMatch -> Maybe Integer
$sel:person:PersonMatch' :: PersonMatch -> Maybe PersonDetail
$sel:faceMatches:PersonMatch' :: PersonMatch -> Maybe [FaceMatch]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [FaceMatch]
faceMatches
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe PersonDetail
person
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
timestamp