{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Rekognition.Types.Face
data FaceMatch = FaceMatch'
{
FaceMatch -> Maybe Double
similarity :: Prelude.Maybe Prelude.Double,
FaceMatch -> Maybe Face
face :: Prelude.Maybe Face
}
deriving (FaceMatch -> FaceMatch -> Bool
(FaceMatch -> FaceMatch -> Bool)
-> (FaceMatch -> FaceMatch -> Bool) -> Eq FaceMatch
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]
(Int -> ReadS FaceMatch)
-> ReadS [FaceMatch]
-> ReadPrec FaceMatch
-> ReadPrec [FaceMatch]
-> Read 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
(Int -> FaceMatch -> ShowS)
-> (FaceMatch -> String)
-> ([FaceMatch] -> ShowS)
-> Show FaceMatch
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. FaceMatch -> Rep FaceMatch x)
-> (forall x. Rep FaceMatch x -> FaceMatch) -> Generic FaceMatch
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' :: Maybe Double -> Maybe Face -> FaceMatch
FaceMatch'
{ $sel:similarity:FaceMatch' :: Maybe Double
similarity = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:face:FaceMatch' :: Maybe Face
face = Maybe Face
forall a. Maybe a
Prelude.Nothing
}
faceMatch_similarity :: Lens.Lens' FaceMatch (Prelude.Maybe Prelude.Double)
faceMatch_similarity :: (Maybe Double -> f (Maybe Double)) -> FaceMatch -> f FaceMatch
faceMatch_similarity = (FaceMatch -> Maybe Double)
-> (FaceMatch -> Maybe Double -> FaceMatch)
-> Lens FaceMatch FaceMatch (Maybe Double) (Maybe Double)
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)
faceMatch_face :: Lens.Lens' FaceMatch (Prelude.Maybe Face)
faceMatch_face :: (Maybe Face -> f (Maybe Face)) -> FaceMatch -> f FaceMatch
faceMatch_face = (FaceMatch -> Maybe Face)
-> (FaceMatch -> Maybe Face -> FaceMatch)
-> Lens FaceMatch FaceMatch (Maybe Face) (Maybe 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)
instance Core.FromJSON FaceMatch where
parseJSON :: Value -> Parser FaceMatch
parseJSON =
String -> (Object -> Parser FaceMatch) -> Value -> Parser FaceMatch
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"FaceMatch"
( \Object
x ->
Maybe Double -> Maybe Face -> FaceMatch
FaceMatch'
(Maybe Double -> Maybe Face -> FaceMatch)
-> Parser (Maybe Double) -> Parser (Maybe Face -> FaceMatch)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Similarity")
Parser (Maybe Face -> FaceMatch)
-> Parser (Maybe Face) -> Parser FaceMatch
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 FaceMatch
instance Prelude.NFData FaceMatch