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