{-# 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.EMRContainers.Types.JobDriver where
import qualified Amazonka.Core as Core
import Amazonka.EMRContainers.Types.SparkSubmitJobDriver
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data JobDriver = JobDriver'
{
JobDriver -> Maybe SparkSubmitJobDriver
sparkSubmitJobDriver :: Prelude.Maybe SparkSubmitJobDriver
}
deriving (JobDriver -> JobDriver -> Bool
(JobDriver -> JobDriver -> Bool)
-> (JobDriver -> JobDriver -> Bool) -> Eq JobDriver
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: JobDriver -> JobDriver -> Bool
$c/= :: JobDriver -> JobDriver -> Bool
== :: JobDriver -> JobDriver -> Bool
$c== :: JobDriver -> JobDriver -> Bool
Prelude.Eq, Int -> JobDriver -> ShowS
[JobDriver] -> ShowS
JobDriver -> String
(Int -> JobDriver -> ShowS)
-> (JobDriver -> String)
-> ([JobDriver] -> ShowS)
-> Show JobDriver
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [JobDriver] -> ShowS
$cshowList :: [JobDriver] -> ShowS
show :: JobDriver -> String
$cshow :: JobDriver -> String
showsPrec :: Int -> JobDriver -> ShowS
$cshowsPrec :: Int -> JobDriver -> ShowS
Prelude.Show, (forall x. JobDriver -> Rep JobDriver x)
-> (forall x. Rep JobDriver x -> JobDriver) -> Generic JobDriver
forall x. Rep JobDriver x -> JobDriver
forall x. JobDriver -> Rep JobDriver x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep JobDriver x -> JobDriver
$cfrom :: forall x. JobDriver -> Rep JobDriver x
Prelude.Generic)
newJobDriver ::
JobDriver
newJobDriver :: JobDriver
newJobDriver =
JobDriver' :: Maybe SparkSubmitJobDriver -> JobDriver
JobDriver' {$sel:sparkSubmitJobDriver:JobDriver' :: Maybe SparkSubmitJobDriver
sparkSubmitJobDriver = Maybe SparkSubmitJobDriver
forall a. Maybe a
Prelude.Nothing}
jobDriver_sparkSubmitJobDriver :: Lens.Lens' JobDriver (Prelude.Maybe SparkSubmitJobDriver)
jobDriver_sparkSubmitJobDriver :: (Maybe SparkSubmitJobDriver -> f (Maybe SparkSubmitJobDriver))
-> JobDriver -> f JobDriver
jobDriver_sparkSubmitJobDriver = (JobDriver -> Maybe SparkSubmitJobDriver)
-> (JobDriver -> Maybe SparkSubmitJobDriver -> JobDriver)
-> Lens
JobDriver
JobDriver
(Maybe SparkSubmitJobDriver)
(Maybe SparkSubmitJobDriver)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobDriver' {Maybe SparkSubmitJobDriver
sparkSubmitJobDriver :: Maybe SparkSubmitJobDriver
$sel:sparkSubmitJobDriver:JobDriver' :: JobDriver -> Maybe SparkSubmitJobDriver
sparkSubmitJobDriver} -> Maybe SparkSubmitJobDriver
sparkSubmitJobDriver) (\s :: JobDriver
s@JobDriver' {} Maybe SparkSubmitJobDriver
a -> JobDriver
s {$sel:sparkSubmitJobDriver:JobDriver' :: Maybe SparkSubmitJobDriver
sparkSubmitJobDriver = Maybe SparkSubmitJobDriver
a} :: JobDriver)
instance Core.FromJSON JobDriver where
parseJSON :: Value -> Parser JobDriver
parseJSON =
String -> (Object -> Parser JobDriver) -> Value -> Parser JobDriver
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"JobDriver"
( \Object
x ->
Maybe SparkSubmitJobDriver -> JobDriver
JobDriver'
(Maybe SparkSubmitJobDriver -> JobDriver)
-> Parser (Maybe SparkSubmitJobDriver) -> Parser JobDriver
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe SparkSubmitJobDriver)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"sparkSubmitJobDriver")
)
instance Prelude.Hashable JobDriver
instance Prelude.NFData JobDriver
instance Core.ToJSON JobDriver where
toJSON :: JobDriver -> Value
toJSON JobDriver' {Maybe SparkSubmitJobDriver
sparkSubmitJobDriver :: Maybe SparkSubmitJobDriver
$sel:sparkSubmitJobDriver:JobDriver' :: JobDriver -> Maybe SparkSubmitJobDriver
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"sparkSubmitJobDriver" Text -> SparkSubmitJobDriver -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(SparkSubmitJobDriver -> Pair)
-> Maybe SparkSubmitJobDriver -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SparkSubmitJobDriver
sparkSubmitJobDriver
]
)