module Network.AWS.Kinesis.ListTagsForStream
(
listTagsForStream
, ListTagsForStream
, ltfsLimit
, ltfsExclusiveStartTagKey
, ltfsStreamName
, listTagsForStreamResponse
, ListTagsForStreamResponse
, ltfsrsResponseStatus
, ltfsrsTags
, ltfsrsHasMoreTags
) where
import Network.AWS.Kinesis.Types
import Network.AWS.Kinesis.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data ListTagsForStream = ListTagsForStream'
{ _ltfsLimit :: !(Maybe Nat)
, _ltfsExclusiveStartTagKey :: !(Maybe Text)
, _ltfsStreamName :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listTagsForStream
:: Text
-> ListTagsForStream
listTagsForStream pStreamName_ =
ListTagsForStream'
{ _ltfsLimit = Nothing
, _ltfsExclusiveStartTagKey = Nothing
, _ltfsStreamName = pStreamName_
}
ltfsLimit :: Lens' ListTagsForStream (Maybe Natural)
ltfsLimit = lens _ltfsLimit (\ s a -> s{_ltfsLimit = a}) . mapping _Nat;
ltfsExclusiveStartTagKey :: Lens' ListTagsForStream (Maybe Text)
ltfsExclusiveStartTagKey = lens _ltfsExclusiveStartTagKey (\ s a -> s{_ltfsExclusiveStartTagKey = a});
ltfsStreamName :: Lens' ListTagsForStream Text
ltfsStreamName = lens _ltfsStreamName (\ s a -> s{_ltfsStreamName = a});
instance AWSRequest ListTagsForStream where
type Rs ListTagsForStream = ListTagsForStreamResponse
request = postJSON kinesis
response
= receiveJSON
(\ s h x ->
ListTagsForStreamResponse' <$>
(pure (fromEnum s)) <*> (x .?> "Tags" .!@ mempty) <*>
(x .:> "HasMoreTags"))
instance Hashable ListTagsForStream
instance NFData ListTagsForStream
instance ToHeaders ListTagsForStream where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("Kinesis_20131202.ListTagsForStream" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON ListTagsForStream where
toJSON ListTagsForStream'{..}
= object
(catMaybes
[("Limit" .=) <$> _ltfsLimit,
("ExclusiveStartTagKey" .=) <$>
_ltfsExclusiveStartTagKey,
Just ("StreamName" .= _ltfsStreamName)])
instance ToPath ListTagsForStream where
toPath = const "/"
instance ToQuery ListTagsForStream where
toQuery = const mempty
data ListTagsForStreamResponse = ListTagsForStreamResponse'
{ _ltfsrsResponseStatus :: !Int
, _ltfsrsTags :: ![Tag]
, _ltfsrsHasMoreTags :: !Bool
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listTagsForStreamResponse
:: Int
-> Bool
-> ListTagsForStreamResponse
listTagsForStreamResponse pResponseStatus_ pHasMoreTags_ =
ListTagsForStreamResponse'
{ _ltfsrsResponseStatus = pResponseStatus_
, _ltfsrsTags = mempty
, _ltfsrsHasMoreTags = pHasMoreTags_
}
ltfsrsResponseStatus :: Lens' ListTagsForStreamResponse Int
ltfsrsResponseStatus = lens _ltfsrsResponseStatus (\ s a -> s{_ltfsrsResponseStatus = a});
ltfsrsTags :: Lens' ListTagsForStreamResponse [Tag]
ltfsrsTags = lens _ltfsrsTags (\ s a -> s{_ltfsrsTags = a}) . _Coerce;
ltfsrsHasMoreTags :: Lens' ListTagsForStreamResponse Bool
ltfsrsHasMoreTags = lens _ltfsrsHasMoreTags (\ s a -> s{_ltfsrsHasMoreTags = a});
instance NFData ListTagsForStreamResponse