{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data =
{
:: Prelude.Maybe ReactionValueFormats,
:: Prelude.Maybe [Prelude.Text],
:: Prelude.Maybe Prelude.Int
}
deriving (ReactionForComment -> ReactionForComment -> Bool
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]
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
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. 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'
{ $sel:reaction:ReactionForComment' :: Maybe ReactionValueFormats
reaction = forall a. Maybe a
Prelude.Nothing,
$sel:reactionUsers:ReactionForComment' :: Maybe [Text]
reactionUsers = forall a. Maybe a
Prelude.Nothing,
$sel:reactionsFromDeletedUsersCount:ReactionForComment' :: Maybe Int
reactionsFromDeletedUsersCount = forall a. Maybe a
Prelude.Nothing
}
reactionForComment_reaction :: Lens.Lens' ReactionForComment (Prelude.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)
reactionForComment_reactionUsers :: Lens.Lens' ReactionForComment (Prelude.Maybe [Prelude.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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 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)
= 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)
instance Data.FromJSON ReactionForComment where
parseJSON :: Value -> Parser ReactionForComment
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ReactionForComment"
( \Object
x ->
Maybe ReactionValueFormats
-> Maybe [Text] -> Maybe Int -> ReactionForComment
ReactionForComment'
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
"reaction")
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
"reactionUsers" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
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
"reactionsFromDeletedUsersCount")
)
instance Prelude.Hashable ReactionForComment where
hashWithSalt :: Int -> ReactionForComment -> Int
hashWithSalt Int
_salt ReactionForComment' {Maybe Int
Maybe [Text]
Maybe ReactionValueFormats
reactionsFromDeletedUsersCount :: Maybe Int
reactionUsers :: Maybe [Text]
reaction :: Maybe ReactionValueFormats
$sel:reactionsFromDeletedUsersCount:ReactionForComment' :: ReactionForComment -> Maybe Int
$sel:reactionUsers:ReactionForComment' :: ReactionForComment -> Maybe [Text]
$sel:reaction:ReactionForComment' :: ReactionForComment -> Maybe ReactionValueFormats
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ReactionValueFormats
reaction
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
reactionUsers
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
reactionsFromDeletedUsersCount
instance Prelude.NFData ReactionForComment where
rnf :: ReactionForComment -> ()
rnf ReactionForComment' {Maybe Int
Maybe [Text]
Maybe ReactionValueFormats
reactionsFromDeletedUsersCount :: Maybe Int
reactionUsers :: Maybe [Text]
reaction :: Maybe ReactionValueFormats
$sel:reactionsFromDeletedUsersCount:ReactionForComment' :: ReactionForComment -> Maybe Int
$sel:reactionUsers:ReactionForComment' :: ReactionForComment -> Maybe [Text]
$sel:reaction:ReactionForComment' :: ReactionForComment -> Maybe ReactionValueFormats
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe ReactionValueFormats
reaction
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
reactionUsers
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
reactionsFromDeletedUsersCount