module Network.AWS.Inspector.LocalizeText
(
localizeText
, LocalizeText
, ltLocale
, ltLocalizedTexts
, localizeTextResponse
, LocalizeTextResponse
, ltrsResults
, ltrsMessage
, ltrsResponseStatus
) where
import Network.AWS.Inspector.Types
import Network.AWS.Inspector.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data LocalizeText = LocalizeText'
{ _ltLocale :: !(Maybe Text)
, _ltLocalizedTexts :: !(Maybe [LocalizedText])
} deriving (Eq,Read,Show,Data,Typeable,Generic)
localizeText
:: LocalizeText
localizeText =
LocalizeText'
{ _ltLocale = Nothing
, _ltLocalizedTexts = Nothing
}
ltLocale :: Lens' LocalizeText (Maybe Text)
ltLocale = lens _ltLocale (\ s a -> s{_ltLocale = a});
ltLocalizedTexts :: Lens' LocalizeText [LocalizedText]
ltLocalizedTexts = lens _ltLocalizedTexts (\ s a -> s{_ltLocalizedTexts = a}) . _Default . _Coerce;
instance AWSRequest LocalizeText where
type Rs LocalizeText = LocalizeTextResponse
request = postJSON inspector
response
= receiveJSON
(\ s h x ->
LocalizeTextResponse' <$>
(x .?> "results" .!@ mempty) <*> (x .?> "message")
<*> (pure (fromEnum s)))
instance ToHeaders LocalizeText where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("InspectorService.LocalizeText" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON LocalizeText where
toJSON LocalizeText'{..}
= object
(catMaybes
[("locale" .=) <$> _ltLocale,
("localizedTexts" .=) <$> _ltLocalizedTexts])
instance ToPath LocalizeText where
toPath = const "/"
instance ToQuery LocalizeText where
toQuery = const mempty
data LocalizeTextResponse = LocalizeTextResponse'
{ _ltrsResults :: !(Maybe [Text])
, _ltrsMessage :: !(Maybe Text)
, _ltrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
localizeTextResponse
:: Int
-> LocalizeTextResponse
localizeTextResponse pResponseStatus_ =
LocalizeTextResponse'
{ _ltrsResults = Nothing
, _ltrsMessage = Nothing
, _ltrsResponseStatus = pResponseStatus_
}
ltrsResults :: Lens' LocalizeTextResponse [Text]
ltrsResults = lens _ltrsResults (\ s a -> s{_ltrsResults = a}) . _Default . _Coerce;
ltrsMessage :: Lens' LocalizeTextResponse (Maybe Text)
ltrsMessage = lens _ltrsMessage (\ s a -> s{_ltrsMessage = a});
ltrsResponseStatus :: Lens' LocalizeTextResponse Int
ltrsResponseStatus = lens _ltrsResponseStatus (\ s a -> s{_ltrsResponseStatus = a});