{-# 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.StageExecution where
import Amazonka.CodePipeline.Types.StageExecutionStatus
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data StageExecution = StageExecution'
{
StageExecution -> Text
pipelineExecutionId :: Prelude.Text,
StageExecution -> StageExecutionStatus
status :: StageExecutionStatus
}
deriving (StageExecution -> StageExecution -> Bool
(StageExecution -> StageExecution -> Bool)
-> (StageExecution -> StageExecution -> Bool) -> Eq StageExecution
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StageExecution -> StageExecution -> Bool
$c/= :: StageExecution -> StageExecution -> Bool
== :: StageExecution -> StageExecution -> Bool
$c== :: StageExecution -> StageExecution -> Bool
Prelude.Eq, ReadPrec [StageExecution]
ReadPrec StageExecution
Int -> ReadS StageExecution
ReadS [StageExecution]
(Int -> ReadS StageExecution)
-> ReadS [StageExecution]
-> ReadPrec StageExecution
-> ReadPrec [StageExecution]
-> Read StageExecution
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StageExecution]
$creadListPrec :: ReadPrec [StageExecution]
readPrec :: ReadPrec StageExecution
$creadPrec :: ReadPrec StageExecution
readList :: ReadS [StageExecution]
$creadList :: ReadS [StageExecution]
readsPrec :: Int -> ReadS StageExecution
$creadsPrec :: Int -> ReadS StageExecution
Prelude.Read, Int -> StageExecution -> ShowS
[StageExecution] -> ShowS
StageExecution -> String
(Int -> StageExecution -> ShowS)
-> (StageExecution -> String)
-> ([StageExecution] -> ShowS)
-> Show StageExecution
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StageExecution] -> ShowS
$cshowList :: [StageExecution] -> ShowS
show :: StageExecution -> String
$cshow :: StageExecution -> String
showsPrec :: Int -> StageExecution -> ShowS
$cshowsPrec :: Int -> StageExecution -> ShowS
Prelude.Show, (forall x. StageExecution -> Rep StageExecution x)
-> (forall x. Rep StageExecution x -> StageExecution)
-> Generic StageExecution
forall x. Rep StageExecution x -> StageExecution
forall x. StageExecution -> Rep StageExecution x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StageExecution x -> StageExecution
$cfrom :: forall x. StageExecution -> Rep StageExecution x
Prelude.Generic)
newStageExecution ::
Prelude.Text ->
StageExecutionStatus ->
StageExecution
newStageExecution :: Text -> StageExecutionStatus -> StageExecution
newStageExecution Text
pPipelineExecutionId_ StageExecutionStatus
pStatus_ =
StageExecution' :: Text -> StageExecutionStatus -> StageExecution
StageExecution'
{ $sel:pipelineExecutionId:StageExecution' :: Text
pipelineExecutionId =
Text
pPipelineExecutionId_,
$sel:status:StageExecution' :: StageExecutionStatus
status = StageExecutionStatus
pStatus_
}
stageExecution_pipelineExecutionId :: Lens.Lens' StageExecution Prelude.Text
stageExecution_pipelineExecutionId :: (Text -> f Text) -> StageExecution -> f StageExecution
stageExecution_pipelineExecutionId = (StageExecution -> Text)
-> (StageExecution -> Text -> StageExecution)
-> Lens StageExecution StageExecution Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StageExecution' {Text
pipelineExecutionId :: Text
$sel:pipelineExecutionId:StageExecution' :: StageExecution -> Text
pipelineExecutionId} -> Text
pipelineExecutionId) (\s :: StageExecution
s@StageExecution' {} Text
a -> StageExecution
s {$sel:pipelineExecutionId:StageExecution' :: Text
pipelineExecutionId = Text
a} :: StageExecution)
stageExecution_status :: Lens.Lens' StageExecution StageExecutionStatus
stageExecution_status :: (StageExecutionStatus -> f StageExecutionStatus)
-> StageExecution -> f StageExecution
stageExecution_status = (StageExecution -> StageExecutionStatus)
-> (StageExecution -> StageExecutionStatus -> StageExecution)
-> Lens
StageExecution
StageExecution
StageExecutionStatus
StageExecutionStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StageExecution' {StageExecutionStatus
status :: StageExecutionStatus
$sel:status:StageExecution' :: StageExecution -> StageExecutionStatus
status} -> StageExecutionStatus
status) (\s :: StageExecution
s@StageExecution' {} StageExecutionStatus
a -> StageExecution
s {$sel:status:StageExecution' :: StageExecutionStatus
status = StageExecutionStatus
a} :: StageExecution)
instance Core.FromJSON StageExecution where
parseJSON :: Value -> Parser StageExecution
parseJSON =
String
-> (Object -> Parser StageExecution)
-> Value
-> Parser StageExecution
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"StageExecution"
( \Object
x ->
Text -> StageExecutionStatus -> StageExecution
StageExecution'
(Text -> StageExecutionStatus -> StageExecution)
-> Parser Text -> Parser (StageExecutionStatus -> StageExecution)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"pipelineExecutionId")
Parser (StageExecutionStatus -> StageExecution)
-> Parser StageExecutionStatus -> Parser StageExecution
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser StageExecutionStatus
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"status")
)
instance Prelude.Hashable StageExecution
instance Prelude.NFData StageExecution