{-# 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.CloudWatch.Types.MessageData where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data MessageData = MessageData'
{
MessageData -> Maybe Text
value :: Prelude.Maybe Prelude.Text,
MessageData -> Maybe Text
code :: Prelude.Maybe Prelude.Text
}
deriving (MessageData -> MessageData -> Bool
(MessageData -> MessageData -> Bool)
-> (MessageData -> MessageData -> Bool) -> Eq MessageData
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MessageData -> MessageData -> Bool
$c/= :: MessageData -> MessageData -> Bool
== :: MessageData -> MessageData -> Bool
$c== :: MessageData -> MessageData -> Bool
Prelude.Eq, ReadPrec [MessageData]
ReadPrec MessageData
Int -> ReadS MessageData
ReadS [MessageData]
(Int -> ReadS MessageData)
-> ReadS [MessageData]
-> ReadPrec MessageData
-> ReadPrec [MessageData]
-> Read MessageData
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MessageData]
$creadListPrec :: ReadPrec [MessageData]
readPrec :: ReadPrec MessageData
$creadPrec :: ReadPrec MessageData
readList :: ReadS [MessageData]
$creadList :: ReadS [MessageData]
readsPrec :: Int -> ReadS MessageData
$creadsPrec :: Int -> ReadS MessageData
Prelude.Read, Int -> MessageData -> ShowS
[MessageData] -> ShowS
MessageData -> String
(Int -> MessageData -> ShowS)
-> (MessageData -> String)
-> ([MessageData] -> ShowS)
-> Show MessageData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MessageData] -> ShowS
$cshowList :: [MessageData] -> ShowS
show :: MessageData -> String
$cshow :: MessageData -> String
showsPrec :: Int -> MessageData -> ShowS
$cshowsPrec :: Int -> MessageData -> ShowS
Prelude.Show, (forall x. MessageData -> Rep MessageData x)
-> (forall x. Rep MessageData x -> MessageData)
-> Generic MessageData
forall x. Rep MessageData x -> MessageData
forall x. MessageData -> Rep MessageData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MessageData x -> MessageData
$cfrom :: forall x. MessageData -> Rep MessageData x
Prelude.Generic)
newMessageData ::
MessageData
newMessageData :: MessageData
newMessageData =
MessageData' :: Maybe Text -> Maybe Text -> MessageData
MessageData'
{ $sel:value:MessageData' :: Maybe Text
value = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:code:MessageData' :: Maybe Text
code = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
messageData_value :: Lens.Lens' MessageData (Prelude.Maybe Prelude.Text)
messageData_value :: (Maybe Text -> f (Maybe Text)) -> MessageData -> f MessageData
messageData_value = (MessageData -> Maybe Text)
-> (MessageData -> Maybe Text -> MessageData)
-> Lens MessageData MessageData (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MessageData' {Maybe Text
value :: Maybe Text
$sel:value:MessageData' :: MessageData -> Maybe Text
value} -> Maybe Text
value) (\s :: MessageData
s@MessageData' {} Maybe Text
a -> MessageData
s {$sel:value:MessageData' :: Maybe Text
value = Maybe Text
a} :: MessageData)
messageData_code :: Lens.Lens' MessageData (Prelude.Maybe Prelude.Text)
messageData_code :: (Maybe Text -> f (Maybe Text)) -> MessageData -> f MessageData
messageData_code = (MessageData -> Maybe Text)
-> (MessageData -> Maybe Text -> MessageData)
-> Lens MessageData MessageData (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MessageData' {Maybe Text
code :: Maybe Text
$sel:code:MessageData' :: MessageData -> Maybe Text
code} -> Maybe Text
code) (\s :: MessageData
s@MessageData' {} Maybe Text
a -> MessageData
s {$sel:code:MessageData' :: Maybe Text
code = Maybe Text
a} :: MessageData)
instance Core.FromXML MessageData where
parseXML :: [Node] -> Either String MessageData
parseXML [Node]
x =
Maybe Text -> Maybe Text -> MessageData
MessageData'
(Maybe Text -> Maybe Text -> MessageData)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> MessageData)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Value") Either String (Maybe Text -> MessageData)
-> Either String (Maybe Text) -> Either String MessageData
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Code")
instance Prelude.Hashable MessageData
instance Prelude.NFData MessageData