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