{-# 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.CodeGuruReviewer.Types.RecommendationFeedbackSummary where
import Amazonka.CodeGuruReviewer.Types.Reaction
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data RecommendationFeedbackSummary = RecommendationFeedbackSummary'
{
RecommendationFeedbackSummary -> Maybe Text
recommendationId :: Prelude.Maybe Prelude.Text,
RecommendationFeedbackSummary -> Maybe Text
userId :: Prelude.Maybe Prelude.Text,
RecommendationFeedbackSummary -> Maybe [Reaction]
reactions :: Prelude.Maybe [Reaction]
}
deriving (RecommendationFeedbackSummary
-> RecommendationFeedbackSummary -> Bool
(RecommendationFeedbackSummary
-> RecommendationFeedbackSummary -> Bool)
-> (RecommendationFeedbackSummary
-> RecommendationFeedbackSummary -> Bool)
-> Eq RecommendationFeedbackSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RecommendationFeedbackSummary
-> RecommendationFeedbackSummary -> Bool
$c/= :: RecommendationFeedbackSummary
-> RecommendationFeedbackSummary -> Bool
== :: RecommendationFeedbackSummary
-> RecommendationFeedbackSummary -> Bool
$c== :: RecommendationFeedbackSummary
-> RecommendationFeedbackSummary -> Bool
Prelude.Eq, ReadPrec [RecommendationFeedbackSummary]
ReadPrec RecommendationFeedbackSummary
Int -> ReadS RecommendationFeedbackSummary
ReadS [RecommendationFeedbackSummary]
(Int -> ReadS RecommendationFeedbackSummary)
-> ReadS [RecommendationFeedbackSummary]
-> ReadPrec RecommendationFeedbackSummary
-> ReadPrec [RecommendationFeedbackSummary]
-> Read RecommendationFeedbackSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RecommendationFeedbackSummary]
$creadListPrec :: ReadPrec [RecommendationFeedbackSummary]
readPrec :: ReadPrec RecommendationFeedbackSummary
$creadPrec :: ReadPrec RecommendationFeedbackSummary
readList :: ReadS [RecommendationFeedbackSummary]
$creadList :: ReadS [RecommendationFeedbackSummary]
readsPrec :: Int -> ReadS RecommendationFeedbackSummary
$creadsPrec :: Int -> ReadS RecommendationFeedbackSummary
Prelude.Read, Int -> RecommendationFeedbackSummary -> ShowS
[RecommendationFeedbackSummary] -> ShowS
RecommendationFeedbackSummary -> String
(Int -> RecommendationFeedbackSummary -> ShowS)
-> (RecommendationFeedbackSummary -> String)
-> ([RecommendationFeedbackSummary] -> ShowS)
-> Show RecommendationFeedbackSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RecommendationFeedbackSummary] -> ShowS
$cshowList :: [RecommendationFeedbackSummary] -> ShowS
show :: RecommendationFeedbackSummary -> String
$cshow :: RecommendationFeedbackSummary -> String
showsPrec :: Int -> RecommendationFeedbackSummary -> ShowS
$cshowsPrec :: Int -> RecommendationFeedbackSummary -> ShowS
Prelude.Show, (forall x.
RecommendationFeedbackSummary
-> Rep RecommendationFeedbackSummary x)
-> (forall x.
Rep RecommendationFeedbackSummary x
-> RecommendationFeedbackSummary)
-> Generic RecommendationFeedbackSummary
forall x.
Rep RecommendationFeedbackSummary x
-> RecommendationFeedbackSummary
forall x.
RecommendationFeedbackSummary
-> Rep RecommendationFeedbackSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RecommendationFeedbackSummary x
-> RecommendationFeedbackSummary
$cfrom :: forall x.
RecommendationFeedbackSummary
-> Rep RecommendationFeedbackSummary x
Prelude.Generic)
newRecommendationFeedbackSummary ::
RecommendationFeedbackSummary
newRecommendationFeedbackSummary :: RecommendationFeedbackSummary
newRecommendationFeedbackSummary =
RecommendationFeedbackSummary' :: Maybe Text
-> Maybe Text -> Maybe [Reaction] -> RecommendationFeedbackSummary
RecommendationFeedbackSummary'
{ $sel:recommendationId:RecommendationFeedbackSummary' :: Maybe Text
recommendationId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:userId:RecommendationFeedbackSummary' :: Maybe Text
userId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:reactions:RecommendationFeedbackSummary' :: Maybe [Reaction]
reactions = Maybe [Reaction]
forall a. Maybe a
Prelude.Nothing
}
recommendationFeedbackSummary_recommendationId :: Lens.Lens' RecommendationFeedbackSummary (Prelude.Maybe Prelude.Text)
recommendationFeedbackSummary_recommendationId :: (Maybe Text -> f (Maybe Text))
-> RecommendationFeedbackSummary -> f RecommendationFeedbackSummary
recommendationFeedbackSummary_recommendationId = (RecommendationFeedbackSummary -> Maybe Text)
-> (RecommendationFeedbackSummary
-> Maybe Text -> RecommendationFeedbackSummary)
-> Lens
RecommendationFeedbackSummary
RecommendationFeedbackSummary
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecommendationFeedbackSummary' {Maybe Text
recommendationId :: Maybe Text
$sel:recommendationId:RecommendationFeedbackSummary' :: RecommendationFeedbackSummary -> Maybe Text
recommendationId} -> Maybe Text
recommendationId) (\s :: RecommendationFeedbackSummary
s@RecommendationFeedbackSummary' {} Maybe Text
a -> RecommendationFeedbackSummary
s {$sel:recommendationId:RecommendationFeedbackSummary' :: Maybe Text
recommendationId = Maybe Text
a} :: RecommendationFeedbackSummary)
recommendationFeedbackSummary_userId :: Lens.Lens' RecommendationFeedbackSummary (Prelude.Maybe Prelude.Text)
recommendationFeedbackSummary_userId :: (Maybe Text -> f (Maybe Text))
-> RecommendationFeedbackSummary -> f RecommendationFeedbackSummary
recommendationFeedbackSummary_userId = (RecommendationFeedbackSummary -> Maybe Text)
-> (RecommendationFeedbackSummary
-> Maybe Text -> RecommendationFeedbackSummary)
-> Lens
RecommendationFeedbackSummary
RecommendationFeedbackSummary
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecommendationFeedbackSummary' {Maybe Text
userId :: Maybe Text
$sel:userId:RecommendationFeedbackSummary' :: RecommendationFeedbackSummary -> Maybe Text
userId} -> Maybe Text
userId) (\s :: RecommendationFeedbackSummary
s@RecommendationFeedbackSummary' {} Maybe Text
a -> RecommendationFeedbackSummary
s {$sel:userId:RecommendationFeedbackSummary' :: Maybe Text
userId = Maybe Text
a} :: RecommendationFeedbackSummary)
recommendationFeedbackSummary_reactions :: Lens.Lens' RecommendationFeedbackSummary (Prelude.Maybe [Reaction])
recommendationFeedbackSummary_reactions :: (Maybe [Reaction] -> f (Maybe [Reaction]))
-> RecommendationFeedbackSummary -> f RecommendationFeedbackSummary
recommendationFeedbackSummary_reactions = (RecommendationFeedbackSummary -> Maybe [Reaction])
-> (RecommendationFeedbackSummary
-> Maybe [Reaction] -> RecommendationFeedbackSummary)
-> Lens
RecommendationFeedbackSummary
RecommendationFeedbackSummary
(Maybe [Reaction])
(Maybe [Reaction])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecommendationFeedbackSummary' {Maybe [Reaction]
reactions :: Maybe [Reaction]
$sel:reactions:RecommendationFeedbackSummary' :: RecommendationFeedbackSummary -> Maybe [Reaction]
reactions} -> Maybe [Reaction]
reactions) (\s :: RecommendationFeedbackSummary
s@RecommendationFeedbackSummary' {} Maybe [Reaction]
a -> RecommendationFeedbackSummary
s {$sel:reactions:RecommendationFeedbackSummary' :: Maybe [Reaction]
reactions = Maybe [Reaction]
a} :: RecommendationFeedbackSummary) ((Maybe [Reaction] -> f (Maybe [Reaction]))
-> RecommendationFeedbackSummary
-> f RecommendationFeedbackSummary)
-> ((Maybe [Reaction] -> f (Maybe [Reaction]))
-> Maybe [Reaction] -> f (Maybe [Reaction]))
-> (Maybe [Reaction] -> f (Maybe [Reaction]))
-> RecommendationFeedbackSummary
-> f RecommendationFeedbackSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Reaction] [Reaction] [Reaction] [Reaction]
-> Iso
(Maybe [Reaction])
(Maybe [Reaction])
(Maybe [Reaction])
(Maybe [Reaction])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Reaction] [Reaction] [Reaction] [Reaction]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON RecommendationFeedbackSummary where
parseJSON :: Value -> Parser RecommendationFeedbackSummary
parseJSON =
String
-> (Object -> Parser RecommendationFeedbackSummary)
-> Value
-> Parser RecommendationFeedbackSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"RecommendationFeedbackSummary"
( \Object
x ->
Maybe Text
-> Maybe Text -> Maybe [Reaction] -> RecommendationFeedbackSummary
RecommendationFeedbackSummary'
(Maybe Text
-> Maybe Text -> Maybe [Reaction] -> RecommendationFeedbackSummary)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe [Reaction] -> RecommendationFeedbackSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RecommendationId")
Parser
(Maybe Text -> Maybe [Reaction] -> RecommendationFeedbackSummary)
-> Parser (Maybe Text)
-> Parser (Maybe [Reaction] -> RecommendationFeedbackSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"UserId")
Parser (Maybe [Reaction] -> RecommendationFeedbackSummary)
-> Parser (Maybe [Reaction])
-> Parser RecommendationFeedbackSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Reaction]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Reactions" Parser (Maybe (Maybe [Reaction]))
-> Maybe [Reaction] -> Parser (Maybe [Reaction])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Reaction]
forall a. Monoid a => a
Prelude.mempty)
)
instance
Prelude.Hashable
RecommendationFeedbackSummary
instance Prelude.NFData RecommendationFeedbackSummary