{-# 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.ActionTypeExecutor where
import Amazonka.CodePipeline.Types.ExecutorConfiguration
import Amazonka.CodePipeline.Types.ExecutorType
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ActionTypeExecutor = ActionTypeExecutor'
{
ActionTypeExecutor -> Maybe Natural
jobTimeout :: Prelude.Maybe Prelude.Natural,
ActionTypeExecutor -> Maybe Text
policyStatementsTemplate :: Prelude.Maybe Prelude.Text,
ActionTypeExecutor -> ExecutorConfiguration
configuration :: ExecutorConfiguration,
ActionTypeExecutor -> ExecutorType
type' :: ExecutorType
}
deriving (ActionTypeExecutor -> ActionTypeExecutor -> Bool
(ActionTypeExecutor -> ActionTypeExecutor -> Bool)
-> (ActionTypeExecutor -> ActionTypeExecutor -> Bool)
-> Eq ActionTypeExecutor
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ActionTypeExecutor -> ActionTypeExecutor -> Bool
$c/= :: ActionTypeExecutor -> ActionTypeExecutor -> Bool
== :: ActionTypeExecutor -> ActionTypeExecutor -> Bool
$c== :: ActionTypeExecutor -> ActionTypeExecutor -> Bool
Prelude.Eq, ReadPrec [ActionTypeExecutor]
ReadPrec ActionTypeExecutor
Int -> ReadS ActionTypeExecutor
ReadS [ActionTypeExecutor]
(Int -> ReadS ActionTypeExecutor)
-> ReadS [ActionTypeExecutor]
-> ReadPrec ActionTypeExecutor
-> ReadPrec [ActionTypeExecutor]
-> Read ActionTypeExecutor
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ActionTypeExecutor]
$creadListPrec :: ReadPrec [ActionTypeExecutor]
readPrec :: ReadPrec ActionTypeExecutor
$creadPrec :: ReadPrec ActionTypeExecutor
readList :: ReadS [ActionTypeExecutor]
$creadList :: ReadS [ActionTypeExecutor]
readsPrec :: Int -> ReadS ActionTypeExecutor
$creadsPrec :: Int -> ReadS ActionTypeExecutor
Prelude.Read, Int -> ActionTypeExecutor -> ShowS
[ActionTypeExecutor] -> ShowS
ActionTypeExecutor -> String
(Int -> ActionTypeExecutor -> ShowS)
-> (ActionTypeExecutor -> String)
-> ([ActionTypeExecutor] -> ShowS)
-> Show ActionTypeExecutor
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ActionTypeExecutor] -> ShowS
$cshowList :: [ActionTypeExecutor] -> ShowS
show :: ActionTypeExecutor -> String
$cshow :: ActionTypeExecutor -> String
showsPrec :: Int -> ActionTypeExecutor -> ShowS
$cshowsPrec :: Int -> ActionTypeExecutor -> ShowS
Prelude.Show, (forall x. ActionTypeExecutor -> Rep ActionTypeExecutor x)
-> (forall x. Rep ActionTypeExecutor x -> ActionTypeExecutor)
-> Generic ActionTypeExecutor
forall x. Rep ActionTypeExecutor x -> ActionTypeExecutor
forall x. ActionTypeExecutor -> Rep ActionTypeExecutor x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ActionTypeExecutor x -> ActionTypeExecutor
$cfrom :: forall x. ActionTypeExecutor -> Rep ActionTypeExecutor x
Prelude.Generic)
newActionTypeExecutor ::
ExecutorConfiguration ->
ExecutorType ->
ActionTypeExecutor
newActionTypeExecutor :: ExecutorConfiguration -> ExecutorType -> ActionTypeExecutor
newActionTypeExecutor ExecutorConfiguration
pConfiguration_ ExecutorType
pType_ =
ActionTypeExecutor' :: Maybe Natural
-> Maybe Text
-> ExecutorConfiguration
-> ExecutorType
-> ActionTypeExecutor
ActionTypeExecutor'
{ $sel:jobTimeout:ActionTypeExecutor' :: Maybe Natural
jobTimeout = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:policyStatementsTemplate:ActionTypeExecutor' :: Maybe Text
policyStatementsTemplate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:configuration:ActionTypeExecutor' :: ExecutorConfiguration
configuration = ExecutorConfiguration
pConfiguration_,
$sel:type':ActionTypeExecutor' :: ExecutorType
type' = ExecutorType
pType_
}
actionTypeExecutor_jobTimeout :: Lens.Lens' ActionTypeExecutor (Prelude.Maybe Prelude.Natural)
actionTypeExecutor_jobTimeout :: (Maybe Natural -> f (Maybe Natural))
-> ActionTypeExecutor -> f ActionTypeExecutor
actionTypeExecutor_jobTimeout = (ActionTypeExecutor -> Maybe Natural)
-> (ActionTypeExecutor -> Maybe Natural -> ActionTypeExecutor)
-> Lens
ActionTypeExecutor
ActionTypeExecutor
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActionTypeExecutor' {Maybe Natural
jobTimeout :: Maybe Natural
$sel:jobTimeout:ActionTypeExecutor' :: ActionTypeExecutor -> Maybe Natural
jobTimeout} -> Maybe Natural
jobTimeout) (\s :: ActionTypeExecutor
s@ActionTypeExecutor' {} Maybe Natural
a -> ActionTypeExecutor
s {$sel:jobTimeout:ActionTypeExecutor' :: Maybe Natural
jobTimeout = Maybe Natural
a} :: ActionTypeExecutor)
actionTypeExecutor_policyStatementsTemplate :: Lens.Lens' ActionTypeExecutor (Prelude.Maybe Prelude.Text)
actionTypeExecutor_policyStatementsTemplate :: (Maybe Text -> f (Maybe Text))
-> ActionTypeExecutor -> f ActionTypeExecutor
actionTypeExecutor_policyStatementsTemplate = (ActionTypeExecutor -> Maybe Text)
-> (ActionTypeExecutor -> Maybe Text -> ActionTypeExecutor)
-> Lens
ActionTypeExecutor ActionTypeExecutor (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActionTypeExecutor' {Maybe Text
policyStatementsTemplate :: Maybe Text
$sel:policyStatementsTemplate:ActionTypeExecutor' :: ActionTypeExecutor -> Maybe Text
policyStatementsTemplate} -> Maybe Text
policyStatementsTemplate) (\s :: ActionTypeExecutor
s@ActionTypeExecutor' {} Maybe Text
a -> ActionTypeExecutor
s {$sel:policyStatementsTemplate:ActionTypeExecutor' :: Maybe Text
policyStatementsTemplate = Maybe Text
a} :: ActionTypeExecutor)
actionTypeExecutor_configuration :: Lens.Lens' ActionTypeExecutor ExecutorConfiguration
actionTypeExecutor_configuration :: (ExecutorConfiguration -> f ExecutorConfiguration)
-> ActionTypeExecutor -> f ActionTypeExecutor
actionTypeExecutor_configuration = (ActionTypeExecutor -> ExecutorConfiguration)
-> (ActionTypeExecutor
-> ExecutorConfiguration -> ActionTypeExecutor)
-> Lens
ActionTypeExecutor
ActionTypeExecutor
ExecutorConfiguration
ExecutorConfiguration
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActionTypeExecutor' {ExecutorConfiguration
configuration :: ExecutorConfiguration
$sel:configuration:ActionTypeExecutor' :: ActionTypeExecutor -> ExecutorConfiguration
configuration} -> ExecutorConfiguration
configuration) (\s :: ActionTypeExecutor
s@ActionTypeExecutor' {} ExecutorConfiguration
a -> ActionTypeExecutor
s {$sel:configuration:ActionTypeExecutor' :: ExecutorConfiguration
configuration = ExecutorConfiguration
a} :: ActionTypeExecutor)
actionTypeExecutor_type :: Lens.Lens' ActionTypeExecutor ExecutorType
actionTypeExecutor_type :: (ExecutorType -> f ExecutorType)
-> ActionTypeExecutor -> f ActionTypeExecutor
actionTypeExecutor_type = (ActionTypeExecutor -> ExecutorType)
-> (ActionTypeExecutor -> ExecutorType -> ActionTypeExecutor)
-> Lens
ActionTypeExecutor ActionTypeExecutor ExecutorType ExecutorType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActionTypeExecutor' {ExecutorType
type' :: ExecutorType
$sel:type':ActionTypeExecutor' :: ActionTypeExecutor -> ExecutorType
type'} -> ExecutorType
type') (\s :: ActionTypeExecutor
s@ActionTypeExecutor' {} ExecutorType
a -> ActionTypeExecutor
s {$sel:type':ActionTypeExecutor' :: ExecutorType
type' = ExecutorType
a} :: ActionTypeExecutor)
instance Core.FromJSON ActionTypeExecutor where
parseJSON :: Value -> Parser ActionTypeExecutor
parseJSON =
String
-> (Object -> Parser ActionTypeExecutor)
-> Value
-> Parser ActionTypeExecutor
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ActionTypeExecutor"
( \Object
x ->
Maybe Natural
-> Maybe Text
-> ExecutorConfiguration
-> ExecutorType
-> ActionTypeExecutor
ActionTypeExecutor'
(Maybe Natural
-> Maybe Text
-> ExecutorConfiguration
-> ExecutorType
-> ActionTypeExecutor)
-> Parser (Maybe Natural)
-> Parser
(Maybe Text
-> ExecutorConfiguration -> ExecutorType -> ActionTypeExecutor)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"jobTimeout")
Parser
(Maybe Text
-> ExecutorConfiguration -> ExecutorType -> ActionTypeExecutor)
-> Parser (Maybe Text)
-> Parser
(ExecutorConfiguration -> ExecutorType -> ActionTypeExecutor)
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
"policyStatementsTemplate")
Parser
(ExecutorConfiguration -> ExecutorType -> ActionTypeExecutor)
-> Parser ExecutorConfiguration
-> Parser (ExecutorType -> ActionTypeExecutor)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ExecutorConfiguration
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"configuration")
Parser (ExecutorType -> ActionTypeExecutor)
-> Parser ExecutorType -> Parser ActionTypeExecutor
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ExecutorType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"type")
)
instance Prelude.Hashable ActionTypeExecutor
instance Prelude.NFData ActionTypeExecutor
instance Core.ToJSON ActionTypeExecutor where
toJSON :: ActionTypeExecutor -> Value
toJSON ActionTypeExecutor' {Maybe Natural
Maybe Text
ExecutorType
ExecutorConfiguration
type' :: ExecutorType
configuration :: ExecutorConfiguration
policyStatementsTemplate :: Maybe Text
jobTimeout :: Maybe Natural
$sel:type':ActionTypeExecutor' :: ActionTypeExecutor -> ExecutorType
$sel:configuration:ActionTypeExecutor' :: ActionTypeExecutor -> ExecutorConfiguration
$sel:policyStatementsTemplate:ActionTypeExecutor' :: ActionTypeExecutor -> Maybe Text
$sel:jobTimeout:ActionTypeExecutor' :: ActionTypeExecutor -> Maybe Natural
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"jobTimeout" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
jobTimeout,
(Text
"policyStatementsTemplate" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
policyStatementsTemplate,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"configuration" Text -> ExecutorConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ExecutorConfiguration
configuration),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"type" Text -> ExecutorType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ExecutorType
type')
]
)