{-# 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EMR.Types.KeyValue
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
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]
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
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. 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'
{ $sel:args:HadoopJarStepConfig' :: Maybe [Text]
args = forall a. Maybe a
Prelude.Nothing,
$sel:mainClass:HadoopJarStepConfig' :: Maybe Text
mainClass = forall a. Maybe a
Prelude.Nothing,
$sel:properties:HadoopJarStepConfig' :: Maybe [KeyValue]
properties = forall a. Maybe a
Prelude.Nothing,
$sel:jar:HadoopJarStepConfig' :: Text
jar = Text
pJar_
}
hadoopJarStepConfig_args :: Lens.Lens' HadoopJarStepConfig (Prelude.Maybe [Prelude.Text])
hadoopJarStepConfig_args :: Lens' HadoopJarStepConfig (Maybe [Text])
hadoopJarStepConfig_args = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 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 :: Lens' HadoopJarStepConfig (Maybe Text)
hadoopJarStepConfig_mainClass = 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 :: Lens' HadoopJarStepConfig (Maybe [KeyValue])
hadoopJarStepConfig_properties = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 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 :: Lens' HadoopJarStepConfig Text
hadoopJarStepConfig_jar = 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 where
hashWithSalt :: Int -> HadoopJarStepConfig -> Int
hashWithSalt Int
_salt 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]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
args
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
mainClass
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [KeyValue]
properties
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
jar
instance Prelude.NFData HadoopJarStepConfig where
rnf :: HadoopJarStepConfig -> ()
rnf 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]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
args
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
mainClass
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [KeyValue]
properties
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
jar
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Args" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
args,
(Key
"MainClass" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
mainClass,
(Key
"Properties" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [KeyValue]
properties,
forall a. a -> Maybe a
Prelude.Just (Key
"Jar" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
jar)
]
)