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