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