{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data PipelineContext = PipelineContext'
{
PipelineContext -> Maybe ActionContext
action :: Prelude.Maybe ActionContext,
PipelineContext -> Maybe Text
pipelineArn :: Prelude.Maybe Prelude.Text,
PipelineContext -> Maybe Text
pipelineExecutionId :: Prelude.Maybe Prelude.Text,
PipelineContext -> Maybe Text
pipelineName :: Prelude.Maybe Prelude.Text,
PipelineContext -> Maybe StageContext
stage :: Prelude.Maybe StageContext
}
deriving (PipelineContext -> PipelineContext -> Bool
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]
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
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. 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'
{ $sel:action:PipelineContext' :: Maybe ActionContext
action = forall a. Maybe a
Prelude.Nothing,
$sel:pipelineArn:PipelineContext' :: Maybe Text
pipelineArn = forall a. Maybe a
Prelude.Nothing,
$sel:pipelineExecutionId:PipelineContext' :: Maybe Text
pipelineExecutionId = forall a. Maybe a
Prelude.Nothing,
$sel:pipelineName:PipelineContext' :: Maybe Text
pipelineName = forall a. Maybe a
Prelude.Nothing,
$sel:stage:PipelineContext' :: Maybe StageContext
stage = forall a. Maybe a
Prelude.Nothing
}
pipelineContext_action :: Lens.Lens' PipelineContext (Prelude.Maybe ActionContext)
pipelineContext_action :: Lens' PipelineContext (Maybe ActionContext)
pipelineContext_action = 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 :: Lens' PipelineContext (Maybe Text)
pipelineContext_pipelineArn = 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 :: Lens' PipelineContext (Maybe Text)
pipelineContext_pipelineExecutionId = 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)
pipelineContext_pipelineName :: Lens.Lens' PipelineContext (Prelude.Maybe Prelude.Text)
pipelineContext_pipelineName :: Lens' PipelineContext (Maybe Text)
pipelineContext_pipelineName = 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_stage :: Lens.Lens' PipelineContext (Prelude.Maybe StageContext)
pipelineContext_stage :: Lens' PipelineContext (Maybe StageContext)
pipelineContext_stage = 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)
instance Data.FromJSON PipelineContext where
parseJSON :: Value -> Parser PipelineContext
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"PipelineContext"
( \Object
x ->
Maybe ActionContext
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe StageContext
-> PipelineContext
PipelineContext'
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
"action")
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
"pipelineArn")
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
"pipelineExecutionId")
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
"pipelineName")
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
"stage")
)
instance Prelude.Hashable PipelineContext where
hashWithSalt :: Int -> PipelineContext -> Int
hashWithSalt Int
_salt PipelineContext' {Maybe Text
Maybe ActionContext
Maybe StageContext
stage :: Maybe StageContext
pipelineName :: Maybe Text
pipelineExecutionId :: Maybe Text
pipelineArn :: Maybe Text
action :: Maybe ActionContext
$sel:stage:PipelineContext' :: PipelineContext -> Maybe StageContext
$sel:pipelineName:PipelineContext' :: PipelineContext -> Maybe Text
$sel:pipelineExecutionId:PipelineContext' :: PipelineContext -> Maybe Text
$sel:pipelineArn:PipelineContext' :: PipelineContext -> Maybe Text
$sel:action:PipelineContext' :: PipelineContext -> Maybe ActionContext
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ActionContext
action
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
pipelineArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
pipelineExecutionId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
pipelineName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StageContext
stage
instance Prelude.NFData PipelineContext where
rnf :: PipelineContext -> ()
rnf PipelineContext' {Maybe Text
Maybe ActionContext
Maybe StageContext
stage :: Maybe StageContext
pipelineName :: Maybe Text
pipelineExecutionId :: Maybe Text
pipelineArn :: Maybe Text
action :: Maybe ActionContext
$sel:stage:PipelineContext' :: PipelineContext -> Maybe StageContext
$sel:pipelineName:PipelineContext' :: PipelineContext -> Maybe Text
$sel:pipelineExecutionId:PipelineContext' :: PipelineContext -> Maybe Text
$sel:pipelineArn:PipelineContext' :: PipelineContext -> Maybe Text
$sel:action:PipelineContext' :: PipelineContext -> Maybe ActionContext
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe ActionContext
action
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
pipelineArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
pipelineExecutionId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
pipelineName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe StageContext
stage