{-# 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.ElasticSearch.ListTags
(
listTags
, ListTags
, ltARN
, listTagsResponse
, ListTagsResponse
, ltrsTagList
, ltrsResponseStatus
) where
import Network.AWS.ElasticSearch.Types
import Network.AWS.ElasticSearch.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype ListTags = ListTags'
{ _ltARN :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
listTags
:: Text
-> ListTags
listTags pARN_ = ListTags' {_ltARN = pARN_}
ltARN :: Lens' ListTags Text
ltARN = lens _ltARN (\ s a -> s{_ltARN = a})
instance AWSRequest ListTags where
type Rs ListTags = ListTagsResponse
request = get elasticSearch
response
= receiveJSON
(\ s h x ->
ListTagsResponse' <$>
(x .?> "TagList" .!@ mempty) <*> (pure (fromEnum s)))
instance Hashable ListTags where
instance NFData ListTags where
instance ToHeaders ListTags where
toHeaders = const mempty
instance ToPath ListTags where
toPath = const "/2015-01-01/tags/"
instance ToQuery ListTags where
toQuery ListTags'{..} = mconcat ["arn" =: _ltARN]
data ListTagsResponse = ListTagsResponse'
{ _ltrsTagList :: !(Maybe [Tag])
, _ltrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
listTagsResponse
:: Int
-> ListTagsResponse
listTagsResponse pResponseStatus_ =
ListTagsResponse'
{_ltrsTagList = Nothing, _ltrsResponseStatus = pResponseStatus_}
ltrsTagList :: Lens' ListTagsResponse [Tag]
ltrsTagList = lens _ltrsTagList (\ s a -> s{_ltrsTagList = a}) . _Default . _Coerce
ltrsResponseStatus :: Lens' ListTagsResponse Int
ltrsResponseStatus = lens _ltrsResponseStatus (\ s a -> s{_ltrsResponseStatus = a})
instance NFData ListTagsResponse where