{-# 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.ClusterStatus where
import qualified Amazonka.Core as Core
import Amazonka.EMR.Types.ClusterState
import Amazonka.EMR.Types.ClusterStateChangeReason
import Amazonka.EMR.Types.ClusterTimeline
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ClusterStatus = ClusterStatus'
{
ClusterStatus -> Maybe ClusterState
state :: Prelude.Maybe ClusterState,
ClusterStatus -> Maybe ClusterStateChangeReason
stateChangeReason :: Prelude.Maybe ClusterStateChangeReason,
ClusterStatus -> Maybe ClusterTimeline
timeline :: Prelude.Maybe ClusterTimeline
}
deriving (ClusterStatus -> ClusterStatus -> Bool
(ClusterStatus -> ClusterStatus -> Bool)
-> (ClusterStatus -> ClusterStatus -> Bool) -> Eq ClusterStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ClusterStatus -> ClusterStatus -> Bool
$c/= :: ClusterStatus -> ClusterStatus -> Bool
== :: ClusterStatus -> ClusterStatus -> Bool
$c== :: ClusterStatus -> ClusterStatus -> Bool
Prelude.Eq, ReadPrec [ClusterStatus]
ReadPrec ClusterStatus
Int -> ReadS ClusterStatus
ReadS [ClusterStatus]
(Int -> ReadS ClusterStatus)
-> ReadS [ClusterStatus]
-> ReadPrec ClusterStatus
-> ReadPrec [ClusterStatus]
-> Read ClusterStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ClusterStatus]
$creadListPrec :: ReadPrec [ClusterStatus]
readPrec :: ReadPrec ClusterStatus
$creadPrec :: ReadPrec ClusterStatus
readList :: ReadS [ClusterStatus]
$creadList :: ReadS [ClusterStatus]
readsPrec :: Int -> ReadS ClusterStatus
$creadsPrec :: Int -> ReadS ClusterStatus
Prelude.Read, Int -> ClusterStatus -> ShowS
[ClusterStatus] -> ShowS
ClusterStatus -> String
(Int -> ClusterStatus -> ShowS)
-> (ClusterStatus -> String)
-> ([ClusterStatus] -> ShowS)
-> Show ClusterStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ClusterStatus] -> ShowS
$cshowList :: [ClusterStatus] -> ShowS
show :: ClusterStatus -> String
$cshow :: ClusterStatus -> String
showsPrec :: Int -> ClusterStatus -> ShowS
$cshowsPrec :: Int -> ClusterStatus -> ShowS
Prelude.Show, (forall x. ClusterStatus -> Rep ClusterStatus x)
-> (forall x. Rep ClusterStatus x -> ClusterStatus)
-> Generic ClusterStatus
forall x. Rep ClusterStatus x -> ClusterStatus
forall x. ClusterStatus -> Rep ClusterStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ClusterStatus x -> ClusterStatus
$cfrom :: forall x. ClusterStatus -> Rep ClusterStatus x
Prelude.Generic)
newClusterStatus ::
ClusterStatus
newClusterStatus :: ClusterStatus
newClusterStatus =
ClusterStatus' :: Maybe ClusterState
-> Maybe ClusterStateChangeReason
-> Maybe ClusterTimeline
-> ClusterStatus
ClusterStatus'
{ $sel:state:ClusterStatus' :: Maybe ClusterState
state = Maybe ClusterState
forall a. Maybe a
Prelude.Nothing,
$sel:stateChangeReason:ClusterStatus' :: Maybe ClusterStateChangeReason
stateChangeReason = Maybe ClusterStateChangeReason
forall a. Maybe a
Prelude.Nothing,
$sel:timeline:ClusterStatus' :: Maybe ClusterTimeline
timeline = Maybe ClusterTimeline
forall a. Maybe a
Prelude.Nothing
}
clusterStatus_state :: Lens.Lens' ClusterStatus (Prelude.Maybe ClusterState)
clusterStatus_state :: (Maybe ClusterState -> f (Maybe ClusterState))
-> ClusterStatus -> f ClusterStatus
clusterStatus_state = (ClusterStatus -> Maybe ClusterState)
-> (ClusterStatus -> Maybe ClusterState -> ClusterStatus)
-> Lens
ClusterStatus
ClusterStatus
(Maybe ClusterState)
(Maybe ClusterState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterStatus' {Maybe ClusterState
state :: Maybe ClusterState
$sel:state:ClusterStatus' :: ClusterStatus -> Maybe ClusterState
state} -> Maybe ClusterState
state) (\s :: ClusterStatus
s@ClusterStatus' {} Maybe ClusterState
a -> ClusterStatus
s {$sel:state:ClusterStatus' :: Maybe ClusterState
state = Maybe ClusterState
a} :: ClusterStatus)
clusterStatus_stateChangeReason :: Lens.Lens' ClusterStatus (Prelude.Maybe ClusterStateChangeReason)
clusterStatus_stateChangeReason :: (Maybe ClusterStateChangeReason
-> f (Maybe ClusterStateChangeReason))
-> ClusterStatus -> f ClusterStatus
clusterStatus_stateChangeReason = (ClusterStatus -> Maybe ClusterStateChangeReason)
-> (ClusterStatus
-> Maybe ClusterStateChangeReason -> ClusterStatus)
-> Lens
ClusterStatus
ClusterStatus
(Maybe ClusterStateChangeReason)
(Maybe ClusterStateChangeReason)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterStatus' {Maybe ClusterStateChangeReason
stateChangeReason :: Maybe ClusterStateChangeReason
$sel:stateChangeReason:ClusterStatus' :: ClusterStatus -> Maybe ClusterStateChangeReason
stateChangeReason} -> Maybe ClusterStateChangeReason
stateChangeReason) (\s :: ClusterStatus
s@ClusterStatus' {} Maybe ClusterStateChangeReason
a -> ClusterStatus
s {$sel:stateChangeReason:ClusterStatus' :: Maybe ClusterStateChangeReason
stateChangeReason = Maybe ClusterStateChangeReason
a} :: ClusterStatus)
clusterStatus_timeline :: Lens.Lens' ClusterStatus (Prelude.Maybe ClusterTimeline)
clusterStatus_timeline :: (Maybe ClusterTimeline -> f (Maybe ClusterTimeline))
-> ClusterStatus -> f ClusterStatus
clusterStatus_timeline = (ClusterStatus -> Maybe ClusterTimeline)
-> (ClusterStatus -> Maybe ClusterTimeline -> ClusterStatus)
-> Lens
ClusterStatus
ClusterStatus
(Maybe ClusterTimeline)
(Maybe ClusterTimeline)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterStatus' {Maybe ClusterTimeline
timeline :: Maybe ClusterTimeline
$sel:timeline:ClusterStatus' :: ClusterStatus -> Maybe ClusterTimeline
timeline} -> Maybe ClusterTimeline
timeline) (\s :: ClusterStatus
s@ClusterStatus' {} Maybe ClusterTimeline
a -> ClusterStatus
s {$sel:timeline:ClusterStatus' :: Maybe ClusterTimeline
timeline = Maybe ClusterTimeline
a} :: ClusterStatus)
instance Core.FromJSON ClusterStatus where
parseJSON :: Value -> Parser ClusterStatus
parseJSON =
String
-> (Object -> Parser ClusterStatus)
-> Value
-> Parser ClusterStatus
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ClusterStatus"
( \Object
x ->
Maybe ClusterState
-> Maybe ClusterStateChangeReason
-> Maybe ClusterTimeline
-> ClusterStatus
ClusterStatus'
(Maybe ClusterState
-> Maybe ClusterStateChangeReason
-> Maybe ClusterTimeline
-> ClusterStatus)
-> Parser (Maybe ClusterState)
-> Parser
(Maybe ClusterStateChangeReason
-> Maybe ClusterTimeline -> ClusterStatus)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ClusterState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"State")
Parser
(Maybe ClusterStateChangeReason
-> Maybe ClusterTimeline -> ClusterStatus)
-> Parser (Maybe ClusterStateChangeReason)
-> Parser (Maybe ClusterTimeline -> ClusterStatus)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ClusterStateChangeReason)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StateChangeReason")
Parser (Maybe ClusterTimeline -> ClusterStatus)
-> Parser (Maybe ClusterTimeline) -> Parser ClusterStatus
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ClusterTimeline)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Timeline")
)
instance Prelude.Hashable ClusterStatus
instance Prelude.NFData ClusterStatus