{-# 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.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 [Comment],
:: Prelude.Maybe Location,
:: Prelude.Maybe Prelude.Text,
:: Prelude.Maybe Prelude.Text
}
deriving (CommentsForPullRequest -> CommentsForPullRequest -> Bool
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]
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
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. 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'
{ $sel:afterBlobId:CommentsForPullRequest' :: Maybe Text
afterBlobId =
forall a. Maybe a
Prelude.Nothing,
$sel:afterCommitId:CommentsForPullRequest' :: Maybe Text
afterCommitId = forall a. Maybe a
Prelude.Nothing,
$sel:beforeBlobId:CommentsForPullRequest' :: Maybe Text
beforeBlobId = forall a. Maybe a
Prelude.Nothing,
$sel:beforeCommitId:CommentsForPullRequest' :: Maybe Text
beforeCommitId = forall a. Maybe a
Prelude.Nothing,
$sel:comments:CommentsForPullRequest' :: Maybe [Comment]
comments = forall a. Maybe a
Prelude.Nothing,
$sel:location:CommentsForPullRequest' :: Maybe Location
location = forall a. Maybe a
Prelude.Nothing,
$sel:pullRequestId:CommentsForPullRequest' :: Maybe Text
pullRequestId = forall a. Maybe a
Prelude.Nothing,
$sel:repositoryName:CommentsForPullRequest' :: Maybe Text
repositoryName = forall a. Maybe a
Prelude.Nothing
}
commentsForPullRequest_afterBlobId :: Lens.Lens' CommentsForPullRequest (Prelude.Maybe Prelude.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_afterCommitId :: Lens.Lens' CommentsForPullRequest (Prelude.Maybe Prelude.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_beforeBlobId :: Lens.Lens' CommentsForPullRequest (Prelude.Maybe Prelude.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_beforeCommitId :: Lens.Lens' CommentsForPullRequest (Prelude.Maybe Prelude.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_comments :: Lens.Lens' CommentsForPullRequest (Prelude.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) 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
commentsForPullRequest_location :: Lens.Lens' CommentsForPullRequest (Prelude.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_pullRequestId :: Lens.Lens' CommentsForPullRequest (Prelude.Maybe Prelude.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_repositoryName :: Lens.Lens' CommentsForPullRequest (Prelude.Maybe Prelude.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)
instance Data.FromJSON CommentsForPullRequest where
parseJSON :: Value -> Parser CommentsForPullRequest
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"CommentsForPullRequest"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Comment]
-> Maybe Location
-> Maybe Text
-> Maybe Text
-> CommentsForPullRequest
CommentsForPullRequest'
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
"afterBlobId")
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
"afterCommitId")
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
"beforeBlobId")
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
"beforeCommitId")
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
"comments" 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
"location")
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
"pullRequestId")
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
"repositoryName")
)
instance Prelude.Hashable CommentsForPullRequest where
hashWithSalt :: Int -> CommentsForPullRequest -> Int
hashWithSalt Int
_salt CommentsForPullRequest' {Maybe [Comment]
Maybe Text
Maybe Location
repositoryName :: Maybe Text
pullRequestId :: Maybe Text
location :: Maybe Location
comments :: Maybe [Comment]
beforeCommitId :: Maybe Text
beforeBlobId :: Maybe Text
afterCommitId :: Maybe Text
afterBlobId :: Maybe Text
$sel:repositoryName:CommentsForPullRequest' :: CommentsForPullRequest -> Maybe Text
$sel:pullRequestId:CommentsForPullRequest' :: CommentsForPullRequest -> Maybe Text
$sel:location:CommentsForPullRequest' :: CommentsForPullRequest -> Maybe Location
$sel:comments:CommentsForPullRequest' :: CommentsForPullRequest -> Maybe [Comment]
$sel:beforeCommitId:CommentsForPullRequest' :: CommentsForPullRequest -> Maybe Text
$sel:beforeBlobId:CommentsForPullRequest' :: CommentsForPullRequest -> Maybe Text
$sel:afterCommitId:CommentsForPullRequest' :: CommentsForPullRequest -> Maybe Text
$sel:afterBlobId:CommentsForPullRequest' :: CommentsForPullRequest -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
afterBlobId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
afterCommitId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
beforeBlobId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
beforeCommitId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Comment]
comments
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Location
location
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
pullRequestId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
repositoryName
instance Prelude.NFData CommentsForPullRequest where
rnf :: CommentsForPullRequest -> ()
rnf CommentsForPullRequest' {Maybe [Comment]
Maybe Text
Maybe Location
repositoryName :: Maybe Text
pullRequestId :: Maybe Text
location :: Maybe Location
comments :: Maybe [Comment]
beforeCommitId :: Maybe Text
beforeBlobId :: Maybe Text
afterCommitId :: Maybe Text
afterBlobId :: Maybe Text
$sel:repositoryName:CommentsForPullRequest' :: CommentsForPullRequest -> Maybe Text
$sel:pullRequestId:CommentsForPullRequest' :: CommentsForPullRequest -> Maybe Text
$sel:location:CommentsForPullRequest' :: CommentsForPullRequest -> Maybe Location
$sel:comments:CommentsForPullRequest' :: CommentsForPullRequest -> Maybe [Comment]
$sel:beforeCommitId:CommentsForPullRequest' :: CommentsForPullRequest -> Maybe Text
$sel:beforeBlobId:CommentsForPullRequest' :: CommentsForPullRequest -> Maybe Text
$sel:afterCommitId:CommentsForPullRequest' :: CommentsForPullRequest -> Maybe Text
$sel:afterBlobId:CommentsForPullRequest' :: CommentsForPullRequest -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
afterBlobId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
afterCommitId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
beforeBlobId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
beforeCommitId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Comment]
comments
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Location
location
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
pullRequestId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
repositoryName