{-# 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.ListQueueTags
(
ListQueueTags (..),
newListQueueTags,
listQueueTags_queueUrl,
ListQueueTagsResponse (..),
newListQueueTagsResponse,
listQueueTagsResponse_tags,
listQueueTagsResponse_httpStatus,
)
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 ListQueueTags = ListQueueTags'
{
ListQueueTags -> Text
queueUrl :: Prelude.Text
}
deriving (ListQueueTags -> ListQueueTags -> Bool
(ListQueueTags -> ListQueueTags -> Bool)
-> (ListQueueTags -> ListQueueTags -> Bool) -> Eq ListQueueTags
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListQueueTags -> ListQueueTags -> Bool
$c/= :: ListQueueTags -> ListQueueTags -> Bool
== :: ListQueueTags -> ListQueueTags -> Bool
$c== :: ListQueueTags -> ListQueueTags -> Bool
Prelude.Eq, ReadPrec [ListQueueTags]
ReadPrec ListQueueTags
Int -> ReadS ListQueueTags
ReadS [ListQueueTags]
(Int -> ReadS ListQueueTags)
-> ReadS [ListQueueTags]
-> ReadPrec ListQueueTags
-> ReadPrec [ListQueueTags]
-> Read ListQueueTags
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListQueueTags]
$creadListPrec :: ReadPrec [ListQueueTags]
readPrec :: ReadPrec ListQueueTags
$creadPrec :: ReadPrec ListQueueTags
readList :: ReadS [ListQueueTags]
$creadList :: ReadS [ListQueueTags]
readsPrec :: Int -> ReadS ListQueueTags
$creadsPrec :: Int -> ReadS ListQueueTags
Prelude.Read, Int -> ListQueueTags -> ShowS
[ListQueueTags] -> ShowS
ListQueueTags -> String
(Int -> ListQueueTags -> ShowS)
-> (ListQueueTags -> String)
-> ([ListQueueTags] -> ShowS)
-> Show ListQueueTags
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListQueueTags] -> ShowS
$cshowList :: [ListQueueTags] -> ShowS
show :: ListQueueTags -> String
$cshow :: ListQueueTags -> String
showsPrec :: Int -> ListQueueTags -> ShowS
$cshowsPrec :: Int -> ListQueueTags -> ShowS
Prelude.Show, (forall x. ListQueueTags -> Rep ListQueueTags x)
-> (forall x. Rep ListQueueTags x -> ListQueueTags)
-> Generic ListQueueTags
forall x. Rep ListQueueTags x -> ListQueueTags
forall x. ListQueueTags -> Rep ListQueueTags x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListQueueTags x -> ListQueueTags
$cfrom :: forall x. ListQueueTags -> Rep ListQueueTags x
Prelude.Generic)
newListQueueTags ::
Prelude.Text ->
ListQueueTags
newListQueueTags :: Text -> ListQueueTags
newListQueueTags Text
pQueueUrl_ =
ListQueueTags' :: Text -> ListQueueTags
ListQueueTags' {$sel:queueUrl:ListQueueTags' :: Text
queueUrl = Text
pQueueUrl_}
listQueueTags_queueUrl :: Lens.Lens' ListQueueTags Prelude.Text
listQueueTags_queueUrl :: (Text -> f Text) -> ListQueueTags -> f ListQueueTags
listQueueTags_queueUrl = (ListQueueTags -> Text)
-> (ListQueueTags -> Text -> ListQueueTags)
-> Lens ListQueueTags ListQueueTags Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListQueueTags' {Text
queueUrl :: Text
$sel:queueUrl:ListQueueTags' :: ListQueueTags -> Text
queueUrl} -> Text
queueUrl) (\s :: ListQueueTags
s@ListQueueTags' {} Text
a -> ListQueueTags
s {$sel:queueUrl:ListQueueTags' :: Text
queueUrl = Text
a} :: ListQueueTags)
instance Core.AWSRequest ListQueueTags where
type
AWSResponse ListQueueTags =
ListQueueTagsResponse
request :: ListQueueTags -> Request ListQueueTags
request = Service -> ListQueueTags -> Request ListQueueTags
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy ListQueueTags
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListQueueTags)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse ListQueueTags))
-> Logger
-> Service
-> Proxy ListQueueTags
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListQueueTags)))
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
"ListQueueTagsResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe (HashMap Text Text) -> Int -> ListQueueTagsResponse
ListQueueTagsResponse'
(Maybe (HashMap Text Text) -> Int -> ListQueueTagsResponse)
-> Either String (Maybe (HashMap Text Text))
-> Either String (Int -> ListQueueTagsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (([Node] -> Either String (HashMap Text Text))
-> [Node] -> Either String (Maybe (HashMap Text Text))
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> Text -> Text -> [Node] -> Either String (HashMap Text Text)
forall k v.
(Eq k, Hashable k, FromText k, FromXML v) =>
Text -> Text -> Text -> [Node] -> Either String (HashMap k v)
Core.parseXMLMap Text
"Tag" Text
"Key" Text
"Value") [Node]
x)
Either String (Int -> ListQueueTagsResponse)
-> Either String Int -> Either String ListQueueTagsResponse
forall (f :: * -> *) a b. Applicative f => 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))
)
instance Prelude.Hashable ListQueueTags
instance Prelude.NFData ListQueueTags
instance Core.ToHeaders ListQueueTags where
toHeaders :: ListQueueTags -> ResponseHeaders
toHeaders = ResponseHeaders -> ListQueueTags -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath ListQueueTags where
toPath :: ListQueueTags -> ByteString
toPath = ByteString -> ListQueueTags -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery ListQueueTags where
toQuery :: ListQueueTags -> QueryString
toQuery ListQueueTags' {Text
queueUrl :: Text
$sel:queueUrl:ListQueueTags' :: ListQueueTags -> 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
"ListQueueTags" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2012-11-05" :: Prelude.ByteString),
ByteString
"QueueUrl" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
queueUrl
]
data ListQueueTagsResponse = ListQueueTagsResponse'
{
ListQueueTagsResponse -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
ListQueueTagsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListQueueTagsResponse -> ListQueueTagsResponse -> Bool
(ListQueueTagsResponse -> ListQueueTagsResponse -> Bool)
-> (ListQueueTagsResponse -> ListQueueTagsResponse -> Bool)
-> Eq ListQueueTagsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListQueueTagsResponse -> ListQueueTagsResponse -> Bool
$c/= :: ListQueueTagsResponse -> ListQueueTagsResponse -> Bool
== :: ListQueueTagsResponse -> ListQueueTagsResponse -> Bool
$c== :: ListQueueTagsResponse -> ListQueueTagsResponse -> Bool
Prelude.Eq, ReadPrec [ListQueueTagsResponse]
ReadPrec ListQueueTagsResponse
Int -> ReadS ListQueueTagsResponse
ReadS [ListQueueTagsResponse]
(Int -> ReadS ListQueueTagsResponse)
-> ReadS [ListQueueTagsResponse]
-> ReadPrec ListQueueTagsResponse
-> ReadPrec [ListQueueTagsResponse]
-> Read ListQueueTagsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListQueueTagsResponse]
$creadListPrec :: ReadPrec [ListQueueTagsResponse]
readPrec :: ReadPrec ListQueueTagsResponse
$creadPrec :: ReadPrec ListQueueTagsResponse
readList :: ReadS [ListQueueTagsResponse]
$creadList :: ReadS [ListQueueTagsResponse]
readsPrec :: Int -> ReadS ListQueueTagsResponse
$creadsPrec :: Int -> ReadS ListQueueTagsResponse
Prelude.Read, Int -> ListQueueTagsResponse -> ShowS
[ListQueueTagsResponse] -> ShowS
ListQueueTagsResponse -> String
(Int -> ListQueueTagsResponse -> ShowS)
-> (ListQueueTagsResponse -> String)
-> ([ListQueueTagsResponse] -> ShowS)
-> Show ListQueueTagsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListQueueTagsResponse] -> ShowS
$cshowList :: [ListQueueTagsResponse] -> ShowS
show :: ListQueueTagsResponse -> String
$cshow :: ListQueueTagsResponse -> String
showsPrec :: Int -> ListQueueTagsResponse -> ShowS
$cshowsPrec :: Int -> ListQueueTagsResponse -> ShowS
Prelude.Show, (forall x. ListQueueTagsResponse -> Rep ListQueueTagsResponse x)
-> (forall x. Rep ListQueueTagsResponse x -> ListQueueTagsResponse)
-> Generic ListQueueTagsResponse
forall x. Rep ListQueueTagsResponse x -> ListQueueTagsResponse
forall x. ListQueueTagsResponse -> Rep ListQueueTagsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListQueueTagsResponse x -> ListQueueTagsResponse
$cfrom :: forall x. ListQueueTagsResponse -> Rep ListQueueTagsResponse x
Prelude.Generic)
newListQueueTagsResponse ::
Prelude.Int ->
ListQueueTagsResponse
newListQueueTagsResponse :: Int -> ListQueueTagsResponse
newListQueueTagsResponse Int
pHttpStatus_ =
ListQueueTagsResponse' :: Maybe (HashMap Text Text) -> Int -> ListQueueTagsResponse
ListQueueTagsResponse'
{ $sel:tags:ListQueueTagsResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListQueueTagsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listQueueTagsResponse_tags :: Lens.Lens' ListQueueTagsResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
listQueueTagsResponse_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> ListQueueTagsResponse -> f ListQueueTagsResponse
listQueueTagsResponse_tags = (ListQueueTagsResponse -> Maybe (HashMap Text Text))
-> (ListQueueTagsResponse
-> Maybe (HashMap Text Text) -> ListQueueTagsResponse)
-> Lens
ListQueueTagsResponse
ListQueueTagsResponse
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListQueueTagsResponse' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:ListQueueTagsResponse' :: ListQueueTagsResponse -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: ListQueueTagsResponse
s@ListQueueTagsResponse' {} Maybe (HashMap Text Text)
a -> ListQueueTagsResponse
s {$sel:tags:ListQueueTagsResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: ListQueueTagsResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> ListQueueTagsResponse -> f ListQueueTagsResponse)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> ListQueueTagsResponse
-> f ListQueueTagsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listQueueTagsResponse_httpStatus :: Lens.Lens' ListQueueTagsResponse Prelude.Int
listQueueTagsResponse_httpStatus :: (Int -> f Int) -> ListQueueTagsResponse -> f ListQueueTagsResponse
listQueueTagsResponse_httpStatus = (ListQueueTagsResponse -> Int)
-> (ListQueueTagsResponse -> Int -> ListQueueTagsResponse)
-> Lens ListQueueTagsResponse ListQueueTagsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListQueueTagsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListQueueTagsResponse' :: ListQueueTagsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListQueueTagsResponse
s@ListQueueTagsResponse' {} Int
a -> ListQueueTagsResponse
s {$sel:httpStatus:ListQueueTagsResponse' :: Int
httpStatus = Int
a} :: ListQueueTagsResponse)
instance Prelude.NFData ListQueueTagsResponse