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