{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data SourceRevision = SourceRevision'
{
SourceRevision -> Maybe Text
revisionId :: Prelude.Maybe Prelude.Text,
SourceRevision -> Maybe Text
revisionSummary :: Prelude.Maybe Prelude.Text,
SourceRevision -> Maybe Text
revisionUrl :: Prelude.Maybe Prelude.Text,
SourceRevision -> Text
actionName :: Prelude.Text
}
deriving (SourceRevision -> SourceRevision -> Bool
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]
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
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. 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'
{ $sel:revisionId:SourceRevision' :: Maybe Text
revisionId = forall a. Maybe a
Prelude.Nothing,
$sel:revisionSummary:SourceRevision' :: Maybe Text
revisionSummary = forall a. Maybe a
Prelude.Nothing,
$sel:revisionUrl:SourceRevision' :: Maybe Text
revisionUrl = forall a. Maybe a
Prelude.Nothing,
$sel:actionName:SourceRevision' :: Text
actionName = Text
pActionName_
}
sourceRevision_revisionId :: Lens.Lens' SourceRevision (Prelude.Maybe Prelude.Text)
sourceRevision_revisionId :: Lens' SourceRevision (Maybe Text)
sourceRevision_revisionId = 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_revisionSummary :: Lens.Lens' SourceRevision (Prelude.Maybe Prelude.Text)
sourceRevision_revisionSummary :: Lens' SourceRevision (Maybe Text)
sourceRevision_revisionSummary = 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 :: Lens' SourceRevision (Maybe Text)
sourceRevision_revisionUrl = 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_actionName :: Lens.Lens' SourceRevision Prelude.Text
sourceRevision_actionName :: Lens' SourceRevision Text
sourceRevision_actionName = 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 Data.FromJSON SourceRevision where
parseJSON :: Value -> Parser SourceRevision
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"SourceRevision"
( \Object
x ->
Maybe Text -> Maybe Text -> Maybe Text -> Text -> SourceRevision
SourceRevision'
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
"revisionId")
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
"revisionSummary")
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
"revisionUrl")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"actionName")
)
instance Prelude.Hashable SourceRevision where
hashWithSalt :: Int -> SourceRevision -> Int
hashWithSalt Int
_salt SourceRevision' {Maybe Text
Text
actionName :: Text
revisionUrl :: Maybe Text
revisionSummary :: Maybe Text
revisionId :: Maybe Text
$sel:actionName:SourceRevision' :: SourceRevision -> Text
$sel:revisionUrl:SourceRevision' :: SourceRevision -> Maybe Text
$sel:revisionSummary:SourceRevision' :: SourceRevision -> Maybe Text
$sel:revisionId:SourceRevision' :: SourceRevision -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
revisionId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
revisionSummary
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
revisionUrl
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
actionName
instance Prelude.NFData SourceRevision where
rnf :: SourceRevision -> ()
rnf SourceRevision' {Maybe Text
Text
actionName :: Text
revisionUrl :: Maybe Text
revisionSummary :: Maybe Text
revisionId :: Maybe Text
$sel:actionName:SourceRevision' :: SourceRevision -> Text
$sel:revisionUrl:SourceRevision' :: SourceRevision -> Maybe Text
$sel:revisionSummary:SourceRevision' :: SourceRevision -> Maybe Text
$sel:revisionId:SourceRevision' :: SourceRevision -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
revisionId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
revisionSummary
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
revisionUrl
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
actionName