{-# 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.Polly.ListLexicons
(
listLexicons
, ListLexicons
, llNextToken
, listLexiconsResponse
, ListLexiconsResponse
, llrsLexicons
, llrsNextToken
, llrsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Polly.Types
import Network.AWS.Polly.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype ListLexicons = ListLexicons'
{ _llNextToken :: Maybe Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
listLexicons
:: ListLexicons
listLexicons = ListLexicons' {_llNextToken = Nothing}
llNextToken :: Lens' ListLexicons (Maybe Text)
llNextToken = lens _llNextToken (\ s a -> s{_llNextToken = a})
instance AWSRequest ListLexicons where
type Rs ListLexicons = ListLexiconsResponse
request = get polly
response
= receiveJSON
(\ s h x ->
ListLexiconsResponse' <$>
(x .?> "Lexicons" .!@ mempty) <*> (x .?> "NextToken")
<*> (pure (fromEnum s)))
instance Hashable ListLexicons where
instance NFData ListLexicons where
instance ToHeaders ListLexicons where
toHeaders = const mempty
instance ToPath ListLexicons where
toPath = const "/v1/lexicons"
instance ToQuery ListLexicons where
toQuery ListLexicons'{..}
= mconcat ["NextToken" =: _llNextToken]
data ListLexiconsResponse = ListLexiconsResponse'
{ _llrsLexicons :: !(Maybe [LexiconDescription])
, _llrsNextToken :: !(Maybe Text)
, _llrsResponseStatus :: !Int
} deriving (Eq, Show, Data, Typeable, Generic)
listLexiconsResponse
:: Int
-> ListLexiconsResponse
listLexiconsResponse pResponseStatus_ =
ListLexiconsResponse'
{ _llrsLexicons = Nothing
, _llrsNextToken = Nothing
, _llrsResponseStatus = pResponseStatus_
}
llrsLexicons :: Lens' ListLexiconsResponse [LexiconDescription]
llrsLexicons = lens _llrsLexicons (\ s a -> s{_llrsLexicons = a}) . _Default . _Coerce
llrsNextToken :: Lens' ListLexiconsResponse (Maybe Text)
llrsNextToken = lens _llrsNextToken (\ s a -> s{_llrsNextToken = a})
llrsResponseStatus :: Lens' ListLexiconsResponse Int
llrsResponseStatus = lens _llrsResponseStatus (\ s a -> s{_llrsResponseStatus = a})
instance NFData ListLexiconsResponse where