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