{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.WorkMailMessageFlow.PutRawMessageContent
(
PutRawMessageContent (..),
newPutRawMessageContent,
putRawMessageContent_messageId,
putRawMessageContent_content,
PutRawMessageContentResponse (..),
newPutRawMessageContentResponse,
putRawMessageContentResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.WorkMailMessageFlow.Types
data PutRawMessageContent = PutRawMessageContent'
{
PutRawMessageContent -> Text
messageId :: Prelude.Text,
PutRawMessageContent -> RawMessageContent
content :: RawMessageContent
}
deriving (PutRawMessageContent -> PutRawMessageContent -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutRawMessageContent -> PutRawMessageContent -> Bool
$c/= :: PutRawMessageContent -> PutRawMessageContent -> Bool
== :: PutRawMessageContent -> PutRawMessageContent -> Bool
$c== :: PutRawMessageContent -> PutRawMessageContent -> Bool
Prelude.Eq, ReadPrec [PutRawMessageContent]
ReadPrec PutRawMessageContent
Int -> ReadS PutRawMessageContent
ReadS [PutRawMessageContent]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutRawMessageContent]
$creadListPrec :: ReadPrec [PutRawMessageContent]
readPrec :: ReadPrec PutRawMessageContent
$creadPrec :: ReadPrec PutRawMessageContent
readList :: ReadS [PutRawMessageContent]
$creadList :: ReadS [PutRawMessageContent]
readsPrec :: Int -> ReadS PutRawMessageContent
$creadsPrec :: Int -> ReadS PutRawMessageContent
Prelude.Read, Int -> PutRawMessageContent -> ShowS
[PutRawMessageContent] -> ShowS
PutRawMessageContent -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutRawMessageContent] -> ShowS
$cshowList :: [PutRawMessageContent] -> ShowS
show :: PutRawMessageContent -> String
$cshow :: PutRawMessageContent -> String
showsPrec :: Int -> PutRawMessageContent -> ShowS
$cshowsPrec :: Int -> PutRawMessageContent -> ShowS
Prelude.Show, forall x. Rep PutRawMessageContent x -> PutRawMessageContent
forall x. PutRawMessageContent -> Rep PutRawMessageContent x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutRawMessageContent x -> PutRawMessageContent
$cfrom :: forall x. PutRawMessageContent -> Rep PutRawMessageContent x
Prelude.Generic)
newPutRawMessageContent ::
Prelude.Text ->
RawMessageContent ->
PutRawMessageContent
newPutRawMessageContent :: Text -> RawMessageContent -> PutRawMessageContent
newPutRawMessageContent Text
pMessageId_ RawMessageContent
pContent_ =
PutRawMessageContent'
{ $sel:messageId:PutRawMessageContent' :: Text
messageId = Text
pMessageId_,
$sel:content:PutRawMessageContent' :: RawMessageContent
content = RawMessageContent
pContent_
}
putRawMessageContent_messageId :: Lens.Lens' PutRawMessageContent Prelude.Text
putRawMessageContent_messageId :: Lens' PutRawMessageContent Text
putRawMessageContent_messageId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutRawMessageContent' {Text
messageId :: Text
$sel:messageId:PutRawMessageContent' :: PutRawMessageContent -> Text
messageId} -> Text
messageId) (\s :: PutRawMessageContent
s@PutRawMessageContent' {} Text
a -> PutRawMessageContent
s {$sel:messageId:PutRawMessageContent' :: Text
messageId = Text
a} :: PutRawMessageContent)
putRawMessageContent_content :: Lens.Lens' PutRawMessageContent RawMessageContent
putRawMessageContent_content :: Lens' PutRawMessageContent RawMessageContent
putRawMessageContent_content = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutRawMessageContent' {RawMessageContent
content :: RawMessageContent
$sel:content:PutRawMessageContent' :: PutRawMessageContent -> RawMessageContent
content} -> RawMessageContent
content) (\s :: PutRawMessageContent
s@PutRawMessageContent' {} RawMessageContent
a -> PutRawMessageContent
s {$sel:content:PutRawMessageContent' :: RawMessageContent
content = RawMessageContent
a} :: PutRawMessageContent)
instance Core.AWSRequest PutRawMessageContent where
type
AWSResponse PutRawMessageContent =
PutRawMessageContentResponse
request :: (Service -> Service)
-> PutRawMessageContent -> Request PutRawMessageContent
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy PutRawMessageContent
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutRawMessageContent)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> PutRawMessageContentResponse
PutRawMessageContentResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable PutRawMessageContent where
hashWithSalt :: Int -> PutRawMessageContent -> Int
hashWithSalt Int
_salt PutRawMessageContent' {Text
RawMessageContent
content :: RawMessageContent
messageId :: Text
$sel:content:PutRawMessageContent' :: PutRawMessageContent -> RawMessageContent
$sel:messageId:PutRawMessageContent' :: PutRawMessageContent -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
messageId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` RawMessageContent
content
instance Prelude.NFData PutRawMessageContent where
rnf :: PutRawMessageContent -> ()
rnf PutRawMessageContent' {Text
RawMessageContent
content :: RawMessageContent
messageId :: Text
$sel:content:PutRawMessageContent' :: PutRawMessageContent -> RawMessageContent
$sel:messageId:PutRawMessageContent' :: PutRawMessageContent -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
messageId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf RawMessageContent
content
instance Data.ToHeaders PutRawMessageContent where
toHeaders :: PutRawMessageContent -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON PutRawMessageContent where
toJSON :: PutRawMessageContent -> Value
toJSON PutRawMessageContent' {Text
RawMessageContent
content :: RawMessageContent
messageId :: Text
$sel:content:PutRawMessageContent' :: PutRawMessageContent -> RawMessageContent
$sel:messageId:PutRawMessageContent' :: PutRawMessageContent -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"content" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= RawMessageContent
content)]
)
instance Data.ToPath PutRawMessageContent where
toPath :: PutRawMessageContent -> ByteString
toPath PutRawMessageContent' {Text
RawMessageContent
content :: RawMessageContent
messageId :: Text
$sel:content:PutRawMessageContent' :: PutRawMessageContent -> RawMessageContent
$sel:messageId:PutRawMessageContent' :: PutRawMessageContent -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/messages/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
messageId]
instance Data.ToQuery PutRawMessageContent where
toQuery :: PutRawMessageContent -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data PutRawMessageContentResponse = PutRawMessageContentResponse'
{
PutRawMessageContentResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PutRawMessageContentResponse
-> PutRawMessageContentResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutRawMessageContentResponse
-> PutRawMessageContentResponse -> Bool
$c/= :: PutRawMessageContentResponse
-> PutRawMessageContentResponse -> Bool
== :: PutRawMessageContentResponse
-> PutRawMessageContentResponse -> Bool
$c== :: PutRawMessageContentResponse
-> PutRawMessageContentResponse -> Bool
Prelude.Eq, ReadPrec [PutRawMessageContentResponse]
ReadPrec PutRawMessageContentResponse
Int -> ReadS PutRawMessageContentResponse
ReadS [PutRawMessageContentResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutRawMessageContentResponse]
$creadListPrec :: ReadPrec [PutRawMessageContentResponse]
readPrec :: ReadPrec PutRawMessageContentResponse
$creadPrec :: ReadPrec PutRawMessageContentResponse
readList :: ReadS [PutRawMessageContentResponse]
$creadList :: ReadS [PutRawMessageContentResponse]
readsPrec :: Int -> ReadS PutRawMessageContentResponse
$creadsPrec :: Int -> ReadS PutRawMessageContentResponse
Prelude.Read, Int -> PutRawMessageContentResponse -> ShowS
[PutRawMessageContentResponse] -> ShowS
PutRawMessageContentResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutRawMessageContentResponse] -> ShowS
$cshowList :: [PutRawMessageContentResponse] -> ShowS
show :: PutRawMessageContentResponse -> String
$cshow :: PutRawMessageContentResponse -> String
showsPrec :: Int -> PutRawMessageContentResponse -> ShowS
$cshowsPrec :: Int -> PutRawMessageContentResponse -> ShowS
Prelude.Show, forall x.
Rep PutRawMessageContentResponse x -> PutRawMessageContentResponse
forall x.
PutRawMessageContentResponse -> Rep PutRawMessageContentResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutRawMessageContentResponse x -> PutRawMessageContentResponse
$cfrom :: forall x.
PutRawMessageContentResponse -> Rep PutRawMessageContentResponse x
Prelude.Generic)
newPutRawMessageContentResponse ::
Prelude.Int ->
PutRawMessageContentResponse
newPutRawMessageContentResponse :: Int -> PutRawMessageContentResponse
newPutRawMessageContentResponse Int
pHttpStatus_ =
PutRawMessageContentResponse'
{ $sel:httpStatus:PutRawMessageContentResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
putRawMessageContentResponse_httpStatus :: Lens.Lens' PutRawMessageContentResponse Prelude.Int
putRawMessageContentResponse_httpStatus :: Lens' PutRawMessageContentResponse Int
putRawMessageContentResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutRawMessageContentResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutRawMessageContentResponse' :: PutRawMessageContentResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutRawMessageContentResponse
s@PutRawMessageContentResponse' {} Int
a -> PutRawMessageContentResponse
s {$sel:httpStatus:PutRawMessageContentResponse' :: Int
httpStatus = Int
a} :: PutRawMessageContentResponse)
instance Prelude.NFData PutRawMessageContentResponse where
rnf :: PutRawMessageContentResponse -> ()
rnf PutRawMessageContentResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutRawMessageContentResponse' :: PutRawMessageContentResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus