{-# 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.ElastiCache.ListTagsForResource
(
ListTagsForResource (..),
newListTagsForResource,
listTagsForResource_resourceName,
TagListMessage (..),
newTagListMessage,
tagListMessage_tagList,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.ElastiCache.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListTagsForResource = ListTagsForResource'
{
ListTagsForResource -> Text
resourceName :: Prelude.Text
}
deriving (ListTagsForResource -> ListTagsForResource -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTagsForResource -> ListTagsForResource -> Bool
$c/= :: ListTagsForResource -> ListTagsForResource -> Bool
== :: ListTagsForResource -> ListTagsForResource -> Bool
$c== :: ListTagsForResource -> ListTagsForResource -> Bool
Prelude.Eq, ReadPrec [ListTagsForResource]
ReadPrec ListTagsForResource
Int -> ReadS ListTagsForResource
ReadS [ListTagsForResource]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTagsForResource]
$creadListPrec :: ReadPrec [ListTagsForResource]
readPrec :: ReadPrec ListTagsForResource
$creadPrec :: ReadPrec ListTagsForResource
readList :: ReadS [ListTagsForResource]
$creadList :: ReadS [ListTagsForResource]
readsPrec :: Int -> ReadS ListTagsForResource
$creadsPrec :: Int -> ReadS ListTagsForResource
Prelude.Read, Int -> ListTagsForResource -> ShowS
[ListTagsForResource] -> ShowS
ListTagsForResource -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTagsForResource] -> ShowS
$cshowList :: [ListTagsForResource] -> ShowS
show :: ListTagsForResource -> String
$cshow :: ListTagsForResource -> String
showsPrec :: Int -> ListTagsForResource -> ShowS
$cshowsPrec :: Int -> ListTagsForResource -> ShowS
Prelude.Show, forall x. Rep ListTagsForResource x -> ListTagsForResource
forall x. ListTagsForResource -> Rep ListTagsForResource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListTagsForResource x -> ListTagsForResource
$cfrom :: forall x. ListTagsForResource -> Rep ListTagsForResource x
Prelude.Generic)
newListTagsForResource ::
Prelude.Text ->
ListTagsForResource
newListTagsForResource :: Text -> ListTagsForResource
newListTagsForResource Text
pResourceName_ =
ListTagsForResource' {$sel:resourceName:ListTagsForResource' :: Text
resourceName = Text
pResourceName_}
listTagsForResource_resourceName :: Lens.Lens' ListTagsForResource Prelude.Text
listTagsForResource_resourceName :: Lens' ListTagsForResource Text
listTagsForResource_resourceName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTagsForResource' {Text
resourceName :: Text
$sel:resourceName:ListTagsForResource' :: ListTagsForResource -> Text
resourceName} -> Text
resourceName) (\s :: ListTagsForResource
s@ListTagsForResource' {} Text
a -> ListTagsForResource
s {$sel:resourceName:ListTagsForResource' :: Text
resourceName = Text
a} :: ListTagsForResource)
instance Core.AWSRequest ListTagsForResource where
type AWSResponse ListTagsForResource = TagListMessage
request :: (Service -> Service)
-> ListTagsForResource -> Request ListTagsForResource
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListTagsForResource
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListTagsForResource)))
response =
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"ListTagsForResourceResult"
(\Int
s ResponseHeaders
h [Node]
x -> forall a. FromXML a => [Node] -> Either String a
Data.parseXML [Node]
x)
instance Prelude.Hashable ListTagsForResource where
hashWithSalt :: Int -> ListTagsForResource -> Int
hashWithSalt Int
_salt ListTagsForResource' {Text
resourceName :: Text
$sel:resourceName:ListTagsForResource' :: ListTagsForResource -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resourceName
instance Prelude.NFData ListTagsForResource where
rnf :: ListTagsForResource -> ()
rnf ListTagsForResource' {Text
resourceName :: Text
$sel:resourceName:ListTagsForResource' :: ListTagsForResource -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
resourceName
instance Data.ToHeaders ListTagsForResource where
toHeaders :: ListTagsForResource -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath ListTagsForResource where
toPath :: ListTagsForResource -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListTagsForResource where
toQuery :: ListTagsForResource -> QueryString
toQuery ListTagsForResource' {Text
resourceName :: Text
$sel:resourceName:ListTagsForResource' :: ListTagsForResource -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"ListTagsForResource" :: Prelude.ByteString),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2015-02-02" :: Prelude.ByteString),
ByteString
"ResourceName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
resourceName
]