{-# 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.StepSummary 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 StepSummary = StepSummary'
{
StepSummary -> Maybe StepStatus
status :: Prelude.Maybe StepStatus,
StepSummary -> Maybe ActionOnFailure
actionOnFailure :: Prelude.Maybe ActionOnFailure,
StepSummary -> Maybe HadoopStepConfig
config :: Prelude.Maybe HadoopStepConfig,
StepSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
StepSummary -> Maybe Text
id :: Prelude.Maybe Prelude.Text
}
deriving (StepSummary -> StepSummary -> Bool
(StepSummary -> StepSummary -> Bool)
-> (StepSummary -> StepSummary -> Bool) -> Eq StepSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StepSummary -> StepSummary -> Bool
$c/= :: StepSummary -> StepSummary -> Bool
== :: StepSummary -> StepSummary -> Bool
$c== :: StepSummary -> StepSummary -> Bool
Prelude.Eq, ReadPrec [StepSummary]
ReadPrec StepSummary
Int -> ReadS StepSummary
ReadS [StepSummary]
(Int -> ReadS StepSummary)
-> ReadS [StepSummary]
-> ReadPrec StepSummary
-> ReadPrec [StepSummary]
-> Read StepSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StepSummary]
$creadListPrec :: ReadPrec [StepSummary]
readPrec :: ReadPrec StepSummary
$creadPrec :: ReadPrec StepSummary
readList :: ReadS [StepSummary]
$creadList :: ReadS [StepSummary]
readsPrec :: Int -> ReadS StepSummary
$creadsPrec :: Int -> ReadS StepSummary
Prelude.Read, Int -> StepSummary -> ShowS
[StepSummary] -> ShowS
StepSummary -> String
(Int -> StepSummary -> ShowS)
-> (StepSummary -> String)
-> ([StepSummary] -> ShowS)
-> Show StepSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StepSummary] -> ShowS
$cshowList :: [StepSummary] -> ShowS
show :: StepSummary -> String
$cshow :: StepSummary -> String
showsPrec :: Int -> StepSummary -> ShowS
$cshowsPrec :: Int -> StepSummary -> ShowS
Prelude.Show, (forall x. StepSummary -> Rep StepSummary x)
-> (forall x. Rep StepSummary x -> StepSummary)
-> Generic StepSummary
forall x. Rep StepSummary x -> StepSummary
forall x. StepSummary -> Rep StepSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StepSummary x -> StepSummary
$cfrom :: forall x. StepSummary -> Rep StepSummary x
Prelude.Generic)
newStepSummary ::
StepSummary
newStepSummary :: StepSummary
newStepSummary =
StepSummary' :: Maybe StepStatus
-> Maybe ActionOnFailure
-> Maybe HadoopStepConfig
-> Maybe Text
-> Maybe Text
-> StepSummary
StepSummary'
{ $sel:status:StepSummary' :: Maybe StepStatus
status = Maybe StepStatus
forall a. Maybe a
Prelude.Nothing,
$sel:actionOnFailure:StepSummary' :: Maybe ActionOnFailure
actionOnFailure = Maybe ActionOnFailure
forall a. Maybe a
Prelude.Nothing,
$sel:config:StepSummary' :: Maybe HadoopStepConfig
config = Maybe HadoopStepConfig
forall a. Maybe a
Prelude.Nothing,
$sel:name:StepSummary' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:id:StepSummary' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
stepSummary_status :: Lens.Lens' StepSummary (Prelude.Maybe StepStatus)
stepSummary_status :: (Maybe StepStatus -> f (Maybe StepStatus))
-> StepSummary -> f StepSummary
stepSummary_status = (StepSummary -> Maybe StepStatus)
-> (StepSummary -> Maybe StepStatus -> StepSummary)
-> Lens
StepSummary StepSummary (Maybe StepStatus) (Maybe StepStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StepSummary' {Maybe StepStatus
status :: Maybe StepStatus
$sel:status:StepSummary' :: StepSummary -> Maybe StepStatus
status} -> Maybe StepStatus
status) (\s :: StepSummary
s@StepSummary' {} Maybe StepStatus
a -> StepSummary
s {$sel:status:StepSummary' :: Maybe StepStatus
status = Maybe StepStatus
a} :: StepSummary)
stepSummary_actionOnFailure :: Lens.Lens' StepSummary (Prelude.Maybe ActionOnFailure)
stepSummary_actionOnFailure :: (Maybe ActionOnFailure -> f (Maybe ActionOnFailure))
-> StepSummary -> f StepSummary
stepSummary_actionOnFailure = (StepSummary -> Maybe ActionOnFailure)
-> (StepSummary -> Maybe ActionOnFailure -> StepSummary)
-> Lens
StepSummary
StepSummary
(Maybe ActionOnFailure)
(Maybe ActionOnFailure)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StepSummary' {Maybe ActionOnFailure
actionOnFailure :: Maybe ActionOnFailure
$sel:actionOnFailure:StepSummary' :: StepSummary -> Maybe ActionOnFailure
actionOnFailure} -> Maybe ActionOnFailure
actionOnFailure) (\s :: StepSummary
s@StepSummary' {} Maybe ActionOnFailure
a -> StepSummary
s {$sel:actionOnFailure:StepSummary' :: Maybe ActionOnFailure
actionOnFailure = Maybe ActionOnFailure
a} :: StepSummary)
stepSummary_config :: Lens.Lens' StepSummary (Prelude.Maybe HadoopStepConfig)
stepSummary_config :: (Maybe HadoopStepConfig -> f (Maybe HadoopStepConfig))
-> StepSummary -> f StepSummary
stepSummary_config = (StepSummary -> Maybe HadoopStepConfig)
-> (StepSummary -> Maybe HadoopStepConfig -> StepSummary)
-> Lens
StepSummary
StepSummary
(Maybe HadoopStepConfig)
(Maybe HadoopStepConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StepSummary' {Maybe HadoopStepConfig
config :: Maybe HadoopStepConfig
$sel:config:StepSummary' :: StepSummary -> Maybe HadoopStepConfig
config} -> Maybe HadoopStepConfig
config) (\s :: StepSummary
s@StepSummary' {} Maybe HadoopStepConfig
a -> StepSummary
s {$sel:config:StepSummary' :: Maybe HadoopStepConfig
config = Maybe HadoopStepConfig
a} :: StepSummary)
stepSummary_name :: Lens.Lens' StepSummary (Prelude.Maybe Prelude.Text)
stepSummary_name :: (Maybe Text -> f (Maybe Text)) -> StepSummary -> f StepSummary
stepSummary_name = (StepSummary -> Maybe Text)
-> (StepSummary -> Maybe Text -> StepSummary)
-> Lens StepSummary StepSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StepSummary' {Maybe Text
name :: Maybe Text
$sel:name:StepSummary' :: StepSummary -> Maybe Text
name} -> Maybe Text
name) (\s :: StepSummary
s@StepSummary' {} Maybe Text
a -> StepSummary
s {$sel:name:StepSummary' :: Maybe Text
name = Maybe Text
a} :: StepSummary)
stepSummary_id :: Lens.Lens' StepSummary (Prelude.Maybe Prelude.Text)
stepSummary_id :: (Maybe Text -> f (Maybe Text)) -> StepSummary -> f StepSummary
stepSummary_id = (StepSummary -> Maybe Text)
-> (StepSummary -> Maybe Text -> StepSummary)
-> Lens StepSummary StepSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StepSummary' {Maybe Text
id :: Maybe Text
$sel:id:StepSummary' :: StepSummary -> Maybe Text
id} -> Maybe Text
id) (\s :: StepSummary
s@StepSummary' {} Maybe Text
a -> StepSummary
s {$sel:id:StepSummary' :: Maybe Text
id = Maybe Text
a} :: StepSummary)
instance Core.FromJSON StepSummary where
parseJSON :: Value -> Parser StepSummary
parseJSON =
String
-> (Object -> Parser StepSummary) -> Value -> Parser StepSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"StepSummary"
( \Object
x ->
Maybe StepStatus
-> Maybe ActionOnFailure
-> Maybe HadoopStepConfig
-> Maybe Text
-> Maybe Text
-> StepSummary
StepSummary'
(Maybe StepStatus
-> Maybe ActionOnFailure
-> Maybe HadoopStepConfig
-> Maybe Text
-> Maybe Text
-> StepSummary)
-> Parser (Maybe StepStatus)
-> Parser
(Maybe ActionOnFailure
-> Maybe HadoopStepConfig
-> Maybe Text
-> Maybe Text
-> StepSummary)
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
-> StepSummary)
-> Parser (Maybe ActionOnFailure)
-> Parser
(Maybe HadoopStepConfig -> Maybe Text -> Maybe Text -> StepSummary)
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 -> StepSummary)
-> Parser (Maybe HadoopStepConfig)
-> Parser (Maybe Text -> Maybe Text -> StepSummary)
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 -> StepSummary)
-> Parser (Maybe Text) -> Parser (Maybe Text -> StepSummary)
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 -> StepSummary)
-> Parser (Maybe Text) -> Parser StepSummary
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 StepSummary
instance Prelude.NFData StepSummary