{-# 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.CommentsForComparedCommit 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 [Comment]
}
deriving (CommentsForComparedCommit -> CommentsForComparedCommit -> Bool
(CommentsForComparedCommit -> CommentsForComparedCommit -> Bool)
-> (CommentsForComparedCommit -> CommentsForComparedCommit -> Bool)
-> Eq CommentsForComparedCommit
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CommentsForComparedCommit -> CommentsForComparedCommit -> Bool
$c/= :: CommentsForComparedCommit -> CommentsForComparedCommit -> Bool
== :: CommentsForComparedCommit -> CommentsForComparedCommit -> Bool
$c== :: CommentsForComparedCommit -> CommentsForComparedCommit -> Bool
Prelude.Eq, ReadPrec [CommentsForComparedCommit]
ReadPrec CommentsForComparedCommit
Int -> ReadS CommentsForComparedCommit
ReadS [CommentsForComparedCommit]
(Int -> ReadS CommentsForComparedCommit)
-> ReadS [CommentsForComparedCommit]
-> ReadPrec CommentsForComparedCommit
-> ReadPrec [CommentsForComparedCommit]
-> Read CommentsForComparedCommit
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CommentsForComparedCommit]
$creadListPrec :: ReadPrec [CommentsForComparedCommit]
readPrec :: ReadPrec CommentsForComparedCommit
$creadPrec :: ReadPrec CommentsForComparedCommit
readList :: ReadS [CommentsForComparedCommit]
$creadList :: ReadS [CommentsForComparedCommit]
readsPrec :: Int -> ReadS CommentsForComparedCommit
$creadsPrec :: Int -> ReadS CommentsForComparedCommit
Prelude.Read, Int -> CommentsForComparedCommit -> ShowS
[CommentsForComparedCommit] -> ShowS
CommentsForComparedCommit -> String
(Int -> CommentsForComparedCommit -> ShowS)
-> (CommentsForComparedCommit -> String)
-> ([CommentsForComparedCommit] -> ShowS)
-> Show CommentsForComparedCommit
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CommentsForComparedCommit] -> ShowS
$cshowList :: [CommentsForComparedCommit] -> ShowS
show :: CommentsForComparedCommit -> String
$cshow :: CommentsForComparedCommit -> String
showsPrec :: Int -> CommentsForComparedCommit -> ShowS
$cshowsPrec :: Int -> CommentsForComparedCommit -> ShowS
Prelude.Show, (forall x.
CommentsForComparedCommit -> Rep CommentsForComparedCommit x)
-> (forall x.
Rep CommentsForComparedCommit x -> CommentsForComparedCommit)
-> Generic CommentsForComparedCommit
forall x.
Rep CommentsForComparedCommit x -> CommentsForComparedCommit
forall x.
CommentsForComparedCommit -> Rep CommentsForComparedCommit x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CommentsForComparedCommit x -> CommentsForComparedCommit
$cfrom :: forall x.
CommentsForComparedCommit -> Rep CommentsForComparedCommit x
Prelude.Generic)
newCommentsForComparedCommit ::
CommentsForComparedCommit
=
CommentsForComparedCommit' :: Maybe Text
-> Maybe Location
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Comment]
-> CommentsForComparedCommit
CommentsForComparedCommit'
{ $sel:beforeBlobId:CommentsForComparedCommit' :: Maybe Text
beforeBlobId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:location:CommentsForComparedCommit' :: Maybe Location
location = Maybe Location
forall a. Maybe a
Prelude.Nothing,
$sel:afterCommitId:CommentsForComparedCommit' :: Maybe Text
afterCommitId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:afterBlobId:CommentsForComparedCommit' :: Maybe Text
afterBlobId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:beforeCommitId:CommentsForComparedCommit' :: Maybe Text
beforeCommitId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:repositoryName:CommentsForComparedCommit' :: Maybe Text
repositoryName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:comments:CommentsForComparedCommit' :: Maybe [Comment]
comments = Maybe [Comment]
forall a. Maybe a
Prelude.Nothing
}
commentsForComparedCommit_beforeBlobId :: Lens.Lens' CommentsForComparedCommit (Prelude.Maybe Prelude.Text)
= (CommentsForComparedCommit -> Maybe Text)
-> (CommentsForComparedCommit
-> Maybe Text -> CommentsForComparedCommit)
-> Lens
CommentsForComparedCommit
CommentsForComparedCommit
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommentsForComparedCommit' {Maybe Text
beforeBlobId :: Maybe Text
$sel:beforeBlobId:CommentsForComparedCommit' :: CommentsForComparedCommit -> Maybe Text
beforeBlobId} -> Maybe Text
beforeBlobId) (\s :: CommentsForComparedCommit
s@CommentsForComparedCommit' {} Maybe Text
a -> CommentsForComparedCommit
s {$sel:beforeBlobId:CommentsForComparedCommit' :: Maybe Text
beforeBlobId = Maybe Text
a} :: CommentsForComparedCommit)
commentsForComparedCommit_location :: Lens.Lens' CommentsForComparedCommit (Prelude.Maybe Location)
= (CommentsForComparedCommit -> Maybe Location)
-> (CommentsForComparedCommit
-> Maybe Location -> CommentsForComparedCommit)
-> Lens
CommentsForComparedCommit
CommentsForComparedCommit
(Maybe Location)
(Maybe Location)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommentsForComparedCommit' {Maybe Location
location :: Maybe Location
$sel:location:CommentsForComparedCommit' :: CommentsForComparedCommit -> Maybe Location
location} -> Maybe Location
location) (\s :: CommentsForComparedCommit
s@CommentsForComparedCommit' {} Maybe Location
a -> CommentsForComparedCommit
s {$sel:location:CommentsForComparedCommit' :: Maybe Location
location = Maybe Location
a} :: CommentsForComparedCommit)
commentsForComparedCommit_afterCommitId :: Lens.Lens' CommentsForComparedCommit (Prelude.Maybe Prelude.Text)
= (CommentsForComparedCommit -> Maybe Text)
-> (CommentsForComparedCommit
-> Maybe Text -> CommentsForComparedCommit)
-> Lens
CommentsForComparedCommit
CommentsForComparedCommit
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommentsForComparedCommit' {Maybe Text
afterCommitId :: Maybe Text
$sel:afterCommitId:CommentsForComparedCommit' :: CommentsForComparedCommit -> Maybe Text
afterCommitId} -> Maybe Text
afterCommitId) (\s :: CommentsForComparedCommit
s@CommentsForComparedCommit' {} Maybe Text
a -> CommentsForComparedCommit
s {$sel:afterCommitId:CommentsForComparedCommit' :: Maybe Text
afterCommitId = Maybe Text
a} :: CommentsForComparedCommit)
commentsForComparedCommit_afterBlobId :: Lens.Lens' CommentsForComparedCommit (Prelude.Maybe Prelude.Text)
= (CommentsForComparedCommit -> Maybe Text)
-> (CommentsForComparedCommit
-> Maybe Text -> CommentsForComparedCommit)
-> Lens
CommentsForComparedCommit
CommentsForComparedCommit
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommentsForComparedCommit' {Maybe Text
afterBlobId :: Maybe Text
$sel:afterBlobId:CommentsForComparedCommit' :: CommentsForComparedCommit -> Maybe Text
afterBlobId} -> Maybe Text
afterBlobId) (\s :: CommentsForComparedCommit
s@CommentsForComparedCommit' {} Maybe Text
a -> CommentsForComparedCommit
s {$sel:afterBlobId:CommentsForComparedCommit' :: Maybe Text
afterBlobId = Maybe Text
a} :: CommentsForComparedCommit)
commentsForComparedCommit_beforeCommitId :: Lens.Lens' CommentsForComparedCommit (Prelude.Maybe Prelude.Text)
= (CommentsForComparedCommit -> Maybe Text)
-> (CommentsForComparedCommit
-> Maybe Text -> CommentsForComparedCommit)
-> Lens
CommentsForComparedCommit
CommentsForComparedCommit
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommentsForComparedCommit' {Maybe Text
beforeCommitId :: Maybe Text
$sel:beforeCommitId:CommentsForComparedCommit' :: CommentsForComparedCommit -> Maybe Text
beforeCommitId} -> Maybe Text
beforeCommitId) (\s :: CommentsForComparedCommit
s@CommentsForComparedCommit' {} Maybe Text
a -> CommentsForComparedCommit
s {$sel:beforeCommitId:CommentsForComparedCommit' :: Maybe Text
beforeCommitId = Maybe Text
a} :: CommentsForComparedCommit)
commentsForComparedCommit_repositoryName :: Lens.Lens' CommentsForComparedCommit (Prelude.Maybe Prelude.Text)
= (CommentsForComparedCommit -> Maybe Text)
-> (CommentsForComparedCommit
-> Maybe Text -> CommentsForComparedCommit)
-> Lens
CommentsForComparedCommit
CommentsForComparedCommit
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommentsForComparedCommit' {Maybe Text
repositoryName :: Maybe Text
$sel:repositoryName:CommentsForComparedCommit' :: CommentsForComparedCommit -> Maybe Text
repositoryName} -> Maybe Text
repositoryName) (\s :: CommentsForComparedCommit
s@CommentsForComparedCommit' {} Maybe Text
a -> CommentsForComparedCommit
s {$sel:repositoryName:CommentsForComparedCommit' :: Maybe Text
repositoryName = Maybe Text
a} :: CommentsForComparedCommit)
commentsForComparedCommit_comments :: Lens.Lens' CommentsForComparedCommit (Prelude.Maybe [Comment])
= (CommentsForComparedCommit -> Maybe [Comment])
-> (CommentsForComparedCommit
-> Maybe [Comment] -> CommentsForComparedCommit)
-> Lens
CommentsForComparedCommit
CommentsForComparedCommit
(Maybe [Comment])
(Maybe [Comment])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommentsForComparedCommit' {Maybe [Comment]
comments :: Maybe [Comment]
$sel:comments:CommentsForComparedCommit' :: CommentsForComparedCommit -> Maybe [Comment]
comments} -> Maybe [Comment]
comments) (\s :: CommentsForComparedCommit
s@CommentsForComparedCommit' {} Maybe [Comment]
a -> CommentsForComparedCommit
s {$sel:comments:CommentsForComparedCommit' :: Maybe [Comment]
comments = Maybe [Comment]
a} :: CommentsForComparedCommit) ((Maybe [Comment] -> f (Maybe [Comment]))
-> CommentsForComparedCommit -> f CommentsForComparedCommit)
-> ((Maybe [Comment] -> f (Maybe [Comment]))
-> Maybe [Comment] -> f (Maybe [Comment]))
-> (Maybe [Comment] -> f (Maybe [Comment]))
-> CommentsForComparedCommit
-> f CommentsForComparedCommit
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 CommentsForComparedCommit where
parseJSON :: Value -> Parser CommentsForComparedCommit
parseJSON =
String
-> (Object -> Parser CommentsForComparedCommit)
-> Value
-> Parser CommentsForComparedCommit
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CommentsForComparedCommit"
( \Object
x ->
Maybe Text
-> Maybe Location
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Comment]
-> CommentsForComparedCommit
CommentsForComparedCommit'
(Maybe Text
-> Maybe Location
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Comment]
-> CommentsForComparedCommit)
-> Parser (Maybe Text)
-> Parser
(Maybe Location
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Comment]
-> CommentsForComparedCommit)
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 [Comment]
-> CommentsForComparedCommit)
-> Parser (Maybe Location)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Comment]
-> CommentsForComparedCommit)
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 [Comment]
-> CommentsForComparedCommit)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Comment]
-> CommentsForComparedCommit)
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 [Comment]
-> CommentsForComparedCommit)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe [Comment] -> CommentsForComparedCommit)
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] -> CommentsForComparedCommit)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe [Comment] -> CommentsForComparedCommit)
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] -> CommentsForComparedCommit)
-> Parser (Maybe Text)
-> Parser (Maybe [Comment] -> CommentsForComparedCommit)
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] -> CommentsForComparedCommit)
-> Parser (Maybe [Comment]) -> Parser CommentsForComparedCommit
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 CommentsForComparedCommit
instance Prelude.NFData CommentsForComparedCommit