{-# 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.PipelineContext where
import Amazonka.CodePipeline.Types.ActionContext
import Amazonka.CodePipeline.Types.StageContext
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data PipelineContext = PipelineContext'
{
PipelineContext -> Maybe StageContext
stage :: Prelude.Maybe StageContext,
PipelineContext -> Maybe Text
pipelineName :: Prelude.Maybe Prelude.Text,
PipelineContext -> Maybe ActionContext
action :: Prelude.Maybe ActionContext,
PipelineContext -> Maybe Text
pipelineArn :: Prelude.Maybe Prelude.Text,
PipelineContext -> Maybe Text
pipelineExecutionId :: Prelude.Maybe Prelude.Text
}
deriving (PipelineContext -> PipelineContext -> Bool
(PipelineContext -> PipelineContext -> Bool)
-> (PipelineContext -> PipelineContext -> Bool)
-> Eq PipelineContext
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PipelineContext -> PipelineContext -> Bool
$c/= :: PipelineContext -> PipelineContext -> Bool
== :: PipelineContext -> PipelineContext -> Bool
$c== :: PipelineContext -> PipelineContext -> Bool
Prelude.Eq, ReadPrec [PipelineContext]
ReadPrec PipelineContext
Int -> ReadS PipelineContext
ReadS [PipelineContext]
(Int -> ReadS PipelineContext)
-> ReadS [PipelineContext]
-> ReadPrec PipelineContext
-> ReadPrec [PipelineContext]
-> Read PipelineContext
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PipelineContext]
$creadListPrec :: ReadPrec [PipelineContext]
readPrec :: ReadPrec PipelineContext
$creadPrec :: ReadPrec PipelineContext
readList :: ReadS [PipelineContext]
$creadList :: ReadS [PipelineContext]
readsPrec :: Int -> ReadS PipelineContext
$creadsPrec :: Int -> ReadS PipelineContext
Prelude.Read, Int -> PipelineContext -> ShowS
[PipelineContext] -> ShowS
PipelineContext -> String
(Int -> PipelineContext -> ShowS)
-> (PipelineContext -> String)
-> ([PipelineContext] -> ShowS)
-> Show PipelineContext
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PipelineContext] -> ShowS
$cshowList :: [PipelineContext] -> ShowS
show :: PipelineContext -> String
$cshow :: PipelineContext -> String
showsPrec :: Int -> PipelineContext -> ShowS
$cshowsPrec :: Int -> PipelineContext -> ShowS
Prelude.Show, (forall x. PipelineContext -> Rep PipelineContext x)
-> (forall x. Rep PipelineContext x -> PipelineContext)
-> Generic PipelineContext
forall x. Rep PipelineContext x -> PipelineContext
forall x. PipelineContext -> Rep PipelineContext x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PipelineContext x -> PipelineContext
$cfrom :: forall x. PipelineContext -> Rep PipelineContext x
Prelude.Generic)
newPipelineContext ::
PipelineContext
newPipelineContext :: PipelineContext
newPipelineContext =
PipelineContext' :: Maybe StageContext
-> Maybe Text
-> Maybe ActionContext
-> Maybe Text
-> Maybe Text
-> PipelineContext
PipelineContext'
{ $sel:stage:PipelineContext' :: Maybe StageContext
stage = Maybe StageContext
forall a. Maybe a
Prelude.Nothing,
$sel:pipelineName:PipelineContext' :: Maybe Text
pipelineName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:action:PipelineContext' :: Maybe ActionContext
action = Maybe ActionContext
forall a. Maybe a
Prelude.Nothing,
$sel:pipelineArn:PipelineContext' :: Maybe Text
pipelineArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:pipelineExecutionId:PipelineContext' :: Maybe Text
pipelineExecutionId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
pipelineContext_stage :: Lens.Lens' PipelineContext (Prelude.Maybe StageContext)
pipelineContext_stage :: (Maybe StageContext -> f (Maybe StageContext))
-> PipelineContext -> f PipelineContext
pipelineContext_stage = (PipelineContext -> Maybe StageContext)
-> (PipelineContext -> Maybe StageContext -> PipelineContext)
-> Lens
PipelineContext
PipelineContext
(Maybe StageContext)
(Maybe StageContext)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PipelineContext' {Maybe StageContext
stage :: Maybe StageContext
$sel:stage:PipelineContext' :: PipelineContext -> Maybe StageContext
stage} -> Maybe StageContext
stage) (\s :: PipelineContext
s@PipelineContext' {} Maybe StageContext
a -> PipelineContext
s {$sel:stage:PipelineContext' :: Maybe StageContext
stage = Maybe StageContext
a} :: PipelineContext)
pipelineContext_pipelineName :: Lens.Lens' PipelineContext (Prelude.Maybe Prelude.Text)
pipelineContext_pipelineName :: (Maybe Text -> f (Maybe Text))
-> PipelineContext -> f PipelineContext
pipelineContext_pipelineName = (PipelineContext -> Maybe Text)
-> (PipelineContext -> Maybe Text -> PipelineContext)
-> Lens PipelineContext PipelineContext (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PipelineContext' {Maybe Text
pipelineName :: Maybe Text
$sel:pipelineName:PipelineContext' :: PipelineContext -> Maybe Text
pipelineName} -> Maybe Text
pipelineName) (\s :: PipelineContext
s@PipelineContext' {} Maybe Text
a -> PipelineContext
s {$sel:pipelineName:PipelineContext' :: Maybe Text
pipelineName = Maybe Text
a} :: PipelineContext)
pipelineContext_action :: Lens.Lens' PipelineContext (Prelude.Maybe ActionContext)
pipelineContext_action :: (Maybe ActionContext -> f (Maybe ActionContext))
-> PipelineContext -> f PipelineContext
pipelineContext_action = (PipelineContext -> Maybe ActionContext)
-> (PipelineContext -> Maybe ActionContext -> PipelineContext)
-> Lens
PipelineContext
PipelineContext
(Maybe ActionContext)
(Maybe ActionContext)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PipelineContext' {Maybe ActionContext
action :: Maybe ActionContext
$sel:action:PipelineContext' :: PipelineContext -> Maybe ActionContext
action} -> Maybe ActionContext
action) (\s :: PipelineContext
s@PipelineContext' {} Maybe ActionContext
a -> PipelineContext
s {$sel:action:PipelineContext' :: Maybe ActionContext
action = Maybe ActionContext
a} :: PipelineContext)
pipelineContext_pipelineArn :: Lens.Lens' PipelineContext (Prelude.Maybe Prelude.Text)
pipelineContext_pipelineArn :: (Maybe Text -> f (Maybe Text))
-> PipelineContext -> f PipelineContext
pipelineContext_pipelineArn = (PipelineContext -> Maybe Text)
-> (PipelineContext -> Maybe Text -> PipelineContext)
-> Lens PipelineContext PipelineContext (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PipelineContext' {Maybe Text
pipelineArn :: Maybe Text
$sel:pipelineArn:PipelineContext' :: PipelineContext -> Maybe Text
pipelineArn} -> Maybe Text
pipelineArn) (\s :: PipelineContext
s@PipelineContext' {} Maybe Text
a -> PipelineContext
s {$sel:pipelineArn:PipelineContext' :: Maybe Text
pipelineArn = Maybe Text
a} :: PipelineContext)
pipelineContext_pipelineExecutionId :: Lens.Lens' PipelineContext (Prelude.Maybe Prelude.Text)
pipelineContext_pipelineExecutionId :: (Maybe Text -> f (Maybe Text))
-> PipelineContext -> f PipelineContext
pipelineContext_pipelineExecutionId = (PipelineContext -> Maybe Text)
-> (PipelineContext -> Maybe Text -> PipelineContext)
-> Lens PipelineContext PipelineContext (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PipelineContext' {Maybe Text
pipelineExecutionId :: Maybe Text
$sel:pipelineExecutionId:PipelineContext' :: PipelineContext -> Maybe Text
pipelineExecutionId} -> Maybe Text
pipelineExecutionId) (\s :: PipelineContext
s@PipelineContext' {} Maybe Text
a -> PipelineContext
s {$sel:pipelineExecutionId:PipelineContext' :: Maybe Text
pipelineExecutionId = Maybe Text
a} :: PipelineContext)
instance Core.FromJSON PipelineContext where
parseJSON :: Value -> Parser PipelineContext
parseJSON =
String
-> (Object -> Parser PipelineContext)
-> Value
-> Parser PipelineContext
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"PipelineContext"
( \Object
x ->
Maybe StageContext
-> Maybe Text
-> Maybe ActionContext
-> Maybe Text
-> Maybe Text
-> PipelineContext
PipelineContext'
(Maybe StageContext
-> Maybe Text
-> Maybe ActionContext
-> Maybe Text
-> Maybe Text
-> PipelineContext)
-> Parser (Maybe StageContext)
-> Parser
(Maybe Text
-> Maybe ActionContext
-> Maybe Text
-> Maybe Text
-> PipelineContext)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe StageContext)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"stage")
Parser
(Maybe Text
-> Maybe ActionContext
-> Maybe Text
-> Maybe Text
-> PipelineContext)
-> Parser (Maybe Text)
-> Parser
(Maybe ActionContext
-> Maybe Text -> Maybe Text -> PipelineContext)
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
"pipelineName")
Parser
(Maybe ActionContext
-> Maybe Text -> Maybe Text -> PipelineContext)
-> Parser (Maybe ActionContext)
-> Parser (Maybe Text -> Maybe Text -> PipelineContext)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ActionContext)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"action")
Parser (Maybe Text -> Maybe Text -> PipelineContext)
-> Parser (Maybe Text) -> Parser (Maybe Text -> PipelineContext)
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
"pipelineArn")
Parser (Maybe Text -> PipelineContext)
-> Parser (Maybe Text) -> Parser PipelineContext
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
"pipelineExecutionId")
)
instance Prelude.Hashable PipelineContext
instance Prelude.NFData PipelineContext