{-# 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.FaceMatch 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
data FaceMatch = FaceMatch'
{
FaceMatch -> Maybe Face
face :: Prelude.Maybe Face,
FaceMatch -> Maybe Double
similarity :: Prelude.Maybe Prelude.Double
}
deriving (FaceMatch -> FaceMatch -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FaceMatch -> FaceMatch -> Bool
$c/= :: FaceMatch -> FaceMatch -> Bool
== :: FaceMatch -> FaceMatch -> Bool
$c== :: FaceMatch -> FaceMatch -> Bool
Prelude.Eq, ReadPrec [FaceMatch]
ReadPrec FaceMatch
Int -> ReadS FaceMatch
ReadS [FaceMatch]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FaceMatch]
$creadListPrec :: ReadPrec [FaceMatch]
readPrec :: ReadPrec FaceMatch
$creadPrec :: ReadPrec FaceMatch
readList :: ReadS [FaceMatch]
$creadList :: ReadS [FaceMatch]
readsPrec :: Int -> ReadS FaceMatch
$creadsPrec :: Int -> ReadS FaceMatch
Prelude.Read, Int -> FaceMatch -> ShowS
[FaceMatch] -> ShowS
FaceMatch -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FaceMatch] -> ShowS
$cshowList :: [FaceMatch] -> ShowS
show :: FaceMatch -> String
$cshow :: FaceMatch -> String
showsPrec :: Int -> FaceMatch -> ShowS
$cshowsPrec :: Int -> FaceMatch -> ShowS
Prelude.Show, forall x. Rep FaceMatch x -> FaceMatch
forall x. FaceMatch -> Rep FaceMatch x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FaceMatch x -> FaceMatch
$cfrom :: forall x. FaceMatch -> Rep FaceMatch x
Prelude.Generic)
newFaceMatch ::
FaceMatch
newFaceMatch :: FaceMatch
newFaceMatch =
FaceMatch'
{ $sel:face:FaceMatch' :: Maybe Face
face = forall a. Maybe a
Prelude.Nothing,
$sel:similarity:FaceMatch' :: Maybe Double
similarity = forall a. Maybe a
Prelude.Nothing
}
faceMatch_face :: Lens.Lens' FaceMatch (Prelude.Maybe Face)
faceMatch_face :: Lens' FaceMatch (Maybe Face)
faceMatch_face = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FaceMatch' {Maybe Face
face :: Maybe Face
$sel:face:FaceMatch' :: FaceMatch -> Maybe Face
face} -> Maybe Face
face) (\s :: FaceMatch
s@FaceMatch' {} Maybe Face
a -> FaceMatch
s {$sel:face:FaceMatch' :: Maybe Face
face = Maybe Face
a} :: FaceMatch)
faceMatch_similarity :: Lens.Lens' FaceMatch (Prelude.Maybe Prelude.Double)
faceMatch_similarity :: Lens' FaceMatch (Maybe Double)
faceMatch_similarity = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FaceMatch' {Maybe Double
similarity :: Maybe Double
$sel:similarity:FaceMatch' :: FaceMatch -> Maybe Double
similarity} -> Maybe Double
similarity) (\s :: FaceMatch
s@FaceMatch' {} Maybe Double
a -> FaceMatch
s {$sel:similarity:FaceMatch' :: Maybe Double
similarity = Maybe Double
a} :: FaceMatch)
instance Data.FromJSON FaceMatch where
parseJSON :: Value -> Parser FaceMatch
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"FaceMatch"
( \Object
x ->
Maybe Face -> Maybe Double -> FaceMatch
FaceMatch'
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
"Similarity")
)
instance Prelude.Hashable FaceMatch where
hashWithSalt :: Int -> FaceMatch -> Int
hashWithSalt Int
_salt FaceMatch' {Maybe Double
Maybe Face
similarity :: Maybe Double
face :: Maybe Face
$sel:similarity:FaceMatch' :: FaceMatch -> Maybe Double
$sel:face:FaceMatch' :: FaceMatch -> 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 Double
similarity
instance Prelude.NFData FaceMatch where
rnf :: FaceMatch -> ()
rnf FaceMatch' {Maybe Double
Maybe Face
similarity :: Maybe Double
face :: Maybe Face
$sel:similarity:FaceMatch' :: FaceMatch -> Maybe Double
$sel:face:FaceMatch' :: FaceMatch -> 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 Double
similarity