{-# 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.GetLexicon
(
getLexicon
, GetLexicon
, glName
, getLexiconResponse
, GetLexiconResponse
, glrsLexiconAttributes
, glrsLexicon
, glrsResponseStatus
) 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 GetLexicon = GetLexicon'
{ _glName :: Sensitive Text
} deriving (Eq, Show, Data, Typeable, Generic)
getLexicon
:: Text
-> GetLexicon
getLexicon pName_ = GetLexicon' {_glName = _Sensitive # pName_}
glName :: Lens' GetLexicon Text
glName = lens _glName (\ s a -> s{_glName = a}) . _Sensitive
instance AWSRequest GetLexicon where
type Rs GetLexicon = GetLexiconResponse
request = get polly
response
= receiveJSON
(\ s h x ->
GetLexiconResponse' <$>
(x .?> "LexiconAttributes") <*> (x .?> "Lexicon") <*>
(pure (fromEnum s)))
instance Hashable GetLexicon where
instance NFData GetLexicon where
instance ToHeaders GetLexicon where
toHeaders = const mempty
instance ToPath GetLexicon where
toPath GetLexicon'{..}
= mconcat ["/v1/lexicons/", toBS _glName]
instance ToQuery GetLexicon where
toQuery = const mempty
data GetLexiconResponse = GetLexiconResponse'
{ _glrsLexiconAttributes :: !(Maybe LexiconAttributes)
, _glrsLexicon :: !(Maybe Lexicon)
, _glrsResponseStatus :: !Int
} deriving (Eq, Show, Data, Typeable, Generic)
getLexiconResponse
:: Int
-> GetLexiconResponse
getLexiconResponse pResponseStatus_ =
GetLexiconResponse'
{ _glrsLexiconAttributes = Nothing
, _glrsLexicon = Nothing
, _glrsResponseStatus = pResponseStatus_
}
glrsLexiconAttributes :: Lens' GetLexiconResponse (Maybe LexiconAttributes)
glrsLexiconAttributes = lens _glrsLexiconAttributes (\ s a -> s{_glrsLexiconAttributes = a})
glrsLexicon :: Lens' GetLexiconResponse (Maybe Lexicon)
glrsLexicon = lens _glrsLexicon (\ s a -> s{_glrsLexicon = a})
glrsResponseStatus :: Lens' GetLexiconResponse Int
glrsResponseStatus = lens _glrsResponseStatus (\ s a -> s{_glrsResponseStatus = a})
instance NFData GetLexiconResponse where