{-# 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.GetQueueUrl
(
GetQueueUrl (..),
newGetQueueUrl,
getQueueUrl_queueOwnerAWSAccountId,
getQueueUrl_queueName,
GetQueueUrlResponse (..),
newGetQueueUrlResponse,
getQueueUrlResponse_httpStatus,
getQueueUrlResponse_queueUrl,
)
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 GetQueueUrl = GetQueueUrl'
{
GetQueueUrl -> Maybe Text
queueOwnerAWSAccountId :: Prelude.Maybe Prelude.Text,
GetQueueUrl -> Text
queueName :: Prelude.Text
}
deriving (GetQueueUrl -> GetQueueUrl -> Bool
(GetQueueUrl -> GetQueueUrl -> Bool)
-> (GetQueueUrl -> GetQueueUrl -> Bool) -> Eq GetQueueUrl
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetQueueUrl -> GetQueueUrl -> Bool
$c/= :: GetQueueUrl -> GetQueueUrl -> Bool
== :: GetQueueUrl -> GetQueueUrl -> Bool
$c== :: GetQueueUrl -> GetQueueUrl -> Bool
Prelude.Eq, ReadPrec [GetQueueUrl]
ReadPrec GetQueueUrl
Int -> ReadS GetQueueUrl
ReadS [GetQueueUrl]
(Int -> ReadS GetQueueUrl)
-> ReadS [GetQueueUrl]
-> ReadPrec GetQueueUrl
-> ReadPrec [GetQueueUrl]
-> Read GetQueueUrl
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetQueueUrl]
$creadListPrec :: ReadPrec [GetQueueUrl]
readPrec :: ReadPrec GetQueueUrl
$creadPrec :: ReadPrec GetQueueUrl
readList :: ReadS [GetQueueUrl]
$creadList :: ReadS [GetQueueUrl]
readsPrec :: Int -> ReadS GetQueueUrl
$creadsPrec :: Int -> ReadS GetQueueUrl
Prelude.Read, Int -> GetQueueUrl -> ShowS
[GetQueueUrl] -> ShowS
GetQueueUrl -> String
(Int -> GetQueueUrl -> ShowS)
-> (GetQueueUrl -> String)
-> ([GetQueueUrl] -> ShowS)
-> Show GetQueueUrl
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetQueueUrl] -> ShowS
$cshowList :: [GetQueueUrl] -> ShowS
show :: GetQueueUrl -> String
$cshow :: GetQueueUrl -> String
showsPrec :: Int -> GetQueueUrl -> ShowS
$cshowsPrec :: Int -> GetQueueUrl -> ShowS
Prelude.Show, (forall x. GetQueueUrl -> Rep GetQueueUrl x)
-> (forall x. Rep GetQueueUrl x -> GetQueueUrl)
-> Generic GetQueueUrl
forall x. Rep GetQueueUrl x -> GetQueueUrl
forall x. GetQueueUrl -> Rep GetQueueUrl x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetQueueUrl x -> GetQueueUrl
$cfrom :: forall x. GetQueueUrl -> Rep GetQueueUrl x
Prelude.Generic)
newGetQueueUrl ::
Prelude.Text ->
GetQueueUrl
newGetQueueUrl :: Text -> GetQueueUrl
newGetQueueUrl Text
pQueueName_ =
GetQueueUrl' :: Maybe Text -> Text -> GetQueueUrl
GetQueueUrl'
{ $sel:queueOwnerAWSAccountId:GetQueueUrl' :: Maybe Text
queueOwnerAWSAccountId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:queueName:GetQueueUrl' :: Text
queueName = Text
pQueueName_
}
getQueueUrl_queueOwnerAWSAccountId :: Lens.Lens' GetQueueUrl (Prelude.Maybe Prelude.Text)
getQueueUrl_queueOwnerAWSAccountId :: (Maybe Text -> f (Maybe Text)) -> GetQueueUrl -> f GetQueueUrl
getQueueUrl_queueOwnerAWSAccountId = (GetQueueUrl -> Maybe Text)
-> (GetQueueUrl -> Maybe Text -> GetQueueUrl)
-> Lens GetQueueUrl GetQueueUrl (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetQueueUrl' {Maybe Text
queueOwnerAWSAccountId :: Maybe Text
$sel:queueOwnerAWSAccountId:GetQueueUrl' :: GetQueueUrl -> Maybe Text
queueOwnerAWSAccountId} -> Maybe Text
queueOwnerAWSAccountId) (\s :: GetQueueUrl
s@GetQueueUrl' {} Maybe Text
a -> GetQueueUrl
s {$sel:queueOwnerAWSAccountId:GetQueueUrl' :: Maybe Text
queueOwnerAWSAccountId = Maybe Text
a} :: GetQueueUrl)
getQueueUrl_queueName :: Lens.Lens' GetQueueUrl Prelude.Text
getQueueUrl_queueName :: (Text -> f Text) -> GetQueueUrl -> f GetQueueUrl
getQueueUrl_queueName = (GetQueueUrl -> Text)
-> (GetQueueUrl -> Text -> GetQueueUrl)
-> Lens GetQueueUrl GetQueueUrl Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetQueueUrl' {Text
queueName :: Text
$sel:queueName:GetQueueUrl' :: GetQueueUrl -> Text
queueName} -> Text
queueName) (\s :: GetQueueUrl
s@GetQueueUrl' {} Text
a -> GetQueueUrl
s {$sel:queueName:GetQueueUrl' :: Text
queueName = Text
a} :: GetQueueUrl)
instance Core.AWSRequest GetQueueUrl where
type AWSResponse GetQueueUrl = GetQueueUrlResponse
request :: GetQueueUrl -> Request GetQueueUrl
request = Service -> GetQueueUrl -> Request GetQueueUrl
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy GetQueueUrl
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetQueueUrl)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse GetQueueUrl))
-> Logger
-> Service
-> Proxy GetQueueUrl
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetQueueUrl)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"GetQueueUrlResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Int -> Text -> GetQueueUrlResponse
GetQueueUrlResponse'
(Int -> Text -> GetQueueUrlResponse)
-> Either String Int -> Either String (Text -> GetQueueUrlResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
Either String (Text -> GetQueueUrlResponse)
-> Either String Text -> Either String GetQueueUrlResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Text
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"QueueUrl")
)
instance Prelude.Hashable GetQueueUrl
instance Prelude.NFData GetQueueUrl
instance Core.ToHeaders GetQueueUrl where
toHeaders :: GetQueueUrl -> ResponseHeaders
toHeaders = ResponseHeaders -> GetQueueUrl -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath GetQueueUrl where
toPath :: GetQueueUrl -> ByteString
toPath = ByteString -> GetQueueUrl -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery GetQueueUrl where
toQuery :: GetQueueUrl -> QueryString
toQuery GetQueueUrl' {Maybe Text
Text
queueName :: Text
queueOwnerAWSAccountId :: Maybe Text
$sel:queueName:GetQueueUrl' :: GetQueueUrl -> Text
$sel:queueOwnerAWSAccountId:GetQueueUrl' :: GetQueueUrl -> Maybe 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
"GetQueueUrl" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2012-11-05" :: Prelude.ByteString),
ByteString
"QueueOwnerAWSAccountId"
ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
queueOwnerAWSAccountId,
ByteString
"QueueName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
queueName
]
data GetQueueUrlResponse = GetQueueUrlResponse'
{
GetQueueUrlResponse -> Int
httpStatus :: Prelude.Int,
GetQueueUrlResponse -> Text
queueUrl :: Prelude.Text
}
deriving (GetQueueUrlResponse -> GetQueueUrlResponse -> Bool
(GetQueueUrlResponse -> GetQueueUrlResponse -> Bool)
-> (GetQueueUrlResponse -> GetQueueUrlResponse -> Bool)
-> Eq GetQueueUrlResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetQueueUrlResponse -> GetQueueUrlResponse -> Bool
$c/= :: GetQueueUrlResponse -> GetQueueUrlResponse -> Bool
== :: GetQueueUrlResponse -> GetQueueUrlResponse -> Bool
$c== :: GetQueueUrlResponse -> GetQueueUrlResponse -> Bool
Prelude.Eq, ReadPrec [GetQueueUrlResponse]
ReadPrec GetQueueUrlResponse
Int -> ReadS GetQueueUrlResponse
ReadS [GetQueueUrlResponse]
(Int -> ReadS GetQueueUrlResponse)
-> ReadS [GetQueueUrlResponse]
-> ReadPrec GetQueueUrlResponse
-> ReadPrec [GetQueueUrlResponse]
-> Read GetQueueUrlResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetQueueUrlResponse]
$creadListPrec :: ReadPrec [GetQueueUrlResponse]
readPrec :: ReadPrec GetQueueUrlResponse
$creadPrec :: ReadPrec GetQueueUrlResponse
readList :: ReadS [GetQueueUrlResponse]
$creadList :: ReadS [GetQueueUrlResponse]
readsPrec :: Int -> ReadS GetQueueUrlResponse
$creadsPrec :: Int -> ReadS GetQueueUrlResponse
Prelude.Read, Int -> GetQueueUrlResponse -> ShowS
[GetQueueUrlResponse] -> ShowS
GetQueueUrlResponse -> String
(Int -> GetQueueUrlResponse -> ShowS)
-> (GetQueueUrlResponse -> String)
-> ([GetQueueUrlResponse] -> ShowS)
-> Show GetQueueUrlResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetQueueUrlResponse] -> ShowS
$cshowList :: [GetQueueUrlResponse] -> ShowS
show :: GetQueueUrlResponse -> String
$cshow :: GetQueueUrlResponse -> String
showsPrec :: Int -> GetQueueUrlResponse -> ShowS
$cshowsPrec :: Int -> GetQueueUrlResponse -> ShowS
Prelude.Show, (forall x. GetQueueUrlResponse -> Rep GetQueueUrlResponse x)
-> (forall x. Rep GetQueueUrlResponse x -> GetQueueUrlResponse)
-> Generic GetQueueUrlResponse
forall x. Rep GetQueueUrlResponse x -> GetQueueUrlResponse
forall x. GetQueueUrlResponse -> Rep GetQueueUrlResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetQueueUrlResponse x -> GetQueueUrlResponse
$cfrom :: forall x. GetQueueUrlResponse -> Rep GetQueueUrlResponse x
Prelude.Generic)
newGetQueueUrlResponse ::
Prelude.Int ->
Prelude.Text ->
GetQueueUrlResponse
newGetQueueUrlResponse :: Int -> Text -> GetQueueUrlResponse
newGetQueueUrlResponse Int
pHttpStatus_ Text
pQueueUrl_ =
GetQueueUrlResponse' :: Int -> Text -> GetQueueUrlResponse
GetQueueUrlResponse'
{ $sel:httpStatus:GetQueueUrlResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:queueUrl:GetQueueUrlResponse' :: Text
queueUrl = Text
pQueueUrl_
}
getQueueUrlResponse_httpStatus :: Lens.Lens' GetQueueUrlResponse Prelude.Int
getQueueUrlResponse_httpStatus :: (Int -> f Int) -> GetQueueUrlResponse -> f GetQueueUrlResponse
getQueueUrlResponse_httpStatus = (GetQueueUrlResponse -> Int)
-> (GetQueueUrlResponse -> Int -> GetQueueUrlResponse)
-> Lens GetQueueUrlResponse GetQueueUrlResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetQueueUrlResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetQueueUrlResponse' :: GetQueueUrlResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetQueueUrlResponse
s@GetQueueUrlResponse' {} Int
a -> GetQueueUrlResponse
s {$sel:httpStatus:GetQueueUrlResponse' :: Int
httpStatus = Int
a} :: GetQueueUrlResponse)
getQueueUrlResponse_queueUrl :: Lens.Lens' GetQueueUrlResponse Prelude.Text
getQueueUrlResponse_queueUrl :: (Text -> f Text) -> GetQueueUrlResponse -> f GetQueueUrlResponse
getQueueUrlResponse_queueUrl = (GetQueueUrlResponse -> Text)
-> (GetQueueUrlResponse -> Text -> GetQueueUrlResponse)
-> Lens GetQueueUrlResponse GetQueueUrlResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetQueueUrlResponse' {Text
queueUrl :: Text
$sel:queueUrl:GetQueueUrlResponse' :: GetQueueUrlResponse -> Text
queueUrl} -> Text
queueUrl) (\s :: GetQueueUrlResponse
s@GetQueueUrlResponse' {} Text
a -> GetQueueUrlResponse
s {$sel:queueUrl:GetQueueUrlResponse' :: Text
queueUrl = Text
a} :: GetQueueUrlResponse)
instance Prelude.NFData GetQueueUrlResponse