{-# 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.Step where
import qualified Amazonka.Core as Core
import Amazonka.EMR.Types.ActionOnFailure
import Amazonka.EMR.Types.HadoopStepConfig
import Amazonka.EMR.Types.StepStatus
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Step = Step'
{
Step -> Maybe StepStatus
status :: Prelude.Maybe StepStatus,
Step -> Maybe ActionOnFailure
actionOnFailure :: Prelude.Maybe ActionOnFailure,
Step -> Maybe HadoopStepConfig
config :: Prelude.Maybe HadoopStepConfig,
Step -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
Step -> Maybe Text
id :: Prelude.Maybe Prelude.Text
}
deriving (Step -> Step -> Bool
(Step -> Step -> Bool) -> (Step -> Step -> Bool) -> Eq Step
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Step -> Step -> Bool
$c/= :: Step -> Step -> Bool
== :: Step -> Step -> Bool
$c== :: Step -> Step -> Bool
Prelude.Eq, ReadPrec [Step]
ReadPrec Step
Int -> ReadS Step
ReadS [Step]
(Int -> ReadS Step)
-> ReadS [Step] -> ReadPrec Step -> ReadPrec [Step] -> Read Step
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Step]
$creadListPrec :: ReadPrec [Step]
readPrec :: ReadPrec Step
$creadPrec :: ReadPrec Step
readList :: ReadS [Step]
$creadList :: ReadS [Step]
readsPrec :: Int -> ReadS Step
$creadsPrec :: Int -> ReadS Step
Prelude.Read, Int -> Step -> ShowS
[Step] -> ShowS
Step -> String
(Int -> Step -> ShowS)
-> (Step -> String) -> ([Step] -> ShowS) -> Show Step
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Step] -> ShowS
$cshowList :: [Step] -> ShowS
show :: Step -> String
$cshow :: Step -> String
showsPrec :: Int -> Step -> ShowS
$cshowsPrec :: Int -> Step -> ShowS
Prelude.Show, (forall x. Step -> Rep Step x)
-> (forall x. Rep Step x -> Step) -> Generic Step
forall x. Rep Step x -> Step
forall x. Step -> Rep Step x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Step x -> Step
$cfrom :: forall x. Step -> Rep Step x
Prelude.Generic)
newStep ::
Step
newStep :: Step
newStep =
Step' :: Maybe StepStatus
-> Maybe ActionOnFailure
-> Maybe HadoopStepConfig
-> Maybe Text
-> Maybe Text
-> Step
Step'
{ $sel:status:Step' :: Maybe StepStatus
status = Maybe StepStatus
forall a. Maybe a
Prelude.Nothing,
$sel:actionOnFailure:Step' :: Maybe ActionOnFailure
actionOnFailure = Maybe ActionOnFailure
forall a. Maybe a
Prelude.Nothing,
$sel:config:Step' :: Maybe HadoopStepConfig
config = Maybe HadoopStepConfig
forall a. Maybe a
Prelude.Nothing,
$sel:name:Step' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:id:Step' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
step_status :: Lens.Lens' Step (Prelude.Maybe StepStatus)
step_status :: (Maybe StepStatus -> f (Maybe StepStatus)) -> Step -> f Step
step_status = (Step -> Maybe StepStatus)
-> (Step -> Maybe StepStatus -> Step)
-> Lens Step Step (Maybe StepStatus) (Maybe StepStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Step' {Maybe StepStatus
status :: Maybe StepStatus
$sel:status:Step' :: Step -> Maybe StepStatus
status} -> Maybe StepStatus
status) (\s :: Step
s@Step' {} Maybe StepStatus
a -> Step
s {$sel:status:Step' :: Maybe StepStatus
status = Maybe StepStatus
a} :: Step)
step_actionOnFailure :: Lens.Lens' Step (Prelude.Maybe ActionOnFailure)
step_actionOnFailure :: (Maybe ActionOnFailure -> f (Maybe ActionOnFailure))
-> Step -> f Step
step_actionOnFailure = (Step -> Maybe ActionOnFailure)
-> (Step -> Maybe ActionOnFailure -> Step)
-> Lens Step Step (Maybe ActionOnFailure) (Maybe ActionOnFailure)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Step' {Maybe ActionOnFailure
actionOnFailure :: Maybe ActionOnFailure
$sel:actionOnFailure:Step' :: Step -> Maybe ActionOnFailure
actionOnFailure} -> Maybe ActionOnFailure
actionOnFailure) (\s :: Step
s@Step' {} Maybe ActionOnFailure
a -> Step
s {$sel:actionOnFailure:Step' :: Maybe ActionOnFailure
actionOnFailure = Maybe ActionOnFailure
a} :: Step)
step_config :: Lens.Lens' Step (Prelude.Maybe HadoopStepConfig)
step_config :: (Maybe HadoopStepConfig -> f (Maybe HadoopStepConfig))
-> Step -> f Step
step_config = (Step -> Maybe HadoopStepConfig)
-> (Step -> Maybe HadoopStepConfig -> Step)
-> Lens Step Step (Maybe HadoopStepConfig) (Maybe HadoopStepConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Step' {Maybe HadoopStepConfig
config :: Maybe HadoopStepConfig
$sel:config:Step' :: Step -> Maybe HadoopStepConfig
config} -> Maybe HadoopStepConfig
config) (\s :: Step
s@Step' {} Maybe HadoopStepConfig
a -> Step
s {$sel:config:Step' :: Maybe HadoopStepConfig
config = Maybe HadoopStepConfig
a} :: Step)
step_name :: Lens.Lens' Step (Prelude.Maybe Prelude.Text)
step_name :: (Maybe Text -> f (Maybe Text)) -> Step -> f Step
step_name = (Step -> Maybe Text)
-> (Step -> Maybe Text -> Step)
-> Lens Step Step (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Step' {Maybe Text
name :: Maybe Text
$sel:name:Step' :: Step -> Maybe Text
name} -> Maybe Text
name) (\s :: Step
s@Step' {} Maybe Text
a -> Step
s {$sel:name:Step' :: Maybe Text
name = Maybe Text
a} :: Step)
step_id :: Lens.Lens' Step (Prelude.Maybe Prelude.Text)
step_id :: (Maybe Text -> f (Maybe Text)) -> Step -> f Step
step_id = (Step -> Maybe Text)
-> (Step -> Maybe Text -> Step)
-> Lens Step Step (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Step' {Maybe Text
id :: Maybe Text
$sel:id:Step' :: Step -> Maybe Text
id} -> Maybe Text
id) (\s :: Step
s@Step' {} Maybe Text
a -> Step
s {$sel:id:Step' :: Maybe Text
id = Maybe Text
a} :: Step)
instance Core.FromJSON Step where
parseJSON :: Value -> Parser Step
parseJSON =
String -> (Object -> Parser Step) -> Value -> Parser Step
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Step"
( \Object
x ->
Maybe StepStatus
-> Maybe ActionOnFailure
-> Maybe HadoopStepConfig
-> Maybe Text
-> Maybe Text
-> Step
Step'
(Maybe StepStatus
-> Maybe ActionOnFailure
-> Maybe HadoopStepConfig
-> Maybe Text
-> Maybe Text
-> Step)
-> Parser (Maybe StepStatus)
-> Parser
(Maybe ActionOnFailure
-> Maybe HadoopStepConfig -> Maybe Text -> Maybe Text -> Step)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe StepStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
Parser
(Maybe ActionOnFailure
-> Maybe HadoopStepConfig -> Maybe Text -> Maybe Text -> Step)
-> Parser (Maybe ActionOnFailure)
-> Parser
(Maybe HadoopStepConfig -> Maybe Text -> Maybe Text -> Step)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ActionOnFailure)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ActionOnFailure")
Parser (Maybe HadoopStepConfig -> Maybe Text -> Maybe Text -> Step)
-> Parser (Maybe HadoopStepConfig)
-> Parser (Maybe Text -> Maybe Text -> Step)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe HadoopStepConfig)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Config")
Parser (Maybe Text -> Maybe Text -> Step)
-> Parser (Maybe Text) -> Parser (Maybe Text -> Step)
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")
Parser (Maybe Text -> Step) -> Parser (Maybe Text) -> Parser Step
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
"Id")
)
instance Prelude.Hashable Step
instance Prelude.NFData Step