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