{-# 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.CompareFacesMatch where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Rekognition.Types.ComparedFace
data CompareFacesMatch = CompareFacesMatch'
{
CompareFacesMatch -> Maybe Double
similarity :: Prelude.Maybe Prelude.Double,
CompareFacesMatch -> Maybe ComparedFace
face :: Prelude.Maybe ComparedFace
}
deriving (CompareFacesMatch -> CompareFacesMatch -> Bool
(CompareFacesMatch -> CompareFacesMatch -> Bool)
-> (CompareFacesMatch -> CompareFacesMatch -> Bool)
-> Eq CompareFacesMatch
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CompareFacesMatch -> CompareFacesMatch -> Bool
$c/= :: CompareFacesMatch -> CompareFacesMatch -> Bool
== :: CompareFacesMatch -> CompareFacesMatch -> Bool
$c== :: CompareFacesMatch -> CompareFacesMatch -> Bool
Prelude.Eq, ReadPrec [CompareFacesMatch]
ReadPrec CompareFacesMatch
Int -> ReadS CompareFacesMatch
ReadS [CompareFacesMatch]
(Int -> ReadS CompareFacesMatch)
-> ReadS [CompareFacesMatch]
-> ReadPrec CompareFacesMatch
-> ReadPrec [CompareFacesMatch]
-> Read CompareFacesMatch
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CompareFacesMatch]
$creadListPrec :: ReadPrec [CompareFacesMatch]
readPrec :: ReadPrec CompareFacesMatch
$creadPrec :: ReadPrec CompareFacesMatch
readList :: ReadS [CompareFacesMatch]
$creadList :: ReadS [CompareFacesMatch]
readsPrec :: Int -> ReadS CompareFacesMatch
$creadsPrec :: Int -> ReadS CompareFacesMatch
Prelude.Read, Int -> CompareFacesMatch -> ShowS
[CompareFacesMatch] -> ShowS
CompareFacesMatch -> String
(Int -> CompareFacesMatch -> ShowS)
-> (CompareFacesMatch -> String)
-> ([CompareFacesMatch] -> ShowS)
-> Show CompareFacesMatch
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CompareFacesMatch] -> ShowS
$cshowList :: [CompareFacesMatch] -> ShowS
show :: CompareFacesMatch -> String
$cshow :: CompareFacesMatch -> String
showsPrec :: Int -> CompareFacesMatch -> ShowS
$cshowsPrec :: Int -> CompareFacesMatch -> ShowS
Prelude.Show, (forall x. CompareFacesMatch -> Rep CompareFacesMatch x)
-> (forall x. Rep CompareFacesMatch x -> CompareFacesMatch)
-> Generic CompareFacesMatch
forall x. Rep CompareFacesMatch x -> CompareFacesMatch
forall x. CompareFacesMatch -> Rep CompareFacesMatch x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CompareFacesMatch x -> CompareFacesMatch
$cfrom :: forall x. CompareFacesMatch -> Rep CompareFacesMatch x
Prelude.Generic)
newCompareFacesMatch ::
CompareFacesMatch
newCompareFacesMatch :: CompareFacesMatch
newCompareFacesMatch =
CompareFacesMatch' :: Maybe Double -> Maybe ComparedFace -> CompareFacesMatch
CompareFacesMatch'
{ $sel:similarity:CompareFacesMatch' :: Maybe Double
similarity = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:face:CompareFacesMatch' :: Maybe ComparedFace
face = Maybe ComparedFace
forall a. Maybe a
Prelude.Nothing
}
compareFacesMatch_similarity :: Lens.Lens' CompareFacesMatch (Prelude.Maybe Prelude.Double)
compareFacesMatch_similarity :: (Maybe Double -> f (Maybe Double))
-> CompareFacesMatch -> f CompareFacesMatch
compareFacesMatch_similarity = (CompareFacesMatch -> Maybe Double)
-> (CompareFacesMatch -> Maybe Double -> CompareFacesMatch)
-> Lens
CompareFacesMatch CompareFacesMatch (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CompareFacesMatch' {Maybe Double
similarity :: Maybe Double
$sel:similarity:CompareFacesMatch' :: CompareFacesMatch -> Maybe Double
similarity} -> Maybe Double
similarity) (\s :: CompareFacesMatch
s@CompareFacesMatch' {} Maybe Double
a -> CompareFacesMatch
s {$sel:similarity:CompareFacesMatch' :: Maybe Double
similarity = Maybe Double
a} :: CompareFacesMatch)
compareFacesMatch_face :: Lens.Lens' CompareFacesMatch (Prelude.Maybe ComparedFace)
compareFacesMatch_face :: (Maybe ComparedFace -> f (Maybe ComparedFace))
-> CompareFacesMatch -> f CompareFacesMatch
compareFacesMatch_face = (CompareFacesMatch -> Maybe ComparedFace)
-> (CompareFacesMatch -> Maybe ComparedFace -> CompareFacesMatch)
-> Lens
CompareFacesMatch
CompareFacesMatch
(Maybe ComparedFace)
(Maybe ComparedFace)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CompareFacesMatch' {Maybe ComparedFace
face :: Maybe ComparedFace
$sel:face:CompareFacesMatch' :: CompareFacesMatch -> Maybe ComparedFace
face} -> Maybe ComparedFace
face) (\s :: CompareFacesMatch
s@CompareFacesMatch' {} Maybe ComparedFace
a -> CompareFacesMatch
s {$sel:face:CompareFacesMatch' :: Maybe ComparedFace
face = Maybe ComparedFace
a} :: CompareFacesMatch)
instance Core.FromJSON CompareFacesMatch where
parseJSON :: Value -> Parser CompareFacesMatch
parseJSON =
String
-> (Object -> Parser CompareFacesMatch)
-> Value
-> Parser CompareFacesMatch
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CompareFacesMatch"
( \Object
x ->
Maybe Double -> Maybe ComparedFace -> CompareFacesMatch
CompareFacesMatch'
(Maybe Double -> Maybe ComparedFace -> CompareFacesMatch)
-> Parser (Maybe Double)
-> Parser (Maybe ComparedFace -> CompareFacesMatch)
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 ComparedFace -> CompareFacesMatch)
-> Parser (Maybe ComparedFace) -> Parser CompareFacesMatch
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ComparedFace)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Face")
)
instance Prelude.Hashable CompareFacesMatch
instance Prelude.NFData CompareFacesMatch