{-# 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.CodeCommit.Types.ReactionForComment where
import Amazonka.CodeCommit.Types.ReactionValueFormats
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data =
{
:: Prelude.Maybe [Prelude.Text],
:: Prelude.Maybe Prelude.Int,
:: Prelude.Maybe ReactionValueFormats
}
deriving (ReactionForComment -> ReactionForComment -> Bool
(ReactionForComment -> ReactionForComment -> Bool)
-> (ReactionForComment -> ReactionForComment -> Bool)
-> Eq ReactionForComment
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReactionForComment -> ReactionForComment -> Bool
$c/= :: ReactionForComment -> ReactionForComment -> Bool
== :: ReactionForComment -> ReactionForComment -> Bool
$c== :: ReactionForComment -> ReactionForComment -> Bool
Prelude.Eq, ReadPrec [ReactionForComment]
ReadPrec ReactionForComment
Int -> ReadS ReactionForComment
ReadS [ReactionForComment]
(Int -> ReadS ReactionForComment)
-> ReadS [ReactionForComment]
-> ReadPrec ReactionForComment
-> ReadPrec [ReactionForComment]
-> Read ReactionForComment
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReactionForComment]
$creadListPrec :: ReadPrec [ReactionForComment]
readPrec :: ReadPrec ReactionForComment
$creadPrec :: ReadPrec ReactionForComment
readList :: ReadS [ReactionForComment]
$creadList :: ReadS [ReactionForComment]
readsPrec :: Int -> ReadS ReactionForComment
$creadsPrec :: Int -> ReadS ReactionForComment
Prelude.Read, Int -> ReactionForComment -> ShowS
[ReactionForComment] -> ShowS
ReactionForComment -> String
(Int -> ReactionForComment -> ShowS)
-> (ReactionForComment -> String)
-> ([ReactionForComment] -> ShowS)
-> Show ReactionForComment
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReactionForComment] -> ShowS
$cshowList :: [ReactionForComment] -> ShowS
show :: ReactionForComment -> String
$cshow :: ReactionForComment -> String
showsPrec :: Int -> ReactionForComment -> ShowS
$cshowsPrec :: Int -> ReactionForComment -> ShowS
Prelude.Show, (forall x. ReactionForComment -> Rep ReactionForComment x)
-> (forall x. Rep ReactionForComment x -> ReactionForComment)
-> Generic ReactionForComment
forall x. Rep ReactionForComment x -> ReactionForComment
forall x. ReactionForComment -> Rep ReactionForComment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ReactionForComment x -> ReactionForComment
$cfrom :: forall x. ReactionForComment -> Rep ReactionForComment x
Prelude.Generic)
newReactionForComment ::
ReactionForComment
=
ReactionForComment' :: Maybe [Text]
-> Maybe Int -> Maybe ReactionValueFormats -> ReactionForComment
ReactionForComment'
{ $sel:reactionUsers:ReactionForComment' :: Maybe [Text]
reactionUsers =
Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:reactionsFromDeletedUsersCount:ReactionForComment' :: Maybe Int
reactionsFromDeletedUsersCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:reaction:ReactionForComment' :: Maybe ReactionValueFormats
reaction = Maybe ReactionValueFormats
forall a. Maybe a
Prelude.Nothing
}
reactionForComment_reactionUsers :: Lens.Lens' ReactionForComment (Prelude.Maybe [Prelude.Text])
= (ReactionForComment -> Maybe [Text])
-> (ReactionForComment -> Maybe [Text] -> ReactionForComment)
-> Lens
ReactionForComment ReactionForComment (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReactionForComment' {Maybe [Text]
reactionUsers :: Maybe [Text]
$sel:reactionUsers:ReactionForComment' :: ReactionForComment -> Maybe [Text]
reactionUsers} -> Maybe [Text]
reactionUsers) (\s :: ReactionForComment
s@ReactionForComment' {} Maybe [Text]
a -> ReactionForComment
s {$sel:reactionUsers:ReactionForComment' :: Maybe [Text]
reactionUsers = Maybe [Text]
a} :: ReactionForComment) ((Maybe [Text] -> f (Maybe [Text]))
-> ReactionForComment -> f ReactionForComment)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ReactionForComment
-> f ReactionForComment
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
reactionForComment_reactionsFromDeletedUsersCount :: Lens.Lens' ReactionForComment (Prelude.Maybe Prelude.Int)
= (ReactionForComment -> Maybe Int)
-> (ReactionForComment -> Maybe Int -> ReactionForComment)
-> Lens
ReactionForComment ReactionForComment (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReactionForComment' {Maybe Int
reactionsFromDeletedUsersCount :: Maybe Int
$sel:reactionsFromDeletedUsersCount:ReactionForComment' :: ReactionForComment -> Maybe Int
reactionsFromDeletedUsersCount} -> Maybe Int
reactionsFromDeletedUsersCount) (\s :: ReactionForComment
s@ReactionForComment' {} Maybe Int
a -> ReactionForComment
s {$sel:reactionsFromDeletedUsersCount:ReactionForComment' :: Maybe Int
reactionsFromDeletedUsersCount = Maybe Int
a} :: ReactionForComment)
reactionForComment_reaction :: Lens.Lens' ReactionForComment (Prelude.Maybe ReactionValueFormats)
= (ReactionForComment -> Maybe ReactionValueFormats)
-> (ReactionForComment
-> Maybe ReactionValueFormats -> ReactionForComment)
-> Lens
ReactionForComment
ReactionForComment
(Maybe ReactionValueFormats)
(Maybe ReactionValueFormats)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReactionForComment' {Maybe ReactionValueFormats
reaction :: Maybe ReactionValueFormats
$sel:reaction:ReactionForComment' :: ReactionForComment -> Maybe ReactionValueFormats
reaction} -> Maybe ReactionValueFormats
reaction) (\s :: ReactionForComment
s@ReactionForComment' {} Maybe ReactionValueFormats
a -> ReactionForComment
s {$sel:reaction:ReactionForComment' :: Maybe ReactionValueFormats
reaction = Maybe ReactionValueFormats
a} :: ReactionForComment)
instance Core.FromJSON ReactionForComment where
parseJSON :: Value -> Parser ReactionForComment
parseJSON =
String
-> (Object -> Parser ReactionForComment)
-> Value
-> Parser ReactionForComment
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ReactionForComment"
( \Object
x ->
Maybe [Text]
-> Maybe Int -> Maybe ReactionValueFormats -> ReactionForComment
ReactionForComment'
(Maybe [Text]
-> Maybe Int -> Maybe ReactionValueFormats -> ReactionForComment)
-> Parser (Maybe [Text])
-> Parser
(Maybe Int -> Maybe ReactionValueFormats -> ReactionForComment)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"reactionUsers" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe Int -> Maybe ReactionValueFormats -> ReactionForComment)
-> Parser (Maybe Int)
-> Parser (Maybe ReactionValueFormats -> ReactionForComment)
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
"reactionsFromDeletedUsersCount")
Parser (Maybe ReactionValueFormats -> ReactionForComment)
-> Parser (Maybe ReactionValueFormats) -> Parser ReactionForComment
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ReactionValueFormats)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"reaction")
)
instance Prelude.Hashable ReactionForComment
instance Prelude.NFData ReactionForComment