{-# 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.CommentsForPullRequest where
import Amazonka.CodeCommit.Types.Comment
import Amazonka.CodeCommit.Types.Location
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 Location,
:: Prelude.Maybe Prelude.Text,
:: Prelude.Maybe Prelude.Text,
:: Prelude.Maybe Prelude.Text,
:: Prelude.Maybe Prelude.Text,
:: Prelude.Maybe Prelude.Text,
:: Prelude.Maybe [Comment]
}
deriving (CommentsForPullRequest -> CommentsForPullRequest -> Bool
(CommentsForPullRequest -> CommentsForPullRequest -> Bool)
-> (CommentsForPullRequest -> CommentsForPullRequest -> Bool)
-> Eq CommentsForPullRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CommentsForPullRequest -> CommentsForPullRequest -> Bool
$c/= :: CommentsForPullRequest -> CommentsForPullRequest -> Bool
== :: CommentsForPullRequest -> CommentsForPullRequest -> Bool
$c== :: CommentsForPullRequest -> CommentsForPullRequest -> Bool
Prelude.Eq, ReadPrec [CommentsForPullRequest]
ReadPrec CommentsForPullRequest
Int -> ReadS CommentsForPullRequest
ReadS [CommentsForPullRequest]
(Int -> ReadS CommentsForPullRequest)
-> ReadS [CommentsForPullRequest]
-> ReadPrec CommentsForPullRequest
-> ReadPrec [CommentsForPullRequest]
-> Read CommentsForPullRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CommentsForPullRequest]
$creadListPrec :: ReadPrec [CommentsForPullRequest]
readPrec :: ReadPrec CommentsForPullRequest
$creadPrec :: ReadPrec CommentsForPullRequest
readList :: ReadS [CommentsForPullRequest]
$creadList :: ReadS [CommentsForPullRequest]
readsPrec :: Int -> ReadS CommentsForPullRequest
$creadsPrec :: Int -> ReadS CommentsForPullRequest
Prelude.Read, Int -> CommentsForPullRequest -> ShowS
[CommentsForPullRequest] -> ShowS
CommentsForPullRequest -> String
(Int -> CommentsForPullRequest -> ShowS)
-> (CommentsForPullRequest -> String)
-> ([CommentsForPullRequest] -> ShowS)
-> Show CommentsForPullRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CommentsForPullRequest] -> ShowS
$cshowList :: [CommentsForPullRequest] -> ShowS
show :: CommentsForPullRequest -> String
$cshow :: CommentsForPullRequest -> String
showsPrec :: Int -> CommentsForPullRequest -> ShowS
$cshowsPrec :: Int -> CommentsForPullRequest -> ShowS
Prelude.Show, (forall x. CommentsForPullRequest -> Rep CommentsForPullRequest x)
-> (forall x.
Rep CommentsForPullRequest x -> CommentsForPullRequest)
-> Generic CommentsForPullRequest
forall x. Rep CommentsForPullRequest x -> CommentsForPullRequest
forall x. CommentsForPullRequest -> Rep CommentsForPullRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CommentsForPullRequest x -> CommentsForPullRequest
$cfrom :: forall x. CommentsForPullRequest -> Rep CommentsForPullRequest x
Prelude.Generic)
newCommentsForPullRequest ::
CommentsForPullRequest
=
CommentsForPullRequest' :: Maybe Text
-> Maybe Location
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Comment]
-> CommentsForPullRequest
CommentsForPullRequest'
{ $sel:beforeBlobId:CommentsForPullRequest' :: Maybe Text
beforeBlobId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:location:CommentsForPullRequest' :: Maybe Location
location = Maybe Location
forall a. Maybe a
Prelude.Nothing,
$sel:afterCommitId:CommentsForPullRequest' :: Maybe Text
afterCommitId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:pullRequestId:CommentsForPullRequest' :: Maybe Text
pullRequestId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:afterBlobId:CommentsForPullRequest' :: Maybe Text
afterBlobId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:beforeCommitId:CommentsForPullRequest' :: Maybe Text
beforeCommitId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:repositoryName:CommentsForPullRequest' :: Maybe Text
repositoryName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:comments:CommentsForPullRequest' :: Maybe [Comment]
comments = Maybe [Comment]
forall a. Maybe a
Prelude.Nothing
}
commentsForPullRequest_beforeBlobId :: Lens.Lens' CommentsForPullRequest (Prelude.Maybe Prelude.Text)
= (CommentsForPullRequest -> Maybe Text)
-> (CommentsForPullRequest -> Maybe Text -> CommentsForPullRequest)
-> Lens
CommentsForPullRequest
CommentsForPullRequest
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommentsForPullRequest' {Maybe Text
beforeBlobId :: Maybe Text
$sel:beforeBlobId:CommentsForPullRequest' :: CommentsForPullRequest -> Maybe Text
beforeBlobId} -> Maybe Text
beforeBlobId) (\s :: CommentsForPullRequest
s@CommentsForPullRequest' {} Maybe Text
a -> CommentsForPullRequest
s {$sel:beforeBlobId:CommentsForPullRequest' :: Maybe Text
beforeBlobId = Maybe Text
a} :: CommentsForPullRequest)
commentsForPullRequest_location :: Lens.Lens' CommentsForPullRequest (Prelude.Maybe Location)
= (CommentsForPullRequest -> Maybe Location)
-> (CommentsForPullRequest
-> Maybe Location -> CommentsForPullRequest)
-> Lens
CommentsForPullRequest
CommentsForPullRequest
(Maybe Location)
(Maybe Location)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommentsForPullRequest' {Maybe Location
location :: Maybe Location
$sel:location:CommentsForPullRequest' :: CommentsForPullRequest -> Maybe Location
location} -> Maybe Location
location) (\s :: CommentsForPullRequest
s@CommentsForPullRequest' {} Maybe Location
a -> CommentsForPullRequest
s {$sel:location:CommentsForPullRequest' :: Maybe Location
location = Maybe Location
a} :: CommentsForPullRequest)
commentsForPullRequest_afterCommitId :: Lens.Lens' CommentsForPullRequest (Prelude.Maybe Prelude.Text)
= (CommentsForPullRequest -> Maybe Text)
-> (CommentsForPullRequest -> Maybe Text -> CommentsForPullRequest)
-> Lens
CommentsForPullRequest
CommentsForPullRequest
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommentsForPullRequest' {Maybe Text
afterCommitId :: Maybe Text
$sel:afterCommitId:CommentsForPullRequest' :: CommentsForPullRequest -> Maybe Text
afterCommitId} -> Maybe Text
afterCommitId) (\s :: CommentsForPullRequest
s@CommentsForPullRequest' {} Maybe Text
a -> CommentsForPullRequest
s {$sel:afterCommitId:CommentsForPullRequest' :: Maybe Text
afterCommitId = Maybe Text
a} :: CommentsForPullRequest)
commentsForPullRequest_pullRequestId :: Lens.Lens' CommentsForPullRequest (Prelude.Maybe Prelude.Text)
= (CommentsForPullRequest -> Maybe Text)
-> (CommentsForPullRequest -> Maybe Text -> CommentsForPullRequest)
-> Lens
CommentsForPullRequest
CommentsForPullRequest
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommentsForPullRequest' {Maybe Text
pullRequestId :: Maybe Text
$sel:pullRequestId:CommentsForPullRequest' :: CommentsForPullRequest -> Maybe Text
pullRequestId} -> Maybe Text
pullRequestId) (\s :: CommentsForPullRequest
s@CommentsForPullRequest' {} Maybe Text
a -> CommentsForPullRequest
s {$sel:pullRequestId:CommentsForPullRequest' :: Maybe Text
pullRequestId = Maybe Text
a} :: CommentsForPullRequest)
commentsForPullRequest_afterBlobId :: Lens.Lens' CommentsForPullRequest (Prelude.Maybe Prelude.Text)
= (CommentsForPullRequest -> Maybe Text)
-> (CommentsForPullRequest -> Maybe Text -> CommentsForPullRequest)
-> Lens
CommentsForPullRequest
CommentsForPullRequest
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommentsForPullRequest' {Maybe Text
afterBlobId :: Maybe Text
$sel:afterBlobId:CommentsForPullRequest' :: CommentsForPullRequest -> Maybe Text
afterBlobId} -> Maybe Text
afterBlobId) (\s :: CommentsForPullRequest
s@CommentsForPullRequest' {} Maybe Text
a -> CommentsForPullRequest
s {$sel:afterBlobId:CommentsForPullRequest' :: Maybe Text
afterBlobId = Maybe Text
a} :: CommentsForPullRequest)
commentsForPullRequest_beforeCommitId :: Lens.Lens' CommentsForPullRequest (Prelude.Maybe Prelude.Text)
= (CommentsForPullRequest -> Maybe Text)
-> (CommentsForPullRequest -> Maybe Text -> CommentsForPullRequest)
-> Lens
CommentsForPullRequest
CommentsForPullRequest
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommentsForPullRequest' {Maybe Text
beforeCommitId :: Maybe Text
$sel:beforeCommitId:CommentsForPullRequest' :: CommentsForPullRequest -> Maybe Text
beforeCommitId} -> Maybe Text
beforeCommitId) (\s :: CommentsForPullRequest
s@CommentsForPullRequest' {} Maybe Text
a -> CommentsForPullRequest
s {$sel:beforeCommitId:CommentsForPullRequest' :: Maybe Text
beforeCommitId = Maybe Text
a} :: CommentsForPullRequest)
commentsForPullRequest_repositoryName :: Lens.Lens' CommentsForPullRequest (Prelude.Maybe Prelude.Text)
= (CommentsForPullRequest -> Maybe Text)
-> (CommentsForPullRequest -> Maybe Text -> CommentsForPullRequest)
-> Lens
CommentsForPullRequest
CommentsForPullRequest
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommentsForPullRequest' {Maybe Text
repositoryName :: Maybe Text
$sel:repositoryName:CommentsForPullRequest' :: CommentsForPullRequest -> Maybe Text
repositoryName} -> Maybe Text
repositoryName) (\s :: CommentsForPullRequest
s@CommentsForPullRequest' {} Maybe Text
a -> CommentsForPullRequest
s {$sel:repositoryName:CommentsForPullRequest' :: Maybe Text
repositoryName = Maybe Text
a} :: CommentsForPullRequest)
commentsForPullRequest_comments :: Lens.Lens' CommentsForPullRequest (Prelude.Maybe [Comment])
= (CommentsForPullRequest -> Maybe [Comment])
-> (CommentsForPullRequest
-> Maybe [Comment] -> CommentsForPullRequest)
-> Lens
CommentsForPullRequest
CommentsForPullRequest
(Maybe [Comment])
(Maybe [Comment])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommentsForPullRequest' {Maybe [Comment]
comments :: Maybe [Comment]
$sel:comments:CommentsForPullRequest' :: CommentsForPullRequest -> Maybe [Comment]
comments} -> Maybe [Comment]
comments) (\s :: CommentsForPullRequest
s@CommentsForPullRequest' {} Maybe [Comment]
a -> CommentsForPullRequest
s {$sel:comments:CommentsForPullRequest' :: Maybe [Comment]
comments = Maybe [Comment]
a} :: CommentsForPullRequest) ((Maybe [Comment] -> f (Maybe [Comment]))
-> CommentsForPullRequest -> f CommentsForPullRequest)
-> ((Maybe [Comment] -> f (Maybe [Comment]))
-> Maybe [Comment] -> f (Maybe [Comment]))
-> (Maybe [Comment] -> f (Maybe [Comment]))
-> CommentsForPullRequest
-> f CommentsForPullRequest
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Comment] [Comment] [Comment] [Comment]
-> Iso
(Maybe [Comment])
(Maybe [Comment])
(Maybe [Comment])
(Maybe [Comment])
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 [Comment] [Comment] [Comment] [Comment]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON CommentsForPullRequest where
parseJSON :: Value -> Parser CommentsForPullRequest
parseJSON =
String
-> (Object -> Parser CommentsForPullRequest)
-> Value
-> Parser CommentsForPullRequest
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CommentsForPullRequest"
( \Object
x ->
Maybe Text
-> Maybe Location
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Comment]
-> CommentsForPullRequest
CommentsForPullRequest'
(Maybe Text
-> Maybe Location
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Comment]
-> CommentsForPullRequest)
-> Parser (Maybe Text)
-> Parser
(Maybe Location
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Comment]
-> CommentsForPullRequest)
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
"beforeBlobId")
Parser
(Maybe Location
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Comment]
-> CommentsForPullRequest)
-> Parser (Maybe Location)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Comment]
-> CommentsForPullRequest)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Location)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"location")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Comment]
-> CommentsForPullRequest)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Comment]
-> CommentsForPullRequest)
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
"afterCommitId")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Comment]
-> CommentsForPullRequest)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Comment]
-> CommentsForPullRequest)
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
"pullRequestId")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Comment]
-> CommentsForPullRequest)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe [Comment] -> CommentsForPullRequest)
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
"afterBlobId")
Parser
(Maybe Text
-> Maybe Text -> Maybe [Comment] -> CommentsForPullRequest)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe [Comment] -> CommentsForPullRequest)
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
"beforeCommitId")
Parser (Maybe Text -> Maybe [Comment] -> CommentsForPullRequest)
-> Parser (Maybe Text)
-> Parser (Maybe [Comment] -> CommentsForPullRequest)
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
"repositoryName")
Parser (Maybe [Comment] -> CommentsForPullRequest)
-> Parser (Maybe [Comment]) -> Parser CommentsForPullRequest
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Comment]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"comments" Parser (Maybe (Maybe [Comment]))
-> Maybe [Comment] -> Parser (Maybe [Comment])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Comment]
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable CommentsForPullRequest
instance Prelude.NFData CommentsForPullRequest