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