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