{-# 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.RecommendationFeedback 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 RecommendationFeedback = RecommendationFeedback'
{
RecommendationFeedback -> Maybe Text
recommendationId :: Prelude.Maybe Prelude.Text,
RecommendationFeedback -> Maybe Text
userId :: Prelude.Maybe Prelude.Text,
RecommendationFeedback -> Maybe [Reaction]
reactions :: Prelude.Maybe [Reaction],
RecommendationFeedback -> Maybe Text
codeReviewArn :: Prelude.Maybe Prelude.Text,
RecommendationFeedback -> Maybe POSIX
createdTimeStamp :: Prelude.Maybe Core.POSIX,
RecommendationFeedback -> Maybe POSIX
lastUpdatedTimeStamp :: Prelude.Maybe Core.POSIX
}
deriving (RecommendationFeedback -> RecommendationFeedback -> Bool
(RecommendationFeedback -> RecommendationFeedback -> Bool)
-> (RecommendationFeedback -> RecommendationFeedback -> Bool)
-> Eq RecommendationFeedback
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RecommendationFeedback -> RecommendationFeedback -> Bool
$c/= :: RecommendationFeedback -> RecommendationFeedback -> Bool
== :: RecommendationFeedback -> RecommendationFeedback -> Bool
$c== :: RecommendationFeedback -> RecommendationFeedback -> Bool
Prelude.Eq, ReadPrec [RecommendationFeedback]
ReadPrec RecommendationFeedback
Int -> ReadS RecommendationFeedback
ReadS [RecommendationFeedback]
(Int -> ReadS RecommendationFeedback)
-> ReadS [RecommendationFeedback]
-> ReadPrec RecommendationFeedback
-> ReadPrec [RecommendationFeedback]
-> Read RecommendationFeedback
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RecommendationFeedback]
$creadListPrec :: ReadPrec [RecommendationFeedback]
readPrec :: ReadPrec RecommendationFeedback
$creadPrec :: ReadPrec RecommendationFeedback
readList :: ReadS [RecommendationFeedback]
$creadList :: ReadS [RecommendationFeedback]
readsPrec :: Int -> ReadS RecommendationFeedback
$creadsPrec :: Int -> ReadS RecommendationFeedback
Prelude.Read, Int -> RecommendationFeedback -> ShowS
[RecommendationFeedback] -> ShowS
RecommendationFeedback -> String
(Int -> RecommendationFeedback -> ShowS)
-> (RecommendationFeedback -> String)
-> ([RecommendationFeedback] -> ShowS)
-> Show RecommendationFeedback
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RecommendationFeedback] -> ShowS
$cshowList :: [RecommendationFeedback] -> ShowS
show :: RecommendationFeedback -> String
$cshow :: RecommendationFeedback -> String
showsPrec :: Int -> RecommendationFeedback -> ShowS
$cshowsPrec :: Int -> RecommendationFeedback -> ShowS
Prelude.Show, (forall x. RecommendationFeedback -> Rep RecommendationFeedback x)
-> (forall x.
Rep RecommendationFeedback x -> RecommendationFeedback)
-> Generic RecommendationFeedback
forall x. Rep RecommendationFeedback x -> RecommendationFeedback
forall x. RecommendationFeedback -> Rep RecommendationFeedback x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RecommendationFeedback x -> RecommendationFeedback
$cfrom :: forall x. RecommendationFeedback -> Rep RecommendationFeedback x
Prelude.Generic)
newRecommendationFeedback ::
RecommendationFeedback
newRecommendationFeedback :: RecommendationFeedback
newRecommendationFeedback =
RecommendationFeedback' :: Maybe Text
-> Maybe Text
-> Maybe [Reaction]
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> RecommendationFeedback
RecommendationFeedback'
{ $sel:recommendationId:RecommendationFeedback' :: Maybe Text
recommendationId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:userId:RecommendationFeedback' :: Maybe Text
userId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:reactions:RecommendationFeedback' :: Maybe [Reaction]
reactions = Maybe [Reaction]
forall a. Maybe a
Prelude.Nothing,
$sel:codeReviewArn:RecommendationFeedback' :: Maybe Text
codeReviewArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:createdTimeStamp:RecommendationFeedback' :: Maybe POSIX
createdTimeStamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:lastUpdatedTimeStamp:RecommendationFeedback' :: Maybe POSIX
lastUpdatedTimeStamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
}
recommendationFeedback_recommendationId :: Lens.Lens' RecommendationFeedback (Prelude.Maybe Prelude.Text)
recommendationFeedback_recommendationId :: (Maybe Text -> f (Maybe Text))
-> RecommendationFeedback -> f RecommendationFeedback
recommendationFeedback_recommendationId = (RecommendationFeedback -> Maybe Text)
-> (RecommendationFeedback -> Maybe Text -> RecommendationFeedback)
-> Lens
RecommendationFeedback
RecommendationFeedback
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecommendationFeedback' {Maybe Text
recommendationId :: Maybe Text
$sel:recommendationId:RecommendationFeedback' :: RecommendationFeedback -> Maybe Text
recommendationId} -> Maybe Text
recommendationId) (\s :: RecommendationFeedback
s@RecommendationFeedback' {} Maybe Text
a -> RecommendationFeedback
s {$sel:recommendationId:RecommendationFeedback' :: Maybe Text
recommendationId = Maybe Text
a} :: RecommendationFeedback)
recommendationFeedback_userId :: Lens.Lens' RecommendationFeedback (Prelude.Maybe Prelude.Text)
recommendationFeedback_userId :: (Maybe Text -> f (Maybe Text))
-> RecommendationFeedback -> f RecommendationFeedback
recommendationFeedback_userId = (RecommendationFeedback -> Maybe Text)
-> (RecommendationFeedback -> Maybe Text -> RecommendationFeedback)
-> Lens
RecommendationFeedback
RecommendationFeedback
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecommendationFeedback' {Maybe Text
userId :: Maybe Text
$sel:userId:RecommendationFeedback' :: RecommendationFeedback -> Maybe Text
userId} -> Maybe Text
userId) (\s :: RecommendationFeedback
s@RecommendationFeedback' {} Maybe Text
a -> RecommendationFeedback
s {$sel:userId:RecommendationFeedback' :: Maybe Text
userId = Maybe Text
a} :: RecommendationFeedback)
recommendationFeedback_reactions :: Lens.Lens' RecommendationFeedback (Prelude.Maybe [Reaction])
recommendationFeedback_reactions :: (Maybe [Reaction] -> f (Maybe [Reaction]))
-> RecommendationFeedback -> f RecommendationFeedback
recommendationFeedback_reactions = (RecommendationFeedback -> Maybe [Reaction])
-> (RecommendationFeedback
-> Maybe [Reaction] -> RecommendationFeedback)
-> Lens
RecommendationFeedback
RecommendationFeedback
(Maybe [Reaction])
(Maybe [Reaction])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecommendationFeedback' {Maybe [Reaction]
reactions :: Maybe [Reaction]
$sel:reactions:RecommendationFeedback' :: RecommendationFeedback -> Maybe [Reaction]
reactions} -> Maybe [Reaction]
reactions) (\s :: RecommendationFeedback
s@RecommendationFeedback' {} Maybe [Reaction]
a -> RecommendationFeedback
s {$sel:reactions:RecommendationFeedback' :: Maybe [Reaction]
reactions = Maybe [Reaction]
a} :: RecommendationFeedback) ((Maybe [Reaction] -> f (Maybe [Reaction]))
-> RecommendationFeedback -> f RecommendationFeedback)
-> ((Maybe [Reaction] -> f (Maybe [Reaction]))
-> Maybe [Reaction] -> f (Maybe [Reaction]))
-> (Maybe [Reaction] -> f (Maybe [Reaction]))
-> RecommendationFeedback
-> f RecommendationFeedback
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
recommendationFeedback_codeReviewArn :: Lens.Lens' RecommendationFeedback (Prelude.Maybe Prelude.Text)
recommendationFeedback_codeReviewArn :: (Maybe Text -> f (Maybe Text))
-> RecommendationFeedback -> f RecommendationFeedback
recommendationFeedback_codeReviewArn = (RecommendationFeedback -> Maybe Text)
-> (RecommendationFeedback -> Maybe Text -> RecommendationFeedback)
-> Lens
RecommendationFeedback
RecommendationFeedback
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecommendationFeedback' {Maybe Text
codeReviewArn :: Maybe Text
$sel:codeReviewArn:RecommendationFeedback' :: RecommendationFeedback -> Maybe Text
codeReviewArn} -> Maybe Text
codeReviewArn) (\s :: RecommendationFeedback
s@RecommendationFeedback' {} Maybe Text
a -> RecommendationFeedback
s {$sel:codeReviewArn:RecommendationFeedback' :: Maybe Text
codeReviewArn = Maybe Text
a} :: RecommendationFeedback)
recommendationFeedback_createdTimeStamp :: Lens.Lens' RecommendationFeedback (Prelude.Maybe Prelude.UTCTime)
recommendationFeedback_createdTimeStamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> RecommendationFeedback -> f RecommendationFeedback
recommendationFeedback_createdTimeStamp = (RecommendationFeedback -> Maybe POSIX)
-> (RecommendationFeedback
-> Maybe POSIX -> RecommendationFeedback)
-> Lens
RecommendationFeedback
RecommendationFeedback
(Maybe POSIX)
(Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecommendationFeedback' {Maybe POSIX
createdTimeStamp :: Maybe POSIX
$sel:createdTimeStamp:RecommendationFeedback' :: RecommendationFeedback -> Maybe POSIX
createdTimeStamp} -> Maybe POSIX
createdTimeStamp) (\s :: RecommendationFeedback
s@RecommendationFeedback' {} Maybe POSIX
a -> RecommendationFeedback
s {$sel:createdTimeStamp:RecommendationFeedback' :: Maybe POSIX
createdTimeStamp = Maybe POSIX
a} :: RecommendationFeedback) ((Maybe POSIX -> f (Maybe POSIX))
-> RecommendationFeedback -> f RecommendationFeedback)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> RecommendationFeedback
-> f RecommendationFeedback
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
recommendationFeedback_lastUpdatedTimeStamp :: Lens.Lens' RecommendationFeedback (Prelude.Maybe Prelude.UTCTime)
recommendationFeedback_lastUpdatedTimeStamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> RecommendationFeedback -> f RecommendationFeedback
recommendationFeedback_lastUpdatedTimeStamp = (RecommendationFeedback -> Maybe POSIX)
-> (RecommendationFeedback
-> Maybe POSIX -> RecommendationFeedback)
-> Lens
RecommendationFeedback
RecommendationFeedback
(Maybe POSIX)
(Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecommendationFeedback' {Maybe POSIX
lastUpdatedTimeStamp :: Maybe POSIX
$sel:lastUpdatedTimeStamp:RecommendationFeedback' :: RecommendationFeedback -> Maybe POSIX
lastUpdatedTimeStamp} -> Maybe POSIX
lastUpdatedTimeStamp) (\s :: RecommendationFeedback
s@RecommendationFeedback' {} Maybe POSIX
a -> RecommendationFeedback
s {$sel:lastUpdatedTimeStamp:RecommendationFeedback' :: Maybe POSIX
lastUpdatedTimeStamp = Maybe POSIX
a} :: RecommendationFeedback) ((Maybe POSIX -> f (Maybe POSIX))
-> RecommendationFeedback -> f RecommendationFeedback)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> RecommendationFeedback
-> f RecommendationFeedback
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
instance Core.FromJSON RecommendationFeedback where
parseJSON :: Value -> Parser RecommendationFeedback
parseJSON =
String
-> (Object -> Parser RecommendationFeedback)
-> Value
-> Parser RecommendationFeedback
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"RecommendationFeedback"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe [Reaction]
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> RecommendationFeedback
RecommendationFeedback'
(Maybe Text
-> Maybe Text
-> Maybe [Reaction]
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> RecommendationFeedback)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe [Reaction]
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> RecommendationFeedback)
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]
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> RecommendationFeedback)
-> Parser (Maybe Text)
-> Parser
(Maybe [Reaction]
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> RecommendationFeedback)
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]
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> RecommendationFeedback)
-> Parser (Maybe [Reaction])
-> Parser
(Maybe Text
-> Maybe POSIX -> Maybe POSIX -> RecommendationFeedback)
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)
Parser
(Maybe Text
-> Maybe POSIX -> Maybe POSIX -> RecommendationFeedback)
-> Parser (Maybe Text)
-> Parser (Maybe POSIX -> Maybe POSIX -> RecommendationFeedback)
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
"CodeReviewArn")
Parser (Maybe POSIX -> Maybe POSIX -> RecommendationFeedback)
-> Parser (Maybe POSIX)
-> Parser (Maybe POSIX -> RecommendationFeedback)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreatedTimeStamp")
Parser (Maybe POSIX -> RecommendationFeedback)
-> Parser (Maybe POSIX) -> Parser RecommendationFeedback
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LastUpdatedTimeStamp")
)
instance Prelude.Hashable RecommendationFeedback
instance Prelude.NFData RecommendationFeedback