{-# 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.GetQueueURL
(
getQueueURL
, GetQueueURL
, gquQueueOwnerAWSAccountId
, gquQueueName
, getQueueURLResponse
, GetQueueURLResponse
, gqursResponseStatus
, gqursQueueURL
) 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 GetQueueURL = GetQueueURL'
{ _gquQueueOwnerAWSAccountId :: !(Maybe Text)
, _gquQueueName :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getQueueURL
:: Text
-> GetQueueURL
getQueueURL pQueueName_ =
GetQueueURL'
{_gquQueueOwnerAWSAccountId = Nothing, _gquQueueName = pQueueName_}
gquQueueOwnerAWSAccountId :: Lens' GetQueueURL (Maybe Text)
gquQueueOwnerAWSAccountId = lens _gquQueueOwnerAWSAccountId (\ s a -> s{_gquQueueOwnerAWSAccountId = a})
gquQueueName :: Lens' GetQueueURL Text
gquQueueName = lens _gquQueueName (\ s a -> s{_gquQueueName = a})
instance AWSRequest GetQueueURL where
type Rs GetQueueURL = GetQueueURLResponse
request = postQuery sqs
response
= receiveXMLWrapper "GetQueueUrlResult"
(\ s h x ->
GetQueueURLResponse' <$>
(pure (fromEnum s)) <*> (x .@ "QueueUrl"))
instance Hashable GetQueueURL where
instance NFData GetQueueURL where
instance ToHeaders GetQueueURL where
toHeaders = const mempty
instance ToPath GetQueueURL where
toPath = const "/"
instance ToQuery GetQueueURL where
toQuery GetQueueURL'{..}
= mconcat
["Action" =: ("GetQueueUrl" :: ByteString),
"Version" =: ("2012-11-05" :: ByteString),
"QueueOwnerAWSAccountId" =:
_gquQueueOwnerAWSAccountId,
"QueueName" =: _gquQueueName]
data GetQueueURLResponse = GetQueueURLResponse'
{ _gqursResponseStatus :: !Int
, _gqursQueueURL :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getQueueURLResponse
:: Int
-> Text
-> GetQueueURLResponse
getQueueURLResponse pResponseStatus_ pQueueURL_ =
GetQueueURLResponse'
{_gqursResponseStatus = pResponseStatus_, _gqursQueueURL = pQueueURL_}
gqursResponseStatus :: Lens' GetQueueURLResponse Int
gqursResponseStatus = lens _gqursResponseStatus (\ s a -> s{_gqursResponseStatus = a})
gqursQueueURL :: Lens' GetQueueURLResponse Text
gqursQueueURL = lens _gqursQueueURL (\ s a -> s{_gqursQueueURL = a})
instance NFData GetQueueURLResponse where