{-# 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.PullRequestTarget where
import Amazonka.CodeCommit.Types.MergeMetadata
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data PullRequestTarget = PullRequestTarget'
{
PullRequestTarget -> Maybe Text
sourceCommit :: Prelude.Maybe Prelude.Text,
PullRequestTarget -> Maybe Text
destinationReference :: Prelude.Maybe Prelude.Text,
PullRequestTarget -> Maybe MergeMetadata
mergeMetadata :: Prelude.Maybe MergeMetadata,
PullRequestTarget -> Maybe Text
mergeBase :: Prelude.Maybe Prelude.Text,
PullRequestTarget -> Maybe Text
destinationCommit :: Prelude.Maybe Prelude.Text,
PullRequestTarget -> Maybe Text
repositoryName :: Prelude.Maybe Prelude.Text,
PullRequestTarget -> Maybe Text
sourceReference :: Prelude.Maybe Prelude.Text
}
deriving (PullRequestTarget -> PullRequestTarget -> Bool
(PullRequestTarget -> PullRequestTarget -> Bool)
-> (PullRequestTarget -> PullRequestTarget -> Bool)
-> Eq PullRequestTarget
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PullRequestTarget -> PullRequestTarget -> Bool
$c/= :: PullRequestTarget -> PullRequestTarget -> Bool
== :: PullRequestTarget -> PullRequestTarget -> Bool
$c== :: PullRequestTarget -> PullRequestTarget -> Bool
Prelude.Eq, ReadPrec [PullRequestTarget]
ReadPrec PullRequestTarget
Int -> ReadS PullRequestTarget
ReadS [PullRequestTarget]
(Int -> ReadS PullRequestTarget)
-> ReadS [PullRequestTarget]
-> ReadPrec PullRequestTarget
-> ReadPrec [PullRequestTarget]
-> Read PullRequestTarget
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PullRequestTarget]
$creadListPrec :: ReadPrec [PullRequestTarget]
readPrec :: ReadPrec PullRequestTarget
$creadPrec :: ReadPrec PullRequestTarget
readList :: ReadS [PullRequestTarget]
$creadList :: ReadS [PullRequestTarget]
readsPrec :: Int -> ReadS PullRequestTarget
$creadsPrec :: Int -> ReadS PullRequestTarget
Prelude.Read, Int -> PullRequestTarget -> ShowS
[PullRequestTarget] -> ShowS
PullRequestTarget -> String
(Int -> PullRequestTarget -> ShowS)
-> (PullRequestTarget -> String)
-> ([PullRequestTarget] -> ShowS)
-> Show PullRequestTarget
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PullRequestTarget] -> ShowS
$cshowList :: [PullRequestTarget] -> ShowS
show :: PullRequestTarget -> String
$cshow :: PullRequestTarget -> String
showsPrec :: Int -> PullRequestTarget -> ShowS
$cshowsPrec :: Int -> PullRequestTarget -> ShowS
Prelude.Show, (forall x. PullRequestTarget -> Rep PullRequestTarget x)
-> (forall x. Rep PullRequestTarget x -> PullRequestTarget)
-> Generic PullRequestTarget
forall x. Rep PullRequestTarget x -> PullRequestTarget
forall x. PullRequestTarget -> Rep PullRequestTarget x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PullRequestTarget x -> PullRequestTarget
$cfrom :: forall x. PullRequestTarget -> Rep PullRequestTarget x
Prelude.Generic)
newPullRequestTarget ::
PullRequestTarget
newPullRequestTarget :: PullRequestTarget
newPullRequestTarget =
PullRequestTarget' :: Maybe Text
-> Maybe Text
-> Maybe MergeMetadata
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PullRequestTarget
PullRequestTarget'
{ $sel:sourceCommit:PullRequestTarget' :: Maybe Text
sourceCommit = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:destinationReference:PullRequestTarget' :: Maybe Text
destinationReference = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:mergeMetadata:PullRequestTarget' :: Maybe MergeMetadata
mergeMetadata = Maybe MergeMetadata
forall a. Maybe a
Prelude.Nothing,
$sel:mergeBase:PullRequestTarget' :: Maybe Text
mergeBase = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:destinationCommit:PullRequestTarget' :: Maybe Text
destinationCommit = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:repositoryName:PullRequestTarget' :: Maybe Text
repositoryName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:sourceReference:PullRequestTarget' :: Maybe Text
sourceReference = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
pullRequestTarget_sourceCommit :: Lens.Lens' PullRequestTarget (Prelude.Maybe Prelude.Text)
pullRequestTarget_sourceCommit :: (Maybe Text -> f (Maybe Text))
-> PullRequestTarget -> f PullRequestTarget
pullRequestTarget_sourceCommit = (PullRequestTarget -> Maybe Text)
-> (PullRequestTarget -> Maybe Text -> PullRequestTarget)
-> Lens
PullRequestTarget PullRequestTarget (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PullRequestTarget' {Maybe Text
sourceCommit :: Maybe Text
$sel:sourceCommit:PullRequestTarget' :: PullRequestTarget -> Maybe Text
sourceCommit} -> Maybe Text
sourceCommit) (\s :: PullRequestTarget
s@PullRequestTarget' {} Maybe Text
a -> PullRequestTarget
s {$sel:sourceCommit:PullRequestTarget' :: Maybe Text
sourceCommit = Maybe Text
a} :: PullRequestTarget)
pullRequestTarget_destinationReference :: Lens.Lens' PullRequestTarget (Prelude.Maybe Prelude.Text)
pullRequestTarget_destinationReference :: (Maybe Text -> f (Maybe Text))
-> PullRequestTarget -> f PullRequestTarget
pullRequestTarget_destinationReference = (PullRequestTarget -> Maybe Text)
-> (PullRequestTarget -> Maybe Text -> PullRequestTarget)
-> Lens
PullRequestTarget PullRequestTarget (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PullRequestTarget' {Maybe Text
destinationReference :: Maybe Text
$sel:destinationReference:PullRequestTarget' :: PullRequestTarget -> Maybe Text
destinationReference} -> Maybe Text
destinationReference) (\s :: PullRequestTarget
s@PullRequestTarget' {} Maybe Text
a -> PullRequestTarget
s {$sel:destinationReference:PullRequestTarget' :: Maybe Text
destinationReference = Maybe Text
a} :: PullRequestTarget)
pullRequestTarget_mergeMetadata :: Lens.Lens' PullRequestTarget (Prelude.Maybe MergeMetadata)
pullRequestTarget_mergeMetadata :: (Maybe MergeMetadata -> f (Maybe MergeMetadata))
-> PullRequestTarget -> f PullRequestTarget
pullRequestTarget_mergeMetadata = (PullRequestTarget -> Maybe MergeMetadata)
-> (PullRequestTarget -> Maybe MergeMetadata -> PullRequestTarget)
-> Lens
PullRequestTarget
PullRequestTarget
(Maybe MergeMetadata)
(Maybe MergeMetadata)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PullRequestTarget' {Maybe MergeMetadata
mergeMetadata :: Maybe MergeMetadata
$sel:mergeMetadata:PullRequestTarget' :: PullRequestTarget -> Maybe MergeMetadata
mergeMetadata} -> Maybe MergeMetadata
mergeMetadata) (\s :: PullRequestTarget
s@PullRequestTarget' {} Maybe MergeMetadata
a -> PullRequestTarget
s {$sel:mergeMetadata:PullRequestTarget' :: Maybe MergeMetadata
mergeMetadata = Maybe MergeMetadata
a} :: PullRequestTarget)
pullRequestTarget_mergeBase :: Lens.Lens' PullRequestTarget (Prelude.Maybe Prelude.Text)
pullRequestTarget_mergeBase :: (Maybe Text -> f (Maybe Text))
-> PullRequestTarget -> f PullRequestTarget
pullRequestTarget_mergeBase = (PullRequestTarget -> Maybe Text)
-> (PullRequestTarget -> Maybe Text -> PullRequestTarget)
-> Lens
PullRequestTarget PullRequestTarget (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PullRequestTarget' {Maybe Text
mergeBase :: Maybe Text
$sel:mergeBase:PullRequestTarget' :: PullRequestTarget -> Maybe Text
mergeBase} -> Maybe Text
mergeBase) (\s :: PullRequestTarget
s@PullRequestTarget' {} Maybe Text
a -> PullRequestTarget
s {$sel:mergeBase:PullRequestTarget' :: Maybe Text
mergeBase = Maybe Text
a} :: PullRequestTarget)
pullRequestTarget_destinationCommit :: Lens.Lens' PullRequestTarget (Prelude.Maybe Prelude.Text)
pullRequestTarget_destinationCommit :: (Maybe Text -> f (Maybe Text))
-> PullRequestTarget -> f PullRequestTarget
pullRequestTarget_destinationCommit = (PullRequestTarget -> Maybe Text)
-> (PullRequestTarget -> Maybe Text -> PullRequestTarget)
-> Lens
PullRequestTarget PullRequestTarget (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PullRequestTarget' {Maybe Text
destinationCommit :: Maybe Text
$sel:destinationCommit:PullRequestTarget' :: PullRequestTarget -> Maybe Text
destinationCommit} -> Maybe Text
destinationCommit) (\s :: PullRequestTarget
s@PullRequestTarget' {} Maybe Text
a -> PullRequestTarget
s {$sel:destinationCommit:PullRequestTarget' :: Maybe Text
destinationCommit = Maybe Text
a} :: PullRequestTarget)
pullRequestTarget_repositoryName :: Lens.Lens' PullRequestTarget (Prelude.Maybe Prelude.Text)
pullRequestTarget_repositoryName :: (Maybe Text -> f (Maybe Text))
-> PullRequestTarget -> f PullRequestTarget
pullRequestTarget_repositoryName = (PullRequestTarget -> Maybe Text)
-> (PullRequestTarget -> Maybe Text -> PullRequestTarget)
-> Lens
PullRequestTarget PullRequestTarget (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PullRequestTarget' {Maybe Text
repositoryName :: Maybe Text
$sel:repositoryName:PullRequestTarget' :: PullRequestTarget -> Maybe Text
repositoryName} -> Maybe Text
repositoryName) (\s :: PullRequestTarget
s@PullRequestTarget' {} Maybe Text
a -> PullRequestTarget
s {$sel:repositoryName:PullRequestTarget' :: Maybe Text
repositoryName = Maybe Text
a} :: PullRequestTarget)
pullRequestTarget_sourceReference :: Lens.Lens' PullRequestTarget (Prelude.Maybe Prelude.Text)
pullRequestTarget_sourceReference :: (Maybe Text -> f (Maybe Text))
-> PullRequestTarget -> f PullRequestTarget
pullRequestTarget_sourceReference = (PullRequestTarget -> Maybe Text)
-> (PullRequestTarget -> Maybe Text -> PullRequestTarget)
-> Lens
PullRequestTarget PullRequestTarget (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PullRequestTarget' {Maybe Text
sourceReference :: Maybe Text
$sel:sourceReference:PullRequestTarget' :: PullRequestTarget -> Maybe Text
sourceReference} -> Maybe Text
sourceReference) (\s :: PullRequestTarget
s@PullRequestTarget' {} Maybe Text
a -> PullRequestTarget
s {$sel:sourceReference:PullRequestTarget' :: Maybe Text
sourceReference = Maybe Text
a} :: PullRequestTarget)
instance Core.FromJSON PullRequestTarget where
parseJSON :: Value -> Parser PullRequestTarget
parseJSON =
String
-> (Object -> Parser PullRequestTarget)
-> Value
-> Parser PullRequestTarget
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"PullRequestTarget"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe MergeMetadata
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PullRequestTarget
PullRequestTarget'
(Maybe Text
-> Maybe Text
-> Maybe MergeMetadata
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PullRequestTarget)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe MergeMetadata
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PullRequestTarget)
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
"sourceCommit")
Parser
(Maybe Text
-> Maybe MergeMetadata
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PullRequestTarget)
-> Parser (Maybe Text)
-> Parser
(Maybe MergeMetadata
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PullRequestTarget)
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
"destinationReference")
Parser
(Maybe MergeMetadata
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PullRequestTarget)
-> Parser (Maybe MergeMetadata)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> PullRequestTarget)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe MergeMetadata)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"mergeMetadata")
Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> PullRequestTarget)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe Text -> Maybe Text -> PullRequestTarget)
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 -> Maybe Text -> PullRequestTarget)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> PullRequestTarget)
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
"destinationCommit")
Parser (Maybe Text -> Maybe Text -> PullRequestTarget)
-> Parser (Maybe Text) -> Parser (Maybe Text -> PullRequestTarget)
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 -> PullRequestTarget)
-> Parser (Maybe Text) -> Parser PullRequestTarget
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
"sourceReference")
)
instance Prelude.Hashable PullRequestTarget
instance Prelude.NFData PullRequestTarget