{-# 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.Glue.Types.JobCommand where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data JobCommand = JobCommand'
{
JobCommand -> Maybe Text
scriptLocation :: Prelude.Maybe Prelude.Text,
JobCommand -> Maybe Text
pythonVersion :: Prelude.Maybe Prelude.Text,
JobCommand -> Maybe Text
name :: Prelude.Maybe Prelude.Text
}
deriving (JobCommand -> JobCommand -> Bool
(JobCommand -> JobCommand -> Bool)
-> (JobCommand -> JobCommand -> Bool) -> Eq JobCommand
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: JobCommand -> JobCommand -> Bool
$c/= :: JobCommand -> JobCommand -> Bool
== :: JobCommand -> JobCommand -> Bool
$c== :: JobCommand -> JobCommand -> Bool
Prelude.Eq, ReadPrec [JobCommand]
ReadPrec JobCommand
Int -> ReadS JobCommand
ReadS [JobCommand]
(Int -> ReadS JobCommand)
-> ReadS [JobCommand]
-> ReadPrec JobCommand
-> ReadPrec [JobCommand]
-> Read JobCommand
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [JobCommand]
$creadListPrec :: ReadPrec [JobCommand]
readPrec :: ReadPrec JobCommand
$creadPrec :: ReadPrec JobCommand
readList :: ReadS [JobCommand]
$creadList :: ReadS [JobCommand]
readsPrec :: Int -> ReadS JobCommand
$creadsPrec :: Int -> ReadS JobCommand
Prelude.Read, Int -> JobCommand -> ShowS
[JobCommand] -> ShowS
JobCommand -> String
(Int -> JobCommand -> ShowS)
-> (JobCommand -> String)
-> ([JobCommand] -> ShowS)
-> Show JobCommand
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [JobCommand] -> ShowS
$cshowList :: [JobCommand] -> ShowS
show :: JobCommand -> String
$cshow :: JobCommand -> String
showsPrec :: Int -> JobCommand -> ShowS
$cshowsPrec :: Int -> JobCommand -> ShowS
Prelude.Show, (forall x. JobCommand -> Rep JobCommand x)
-> (forall x. Rep JobCommand x -> JobCommand) -> Generic JobCommand
forall x. Rep JobCommand x -> JobCommand
forall x. JobCommand -> Rep JobCommand x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep JobCommand x -> JobCommand
$cfrom :: forall x. JobCommand -> Rep JobCommand x
Prelude.Generic)
newJobCommand ::
JobCommand
newJobCommand :: JobCommand
newJobCommand =
JobCommand' :: Maybe Text -> Maybe Text -> Maybe Text -> JobCommand
JobCommand'
{ $sel:scriptLocation:JobCommand' :: Maybe Text
scriptLocation = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:pythonVersion:JobCommand' :: Maybe Text
pythonVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:JobCommand' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
jobCommand_scriptLocation :: Lens.Lens' JobCommand (Prelude.Maybe Prelude.Text)
jobCommand_scriptLocation :: (Maybe Text -> f (Maybe Text)) -> JobCommand -> f JobCommand
jobCommand_scriptLocation = (JobCommand -> Maybe Text)
-> (JobCommand -> Maybe Text -> JobCommand)
-> Lens JobCommand JobCommand (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobCommand' {Maybe Text
scriptLocation :: Maybe Text
$sel:scriptLocation:JobCommand' :: JobCommand -> Maybe Text
scriptLocation} -> Maybe Text
scriptLocation) (\s :: JobCommand
s@JobCommand' {} Maybe Text
a -> JobCommand
s {$sel:scriptLocation:JobCommand' :: Maybe Text
scriptLocation = Maybe Text
a} :: JobCommand)
jobCommand_pythonVersion :: Lens.Lens' JobCommand (Prelude.Maybe Prelude.Text)
jobCommand_pythonVersion :: (Maybe Text -> f (Maybe Text)) -> JobCommand -> f JobCommand
jobCommand_pythonVersion = (JobCommand -> Maybe Text)
-> (JobCommand -> Maybe Text -> JobCommand)
-> Lens JobCommand JobCommand (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobCommand' {Maybe Text
pythonVersion :: Maybe Text
$sel:pythonVersion:JobCommand' :: JobCommand -> Maybe Text
pythonVersion} -> Maybe Text
pythonVersion) (\s :: JobCommand
s@JobCommand' {} Maybe Text
a -> JobCommand
s {$sel:pythonVersion:JobCommand' :: Maybe Text
pythonVersion = Maybe Text
a} :: JobCommand)
jobCommand_name :: Lens.Lens' JobCommand (Prelude.Maybe Prelude.Text)
jobCommand_name :: (Maybe Text -> f (Maybe Text)) -> JobCommand -> f JobCommand
jobCommand_name = (JobCommand -> Maybe Text)
-> (JobCommand -> Maybe Text -> JobCommand)
-> Lens JobCommand JobCommand (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobCommand' {Maybe Text
name :: Maybe Text
$sel:name:JobCommand' :: JobCommand -> Maybe Text
name} -> Maybe Text
name) (\s :: JobCommand
s@JobCommand' {} Maybe Text
a -> JobCommand
s {$sel:name:JobCommand' :: Maybe Text
name = Maybe Text
a} :: JobCommand)
instance Core.FromJSON JobCommand where
parseJSON :: Value -> Parser JobCommand
parseJSON =
String
-> (Object -> Parser JobCommand) -> Value -> Parser JobCommand
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"JobCommand"
( \Object
x ->
Maybe Text -> Maybe Text -> Maybe Text -> JobCommand
JobCommand'
(Maybe Text -> Maybe Text -> Maybe Text -> JobCommand)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> JobCommand)
forall (f :: * -> *) a b. Functor 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
"ScriptLocation")
Parser (Maybe Text -> Maybe Text -> JobCommand)
-> Parser (Maybe Text) -> Parser (Maybe Text -> JobCommand)
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
"PythonVersion")
Parser (Maybe Text -> JobCommand)
-> Parser (Maybe Text) -> Parser JobCommand
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
"Name")
)
instance Prelude.Hashable JobCommand
instance Prelude.NFData JobCommand
instance Core.ToJSON JobCommand where
toJSON :: JobCommand -> Value
toJSON JobCommand' {Maybe Text
name :: Maybe Text
pythonVersion :: Maybe Text
scriptLocation :: Maybe Text
$sel:name:JobCommand' :: JobCommand -> Maybe Text
$sel:pythonVersion:JobCommand' :: JobCommand -> Maybe Text
$sel:scriptLocation:JobCommand' :: JobCommand -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"ScriptLocation" 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
scriptLocation,
(Text
"PythonVersion" 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
pythonVersion,
(Text
"Name" 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
name
]
)