module Network.AWS.LexModels.GetIntent
(
getIntent
, GetIntent
, giName
, giVersion
, getIntentResponse
, GetIntentResponse
, girsFulfillmentActivity
, girsSlots
, girsRejectionStatement
, girsChecksum
, girsConclusionStatement
, girsSampleUtterances
, girsParentIntentSignature
, girsCreatedDate
, girsName
, girsVersion
, girsFollowUpPrompt
, girsLastUpdatedDate
, girsConfirmationPrompt
, girsDialogCodeHook
, girsDescription
, girsResponseStatus
) 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
data GetIntent = GetIntent'
{ _giName :: !Text
, _giVersion :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getIntent
:: Text
-> Text
-> GetIntent
getIntent pName_ pVersion_ =
GetIntent' {_giName = pName_, _giVersion = pVersion_}
giName :: Lens' GetIntent Text
giName = lens _giName (\ s a -> s{_giName = a});
giVersion :: Lens' GetIntent Text
giVersion = lens _giVersion (\ s a -> s{_giVersion = a});
instance AWSRequest GetIntent where
type Rs GetIntent = GetIntentResponse
request = get lexModels
response
= receiveJSON
(\ s h x ->
GetIntentResponse' <$>
(x .?> "fulfillmentActivity") <*>
(x .?> "slots" .!@ mempty)
<*> (x .?> "rejectionStatement")
<*> (x .?> "checksum")
<*> (x .?> "conclusionStatement")
<*> (x .?> "sampleUtterances" .!@ mempty)
<*> (x .?> "parentIntentSignature")
<*> (x .?> "createdDate")
<*> (x .?> "name")
<*> (x .?> "version")
<*> (x .?> "followUpPrompt")
<*> (x .?> "lastUpdatedDate")
<*> (x .?> "confirmationPrompt")
<*> (x .?> "dialogCodeHook")
<*> (x .?> "description")
<*> (pure (fromEnum s)))
instance Hashable GetIntent where
instance NFData GetIntent where
instance ToHeaders GetIntent where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToPath GetIntent where
toPath GetIntent'{..}
= mconcat
["/intents/", toBS _giName, "/versions/",
toBS _giVersion]
instance ToQuery GetIntent where
toQuery = const mempty
data GetIntentResponse = GetIntentResponse'
{ _girsFulfillmentActivity :: !(Maybe FulfillmentActivity)
, _girsSlots :: !(Maybe [Slot])
, _girsRejectionStatement :: !(Maybe Statement)
, _girsChecksum :: !(Maybe Text)
, _girsConclusionStatement :: !(Maybe Statement)
, _girsSampleUtterances :: !(Maybe [Text])
, _girsParentIntentSignature :: !(Maybe Text)
, _girsCreatedDate :: !(Maybe POSIX)
, _girsName :: !(Maybe Text)
, _girsVersion :: !(Maybe Text)
, _girsFollowUpPrompt :: !(Maybe FollowUpPrompt)
, _girsLastUpdatedDate :: !(Maybe POSIX)
, _girsConfirmationPrompt :: !(Maybe Prompt)
, _girsDialogCodeHook :: !(Maybe CodeHook)
, _girsDescription :: !(Maybe Text)
, _girsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getIntentResponse
:: Int
-> GetIntentResponse
getIntentResponse pResponseStatus_ =
GetIntentResponse'
{ _girsFulfillmentActivity = Nothing
, _girsSlots = Nothing
, _girsRejectionStatement = Nothing
, _girsChecksum = Nothing
, _girsConclusionStatement = Nothing
, _girsSampleUtterances = Nothing
, _girsParentIntentSignature = Nothing
, _girsCreatedDate = Nothing
, _girsName = Nothing
, _girsVersion = Nothing
, _girsFollowUpPrompt = Nothing
, _girsLastUpdatedDate = Nothing
, _girsConfirmationPrompt = Nothing
, _girsDialogCodeHook = Nothing
, _girsDescription = Nothing
, _girsResponseStatus = pResponseStatus_
}
girsFulfillmentActivity :: Lens' GetIntentResponse (Maybe FulfillmentActivity)
girsFulfillmentActivity = lens _girsFulfillmentActivity (\ s a -> s{_girsFulfillmentActivity = a});
girsSlots :: Lens' GetIntentResponse [Slot]
girsSlots = lens _girsSlots (\ s a -> s{_girsSlots = a}) . _Default . _Coerce;
girsRejectionStatement :: Lens' GetIntentResponse (Maybe Statement)
girsRejectionStatement = lens _girsRejectionStatement (\ s a -> s{_girsRejectionStatement = a});
girsChecksum :: Lens' GetIntentResponse (Maybe Text)
girsChecksum = lens _girsChecksum (\ s a -> s{_girsChecksum = a});
girsConclusionStatement :: Lens' GetIntentResponse (Maybe Statement)
girsConclusionStatement = lens _girsConclusionStatement (\ s a -> s{_girsConclusionStatement = a});
girsSampleUtterances :: Lens' GetIntentResponse [Text]
girsSampleUtterances = lens _girsSampleUtterances (\ s a -> s{_girsSampleUtterances = a}) . _Default . _Coerce;
girsParentIntentSignature :: Lens' GetIntentResponse (Maybe Text)
girsParentIntentSignature = lens _girsParentIntentSignature (\ s a -> s{_girsParentIntentSignature = a});
girsCreatedDate :: Lens' GetIntentResponse (Maybe UTCTime)
girsCreatedDate = lens _girsCreatedDate (\ s a -> s{_girsCreatedDate = a}) . mapping _Time;
girsName :: Lens' GetIntentResponse (Maybe Text)
girsName = lens _girsName (\ s a -> s{_girsName = a});
girsVersion :: Lens' GetIntentResponse (Maybe Text)
girsVersion = lens _girsVersion (\ s a -> s{_girsVersion = a});
girsFollowUpPrompt :: Lens' GetIntentResponse (Maybe FollowUpPrompt)
girsFollowUpPrompt = lens _girsFollowUpPrompt (\ s a -> s{_girsFollowUpPrompt = a});
girsLastUpdatedDate :: Lens' GetIntentResponse (Maybe UTCTime)
girsLastUpdatedDate = lens _girsLastUpdatedDate (\ s a -> s{_girsLastUpdatedDate = a}) . mapping _Time;
girsConfirmationPrompt :: Lens' GetIntentResponse (Maybe Prompt)
girsConfirmationPrompt = lens _girsConfirmationPrompt (\ s a -> s{_girsConfirmationPrompt = a});
girsDialogCodeHook :: Lens' GetIntentResponse (Maybe CodeHook)
girsDialogCodeHook = lens _girsDialogCodeHook (\ s a -> s{_girsDialogCodeHook = a});
girsDescription :: Lens' GetIntentResponse (Maybe Text)
girsDescription = lens _girsDescription (\ s a -> s{_girsDescription = a});
girsResponseStatus :: Lens' GetIntentResponse Int
girsResponseStatus = lens _girsResponseStatus (\ s a -> s{_girsResponseStatus = a});
instance NFData GetIntentResponse where