{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data JobCommand = JobCommand'
{
JobCommand -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
JobCommand -> Maybe Text
pythonVersion :: Prelude.Maybe Prelude.Text,
JobCommand -> Maybe Text
scriptLocation :: Prelude.Maybe Prelude.Text
}
deriving (JobCommand -> JobCommand -> Bool
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]
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
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. 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'
{ $sel:name:JobCommand' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
$sel:pythonVersion:JobCommand' :: Maybe Text
pythonVersion = forall a. Maybe a
Prelude.Nothing,
$sel:scriptLocation:JobCommand' :: Maybe Text
scriptLocation = forall a. Maybe a
Prelude.Nothing
}
jobCommand_name :: Lens.Lens' JobCommand (Prelude.Maybe Prelude.Text)
jobCommand_name :: Lens' JobCommand (Maybe Text)
jobCommand_name = 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)
jobCommand_pythonVersion :: Lens.Lens' JobCommand (Prelude.Maybe Prelude.Text)
jobCommand_pythonVersion :: Lens' JobCommand (Maybe Text)
jobCommand_pythonVersion = 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_scriptLocation :: Lens.Lens' JobCommand (Prelude.Maybe Prelude.Text)
jobCommand_scriptLocation :: Lens' JobCommand (Maybe Text)
jobCommand_scriptLocation = 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)
instance Data.FromJSON JobCommand where
parseJSON :: Value -> Parser JobCommand
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"JobCommand"
( \Object
x ->
Maybe Text -> Maybe Text -> Maybe Text -> JobCommand
JobCommand'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Name")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"PythonVersion")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ScriptLocation")
)
instance Prelude.Hashable JobCommand where
hashWithSalt :: Int -> JobCommand -> Int
hashWithSalt Int
_salt JobCommand' {Maybe Text
scriptLocation :: Maybe Text
pythonVersion :: Maybe Text
name :: Maybe Text
$sel:scriptLocation:JobCommand' :: JobCommand -> Maybe Text
$sel:pythonVersion:JobCommand' :: JobCommand -> Maybe Text
$sel:name:JobCommand' :: JobCommand -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
pythonVersion
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
scriptLocation
instance Prelude.NFData JobCommand where
rnf :: JobCommand -> ()
rnf JobCommand' {Maybe Text
scriptLocation :: Maybe Text
pythonVersion :: Maybe Text
name :: Maybe Text
$sel:scriptLocation:JobCommand' :: JobCommand -> Maybe Text
$sel:pythonVersion:JobCommand' :: JobCommand -> Maybe Text
$sel:name:JobCommand' :: JobCommand -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
pythonVersion
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
scriptLocation
instance Data.ToJSON JobCommand where
toJSON :: JobCommand -> Value
toJSON JobCommand' {Maybe Text
scriptLocation :: Maybe Text
pythonVersion :: Maybe Text
name :: Maybe Text
$sel:scriptLocation:JobCommand' :: JobCommand -> Maybe Text
$sel:pythonVersion:JobCommand' :: JobCommand -> Maybe Text
$sel:name:JobCommand' :: JobCommand -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Name" 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
name,
(Key
"PythonVersion" 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
pythonVersion,
(Key
"ScriptLocation" 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
scriptLocation
]
)