{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.SQS.DeleteMessageBatch
(
deleteMessageBatch
, DeleteMessageBatch
, dmbQueueURL
, dmbEntries
, deleteMessageBatchResponse
, DeleteMessageBatchResponse
, dmbrsResponseStatus
, dmbrsSuccessful
, dmbrsFailed
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.SQS.Types
import Network.AWS.SQS.Types.Product
data DeleteMessageBatch = DeleteMessageBatch'
{ _dmbQueueURL :: !Text
, _dmbEntries :: ![DeleteMessageBatchRequestEntry]
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteMessageBatch
:: Text
-> DeleteMessageBatch
deleteMessageBatch pQueueURL_ =
DeleteMessageBatch' {_dmbQueueURL = pQueueURL_, _dmbEntries = mempty}
dmbQueueURL :: Lens' DeleteMessageBatch Text
dmbQueueURL = lens _dmbQueueURL (\ s a -> s{_dmbQueueURL = a})
dmbEntries :: Lens' DeleteMessageBatch [DeleteMessageBatchRequestEntry]
dmbEntries = lens _dmbEntries (\ s a -> s{_dmbEntries = a}) . _Coerce
instance AWSRequest DeleteMessageBatch where
type Rs DeleteMessageBatch =
DeleteMessageBatchResponse
request = postQuery sqs
response
= receiveXMLWrapper "DeleteMessageBatchResult"
(\ s h x ->
DeleteMessageBatchResponse' <$>
(pure (fromEnum s)) <*>
(parseXMLList "DeleteMessageBatchResultEntry" x)
<*> (parseXMLList "BatchResultErrorEntry" x))
instance Hashable DeleteMessageBatch where
instance NFData DeleteMessageBatch where
instance ToHeaders DeleteMessageBatch where
toHeaders = const mempty
instance ToPath DeleteMessageBatch where
toPath = const "/"
instance ToQuery DeleteMessageBatch where
toQuery DeleteMessageBatch'{..}
= mconcat
["Action" =: ("DeleteMessageBatch" :: ByteString),
"Version" =: ("2012-11-05" :: ByteString),
"QueueUrl" =: _dmbQueueURL,
toQueryList "DeleteMessageBatchRequestEntry"
_dmbEntries]
data DeleteMessageBatchResponse = DeleteMessageBatchResponse'
{ _dmbrsResponseStatus :: !Int
, _dmbrsSuccessful :: ![DeleteMessageBatchResultEntry]
, _dmbrsFailed :: ![BatchResultErrorEntry]
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteMessageBatchResponse
:: Int
-> DeleteMessageBatchResponse
deleteMessageBatchResponse pResponseStatus_ =
DeleteMessageBatchResponse'
{ _dmbrsResponseStatus = pResponseStatus_
, _dmbrsSuccessful = mempty
, _dmbrsFailed = mempty
}
dmbrsResponseStatus :: Lens' DeleteMessageBatchResponse Int
dmbrsResponseStatus = lens _dmbrsResponseStatus (\ s a -> s{_dmbrsResponseStatus = a})
dmbrsSuccessful :: Lens' DeleteMessageBatchResponse [DeleteMessageBatchResultEntry]
dmbrsSuccessful = lens _dmbrsSuccessful (\ s a -> s{_dmbrsSuccessful = a}) . _Coerce
dmbrsFailed :: Lens' DeleteMessageBatchResponse [BatchResultErrorEntry]
dmbrsFailed = lens _dmbrsFailed (\ s a -> s{_dmbrsFailed = a}) . _Coerce
instance NFData DeleteMessageBatchResponse where