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