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