{-# 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.RDS.ListTagsForResource
(
listTagsForResource
, ListTagsForResource
, ltfrFilters
, ltfrResourceName
, listTagsForResourceResponse
, ListTagsForResourceResponse
, ltfrrsTagList
, ltfrrsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.RDS.Types
import Network.AWS.RDS.Types.Product
import Network.AWS.Request
import Network.AWS.Response
data ListTagsForResource = ListTagsForResource'
{ _ltfrFilters :: !(Maybe [Filter])
, _ltfrResourceName :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listTagsForResource
:: Text
-> ListTagsForResource
listTagsForResource pResourceName_ =
ListTagsForResource'
{ _ltfrFilters = Nothing
, _ltfrResourceName = pResourceName_
}
ltfrFilters :: Lens' ListTagsForResource [Filter]
ltfrFilters = lens _ltfrFilters (\ s a -> s{_ltfrFilters = a}) . _Default . _Coerce;
ltfrResourceName :: Lens' ListTagsForResource Text
ltfrResourceName = lens _ltfrResourceName (\ s a -> s{_ltfrResourceName = a});
instance AWSRequest ListTagsForResource where
type Rs ListTagsForResource =
ListTagsForResourceResponse
request = postQuery rds
response
= receiveXMLWrapper "ListTagsForResourceResult"
(\ s h x ->
ListTagsForResourceResponse' <$>
(x .@? "TagList" .!@ mempty >>=
may (parseXMLList "Tag"))
<*> (pure (fromEnum s)))
instance Hashable ListTagsForResource
instance NFData ListTagsForResource
instance ToHeaders ListTagsForResource where
toHeaders = const mempty
instance ToPath ListTagsForResource where
toPath = const "/"
instance ToQuery ListTagsForResource where
toQuery ListTagsForResource'{..}
= mconcat
["Action" =: ("ListTagsForResource" :: ByteString),
"Version" =: ("2014-10-31" :: ByteString),
"Filters" =:
toQuery (toQueryList "Filter" <$> _ltfrFilters),
"ResourceName" =: _ltfrResourceName]
data ListTagsForResourceResponse = ListTagsForResourceResponse'
{ _ltfrrsTagList :: !(Maybe [Tag])
, _ltfrrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listTagsForResourceResponse
:: Int
-> ListTagsForResourceResponse
listTagsForResourceResponse pResponseStatus_ =
ListTagsForResourceResponse'
{ _ltfrrsTagList = Nothing
, _ltfrrsResponseStatus = pResponseStatus_
}
ltfrrsTagList :: Lens' ListTagsForResourceResponse [Tag]
ltfrrsTagList = lens _ltfrrsTagList (\ s a -> s{_ltfrrsTagList = a}) . _Default . _Coerce;
ltfrrsResponseStatus :: Lens' ListTagsForResourceResponse Int
ltfrrsResponseStatus = lens _ltfrrsResponseStatus (\ s a -> s{_ltfrrsResponseStatus = a});
instance NFData ListTagsForResourceResponse