{-# 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.FaceSearchSettings 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
data FaceSearchSettings = FaceSearchSettings'
{
FaceSearchSettings -> Maybe Text
collectionId :: Prelude.Maybe Prelude.Text,
FaceSearchSettings -> Maybe Double
faceMatchThreshold :: Prelude.Maybe Prelude.Double
}
deriving (FaceSearchSettings -> FaceSearchSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FaceSearchSettings -> FaceSearchSettings -> Bool
$c/= :: FaceSearchSettings -> FaceSearchSettings -> Bool
== :: FaceSearchSettings -> FaceSearchSettings -> Bool
$c== :: FaceSearchSettings -> FaceSearchSettings -> Bool
Prelude.Eq, ReadPrec [FaceSearchSettings]
ReadPrec FaceSearchSettings
Int -> ReadS FaceSearchSettings
ReadS [FaceSearchSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FaceSearchSettings]
$creadListPrec :: ReadPrec [FaceSearchSettings]
readPrec :: ReadPrec FaceSearchSettings
$creadPrec :: ReadPrec FaceSearchSettings
readList :: ReadS [FaceSearchSettings]
$creadList :: ReadS [FaceSearchSettings]
readsPrec :: Int -> ReadS FaceSearchSettings
$creadsPrec :: Int -> ReadS FaceSearchSettings
Prelude.Read, Int -> FaceSearchSettings -> ShowS
[FaceSearchSettings] -> ShowS
FaceSearchSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FaceSearchSettings] -> ShowS
$cshowList :: [FaceSearchSettings] -> ShowS
show :: FaceSearchSettings -> String
$cshow :: FaceSearchSettings -> String
showsPrec :: Int -> FaceSearchSettings -> ShowS
$cshowsPrec :: Int -> FaceSearchSettings -> ShowS
Prelude.Show, forall x. Rep FaceSearchSettings x -> FaceSearchSettings
forall x. FaceSearchSettings -> Rep FaceSearchSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FaceSearchSettings x -> FaceSearchSettings
$cfrom :: forall x. FaceSearchSettings -> Rep FaceSearchSettings x
Prelude.Generic)
newFaceSearchSettings ::
FaceSearchSettings
newFaceSearchSettings :: FaceSearchSettings
newFaceSearchSettings =
FaceSearchSettings'
{ $sel:collectionId:FaceSearchSettings' :: Maybe Text
collectionId = forall a. Maybe a
Prelude.Nothing,
$sel:faceMatchThreshold:FaceSearchSettings' :: Maybe Double
faceMatchThreshold = forall a. Maybe a
Prelude.Nothing
}
faceSearchSettings_collectionId :: Lens.Lens' FaceSearchSettings (Prelude.Maybe Prelude.Text)
faceSearchSettings_collectionId :: Lens' FaceSearchSettings (Maybe Text)
faceSearchSettings_collectionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FaceSearchSettings' {Maybe Text
collectionId :: Maybe Text
$sel:collectionId:FaceSearchSettings' :: FaceSearchSettings -> Maybe Text
collectionId} -> Maybe Text
collectionId) (\s :: FaceSearchSettings
s@FaceSearchSettings' {} Maybe Text
a -> FaceSearchSettings
s {$sel:collectionId:FaceSearchSettings' :: Maybe Text
collectionId = Maybe Text
a} :: FaceSearchSettings)
faceSearchSettings_faceMatchThreshold :: Lens.Lens' FaceSearchSettings (Prelude.Maybe Prelude.Double)
faceSearchSettings_faceMatchThreshold :: Lens' FaceSearchSettings (Maybe Double)
faceSearchSettings_faceMatchThreshold = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FaceSearchSettings' {Maybe Double
faceMatchThreshold :: Maybe Double
$sel:faceMatchThreshold:FaceSearchSettings' :: FaceSearchSettings -> Maybe Double
faceMatchThreshold} -> Maybe Double
faceMatchThreshold) (\s :: FaceSearchSettings
s@FaceSearchSettings' {} Maybe Double
a -> FaceSearchSettings
s {$sel:faceMatchThreshold:FaceSearchSettings' :: Maybe Double
faceMatchThreshold = Maybe Double
a} :: FaceSearchSettings)
instance Data.FromJSON FaceSearchSettings where
parseJSON :: Value -> Parser FaceSearchSettings
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"FaceSearchSettings"
( \Object
x ->
Maybe Text -> Maybe Double -> FaceSearchSettings
FaceSearchSettings'
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
"CollectionId")
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
"FaceMatchThreshold")
)
instance Prelude.Hashable FaceSearchSettings where
hashWithSalt :: Int -> FaceSearchSettings -> Int
hashWithSalt Int
_salt FaceSearchSettings' {Maybe Double
Maybe Text
faceMatchThreshold :: Maybe Double
collectionId :: Maybe Text
$sel:faceMatchThreshold:FaceSearchSettings' :: FaceSearchSettings -> Maybe Double
$sel:collectionId:FaceSearchSettings' :: FaceSearchSettings -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
collectionId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
faceMatchThreshold
instance Prelude.NFData FaceSearchSettings where
rnf :: FaceSearchSettings -> ()
rnf FaceSearchSettings' {Maybe Double
Maybe Text
faceMatchThreshold :: Maybe Double
collectionId :: Maybe Text
$sel:faceMatchThreshold:FaceSearchSettings' :: FaceSearchSettings -> Maybe Double
$sel:collectionId:FaceSearchSettings' :: FaceSearchSettings -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
collectionId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
faceMatchThreshold
instance Data.ToJSON FaceSearchSettings where
toJSON :: FaceSearchSettings -> Value
toJSON FaceSearchSettings' {Maybe Double
Maybe Text
faceMatchThreshold :: Maybe Double
collectionId :: Maybe Text
$sel:faceMatchThreshold:FaceSearchSettings' :: FaceSearchSettings -> Maybe Double
$sel:collectionId:FaceSearchSettings' :: FaceSearchSettings -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"CollectionId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
collectionId,
(Key
"FaceMatchThreshold" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Double
faceMatchThreshold
]
)