{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data =
{
:: Prelude.Maybe Prelude.Text,
:: Prelude.Maybe [Prelude.Text],
:: Prelude.Maybe Prelude.Text,
:: Prelude.Maybe Prelude.Text,
:: Prelude.Maybe Prelude.Text,
:: Prelude.Maybe Data.POSIX,
:: Prelude.Maybe Prelude.Bool,
:: Prelude.Maybe Prelude.Text,
:: Prelude.Maybe Data.POSIX,
:: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Int)
}
deriving (Comment -> Comment -> Bool
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]
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
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. 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'
{ $sel:authorArn:Comment' :: Maybe Text
authorArn = forall a. Maybe a
Prelude.Nothing,
$sel:callerReactions:Comment' :: Maybe [Text]
callerReactions = forall a. Maybe a
Prelude.Nothing,
$sel:clientRequestToken:Comment' :: Maybe Text
clientRequestToken = forall a. Maybe a
Prelude.Nothing,
$sel:commentId:Comment' :: Maybe Text
commentId = forall a. Maybe a
Prelude.Nothing,
$sel:content:Comment' :: Maybe Text
content = forall a. Maybe a
Prelude.Nothing,
$sel:creationDate:Comment' :: Maybe POSIX
creationDate = forall a. Maybe a
Prelude.Nothing,
$sel:deleted:Comment' :: Maybe Bool
deleted = forall a. Maybe a
Prelude.Nothing,
$sel:inReplyTo:Comment' :: Maybe Text
inReplyTo = forall a. Maybe a
Prelude.Nothing,
$sel:lastModifiedDate:Comment' :: Maybe POSIX
lastModifiedDate = forall a. Maybe a
Prelude.Nothing,
$sel:reactionCounts:Comment' :: Maybe (HashMap Text Int)
reactionCounts = forall a. Maybe a
Prelude.Nothing
}
comment_authorArn :: Lens.Lens' Comment (Prelude.Maybe Prelude.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_callerReactions :: Lens.Lens' Comment (Prelude.Maybe [Prelude.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) 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
comment_clientRequestToken :: Lens.Lens' Comment (Prelude.Maybe Prelude.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)
= 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_content :: Lens.Lens' Comment (Prelude.Maybe Prelude.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_creationDate :: Lens.Lens' Comment (Prelude.Maybe Prelude.UTCTime)
= 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) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time
comment_deleted :: Lens.Lens' Comment (Prelude.Maybe Prelude.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_inReplyTo :: Lens.Lens' Comment (Prelude.Maybe Prelude.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_lastModifiedDate :: Lens.Lens' Comment (Prelude.Maybe Prelude.UTCTime)
= 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) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time
comment_reactionCounts :: Lens.Lens' Comment (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.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) 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
instance Data.FromJSON Comment where
parseJSON :: Value -> Parser Comment
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Comment"
( \Object
x ->
Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Bool
-> Maybe Text
-> Maybe POSIX
-> Maybe (HashMap Text Int)
-> Comment
Comment'
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
"authorArn")
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
"callerReactions"
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
"clientRequestToken")
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
"commentId")
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
"content")
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
"creationDate")
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
"deleted")
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
"inReplyTo")
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
"lastModifiedDate")
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
"reactionCounts"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable Comment where
hashWithSalt :: Int -> Comment -> Int
hashWithSalt Int
_salt Comment' {Maybe Bool
Maybe [Text]
Maybe Text
Maybe (HashMap Text Int)
Maybe POSIX
reactionCounts :: Maybe (HashMap Text Int)
lastModifiedDate :: Maybe POSIX
inReplyTo :: Maybe Text
deleted :: Maybe Bool
creationDate :: Maybe POSIX
content :: Maybe Text
commentId :: Maybe Text
clientRequestToken :: Maybe Text
callerReactions :: Maybe [Text]
authorArn :: Maybe Text
$sel:reactionCounts:Comment' :: Comment -> Maybe (HashMap Text Int)
$sel:lastModifiedDate:Comment' :: Comment -> Maybe POSIX
$sel:inReplyTo:Comment' :: Comment -> Maybe Text
$sel:deleted:Comment' :: Comment -> Maybe Bool
$sel:creationDate:Comment' :: Comment -> Maybe POSIX
$sel:content:Comment' :: Comment -> Maybe Text
$sel:commentId:Comment' :: Comment -> Maybe Text
$sel:clientRequestToken:Comment' :: Comment -> Maybe Text
$sel:callerReactions:Comment' :: Comment -> Maybe [Text]
$sel:authorArn:Comment' :: Comment -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
authorArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
callerReactions
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clientRequestToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
commentId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
content
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
creationDate
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
deleted
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
inReplyTo
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastModifiedDate
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Int)
reactionCounts
instance Prelude.NFData Comment where
rnf :: Comment -> ()
rnf Comment' {Maybe Bool
Maybe [Text]
Maybe Text
Maybe (HashMap Text Int)
Maybe POSIX
reactionCounts :: Maybe (HashMap Text Int)
lastModifiedDate :: Maybe POSIX
inReplyTo :: Maybe Text
deleted :: Maybe Bool
creationDate :: Maybe POSIX
content :: Maybe Text
commentId :: Maybe Text
clientRequestToken :: Maybe Text
callerReactions :: Maybe [Text]
authorArn :: Maybe Text
$sel:reactionCounts:Comment' :: Comment -> Maybe (HashMap Text Int)
$sel:lastModifiedDate:Comment' :: Comment -> Maybe POSIX
$sel:inReplyTo:Comment' :: Comment -> Maybe Text
$sel:deleted:Comment' :: Comment -> Maybe Bool
$sel:creationDate:Comment' :: Comment -> Maybe POSIX
$sel:content:Comment' :: Comment -> Maybe Text
$sel:commentId:Comment' :: Comment -> Maybe Text
$sel:clientRequestToken:Comment' :: Comment -> Maybe Text
$sel:callerReactions:Comment' :: Comment -> Maybe [Text]
$sel:authorArn:Comment' :: Comment -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
authorArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
callerReactions
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clientRequestToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
commentId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
content
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationDate
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
deleted
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
inReplyTo
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastModifiedDate
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Int)
reactionCounts