{-# 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.ListQueues
(
listQueues
, ListQueues
, lqQueueNamePrefix
, listQueuesResponse
, ListQueuesResponse
, lqrsQueueURLs
, lqrsResponseStatus
) 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
newtype ListQueues = ListQueues'
{ _lqQueueNamePrefix :: Maybe Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
listQueues
:: ListQueues
listQueues = ListQueues' {_lqQueueNamePrefix = Nothing}
lqQueueNamePrefix :: Lens' ListQueues (Maybe Text)
lqQueueNamePrefix = lens _lqQueueNamePrefix (\ s a -> s{_lqQueueNamePrefix = a})
instance AWSRequest ListQueues where
type Rs ListQueues = ListQueuesResponse
request = postQuery sqs
response
= receiveXMLWrapper "ListQueuesResult"
(\ s h x ->
ListQueuesResponse' <$>
(may (parseXMLList "QueueUrl") x) <*>
(pure (fromEnum s)))
instance Hashable ListQueues where
instance NFData ListQueues where
instance ToHeaders ListQueues where
toHeaders = const mempty
instance ToPath ListQueues where
toPath = const "/"
instance ToQuery ListQueues where
toQuery ListQueues'{..}
= mconcat
["Action" =: ("ListQueues" :: ByteString),
"Version" =: ("2012-11-05" :: ByteString),
"QueueNamePrefix" =: _lqQueueNamePrefix]
data ListQueuesResponse = ListQueuesResponse'
{ _lqrsQueueURLs :: !(Maybe [Text])
, _lqrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
listQueuesResponse
:: Int
-> ListQueuesResponse
listQueuesResponse pResponseStatus_ =
ListQueuesResponse'
{_lqrsQueueURLs = Nothing, _lqrsResponseStatus = pResponseStatus_}
lqrsQueueURLs :: Lens' ListQueuesResponse [Text]
lqrsQueueURLs = lens _lqrsQueueURLs (\ s a -> s{_lqrsQueueURLs = a}) . _Default . _Coerce
lqrsResponseStatus :: Lens' ListQueuesResponse Int
lqrsResponseStatus = lens _lqrsResponseStatus (\ s a -> s{_lqrsResponseStatus = a})
instance NFData ListQueuesResponse where