{-# 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.LexModels.GetBuiltinIntent
(
getBuiltinIntent
, GetBuiltinIntent
, gbiSignature
, getBuiltinIntentResponse
, GetBuiltinIntentResponse
, gbirsSignature
, gbirsSlots
, gbirsSupportedLocales
, gbirsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.LexModels.Types
import Network.AWS.LexModels.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype GetBuiltinIntent = GetBuiltinIntent'
{ _gbiSignature :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getBuiltinIntent
:: Text
-> GetBuiltinIntent
getBuiltinIntent pSignature_ = GetBuiltinIntent' {_gbiSignature = pSignature_}
gbiSignature :: Lens' GetBuiltinIntent Text
gbiSignature = lens _gbiSignature (\ s a -> s{_gbiSignature = a})
instance AWSRequest GetBuiltinIntent where
type Rs GetBuiltinIntent = GetBuiltinIntentResponse
request = get lexModels
response
= receiveJSON
(\ s h x ->
GetBuiltinIntentResponse' <$>
(x .?> "signature") <*> (x .?> "slots" .!@ mempty)
<*> (x .?> "supportedLocales" .!@ mempty)
<*> (pure (fromEnum s)))
instance Hashable GetBuiltinIntent where
instance NFData GetBuiltinIntent where
instance ToHeaders GetBuiltinIntent where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToPath GetBuiltinIntent where
toPath GetBuiltinIntent'{..}
= mconcat ["/builtins/intents/", toBS _gbiSignature]
instance ToQuery GetBuiltinIntent where
toQuery = const mempty
data GetBuiltinIntentResponse = GetBuiltinIntentResponse'
{ _gbirsSignature :: !(Maybe Text)
, _gbirsSlots :: !(Maybe [BuiltinIntentSlot])
, _gbirsSupportedLocales :: !(Maybe [Locale])
, _gbirsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getBuiltinIntentResponse
:: Int
-> GetBuiltinIntentResponse
getBuiltinIntentResponse pResponseStatus_ =
GetBuiltinIntentResponse'
{ _gbirsSignature = Nothing
, _gbirsSlots = Nothing
, _gbirsSupportedLocales = Nothing
, _gbirsResponseStatus = pResponseStatus_
}
gbirsSignature :: Lens' GetBuiltinIntentResponse (Maybe Text)
gbirsSignature = lens _gbirsSignature (\ s a -> s{_gbirsSignature = a})
gbirsSlots :: Lens' GetBuiltinIntentResponse [BuiltinIntentSlot]
gbirsSlots = lens _gbirsSlots (\ s a -> s{_gbirsSlots = a}) . _Default . _Coerce
gbirsSupportedLocales :: Lens' GetBuiltinIntentResponse [Locale]
gbirsSupportedLocales = lens _gbirsSupportedLocales (\ s a -> s{_gbirsSupportedLocales = a}) . _Default . _Coerce
gbirsResponseStatus :: Lens' GetBuiltinIntentResponse Int
gbirsResponseStatus = lens _gbirsResponseStatus (\ s a -> s{_gbirsResponseStatus = a})
instance NFData GetBuiltinIntentResponse where