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