module Network.AWS.Lambda.ListTags
(
listTags
, ListTags
, ltResource
, listTagsResponse
, ListTagsResponse
, ltrsTags
, ltrsResponseStatus
) where
import Network.AWS.Lambda.Types
import Network.AWS.Lambda.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype ListTags = ListTags'
{ _ltResource :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
listTags
:: Text
-> ListTags
listTags pResource_ = ListTags' {_ltResource = pResource_}
ltResource :: Lens' ListTags Text
ltResource = lens _ltResource (\ s a -> s{_ltResource = a});
instance AWSRequest ListTags where
type Rs ListTags = ListTagsResponse
request = get lambda
response
= receiveJSON
(\ s h x ->
ListTagsResponse' <$>
(x .?> "Tags" .!@ mempty) <*> (pure (fromEnum s)))
instance Hashable ListTags where
instance NFData ListTags where
instance ToHeaders ListTags where
toHeaders = const mempty
instance ToPath ListTags where
toPath ListTags'{..}
= mconcat ["/2017-03-31/tags/", toBS _ltResource]
instance ToQuery ListTags where
toQuery = const mempty
data ListTagsResponse = ListTagsResponse'
{ _ltrsTags :: !(Maybe (Map Text Text))
, _ltrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
listTagsResponse
:: Int
-> ListTagsResponse
listTagsResponse pResponseStatus_ =
ListTagsResponse'
{_ltrsTags = Nothing, _ltrsResponseStatus = pResponseStatus_}
ltrsTags :: Lens' ListTagsResponse (HashMap Text Text)
ltrsTags = lens _ltrsTags (\ s a -> s{_ltrsTags = a}) . _Default . _Map;
ltrsResponseStatus :: Lens' ListTagsResponse Int
ltrsResponseStatus = lens _ltrsResponseStatus (\ s a -> s{_ltrsResponseStatus = a});
instance NFData ListTagsResponse where