{-# 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.CodePipeline.Types.SourceRevision where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SourceRevision = SourceRevision'
{
SourceRevision -> Maybe Text
revisionSummary :: Prelude.Maybe Prelude.Text,
SourceRevision -> Maybe Text
revisionUrl :: Prelude.Maybe Prelude.Text,
SourceRevision -> Maybe Text
revisionId :: Prelude.Maybe Prelude.Text,
SourceRevision -> Text
actionName :: Prelude.Text
}
deriving (SourceRevision -> SourceRevision -> Bool
(SourceRevision -> SourceRevision -> Bool)
-> (SourceRevision -> SourceRevision -> Bool) -> Eq SourceRevision
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SourceRevision -> SourceRevision -> Bool
$c/= :: SourceRevision -> SourceRevision -> Bool
== :: SourceRevision -> SourceRevision -> Bool
$c== :: SourceRevision -> SourceRevision -> Bool
Prelude.Eq, ReadPrec [SourceRevision]
ReadPrec SourceRevision
Int -> ReadS SourceRevision
ReadS [SourceRevision]
(Int -> ReadS SourceRevision)
-> ReadS [SourceRevision]
-> ReadPrec SourceRevision
-> ReadPrec [SourceRevision]
-> Read SourceRevision
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SourceRevision]
$creadListPrec :: ReadPrec [SourceRevision]
readPrec :: ReadPrec SourceRevision
$creadPrec :: ReadPrec SourceRevision
readList :: ReadS [SourceRevision]
$creadList :: ReadS [SourceRevision]
readsPrec :: Int -> ReadS SourceRevision
$creadsPrec :: Int -> ReadS SourceRevision
Prelude.Read, Int -> SourceRevision -> ShowS
[SourceRevision] -> ShowS
SourceRevision -> String
(Int -> SourceRevision -> ShowS)
-> (SourceRevision -> String)
-> ([SourceRevision] -> ShowS)
-> Show SourceRevision
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SourceRevision] -> ShowS
$cshowList :: [SourceRevision] -> ShowS
show :: SourceRevision -> String
$cshow :: SourceRevision -> String
showsPrec :: Int -> SourceRevision -> ShowS
$cshowsPrec :: Int -> SourceRevision -> ShowS
Prelude.Show, (forall x. SourceRevision -> Rep SourceRevision x)
-> (forall x. Rep SourceRevision x -> SourceRevision)
-> Generic SourceRevision
forall x. Rep SourceRevision x -> SourceRevision
forall x. SourceRevision -> Rep SourceRevision x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SourceRevision x -> SourceRevision
$cfrom :: forall x. SourceRevision -> Rep SourceRevision x
Prelude.Generic)
newSourceRevision ::
Prelude.Text ->
SourceRevision
newSourceRevision :: Text -> SourceRevision
newSourceRevision Text
pActionName_ =
SourceRevision' :: Maybe Text -> Maybe Text -> Maybe Text -> Text -> SourceRevision
SourceRevision'
{ $sel:revisionSummary:SourceRevision' :: Maybe Text
revisionSummary = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:revisionUrl:SourceRevision' :: Maybe Text
revisionUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:revisionId:SourceRevision' :: Maybe Text
revisionId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:actionName:SourceRevision' :: Text
actionName = Text
pActionName_
}
sourceRevision_revisionSummary :: Lens.Lens' SourceRevision (Prelude.Maybe Prelude.Text)
sourceRevision_revisionSummary :: (Maybe Text -> f (Maybe Text))
-> SourceRevision -> f SourceRevision
sourceRevision_revisionSummary = (SourceRevision -> Maybe Text)
-> (SourceRevision -> Maybe Text -> SourceRevision)
-> Lens SourceRevision SourceRevision (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceRevision' {Maybe Text
revisionSummary :: Maybe Text
$sel:revisionSummary:SourceRevision' :: SourceRevision -> Maybe Text
revisionSummary} -> Maybe Text
revisionSummary) (\s :: SourceRevision
s@SourceRevision' {} Maybe Text
a -> SourceRevision
s {$sel:revisionSummary:SourceRevision' :: Maybe Text
revisionSummary = Maybe Text
a} :: SourceRevision)
sourceRevision_revisionUrl :: Lens.Lens' SourceRevision (Prelude.Maybe Prelude.Text)
sourceRevision_revisionUrl :: (Maybe Text -> f (Maybe Text))
-> SourceRevision -> f SourceRevision
sourceRevision_revisionUrl = (SourceRevision -> Maybe Text)
-> (SourceRevision -> Maybe Text -> SourceRevision)
-> Lens SourceRevision SourceRevision (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceRevision' {Maybe Text
revisionUrl :: Maybe Text
$sel:revisionUrl:SourceRevision' :: SourceRevision -> Maybe Text
revisionUrl} -> Maybe Text
revisionUrl) (\s :: SourceRevision
s@SourceRevision' {} Maybe Text
a -> SourceRevision
s {$sel:revisionUrl:SourceRevision' :: Maybe Text
revisionUrl = Maybe Text
a} :: SourceRevision)
sourceRevision_revisionId :: Lens.Lens' SourceRevision (Prelude.Maybe Prelude.Text)
sourceRevision_revisionId :: (Maybe Text -> f (Maybe Text))
-> SourceRevision -> f SourceRevision
sourceRevision_revisionId = (SourceRevision -> Maybe Text)
-> (SourceRevision -> Maybe Text -> SourceRevision)
-> Lens SourceRevision SourceRevision (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceRevision' {Maybe Text
revisionId :: Maybe Text
$sel:revisionId:SourceRevision' :: SourceRevision -> Maybe Text
revisionId} -> Maybe Text
revisionId) (\s :: SourceRevision
s@SourceRevision' {} Maybe Text
a -> SourceRevision
s {$sel:revisionId:SourceRevision' :: Maybe Text
revisionId = Maybe Text
a} :: SourceRevision)
sourceRevision_actionName :: Lens.Lens' SourceRevision Prelude.Text
sourceRevision_actionName :: (Text -> f Text) -> SourceRevision -> f SourceRevision
sourceRevision_actionName = (SourceRevision -> Text)
-> (SourceRevision -> Text -> SourceRevision)
-> Lens SourceRevision SourceRevision Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceRevision' {Text
actionName :: Text
$sel:actionName:SourceRevision' :: SourceRevision -> Text
actionName} -> Text
actionName) (\s :: SourceRevision
s@SourceRevision' {} Text
a -> SourceRevision
s {$sel:actionName:SourceRevision' :: Text
actionName = Text
a} :: SourceRevision)
instance Core.FromJSON SourceRevision where
parseJSON :: Value -> Parser SourceRevision
parseJSON =
String
-> (Object -> Parser SourceRevision)
-> Value
-> Parser SourceRevision
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SourceRevision"
( \Object
x ->
Maybe Text -> Maybe Text -> Maybe Text -> Text -> SourceRevision
SourceRevision'
(Maybe Text -> Maybe Text -> Maybe Text -> Text -> SourceRevision)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Text -> SourceRevision)
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
"revisionSummary")
Parser (Maybe Text -> Maybe Text -> Text -> SourceRevision)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Text -> SourceRevision)
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
"revisionUrl")
Parser (Maybe Text -> Text -> SourceRevision)
-> Parser (Maybe Text) -> Parser (Text -> SourceRevision)
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
"revisionId")
Parser (Text -> SourceRevision)
-> Parser Text -> Parser SourceRevision
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"actionName")
)
instance Prelude.Hashable SourceRevision
instance Prelude.NFData SourceRevision