{-# 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.PullRequestCreatedEventMetadata where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data PullRequestCreatedEventMetadata = PullRequestCreatedEventMetadata'
{
PullRequestCreatedEventMetadata -> Maybe Text
destinationCommitId :: Prelude.Maybe Prelude.Text,
PullRequestCreatedEventMetadata -> Maybe Text
mergeBase :: Prelude.Maybe Prelude.Text,
PullRequestCreatedEventMetadata -> Maybe Text
repositoryName :: Prelude.Maybe Prelude.Text,
PullRequestCreatedEventMetadata -> Maybe Text
sourceCommitId :: Prelude.Maybe Prelude.Text
}
deriving (PullRequestCreatedEventMetadata
-> PullRequestCreatedEventMetadata -> Bool
(PullRequestCreatedEventMetadata
-> PullRequestCreatedEventMetadata -> Bool)
-> (PullRequestCreatedEventMetadata
-> PullRequestCreatedEventMetadata -> Bool)
-> Eq PullRequestCreatedEventMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PullRequestCreatedEventMetadata
-> PullRequestCreatedEventMetadata -> Bool
$c/= :: PullRequestCreatedEventMetadata
-> PullRequestCreatedEventMetadata -> Bool
== :: PullRequestCreatedEventMetadata
-> PullRequestCreatedEventMetadata -> Bool
$c== :: PullRequestCreatedEventMetadata
-> PullRequestCreatedEventMetadata -> Bool
Prelude.Eq, ReadPrec [PullRequestCreatedEventMetadata]
ReadPrec PullRequestCreatedEventMetadata
Int -> ReadS PullRequestCreatedEventMetadata
ReadS [PullRequestCreatedEventMetadata]
(Int -> ReadS PullRequestCreatedEventMetadata)
-> ReadS [PullRequestCreatedEventMetadata]
-> ReadPrec PullRequestCreatedEventMetadata
-> ReadPrec [PullRequestCreatedEventMetadata]
-> Read PullRequestCreatedEventMetadata
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PullRequestCreatedEventMetadata]
$creadListPrec :: ReadPrec [PullRequestCreatedEventMetadata]
readPrec :: ReadPrec PullRequestCreatedEventMetadata
$creadPrec :: ReadPrec PullRequestCreatedEventMetadata
readList :: ReadS [PullRequestCreatedEventMetadata]
$creadList :: ReadS [PullRequestCreatedEventMetadata]
readsPrec :: Int -> ReadS PullRequestCreatedEventMetadata
$creadsPrec :: Int -> ReadS PullRequestCreatedEventMetadata
Prelude.Read, Int -> PullRequestCreatedEventMetadata -> ShowS
[PullRequestCreatedEventMetadata] -> ShowS
PullRequestCreatedEventMetadata -> String
(Int -> PullRequestCreatedEventMetadata -> ShowS)
-> (PullRequestCreatedEventMetadata -> String)
-> ([PullRequestCreatedEventMetadata] -> ShowS)
-> Show PullRequestCreatedEventMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PullRequestCreatedEventMetadata] -> ShowS
$cshowList :: [PullRequestCreatedEventMetadata] -> ShowS
show :: PullRequestCreatedEventMetadata -> String
$cshow :: PullRequestCreatedEventMetadata -> String
showsPrec :: Int -> PullRequestCreatedEventMetadata -> ShowS
$cshowsPrec :: Int -> PullRequestCreatedEventMetadata -> ShowS
Prelude.Show, (forall x.
PullRequestCreatedEventMetadata
-> Rep PullRequestCreatedEventMetadata x)
-> (forall x.
Rep PullRequestCreatedEventMetadata x
-> PullRequestCreatedEventMetadata)
-> Generic PullRequestCreatedEventMetadata
forall x.
Rep PullRequestCreatedEventMetadata x
-> PullRequestCreatedEventMetadata
forall x.
PullRequestCreatedEventMetadata
-> Rep PullRequestCreatedEventMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PullRequestCreatedEventMetadata x
-> PullRequestCreatedEventMetadata
$cfrom :: forall x.
PullRequestCreatedEventMetadata
-> Rep PullRequestCreatedEventMetadata x
Prelude.Generic)
newPullRequestCreatedEventMetadata ::
PullRequestCreatedEventMetadata
newPullRequestCreatedEventMetadata :: PullRequestCreatedEventMetadata
newPullRequestCreatedEventMetadata =
PullRequestCreatedEventMetadata' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PullRequestCreatedEventMetadata
PullRequestCreatedEventMetadata'
{ $sel:destinationCommitId:PullRequestCreatedEventMetadata' :: Maybe Text
destinationCommitId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:mergeBase:PullRequestCreatedEventMetadata' :: Maybe Text
mergeBase = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:repositoryName:PullRequestCreatedEventMetadata' :: Maybe Text
repositoryName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:sourceCommitId:PullRequestCreatedEventMetadata' :: Maybe Text
sourceCommitId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
pullRequestCreatedEventMetadata_destinationCommitId :: Lens.Lens' PullRequestCreatedEventMetadata (Prelude.Maybe Prelude.Text)
pullRequestCreatedEventMetadata_destinationCommitId :: (Maybe Text -> f (Maybe Text))
-> PullRequestCreatedEventMetadata
-> f PullRequestCreatedEventMetadata
pullRequestCreatedEventMetadata_destinationCommitId = (PullRequestCreatedEventMetadata -> Maybe Text)
-> (PullRequestCreatedEventMetadata
-> Maybe Text -> PullRequestCreatedEventMetadata)
-> Lens
PullRequestCreatedEventMetadata
PullRequestCreatedEventMetadata
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PullRequestCreatedEventMetadata' {Maybe Text
destinationCommitId :: Maybe Text
$sel:destinationCommitId:PullRequestCreatedEventMetadata' :: PullRequestCreatedEventMetadata -> Maybe Text
destinationCommitId} -> Maybe Text
destinationCommitId) (\s :: PullRequestCreatedEventMetadata
s@PullRequestCreatedEventMetadata' {} Maybe Text
a -> PullRequestCreatedEventMetadata
s {$sel:destinationCommitId:PullRequestCreatedEventMetadata' :: Maybe Text
destinationCommitId = Maybe Text
a} :: PullRequestCreatedEventMetadata)
pullRequestCreatedEventMetadata_mergeBase :: Lens.Lens' PullRequestCreatedEventMetadata (Prelude.Maybe Prelude.Text)
pullRequestCreatedEventMetadata_mergeBase :: (Maybe Text -> f (Maybe Text))
-> PullRequestCreatedEventMetadata
-> f PullRequestCreatedEventMetadata
pullRequestCreatedEventMetadata_mergeBase = (PullRequestCreatedEventMetadata -> Maybe Text)
-> (PullRequestCreatedEventMetadata
-> Maybe Text -> PullRequestCreatedEventMetadata)
-> Lens
PullRequestCreatedEventMetadata
PullRequestCreatedEventMetadata
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PullRequestCreatedEventMetadata' {Maybe Text
mergeBase :: Maybe Text
$sel:mergeBase:PullRequestCreatedEventMetadata' :: PullRequestCreatedEventMetadata -> Maybe Text
mergeBase} -> Maybe Text
mergeBase) (\s :: PullRequestCreatedEventMetadata
s@PullRequestCreatedEventMetadata' {} Maybe Text
a -> PullRequestCreatedEventMetadata
s {$sel:mergeBase:PullRequestCreatedEventMetadata' :: Maybe Text
mergeBase = Maybe Text
a} :: PullRequestCreatedEventMetadata)
pullRequestCreatedEventMetadata_repositoryName :: Lens.Lens' PullRequestCreatedEventMetadata (Prelude.Maybe Prelude.Text)
pullRequestCreatedEventMetadata_repositoryName :: (Maybe Text -> f (Maybe Text))
-> PullRequestCreatedEventMetadata
-> f PullRequestCreatedEventMetadata
pullRequestCreatedEventMetadata_repositoryName = (PullRequestCreatedEventMetadata -> Maybe Text)
-> (PullRequestCreatedEventMetadata
-> Maybe Text -> PullRequestCreatedEventMetadata)
-> Lens
PullRequestCreatedEventMetadata
PullRequestCreatedEventMetadata
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PullRequestCreatedEventMetadata' {Maybe Text
repositoryName :: Maybe Text
$sel:repositoryName:PullRequestCreatedEventMetadata' :: PullRequestCreatedEventMetadata -> Maybe Text
repositoryName} -> Maybe Text
repositoryName) (\s :: PullRequestCreatedEventMetadata
s@PullRequestCreatedEventMetadata' {} Maybe Text
a -> PullRequestCreatedEventMetadata
s {$sel:repositoryName:PullRequestCreatedEventMetadata' :: Maybe Text
repositoryName = Maybe Text
a} :: PullRequestCreatedEventMetadata)
pullRequestCreatedEventMetadata_sourceCommitId :: Lens.Lens' PullRequestCreatedEventMetadata (Prelude.Maybe Prelude.Text)
pullRequestCreatedEventMetadata_sourceCommitId :: (Maybe Text -> f (Maybe Text))
-> PullRequestCreatedEventMetadata
-> f PullRequestCreatedEventMetadata
pullRequestCreatedEventMetadata_sourceCommitId = (PullRequestCreatedEventMetadata -> Maybe Text)
-> (PullRequestCreatedEventMetadata
-> Maybe Text -> PullRequestCreatedEventMetadata)
-> Lens
PullRequestCreatedEventMetadata
PullRequestCreatedEventMetadata
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PullRequestCreatedEventMetadata' {Maybe Text
sourceCommitId :: Maybe Text
$sel:sourceCommitId:PullRequestCreatedEventMetadata' :: PullRequestCreatedEventMetadata -> Maybe Text
sourceCommitId} -> Maybe Text
sourceCommitId) (\s :: PullRequestCreatedEventMetadata
s@PullRequestCreatedEventMetadata' {} Maybe Text
a -> PullRequestCreatedEventMetadata
s {$sel:sourceCommitId:PullRequestCreatedEventMetadata' :: Maybe Text
sourceCommitId = Maybe Text
a} :: PullRequestCreatedEventMetadata)
instance
Core.FromJSON
PullRequestCreatedEventMetadata
where
parseJSON :: Value -> Parser PullRequestCreatedEventMetadata
parseJSON =
String
-> (Object -> Parser PullRequestCreatedEventMetadata)
-> Value
-> Parser PullRequestCreatedEventMetadata
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"PullRequestCreatedEventMetadata"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PullRequestCreatedEventMetadata
PullRequestCreatedEventMetadata'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PullRequestCreatedEventMetadata)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> PullRequestCreatedEventMetadata)
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
"destinationCommitId")
Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> PullRequestCreatedEventMetadata)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe Text -> PullRequestCreatedEventMetadata)
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
"mergeBase")
Parser
(Maybe Text -> Maybe Text -> PullRequestCreatedEventMetadata)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> PullRequestCreatedEventMetadata)
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 Text -> PullRequestCreatedEventMetadata)
-> Parser (Maybe Text) -> Parser PullRequestCreatedEventMetadata
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
"sourceCommitId")
)
instance
Prelude.Hashable
PullRequestCreatedEventMetadata
instance
Prelude.NFData
PullRequestCreatedEventMetadata