{-# 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.Comprehend.Types.SentimentScore 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 SentimentScore = SentimentScore'
{
SentimentScore -> Maybe Double
mixed :: Prelude.Maybe Prelude.Double,
SentimentScore -> Maybe Double
negative :: Prelude.Maybe Prelude.Double,
SentimentScore -> Maybe Double
neutral :: Prelude.Maybe Prelude.Double,
SentimentScore -> Maybe Double
positive :: Prelude.Maybe Prelude.Double
}
deriving (SentimentScore -> SentimentScore -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SentimentScore -> SentimentScore -> Bool
$c/= :: SentimentScore -> SentimentScore -> Bool
== :: SentimentScore -> SentimentScore -> Bool
$c== :: SentimentScore -> SentimentScore -> Bool
Prelude.Eq, ReadPrec [SentimentScore]
ReadPrec SentimentScore
Int -> ReadS SentimentScore
ReadS [SentimentScore]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SentimentScore]
$creadListPrec :: ReadPrec [SentimentScore]
readPrec :: ReadPrec SentimentScore
$creadPrec :: ReadPrec SentimentScore
readList :: ReadS [SentimentScore]
$creadList :: ReadS [SentimentScore]
readsPrec :: Int -> ReadS SentimentScore
$creadsPrec :: Int -> ReadS SentimentScore
Prelude.Read, Int -> SentimentScore -> ShowS
[SentimentScore] -> ShowS
SentimentScore -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SentimentScore] -> ShowS
$cshowList :: [SentimentScore] -> ShowS
show :: SentimentScore -> String
$cshow :: SentimentScore -> String
showsPrec :: Int -> SentimentScore -> ShowS
$cshowsPrec :: Int -> SentimentScore -> ShowS
Prelude.Show, forall x. Rep SentimentScore x -> SentimentScore
forall x. SentimentScore -> Rep SentimentScore x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SentimentScore x -> SentimentScore
$cfrom :: forall x. SentimentScore -> Rep SentimentScore x
Prelude.Generic)
newSentimentScore ::
SentimentScore
newSentimentScore :: SentimentScore
newSentimentScore =
SentimentScore'
{ $sel:mixed:SentimentScore' :: Maybe Double
mixed = forall a. Maybe a
Prelude.Nothing,
$sel:negative:SentimentScore' :: Maybe Double
negative = forall a. Maybe a
Prelude.Nothing,
$sel:neutral:SentimentScore' :: Maybe Double
neutral = forall a. Maybe a
Prelude.Nothing,
$sel:positive:SentimentScore' :: Maybe Double
positive = forall a. Maybe a
Prelude.Nothing
}
sentimentScore_mixed :: Lens.Lens' SentimentScore (Prelude.Maybe Prelude.Double)
sentimentScore_mixed :: Lens' SentimentScore (Maybe Double)
sentimentScore_mixed = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SentimentScore' {Maybe Double
mixed :: Maybe Double
$sel:mixed:SentimentScore' :: SentimentScore -> Maybe Double
mixed} -> Maybe Double
mixed) (\s :: SentimentScore
s@SentimentScore' {} Maybe Double
a -> SentimentScore
s {$sel:mixed:SentimentScore' :: Maybe Double
mixed = Maybe Double
a} :: SentimentScore)
sentimentScore_negative :: Lens.Lens' SentimentScore (Prelude.Maybe Prelude.Double)
sentimentScore_negative :: Lens' SentimentScore (Maybe Double)
sentimentScore_negative = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SentimentScore' {Maybe Double
negative :: Maybe Double
$sel:negative:SentimentScore' :: SentimentScore -> Maybe Double
negative} -> Maybe Double
negative) (\s :: SentimentScore
s@SentimentScore' {} Maybe Double
a -> SentimentScore
s {$sel:negative:SentimentScore' :: Maybe Double
negative = Maybe Double
a} :: SentimentScore)
sentimentScore_neutral :: Lens.Lens' SentimentScore (Prelude.Maybe Prelude.Double)
sentimentScore_neutral :: Lens' SentimentScore (Maybe Double)
sentimentScore_neutral = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SentimentScore' {Maybe Double
neutral :: Maybe Double
$sel:neutral:SentimentScore' :: SentimentScore -> Maybe Double
neutral} -> Maybe Double
neutral) (\s :: SentimentScore
s@SentimentScore' {} Maybe Double
a -> SentimentScore
s {$sel:neutral:SentimentScore' :: Maybe Double
neutral = Maybe Double
a} :: SentimentScore)
sentimentScore_positive :: Lens.Lens' SentimentScore (Prelude.Maybe Prelude.Double)
sentimentScore_positive :: Lens' SentimentScore (Maybe Double)
sentimentScore_positive = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SentimentScore' {Maybe Double
positive :: Maybe Double
$sel:positive:SentimentScore' :: SentimentScore -> Maybe Double
positive} -> Maybe Double
positive) (\s :: SentimentScore
s@SentimentScore' {} Maybe Double
a -> SentimentScore
s {$sel:positive:SentimentScore' :: Maybe Double
positive = Maybe Double
a} :: SentimentScore)
instance Data.FromJSON SentimentScore where
parseJSON :: Value -> Parser SentimentScore
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"SentimentScore"
( \Object
x ->
Maybe Double
-> Maybe Double -> Maybe Double -> Maybe Double -> SentimentScore
SentimentScore'
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
"Mixed")
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
"Negative")
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
"Neutral")
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
"Positive")
)
instance Prelude.Hashable SentimentScore where
hashWithSalt :: Int -> SentimentScore -> Int
hashWithSalt Int
_salt SentimentScore' {Maybe Double
positive :: Maybe Double
neutral :: Maybe Double
negative :: Maybe Double
mixed :: Maybe Double
$sel:positive:SentimentScore' :: SentimentScore -> Maybe Double
$sel:neutral:SentimentScore' :: SentimentScore -> Maybe Double
$sel:negative:SentimentScore' :: SentimentScore -> Maybe Double
$sel:mixed:SentimentScore' :: SentimentScore -> Maybe Double
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
mixed
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
negative
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
neutral
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
positive
instance Prelude.NFData SentimentScore where
rnf :: SentimentScore -> ()
rnf SentimentScore' {Maybe Double
positive :: Maybe Double
neutral :: Maybe Double
negative :: Maybe Double
mixed :: Maybe Double
$sel:positive:SentimentScore' :: SentimentScore -> Maybe Double
$sel:neutral:SentimentScore' :: SentimentScore -> Maybe Double
$sel:negative:SentimentScore' :: SentimentScore -> Maybe Double
$sel:mixed:SentimentScore' :: SentimentScore -> Maybe Double
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
mixed
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
negative
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
neutral
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
positive