{-# 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.HadoopJarStepConfig where
import qualified Amazonka.Core as Core
import Amazonka.EMR.Types.KeyValue
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data HadoopJarStepConfig = HadoopJarStepConfig'
{
HadoopJarStepConfig -> Maybe [Text]
args :: Prelude.Maybe [Prelude.Text],
HadoopJarStepConfig -> Maybe Text
mainClass :: Prelude.Maybe Prelude.Text,
HadoopJarStepConfig -> Maybe [KeyValue]
properties :: Prelude.Maybe [KeyValue],
HadoopJarStepConfig -> Text
jar :: Prelude.Text
}
deriving (HadoopJarStepConfig -> HadoopJarStepConfig -> Bool
(HadoopJarStepConfig -> HadoopJarStepConfig -> Bool)
-> (HadoopJarStepConfig -> HadoopJarStepConfig -> Bool)
-> Eq HadoopJarStepConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HadoopJarStepConfig -> HadoopJarStepConfig -> Bool
$c/= :: HadoopJarStepConfig -> HadoopJarStepConfig -> Bool
== :: HadoopJarStepConfig -> HadoopJarStepConfig -> Bool
$c== :: HadoopJarStepConfig -> HadoopJarStepConfig -> Bool
Prelude.Eq, ReadPrec [HadoopJarStepConfig]
ReadPrec HadoopJarStepConfig
Int -> ReadS HadoopJarStepConfig
ReadS [HadoopJarStepConfig]
(Int -> ReadS HadoopJarStepConfig)
-> ReadS [HadoopJarStepConfig]
-> ReadPrec HadoopJarStepConfig
-> ReadPrec [HadoopJarStepConfig]
-> Read HadoopJarStepConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HadoopJarStepConfig]
$creadListPrec :: ReadPrec [HadoopJarStepConfig]
readPrec :: ReadPrec HadoopJarStepConfig
$creadPrec :: ReadPrec HadoopJarStepConfig
readList :: ReadS [HadoopJarStepConfig]
$creadList :: ReadS [HadoopJarStepConfig]
readsPrec :: Int -> ReadS HadoopJarStepConfig
$creadsPrec :: Int -> ReadS HadoopJarStepConfig
Prelude.Read, Int -> HadoopJarStepConfig -> ShowS
[HadoopJarStepConfig] -> ShowS
HadoopJarStepConfig -> String
(Int -> HadoopJarStepConfig -> ShowS)
-> (HadoopJarStepConfig -> String)
-> ([HadoopJarStepConfig] -> ShowS)
-> Show HadoopJarStepConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HadoopJarStepConfig] -> ShowS
$cshowList :: [HadoopJarStepConfig] -> ShowS
show :: HadoopJarStepConfig -> String
$cshow :: HadoopJarStepConfig -> String
showsPrec :: Int -> HadoopJarStepConfig -> ShowS
$cshowsPrec :: Int -> HadoopJarStepConfig -> ShowS
Prelude.Show, (forall x. HadoopJarStepConfig -> Rep HadoopJarStepConfig x)
-> (forall x. Rep HadoopJarStepConfig x -> HadoopJarStepConfig)
-> Generic HadoopJarStepConfig
forall x. Rep HadoopJarStepConfig x -> HadoopJarStepConfig
forall x. HadoopJarStepConfig -> Rep HadoopJarStepConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HadoopJarStepConfig x -> HadoopJarStepConfig
$cfrom :: forall x. HadoopJarStepConfig -> Rep HadoopJarStepConfig x
Prelude.Generic)
newHadoopJarStepConfig ::
Prelude.Text ->
HadoopJarStepConfig
newHadoopJarStepConfig :: Text -> HadoopJarStepConfig
newHadoopJarStepConfig Text
pJar_ =
HadoopJarStepConfig' :: Maybe [Text]
-> Maybe Text -> Maybe [KeyValue] -> Text -> HadoopJarStepConfig
HadoopJarStepConfig'
{ $sel:args:HadoopJarStepConfig' :: Maybe [Text]
args = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:mainClass:HadoopJarStepConfig' :: Maybe Text
mainClass = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:properties:HadoopJarStepConfig' :: Maybe [KeyValue]
properties = Maybe [KeyValue]
forall a. Maybe a
Prelude.Nothing,
$sel:jar:HadoopJarStepConfig' :: Text
jar = Text
pJar_
}
hadoopJarStepConfig_args :: Lens.Lens' HadoopJarStepConfig (Prelude.Maybe [Prelude.Text])
hadoopJarStepConfig_args :: (Maybe [Text] -> f (Maybe [Text]))
-> HadoopJarStepConfig -> f HadoopJarStepConfig
hadoopJarStepConfig_args = (HadoopJarStepConfig -> Maybe [Text])
-> (HadoopJarStepConfig -> Maybe [Text] -> HadoopJarStepConfig)
-> Lens
HadoopJarStepConfig
HadoopJarStepConfig
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HadoopJarStepConfig' {Maybe [Text]
args :: Maybe [Text]
$sel:args:HadoopJarStepConfig' :: HadoopJarStepConfig -> Maybe [Text]
args} -> Maybe [Text]
args) (\s :: HadoopJarStepConfig
s@HadoopJarStepConfig' {} Maybe [Text]
a -> HadoopJarStepConfig
s {$sel:args:HadoopJarStepConfig' :: Maybe [Text]
args = Maybe [Text]
a} :: HadoopJarStepConfig) ((Maybe [Text] -> f (Maybe [Text]))
-> HadoopJarStepConfig -> f HadoopJarStepConfig)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> HadoopJarStepConfig
-> f HadoopJarStepConfig
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
hadoopJarStepConfig_mainClass :: Lens.Lens' HadoopJarStepConfig (Prelude.Maybe Prelude.Text)
hadoopJarStepConfig_mainClass :: (Maybe Text -> f (Maybe Text))
-> HadoopJarStepConfig -> f HadoopJarStepConfig
hadoopJarStepConfig_mainClass = (HadoopJarStepConfig -> Maybe Text)
-> (HadoopJarStepConfig -> Maybe Text -> HadoopJarStepConfig)
-> Lens
HadoopJarStepConfig HadoopJarStepConfig (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HadoopJarStepConfig' {Maybe Text
mainClass :: Maybe Text
$sel:mainClass:HadoopJarStepConfig' :: HadoopJarStepConfig -> Maybe Text
mainClass} -> Maybe Text
mainClass) (\s :: HadoopJarStepConfig
s@HadoopJarStepConfig' {} Maybe Text
a -> HadoopJarStepConfig
s {$sel:mainClass:HadoopJarStepConfig' :: Maybe Text
mainClass = Maybe Text
a} :: HadoopJarStepConfig)
hadoopJarStepConfig_properties :: Lens.Lens' HadoopJarStepConfig (Prelude.Maybe [KeyValue])
hadoopJarStepConfig_properties :: (Maybe [KeyValue] -> f (Maybe [KeyValue]))
-> HadoopJarStepConfig -> f HadoopJarStepConfig
hadoopJarStepConfig_properties = (HadoopJarStepConfig -> Maybe [KeyValue])
-> (HadoopJarStepConfig -> Maybe [KeyValue] -> HadoopJarStepConfig)
-> Lens
HadoopJarStepConfig
HadoopJarStepConfig
(Maybe [KeyValue])
(Maybe [KeyValue])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HadoopJarStepConfig' {Maybe [KeyValue]
properties :: Maybe [KeyValue]
$sel:properties:HadoopJarStepConfig' :: HadoopJarStepConfig -> Maybe [KeyValue]
properties} -> Maybe [KeyValue]
properties) (\s :: HadoopJarStepConfig
s@HadoopJarStepConfig' {} Maybe [KeyValue]
a -> HadoopJarStepConfig
s {$sel:properties:HadoopJarStepConfig' :: Maybe [KeyValue]
properties = Maybe [KeyValue]
a} :: HadoopJarStepConfig) ((Maybe [KeyValue] -> f (Maybe [KeyValue]))
-> HadoopJarStepConfig -> f HadoopJarStepConfig)
-> ((Maybe [KeyValue] -> f (Maybe [KeyValue]))
-> Maybe [KeyValue] -> f (Maybe [KeyValue]))
-> (Maybe [KeyValue] -> f (Maybe [KeyValue]))
-> HadoopJarStepConfig
-> f HadoopJarStepConfig
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [KeyValue] [KeyValue] [KeyValue] [KeyValue]
-> Iso
(Maybe [KeyValue])
(Maybe [KeyValue])
(Maybe [KeyValue])
(Maybe [KeyValue])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [KeyValue] [KeyValue] [KeyValue] [KeyValue]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
hadoopJarStepConfig_jar :: Lens.Lens' HadoopJarStepConfig Prelude.Text
hadoopJarStepConfig_jar :: (Text -> f Text) -> HadoopJarStepConfig -> f HadoopJarStepConfig
hadoopJarStepConfig_jar = (HadoopJarStepConfig -> Text)
-> (HadoopJarStepConfig -> Text -> HadoopJarStepConfig)
-> Lens HadoopJarStepConfig HadoopJarStepConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HadoopJarStepConfig' {Text
jar :: Text
$sel:jar:HadoopJarStepConfig' :: HadoopJarStepConfig -> Text
jar} -> Text
jar) (\s :: HadoopJarStepConfig
s@HadoopJarStepConfig' {} Text
a -> HadoopJarStepConfig
s {$sel:jar:HadoopJarStepConfig' :: Text
jar = Text
a} :: HadoopJarStepConfig)
instance Prelude.Hashable HadoopJarStepConfig
instance Prelude.NFData HadoopJarStepConfig
instance Core.ToJSON HadoopJarStepConfig where
toJSON :: HadoopJarStepConfig -> Value
toJSON HadoopJarStepConfig' {Maybe [Text]
Maybe [KeyValue]
Maybe Text
Text
jar :: Text
properties :: Maybe [KeyValue]
mainClass :: Maybe Text
args :: Maybe [Text]
$sel:jar:HadoopJarStepConfig' :: HadoopJarStepConfig -> Text
$sel:properties:HadoopJarStepConfig' :: HadoopJarStepConfig -> Maybe [KeyValue]
$sel:mainClass:HadoopJarStepConfig' :: HadoopJarStepConfig -> Maybe Text
$sel:args:HadoopJarStepConfig' :: HadoopJarStepConfig -> Maybe [Text]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Args" 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]
args,
(Text
"MainClass" 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
mainClass,
(Text
"Properties" Text -> [KeyValue] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([KeyValue] -> Pair) -> Maybe [KeyValue] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [KeyValue]
properties,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Jar" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
jar)
]
)