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