{-# 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.HadoopStepConfig where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data HadoopStepConfig = HadoopStepConfig'
{
HadoopStepConfig -> Maybe [Text]
args :: Prelude.Maybe [Prelude.Text],
HadoopStepConfig -> Maybe Text
jar :: Prelude.Maybe Prelude.Text,
HadoopStepConfig -> Maybe Text
mainClass :: Prelude.Maybe Prelude.Text,
HadoopStepConfig -> Maybe (HashMap Text Text)
properties :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
}
deriving (HadoopStepConfig -> HadoopStepConfig -> Bool
(HadoopStepConfig -> HadoopStepConfig -> Bool)
-> (HadoopStepConfig -> HadoopStepConfig -> Bool)
-> Eq HadoopStepConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HadoopStepConfig -> HadoopStepConfig -> Bool
$c/= :: HadoopStepConfig -> HadoopStepConfig -> Bool
== :: HadoopStepConfig -> HadoopStepConfig -> Bool
$c== :: HadoopStepConfig -> HadoopStepConfig -> Bool
Prelude.Eq, ReadPrec [HadoopStepConfig]
ReadPrec HadoopStepConfig
Int -> ReadS HadoopStepConfig
ReadS [HadoopStepConfig]
(Int -> ReadS HadoopStepConfig)
-> ReadS [HadoopStepConfig]
-> ReadPrec HadoopStepConfig
-> ReadPrec [HadoopStepConfig]
-> Read HadoopStepConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HadoopStepConfig]
$creadListPrec :: ReadPrec [HadoopStepConfig]
readPrec :: ReadPrec HadoopStepConfig
$creadPrec :: ReadPrec HadoopStepConfig
readList :: ReadS [HadoopStepConfig]
$creadList :: ReadS [HadoopStepConfig]
readsPrec :: Int -> ReadS HadoopStepConfig
$creadsPrec :: Int -> ReadS HadoopStepConfig
Prelude.Read, Int -> HadoopStepConfig -> ShowS
[HadoopStepConfig] -> ShowS
HadoopStepConfig -> String
(Int -> HadoopStepConfig -> ShowS)
-> (HadoopStepConfig -> String)
-> ([HadoopStepConfig] -> ShowS)
-> Show HadoopStepConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HadoopStepConfig] -> ShowS
$cshowList :: [HadoopStepConfig] -> ShowS
show :: HadoopStepConfig -> String
$cshow :: HadoopStepConfig -> String
showsPrec :: Int -> HadoopStepConfig -> ShowS
$cshowsPrec :: Int -> HadoopStepConfig -> ShowS
Prelude.Show, (forall x. HadoopStepConfig -> Rep HadoopStepConfig x)
-> (forall x. Rep HadoopStepConfig x -> HadoopStepConfig)
-> Generic HadoopStepConfig
forall x. Rep HadoopStepConfig x -> HadoopStepConfig
forall x. HadoopStepConfig -> Rep HadoopStepConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HadoopStepConfig x -> HadoopStepConfig
$cfrom :: forall x. HadoopStepConfig -> Rep HadoopStepConfig x
Prelude.Generic)
newHadoopStepConfig ::
HadoopStepConfig
newHadoopStepConfig :: HadoopStepConfig
newHadoopStepConfig =
HadoopStepConfig' :: Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> HadoopStepConfig
HadoopStepConfig'
{ $sel:args:HadoopStepConfig' :: Maybe [Text]
args = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:jar:HadoopStepConfig' :: Maybe Text
jar = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:mainClass:HadoopStepConfig' :: Maybe Text
mainClass = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:properties:HadoopStepConfig' :: Maybe (HashMap Text Text)
properties = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing
}
hadoopStepConfig_args :: Lens.Lens' HadoopStepConfig (Prelude.Maybe [Prelude.Text])
hadoopStepConfig_args :: (Maybe [Text] -> f (Maybe [Text]))
-> HadoopStepConfig -> f HadoopStepConfig
hadoopStepConfig_args = (HadoopStepConfig -> Maybe [Text])
-> (HadoopStepConfig -> Maybe [Text] -> HadoopStepConfig)
-> Lens
HadoopStepConfig HadoopStepConfig (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HadoopStepConfig' {Maybe [Text]
args :: Maybe [Text]
$sel:args:HadoopStepConfig' :: HadoopStepConfig -> Maybe [Text]
args} -> Maybe [Text]
args) (\s :: HadoopStepConfig
s@HadoopStepConfig' {} Maybe [Text]
a -> HadoopStepConfig
s {$sel:args:HadoopStepConfig' :: Maybe [Text]
args = Maybe [Text]
a} :: HadoopStepConfig) ((Maybe [Text] -> f (Maybe [Text]))
-> HadoopStepConfig -> f HadoopStepConfig)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> HadoopStepConfig
-> f HadoopStepConfig
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
hadoopStepConfig_jar :: Lens.Lens' HadoopStepConfig (Prelude.Maybe Prelude.Text)
hadoopStepConfig_jar :: (Maybe Text -> f (Maybe Text))
-> HadoopStepConfig -> f HadoopStepConfig
hadoopStepConfig_jar = (HadoopStepConfig -> Maybe Text)
-> (HadoopStepConfig -> Maybe Text -> HadoopStepConfig)
-> Lens HadoopStepConfig HadoopStepConfig (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HadoopStepConfig' {Maybe Text
jar :: Maybe Text
$sel:jar:HadoopStepConfig' :: HadoopStepConfig -> Maybe Text
jar} -> Maybe Text
jar) (\s :: HadoopStepConfig
s@HadoopStepConfig' {} Maybe Text
a -> HadoopStepConfig
s {$sel:jar:HadoopStepConfig' :: Maybe Text
jar = Maybe Text
a} :: HadoopStepConfig)
hadoopStepConfig_mainClass :: Lens.Lens' HadoopStepConfig (Prelude.Maybe Prelude.Text)
hadoopStepConfig_mainClass :: (Maybe Text -> f (Maybe Text))
-> HadoopStepConfig -> f HadoopStepConfig
hadoopStepConfig_mainClass = (HadoopStepConfig -> Maybe Text)
-> (HadoopStepConfig -> Maybe Text -> HadoopStepConfig)
-> Lens HadoopStepConfig HadoopStepConfig (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HadoopStepConfig' {Maybe Text
mainClass :: Maybe Text
$sel:mainClass:HadoopStepConfig' :: HadoopStepConfig -> Maybe Text
mainClass} -> Maybe Text
mainClass) (\s :: HadoopStepConfig
s@HadoopStepConfig' {} Maybe Text
a -> HadoopStepConfig
s {$sel:mainClass:HadoopStepConfig' :: Maybe Text
mainClass = Maybe Text
a} :: HadoopStepConfig)
hadoopStepConfig_properties :: Lens.Lens' HadoopStepConfig (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
hadoopStepConfig_properties :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> HadoopStepConfig -> f HadoopStepConfig
hadoopStepConfig_properties = (HadoopStepConfig -> Maybe (HashMap Text Text))
-> (HadoopStepConfig
-> Maybe (HashMap Text Text) -> HadoopStepConfig)
-> Lens
HadoopStepConfig
HadoopStepConfig
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HadoopStepConfig' {Maybe (HashMap Text Text)
properties :: Maybe (HashMap Text Text)
$sel:properties:HadoopStepConfig' :: HadoopStepConfig -> Maybe (HashMap Text Text)
properties} -> Maybe (HashMap Text Text)
properties) (\s :: HadoopStepConfig
s@HadoopStepConfig' {} Maybe (HashMap Text Text)
a -> HadoopStepConfig
s {$sel:properties:HadoopStepConfig' :: Maybe (HashMap Text Text)
properties = Maybe (HashMap Text Text)
a} :: HadoopStepConfig) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> HadoopStepConfig -> f HadoopStepConfig)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> HadoopStepConfig
-> f HadoopStepConfig
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text 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
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON HadoopStepConfig where
parseJSON :: Value -> Parser HadoopStepConfig
parseJSON =
String
-> (Object -> Parser HadoopStepConfig)
-> Value
-> Parser HadoopStepConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"HadoopStepConfig"
( \Object
x ->
Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> HadoopStepConfig
HadoopStepConfig'
(Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> HadoopStepConfig)
-> Parser (Maybe [Text])
-> Parser
(Maybe Text
-> Maybe Text -> Maybe (HashMap Text Text) -> HadoopStepConfig)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Args" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe Text
-> Maybe Text -> Maybe (HashMap Text Text) -> HadoopStepConfig)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe (HashMap Text Text) -> HadoopStepConfig)
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
"Jar")
Parser
(Maybe Text -> Maybe (HashMap Text Text) -> HadoopStepConfig)
-> Parser (Maybe Text)
-> Parser (Maybe (HashMap Text Text) -> HadoopStepConfig)
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
"MainClass")
Parser (Maybe (HashMap Text Text) -> HadoopStepConfig)
-> Parser (Maybe (HashMap Text Text)) -> Parser HadoopStepConfig
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Properties" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable HadoopStepConfig
instance Prelude.NFData HadoopStepConfig