{-# 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.ChangeMessageVisibilityBatch
(
changeMessageVisibilityBatch
, ChangeMessageVisibilityBatch
, cmvbQueueURL
, cmvbEntries
, changeMessageVisibilityBatchResponse
, ChangeMessageVisibilityBatchResponse
, cmvbrsResponseStatus
, cmvbrsSuccessful
, cmvbrsFailed
) 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 ChangeMessageVisibilityBatch = ChangeMessageVisibilityBatch'
{ _cmvbQueueURL :: !Text
, _cmvbEntries :: ![ChangeMessageVisibilityBatchRequestEntry]
} deriving (Eq, Read, Show, Data, Typeable, Generic)
changeMessageVisibilityBatch
:: Text
-> ChangeMessageVisibilityBatch
changeMessageVisibilityBatch pQueueURL_ =
ChangeMessageVisibilityBatch'
{_cmvbQueueURL = pQueueURL_, _cmvbEntries = mempty}
cmvbQueueURL :: Lens' ChangeMessageVisibilityBatch Text
cmvbQueueURL = lens _cmvbQueueURL (\ s a -> s{_cmvbQueueURL = a})
cmvbEntries :: Lens' ChangeMessageVisibilityBatch [ChangeMessageVisibilityBatchRequestEntry]
cmvbEntries = lens _cmvbEntries (\ s a -> s{_cmvbEntries = a}) . _Coerce
instance AWSRequest ChangeMessageVisibilityBatch
where
type Rs ChangeMessageVisibilityBatch =
ChangeMessageVisibilityBatchResponse
request = postQuery sqs
response
= receiveXMLWrapper
"ChangeMessageVisibilityBatchResult"
(\ s h x ->
ChangeMessageVisibilityBatchResponse' <$>
(pure (fromEnum s)) <*>
(parseXMLList
"ChangeMessageVisibilityBatchResultEntry"
x)
<*> (parseXMLList "BatchResultErrorEntry" x))
instance Hashable ChangeMessageVisibilityBatch where
instance NFData ChangeMessageVisibilityBatch where
instance ToHeaders ChangeMessageVisibilityBatch where
toHeaders = const mempty
instance ToPath ChangeMessageVisibilityBatch where
toPath = const "/"
instance ToQuery ChangeMessageVisibilityBatch where
toQuery ChangeMessageVisibilityBatch'{..}
= mconcat
["Action" =:
("ChangeMessageVisibilityBatch" :: ByteString),
"Version" =: ("2012-11-05" :: ByteString),
"QueueUrl" =: _cmvbQueueURL,
toQueryList
"ChangeMessageVisibilityBatchRequestEntry"
_cmvbEntries]
data ChangeMessageVisibilityBatchResponse = ChangeMessageVisibilityBatchResponse'
{ _cmvbrsResponseStatus :: !Int
, _cmvbrsSuccessful :: ![ChangeMessageVisibilityBatchResultEntry]
, _cmvbrsFailed :: ![BatchResultErrorEntry]
} deriving (Eq, Read, Show, Data, Typeable, Generic)
changeMessageVisibilityBatchResponse
:: Int
-> ChangeMessageVisibilityBatchResponse
changeMessageVisibilityBatchResponse pResponseStatus_ =
ChangeMessageVisibilityBatchResponse'
{ _cmvbrsResponseStatus = pResponseStatus_
, _cmvbrsSuccessful = mempty
, _cmvbrsFailed = mempty
}
cmvbrsResponseStatus :: Lens' ChangeMessageVisibilityBatchResponse Int
cmvbrsResponseStatus = lens _cmvbrsResponseStatus (\ s a -> s{_cmvbrsResponseStatus = a})
cmvbrsSuccessful :: Lens' ChangeMessageVisibilityBatchResponse [ChangeMessageVisibilityBatchResultEntry]
cmvbrsSuccessful = lens _cmvbrsSuccessful (\ s a -> s{_cmvbrsSuccessful = a}) . _Coerce
cmvbrsFailed :: Lens' ChangeMessageVisibilityBatchResponse [BatchResultErrorEntry]
cmvbrsFailed = lens _cmvbrsFailed (\ s a -> s{_cmvbrsFailed = a}) . _Coerce
instance NFData ChangeMessageVisibilityBatchResponse
where