{-# 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.EMR.Types.BootstrapActionConfig where
import qualified Amazonka.Core as Core
import Amazonka.EMR.Types.ScriptBootstrapActionConfig
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data BootstrapActionConfig = BootstrapActionConfig'
{
BootstrapActionConfig -> Text
name :: Prelude.Text,
BootstrapActionConfig -> ScriptBootstrapActionConfig
scriptBootstrapAction :: ScriptBootstrapActionConfig
}
deriving (BootstrapActionConfig -> BootstrapActionConfig -> Bool
(BootstrapActionConfig -> BootstrapActionConfig -> Bool)
-> (BootstrapActionConfig -> BootstrapActionConfig -> Bool)
-> Eq BootstrapActionConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BootstrapActionConfig -> BootstrapActionConfig -> Bool
$c/= :: BootstrapActionConfig -> BootstrapActionConfig -> Bool
== :: BootstrapActionConfig -> BootstrapActionConfig -> Bool
$c== :: BootstrapActionConfig -> BootstrapActionConfig -> Bool
Prelude.Eq, ReadPrec [BootstrapActionConfig]
ReadPrec BootstrapActionConfig
Int -> ReadS BootstrapActionConfig
ReadS [BootstrapActionConfig]
(Int -> ReadS BootstrapActionConfig)
-> ReadS [BootstrapActionConfig]
-> ReadPrec BootstrapActionConfig
-> ReadPrec [BootstrapActionConfig]
-> Read BootstrapActionConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BootstrapActionConfig]
$creadListPrec :: ReadPrec [BootstrapActionConfig]
readPrec :: ReadPrec BootstrapActionConfig
$creadPrec :: ReadPrec BootstrapActionConfig
readList :: ReadS [BootstrapActionConfig]
$creadList :: ReadS [BootstrapActionConfig]
readsPrec :: Int -> ReadS BootstrapActionConfig
$creadsPrec :: Int -> ReadS BootstrapActionConfig
Prelude.Read, Int -> BootstrapActionConfig -> ShowS
[BootstrapActionConfig] -> ShowS
BootstrapActionConfig -> String
(Int -> BootstrapActionConfig -> ShowS)
-> (BootstrapActionConfig -> String)
-> ([BootstrapActionConfig] -> ShowS)
-> Show BootstrapActionConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BootstrapActionConfig] -> ShowS
$cshowList :: [BootstrapActionConfig] -> ShowS
show :: BootstrapActionConfig -> String
$cshow :: BootstrapActionConfig -> String
showsPrec :: Int -> BootstrapActionConfig -> ShowS
$cshowsPrec :: Int -> BootstrapActionConfig -> ShowS
Prelude.Show, (forall x. BootstrapActionConfig -> Rep BootstrapActionConfig x)
-> (forall x. Rep BootstrapActionConfig x -> BootstrapActionConfig)
-> Generic BootstrapActionConfig
forall x. Rep BootstrapActionConfig x -> BootstrapActionConfig
forall x. BootstrapActionConfig -> Rep BootstrapActionConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BootstrapActionConfig x -> BootstrapActionConfig
$cfrom :: forall x. BootstrapActionConfig -> Rep BootstrapActionConfig x
Prelude.Generic)
newBootstrapActionConfig ::
Prelude.Text ->
ScriptBootstrapActionConfig ->
BootstrapActionConfig
newBootstrapActionConfig :: Text -> ScriptBootstrapActionConfig -> BootstrapActionConfig
newBootstrapActionConfig
Text
pName_
ScriptBootstrapActionConfig
pScriptBootstrapAction_ =
BootstrapActionConfig' :: Text -> ScriptBootstrapActionConfig -> BootstrapActionConfig
BootstrapActionConfig'
{ $sel:name:BootstrapActionConfig' :: Text
name = Text
pName_,
$sel:scriptBootstrapAction:BootstrapActionConfig' :: ScriptBootstrapActionConfig
scriptBootstrapAction = ScriptBootstrapActionConfig
pScriptBootstrapAction_
}
bootstrapActionConfig_name :: Lens.Lens' BootstrapActionConfig Prelude.Text
bootstrapActionConfig_name :: (Text -> f Text)
-> BootstrapActionConfig -> f BootstrapActionConfig
bootstrapActionConfig_name = (BootstrapActionConfig -> Text)
-> (BootstrapActionConfig -> Text -> BootstrapActionConfig)
-> Lens BootstrapActionConfig BootstrapActionConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BootstrapActionConfig' {Text
name :: Text
$sel:name:BootstrapActionConfig' :: BootstrapActionConfig -> Text
name} -> Text
name) (\s :: BootstrapActionConfig
s@BootstrapActionConfig' {} Text
a -> BootstrapActionConfig
s {$sel:name:BootstrapActionConfig' :: Text
name = Text
a} :: BootstrapActionConfig)
bootstrapActionConfig_scriptBootstrapAction :: Lens.Lens' BootstrapActionConfig ScriptBootstrapActionConfig
bootstrapActionConfig_scriptBootstrapAction :: (ScriptBootstrapActionConfig -> f ScriptBootstrapActionConfig)
-> BootstrapActionConfig -> f BootstrapActionConfig
bootstrapActionConfig_scriptBootstrapAction = (BootstrapActionConfig -> ScriptBootstrapActionConfig)
-> (BootstrapActionConfig
-> ScriptBootstrapActionConfig -> BootstrapActionConfig)
-> Lens
BootstrapActionConfig
BootstrapActionConfig
ScriptBootstrapActionConfig
ScriptBootstrapActionConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BootstrapActionConfig' {ScriptBootstrapActionConfig
scriptBootstrapAction :: ScriptBootstrapActionConfig
$sel:scriptBootstrapAction:BootstrapActionConfig' :: BootstrapActionConfig -> ScriptBootstrapActionConfig
scriptBootstrapAction} -> ScriptBootstrapActionConfig
scriptBootstrapAction) (\s :: BootstrapActionConfig
s@BootstrapActionConfig' {} ScriptBootstrapActionConfig
a -> BootstrapActionConfig
s {$sel:scriptBootstrapAction:BootstrapActionConfig' :: ScriptBootstrapActionConfig
scriptBootstrapAction = ScriptBootstrapActionConfig
a} :: BootstrapActionConfig)
instance Prelude.Hashable BootstrapActionConfig
instance Prelude.NFData BootstrapActionConfig
instance Core.ToJSON BootstrapActionConfig where
toJSON :: BootstrapActionConfig -> Value
toJSON BootstrapActionConfig' {Text
ScriptBootstrapActionConfig
scriptBootstrapAction :: ScriptBootstrapActionConfig
name :: Text
$sel:scriptBootstrapAction:BootstrapActionConfig' :: BootstrapActionConfig -> ScriptBootstrapActionConfig
$sel:name:BootstrapActionConfig' :: BootstrapActionConfig -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"ScriptBootstrapAction"
Text -> ScriptBootstrapActionConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ScriptBootstrapActionConfig
scriptBootstrapAction
)
]
)