{-# 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.Comment where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data =
{
:: Prelude.Maybe Core.POSIX,
:: Prelude.Maybe Prelude.Text,
:: Prelude.Maybe Prelude.Text,
:: Prelude.Maybe [Prelude.Text],
:: Prelude.Maybe Core.POSIX,
:: Prelude.Maybe Prelude.Bool,
:: Prelude.Maybe Prelude.Text,
:: Prelude.Maybe Prelude.Text,
:: Prelude.Maybe Prelude.Text,
:: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Int)
}
deriving (Comment -> Comment -> Bool
(Comment -> Comment -> Bool)
-> (Comment -> Comment -> Bool) -> Eq Comment
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Comment -> Comment -> Bool
$c/= :: Comment -> Comment -> Bool
== :: Comment -> Comment -> Bool
$c== :: Comment -> Comment -> Bool
Prelude.Eq, ReadPrec [Comment]
ReadPrec Comment
Int -> ReadS Comment
ReadS [Comment]
(Int -> ReadS Comment)
-> ReadS [Comment]
-> ReadPrec Comment
-> ReadPrec [Comment]
-> Read Comment
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Comment]
$creadListPrec :: ReadPrec [Comment]
readPrec :: ReadPrec Comment
$creadPrec :: ReadPrec Comment
readList :: ReadS [Comment]
$creadList :: ReadS [Comment]
readsPrec :: Int -> ReadS Comment
$creadsPrec :: Int -> ReadS Comment
Prelude.Read, Int -> Comment -> ShowS
[Comment] -> ShowS
Comment -> String
(Int -> Comment -> ShowS)
-> (Comment -> String) -> ([Comment] -> ShowS) -> Show Comment
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Comment] -> ShowS
$cshowList :: [Comment] -> ShowS
show :: Comment -> String
$cshow :: Comment -> String
showsPrec :: Int -> Comment -> ShowS
$cshowsPrec :: Int -> Comment -> ShowS
Prelude.Show, (forall x. Comment -> Rep Comment x)
-> (forall x. Rep Comment x -> Comment) -> Generic Comment
forall x. Rep Comment x -> Comment
forall x. Comment -> Rep Comment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Comment x -> Comment
$cfrom :: forall x. Comment -> Rep Comment x
Prelude.Generic)
newComment ::
Comment
=
Comment' :: Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe POSIX
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Int)
-> Comment
Comment'
{ $sel:lastModifiedDate:Comment' :: Maybe POSIX
lastModifiedDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:authorArn:Comment' :: Maybe Text
authorArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:content:Comment' :: Maybe Text
content = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:callerReactions:Comment' :: Maybe [Text]
callerReactions = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:creationDate:Comment' :: Maybe POSIX
creationDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:deleted:Comment' :: Maybe Bool
deleted = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:clientRequestToken:Comment' :: Maybe Text
clientRequestToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:commentId:Comment' :: Maybe Text
commentId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:inReplyTo:Comment' :: Maybe Text
inReplyTo = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:reactionCounts:Comment' :: Maybe (HashMap Text Int)
reactionCounts = Maybe (HashMap Text Int)
forall a. Maybe a
Prelude.Nothing
}
comment_lastModifiedDate :: Lens.Lens' Comment (Prelude.Maybe Prelude.UTCTime)
= (Comment -> Maybe POSIX)
-> (Comment -> Maybe POSIX -> Comment)
-> Lens Comment Comment (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Comment' {Maybe POSIX
lastModifiedDate :: Maybe POSIX
$sel:lastModifiedDate:Comment' :: Comment -> Maybe POSIX
lastModifiedDate} -> Maybe POSIX
lastModifiedDate) (\s :: Comment
s@Comment' {} Maybe POSIX
a -> Comment
s {$sel:lastModifiedDate:Comment' :: Maybe POSIX
lastModifiedDate = Maybe POSIX
a} :: Comment) ((Maybe POSIX -> f (Maybe POSIX)) -> Comment -> f Comment)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Comment
-> f Comment
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
comment_authorArn :: Lens.Lens' Comment (Prelude.Maybe Prelude.Text)
= (Comment -> Maybe Text)
-> (Comment -> Maybe Text -> Comment)
-> Lens Comment Comment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Comment' {Maybe Text
authorArn :: Maybe Text
$sel:authorArn:Comment' :: Comment -> Maybe Text
authorArn} -> Maybe Text
authorArn) (\s :: Comment
s@Comment' {} Maybe Text
a -> Comment
s {$sel:authorArn:Comment' :: Maybe Text
authorArn = Maybe Text
a} :: Comment)
comment_content :: Lens.Lens' Comment (Prelude.Maybe Prelude.Text)
= (Comment -> Maybe Text)
-> (Comment -> Maybe Text -> Comment)
-> Lens Comment Comment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Comment' {Maybe Text
content :: Maybe Text
$sel:content:Comment' :: Comment -> Maybe Text
content} -> Maybe Text
content) (\s :: Comment
s@Comment' {} Maybe Text
a -> Comment
s {$sel:content:Comment' :: Maybe Text
content = Maybe Text
a} :: Comment)
comment_callerReactions :: Lens.Lens' Comment (Prelude.Maybe [Prelude.Text])
= (Comment -> Maybe [Text])
-> (Comment -> Maybe [Text] -> Comment)
-> Lens Comment Comment (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Comment' {Maybe [Text]
callerReactions :: Maybe [Text]
$sel:callerReactions:Comment' :: Comment -> Maybe [Text]
callerReactions} -> Maybe [Text]
callerReactions) (\s :: Comment
s@Comment' {} Maybe [Text]
a -> Comment
s {$sel:callerReactions:Comment' :: Maybe [Text]
callerReactions = Maybe [Text]
a} :: Comment) ((Maybe [Text] -> f (Maybe [Text])) -> Comment -> f Comment)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> Comment
-> f Comment
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
comment_creationDate :: Lens.Lens' Comment (Prelude.Maybe Prelude.UTCTime)
= (Comment -> Maybe POSIX)
-> (Comment -> Maybe POSIX -> Comment)
-> Lens Comment Comment (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Comment' {Maybe POSIX
creationDate :: Maybe POSIX
$sel:creationDate:Comment' :: Comment -> Maybe POSIX
creationDate} -> Maybe POSIX
creationDate) (\s :: Comment
s@Comment' {} Maybe POSIX
a -> Comment
s {$sel:creationDate:Comment' :: Maybe POSIX
creationDate = Maybe POSIX
a} :: Comment) ((Maybe POSIX -> f (Maybe POSIX)) -> Comment -> f Comment)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Comment
-> f Comment
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
comment_deleted :: Lens.Lens' Comment (Prelude.Maybe Prelude.Bool)
= (Comment -> Maybe Bool)
-> (Comment -> Maybe Bool -> Comment)
-> Lens Comment Comment (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Comment' {Maybe Bool
deleted :: Maybe Bool
$sel:deleted:Comment' :: Comment -> Maybe Bool
deleted} -> Maybe Bool
deleted) (\s :: Comment
s@Comment' {} Maybe Bool
a -> Comment
s {$sel:deleted:Comment' :: Maybe Bool
deleted = Maybe Bool
a} :: Comment)
comment_clientRequestToken :: Lens.Lens' Comment (Prelude.Maybe Prelude.Text)
= (Comment -> Maybe Text)
-> (Comment -> Maybe Text -> Comment)
-> Lens Comment Comment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Comment' {Maybe Text
clientRequestToken :: Maybe Text
$sel:clientRequestToken:Comment' :: Comment -> Maybe Text
clientRequestToken} -> Maybe Text
clientRequestToken) (\s :: Comment
s@Comment' {} Maybe Text
a -> Comment
s {$sel:clientRequestToken:Comment' :: Maybe Text
clientRequestToken = Maybe Text
a} :: Comment)
comment_commentId :: Lens.Lens' Comment (Prelude.Maybe Prelude.Text)
= (Comment -> Maybe Text)
-> (Comment -> Maybe Text -> Comment)
-> Lens Comment Comment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Comment' {Maybe Text
commentId :: Maybe Text
$sel:commentId:Comment' :: Comment -> Maybe Text
commentId} -> Maybe Text
commentId) (\s :: Comment
s@Comment' {} Maybe Text
a -> Comment
s {$sel:commentId:Comment' :: Maybe Text
commentId = Maybe Text
a} :: Comment)
comment_inReplyTo :: Lens.Lens' Comment (Prelude.Maybe Prelude.Text)
= (Comment -> Maybe Text)
-> (Comment -> Maybe Text -> Comment)
-> Lens Comment Comment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Comment' {Maybe Text
inReplyTo :: Maybe Text
$sel:inReplyTo:Comment' :: Comment -> Maybe Text
inReplyTo} -> Maybe Text
inReplyTo) (\s :: Comment
s@Comment' {} Maybe Text
a -> Comment
s {$sel:inReplyTo:Comment' :: Maybe Text
inReplyTo = Maybe Text
a} :: Comment)
comment_reactionCounts :: Lens.Lens' Comment (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Int))
= (Comment -> Maybe (HashMap Text Int))
-> (Comment -> Maybe (HashMap Text Int) -> Comment)
-> Lens
Comment
Comment
(Maybe (HashMap Text Int))
(Maybe (HashMap Text Int))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Comment' {Maybe (HashMap Text Int)
reactionCounts :: Maybe (HashMap Text Int)
$sel:reactionCounts:Comment' :: Comment -> Maybe (HashMap Text Int)
reactionCounts} -> Maybe (HashMap Text Int)
reactionCounts) (\s :: Comment
s@Comment' {} Maybe (HashMap Text Int)
a -> Comment
s {$sel:reactionCounts:Comment' :: Maybe (HashMap Text Int)
reactionCounts = Maybe (HashMap Text Int)
a} :: Comment) ((Maybe (HashMap Text Int) -> f (Maybe (HashMap Text Int)))
-> Comment -> f Comment)
-> ((Maybe (HashMap Text Int) -> f (Maybe (HashMap Text Int)))
-> Maybe (HashMap Text Int) -> f (Maybe (HashMap Text Int)))
-> (Maybe (HashMap Text Int) -> f (Maybe (HashMap Text Int)))
-> Comment
-> f Comment
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Int)
(HashMap Text Int)
(HashMap Text Int)
(HashMap Text Int)
-> Iso
(Maybe (HashMap Text Int))
(Maybe (HashMap Text Int))
(Maybe (HashMap Text Int))
(Maybe (HashMap Text Int))
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
(HashMap Text Int)
(HashMap Text Int)
(HashMap Text Int)
(HashMap Text Int)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON Comment where
parseJSON :: Value -> Parser Comment
parseJSON =
String -> (Object -> Parser Comment) -> Value -> Parser Comment
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Comment"
( \Object
x ->
Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe POSIX
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Int)
-> Comment
Comment'
(Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe POSIX
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Int)
-> Comment)
-> Parser (Maybe POSIX)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe POSIX
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Int)
-> Comment)
forall (f :: * -> *) a b. Functor 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
"lastModifiedDate")
Parser
(Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe POSIX
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Int)
-> Comment)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe [Text]
-> Maybe POSIX
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Int)
-> Comment)
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
"authorArn")
Parser
(Maybe Text
-> Maybe [Text]
-> Maybe POSIX
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Int)
-> Comment)
-> Parser (Maybe Text)
-> Parser
(Maybe [Text]
-> Maybe POSIX
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Int)
-> Comment)
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
"content")
Parser
(Maybe [Text]
-> Maybe POSIX
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Int)
-> Comment)
-> Parser (Maybe [Text])
-> Parser
(Maybe POSIX
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Int)
-> Comment)
forall (f :: * -> *) a b. Applicative f => 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
"callerReactions"
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 POSIX
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Int)
-> Comment)
-> Parser (Maybe POSIX)
-> Parser
(Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Int)
-> Comment)
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
"creationDate")
Parser
(Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Int)
-> Comment)
-> Parser (Maybe Bool)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe (HashMap Text Int) -> Comment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"deleted")
Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe (HashMap Text Int) -> Comment)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe Text -> Maybe (HashMap Text Int) -> Comment)
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
"clientRequestToken")
Parser
(Maybe Text -> Maybe Text -> Maybe (HashMap Text Int) -> Comment)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe (HashMap Text Int) -> Comment)
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
"commentId")
Parser (Maybe Text -> Maybe (HashMap Text Int) -> Comment)
-> Parser (Maybe Text)
-> Parser (Maybe (HashMap Text Int) -> Comment)
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
"inReplyTo")
Parser (Maybe (HashMap Text Int) -> Comment)
-> Parser (Maybe (HashMap Text Int)) -> Parser Comment
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Int)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"reactionCounts"
Parser (Maybe (Maybe (HashMap Text Int)))
-> Maybe (HashMap Text Int) -> Parser (Maybe (HashMap Text Int))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Int)
forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable Comment
instance Prelude.NFData Comment