{-# 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.SQS.DeleteMessage
(
DeleteMessage (..),
newDeleteMessage,
deleteMessage_queueUrl,
deleteMessage_receiptHandle,
DeleteMessageResponse (..),
newDeleteMessageResponse,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SQS.Types
data DeleteMessage = DeleteMessage'
{
DeleteMessage -> Text
queueUrl :: Prelude.Text,
DeleteMessage -> Text
receiptHandle :: Prelude.Text
}
deriving (DeleteMessage -> DeleteMessage -> Bool
(DeleteMessage -> DeleteMessage -> Bool)
-> (DeleteMessage -> DeleteMessage -> Bool) -> Eq DeleteMessage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteMessage -> DeleteMessage -> Bool
$c/= :: DeleteMessage -> DeleteMessage -> Bool
== :: DeleteMessage -> DeleteMessage -> Bool
$c== :: DeleteMessage -> DeleteMessage -> Bool
Prelude.Eq, ReadPrec [DeleteMessage]
ReadPrec DeleteMessage
Int -> ReadS DeleteMessage
ReadS [DeleteMessage]
(Int -> ReadS DeleteMessage)
-> ReadS [DeleteMessage]
-> ReadPrec DeleteMessage
-> ReadPrec [DeleteMessage]
-> Read DeleteMessage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteMessage]
$creadListPrec :: ReadPrec [DeleteMessage]
readPrec :: ReadPrec DeleteMessage
$creadPrec :: ReadPrec DeleteMessage
readList :: ReadS [DeleteMessage]
$creadList :: ReadS [DeleteMessage]
readsPrec :: Int -> ReadS DeleteMessage
$creadsPrec :: Int -> ReadS DeleteMessage
Prelude.Read, Int -> DeleteMessage -> ShowS
[DeleteMessage] -> ShowS
DeleteMessage -> String
(Int -> DeleteMessage -> ShowS)
-> (DeleteMessage -> String)
-> ([DeleteMessage] -> ShowS)
-> Show DeleteMessage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteMessage] -> ShowS
$cshowList :: [DeleteMessage] -> ShowS
show :: DeleteMessage -> String
$cshow :: DeleteMessage -> String
showsPrec :: Int -> DeleteMessage -> ShowS
$cshowsPrec :: Int -> DeleteMessage -> ShowS
Prelude.Show, (forall x. DeleteMessage -> Rep DeleteMessage x)
-> (forall x. Rep DeleteMessage x -> DeleteMessage)
-> Generic DeleteMessage
forall x. Rep DeleteMessage x -> DeleteMessage
forall x. DeleteMessage -> Rep DeleteMessage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteMessage x -> DeleteMessage
$cfrom :: forall x. DeleteMessage -> Rep DeleteMessage x
Prelude.Generic)
newDeleteMessage ::
Prelude.Text ->
Prelude.Text ->
DeleteMessage
newDeleteMessage :: Text -> Text -> DeleteMessage
newDeleteMessage Text
pQueueUrl_ Text
pReceiptHandle_ =
DeleteMessage' :: Text -> Text -> DeleteMessage
DeleteMessage'
{ $sel:queueUrl:DeleteMessage' :: Text
queueUrl = Text
pQueueUrl_,
$sel:receiptHandle:DeleteMessage' :: Text
receiptHandle = Text
pReceiptHandle_
}
deleteMessage_queueUrl :: Lens.Lens' DeleteMessage Prelude.Text
deleteMessage_queueUrl :: (Text -> f Text) -> DeleteMessage -> f DeleteMessage
deleteMessage_queueUrl = (DeleteMessage -> Text)
-> (DeleteMessage -> Text -> DeleteMessage)
-> Lens DeleteMessage DeleteMessage Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteMessage' {Text
queueUrl :: Text
$sel:queueUrl:DeleteMessage' :: DeleteMessage -> Text
queueUrl} -> Text
queueUrl) (\s :: DeleteMessage
s@DeleteMessage' {} Text
a -> DeleteMessage
s {$sel:queueUrl:DeleteMessage' :: Text
queueUrl = Text
a} :: DeleteMessage)
deleteMessage_receiptHandle :: Lens.Lens' DeleteMessage Prelude.Text
deleteMessage_receiptHandle :: (Text -> f Text) -> DeleteMessage -> f DeleteMessage
deleteMessage_receiptHandle = (DeleteMessage -> Text)
-> (DeleteMessage -> Text -> DeleteMessage)
-> Lens DeleteMessage DeleteMessage Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteMessage' {Text
receiptHandle :: Text
$sel:receiptHandle:DeleteMessage' :: DeleteMessage -> Text
receiptHandle} -> Text
receiptHandle) (\s :: DeleteMessage
s@DeleteMessage' {} Text
a -> DeleteMessage
s {$sel:receiptHandle:DeleteMessage' :: Text
receiptHandle = Text
a} :: DeleteMessage)
instance Core.AWSRequest DeleteMessage where
type
AWSResponse DeleteMessage =
DeleteMessageResponse
request :: DeleteMessage -> Request DeleteMessage
request = Service -> DeleteMessage -> Request DeleteMessage
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteMessage
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteMessage)))
response =
AWSResponse DeleteMessage
-> Logger
-> Service
-> Proxy DeleteMessage
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteMessage)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse DeleteMessage
DeleteMessageResponse
DeleteMessageResponse'
instance Prelude.Hashable DeleteMessage
instance Prelude.NFData DeleteMessage
instance Core.ToHeaders DeleteMessage where
toHeaders :: DeleteMessage -> [Header]
toHeaders = [Header] -> DeleteMessage -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DeleteMessage where
toPath :: DeleteMessage -> ByteString
toPath = ByteString -> DeleteMessage -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteMessage where
toQuery :: DeleteMessage -> QueryString
toQuery DeleteMessage' {Text
receiptHandle :: Text
queueUrl :: Text
$sel:receiptHandle:DeleteMessage' :: DeleteMessage -> Text
$sel:queueUrl:DeleteMessage' :: DeleteMessage -> Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"DeleteMessage" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2012-11-05" :: Prelude.ByteString),
ByteString
"QueueUrl" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
queueUrl,
ByteString
"ReceiptHandle" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
receiptHandle
]
data DeleteMessageResponse = DeleteMessageResponse'
{
}
deriving (DeleteMessageResponse -> DeleteMessageResponse -> Bool
(DeleteMessageResponse -> DeleteMessageResponse -> Bool)
-> (DeleteMessageResponse -> DeleteMessageResponse -> Bool)
-> Eq DeleteMessageResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteMessageResponse -> DeleteMessageResponse -> Bool
$c/= :: DeleteMessageResponse -> DeleteMessageResponse -> Bool
== :: DeleteMessageResponse -> DeleteMessageResponse -> Bool
$c== :: DeleteMessageResponse -> DeleteMessageResponse -> Bool
Prelude.Eq, ReadPrec [DeleteMessageResponse]
ReadPrec DeleteMessageResponse
Int -> ReadS DeleteMessageResponse
ReadS [DeleteMessageResponse]
(Int -> ReadS DeleteMessageResponse)
-> ReadS [DeleteMessageResponse]
-> ReadPrec DeleteMessageResponse
-> ReadPrec [DeleteMessageResponse]
-> Read DeleteMessageResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteMessageResponse]
$creadListPrec :: ReadPrec [DeleteMessageResponse]
readPrec :: ReadPrec DeleteMessageResponse
$creadPrec :: ReadPrec DeleteMessageResponse
readList :: ReadS [DeleteMessageResponse]
$creadList :: ReadS [DeleteMessageResponse]
readsPrec :: Int -> ReadS DeleteMessageResponse
$creadsPrec :: Int -> ReadS DeleteMessageResponse
Prelude.Read, Int -> DeleteMessageResponse -> ShowS
[DeleteMessageResponse] -> ShowS
DeleteMessageResponse -> String
(Int -> DeleteMessageResponse -> ShowS)
-> (DeleteMessageResponse -> String)
-> ([DeleteMessageResponse] -> ShowS)
-> Show DeleteMessageResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteMessageResponse] -> ShowS
$cshowList :: [DeleteMessageResponse] -> ShowS
show :: DeleteMessageResponse -> String
$cshow :: DeleteMessageResponse -> String
showsPrec :: Int -> DeleteMessageResponse -> ShowS
$cshowsPrec :: Int -> DeleteMessageResponse -> ShowS
Prelude.Show, (forall x. DeleteMessageResponse -> Rep DeleteMessageResponse x)
-> (forall x. Rep DeleteMessageResponse x -> DeleteMessageResponse)
-> Generic DeleteMessageResponse
forall x. Rep DeleteMessageResponse x -> DeleteMessageResponse
forall x. DeleteMessageResponse -> Rep DeleteMessageResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteMessageResponse x -> DeleteMessageResponse
$cfrom :: forall x. DeleteMessageResponse -> Rep DeleteMessageResponse x
Prelude.Generic)
newDeleteMessageResponse ::
DeleteMessageResponse
newDeleteMessageResponse :: DeleteMessageResponse
newDeleteMessageResponse = DeleteMessageResponse
DeleteMessageResponse'
instance Prelude.NFData DeleteMessageResponse