{-# 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.SES.Types.Message where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SES.Types.Body
import Amazonka.SES.Types.Content
data Message = Message'
{
Message -> Content
subject :: Content,
Message -> Body
body :: Body
}
deriving (Message -> Message -> Bool
(Message -> Message -> Bool)
-> (Message -> Message -> Bool) -> Eq Message
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Message -> Message -> Bool
$c/= :: Message -> Message -> Bool
== :: Message -> Message -> Bool
$c== :: Message -> Message -> Bool
Prelude.Eq, ReadPrec [Message]
ReadPrec Message
Int -> ReadS Message
ReadS [Message]
(Int -> ReadS Message)
-> ReadS [Message]
-> ReadPrec Message
-> ReadPrec [Message]
-> Read Message
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Message]
$creadListPrec :: ReadPrec [Message]
readPrec :: ReadPrec Message
$creadPrec :: ReadPrec Message
readList :: ReadS [Message]
$creadList :: ReadS [Message]
readsPrec :: Int -> ReadS Message
$creadsPrec :: Int -> ReadS Message
Prelude.Read, Int -> Message -> ShowS
[Message] -> ShowS
Message -> String
(Int -> Message -> ShowS)
-> (Message -> String) -> ([Message] -> ShowS) -> Show Message
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Message] -> ShowS
$cshowList :: [Message] -> ShowS
show :: Message -> String
$cshow :: Message -> String
showsPrec :: Int -> Message -> ShowS
$cshowsPrec :: Int -> Message -> ShowS
Prelude.Show, (forall x. Message -> Rep Message x)
-> (forall x. Rep Message x -> Message) -> Generic Message
forall x. Rep Message x -> Message
forall x. Message -> Rep Message x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Message x -> Message
$cfrom :: forall x. Message -> Rep Message x
Prelude.Generic)
newMessage ::
Content ->
Body ->
Message
newMessage :: Content -> Body -> Message
newMessage Content
pSubject_ Body
pBody_ =
Message' :: Content -> Body -> Message
Message' {$sel:subject:Message' :: Content
subject = Content
pSubject_, $sel:body:Message' :: Body
body = Body
pBody_}
message_subject :: Lens.Lens' Message Content
message_subject :: (Content -> f Content) -> Message -> f Message
message_subject = (Message -> Content)
-> (Message -> Content -> Message)
-> Lens Message Message Content Content
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Message' {Content
subject :: Content
$sel:subject:Message' :: Message -> Content
subject} -> Content
subject) (\s :: Message
s@Message' {} Content
a -> Message
s {$sel:subject:Message' :: Content
subject = Content
a} :: Message)
message_body :: Lens.Lens' Message Body
message_body :: (Body -> f Body) -> Message -> f Message
message_body = (Message -> Body)
-> (Message -> Body -> Message) -> Lens Message Message Body Body
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Message' {Body
body :: Body
$sel:body:Message' :: Message -> Body
body} -> Body
body) (\s :: Message
s@Message' {} Body
a -> Message
s {$sel:body:Message' :: Body
body = Body
a} :: Message)
instance Prelude.Hashable Message
instance Prelude.NFData Message
instance Core.ToQuery Message where
toQuery :: Message -> QueryString
toQuery Message' {Content
Body
body :: Body
subject :: Content
$sel:body:Message' :: Message -> Body
$sel:subject:Message' :: Message -> Content
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"Subject" ByteString -> Content -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Content
subject, ByteString
"Body" ByteString -> Body -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Body
body]