{-# 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.GetIntent
(
getIntent
, GetIntent
, giName
, giVersion
, getIntentResponse
, GetIntentResponse
, getrsFulfillmentActivity
, getrsSlots
, getrsRejectionStatement
, getrsChecksum
, getrsConclusionStatement
, getrsSampleUtterances
, getrsParentIntentSignature
, getrsCreatedDate
, getrsName
, getrsVersion
, getrsFollowUpPrompt
, getrsLastUpdatedDate
, getrsConfirmationPrompt
, getrsDialogCodeHook
, getrsDescription
, getrsResponseStatus
) 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'
{ _getrsFulfillmentActivity :: !(Maybe FulfillmentActivity)
, _getrsSlots :: !(Maybe [Slot])
, _getrsRejectionStatement :: !(Maybe Statement)
, _getrsChecksum :: !(Maybe Text)
, _getrsConclusionStatement :: !(Maybe Statement)
, _getrsSampleUtterances :: !(Maybe [Text])
, _getrsParentIntentSignature :: !(Maybe Text)
, _getrsCreatedDate :: !(Maybe POSIX)
, _getrsName :: !(Maybe Text)
, _getrsVersion :: !(Maybe Text)
, _getrsFollowUpPrompt :: !(Maybe FollowUpPrompt)
, _getrsLastUpdatedDate :: !(Maybe POSIX)
, _getrsConfirmationPrompt :: !(Maybe Prompt)
, _getrsDialogCodeHook :: !(Maybe CodeHook)
, _getrsDescription :: !(Maybe Text)
, _getrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getIntentResponse
:: Int
-> GetIntentResponse
getIntentResponse pResponseStatus_ =
GetIntentResponse'
{ _getrsFulfillmentActivity = Nothing
, _getrsSlots = Nothing
, _getrsRejectionStatement = Nothing
, _getrsChecksum = Nothing
, _getrsConclusionStatement = Nothing
, _getrsSampleUtterances = Nothing
, _getrsParentIntentSignature = Nothing
, _getrsCreatedDate = Nothing
, _getrsName = Nothing
, _getrsVersion = Nothing
, _getrsFollowUpPrompt = Nothing
, _getrsLastUpdatedDate = Nothing
, _getrsConfirmationPrompt = Nothing
, _getrsDialogCodeHook = Nothing
, _getrsDescription = Nothing
, _getrsResponseStatus = pResponseStatus_
}
getrsFulfillmentActivity :: Lens' GetIntentResponse (Maybe FulfillmentActivity)
getrsFulfillmentActivity = lens _getrsFulfillmentActivity (\ s a -> s{_getrsFulfillmentActivity = a})
getrsSlots :: Lens' GetIntentResponse [Slot]
getrsSlots = lens _getrsSlots (\ s a -> s{_getrsSlots = a}) . _Default . _Coerce
getrsRejectionStatement :: Lens' GetIntentResponse (Maybe Statement)
getrsRejectionStatement = lens _getrsRejectionStatement (\ s a -> s{_getrsRejectionStatement = a})
getrsChecksum :: Lens' GetIntentResponse (Maybe Text)
getrsChecksum = lens _getrsChecksum (\ s a -> s{_getrsChecksum = a})
getrsConclusionStatement :: Lens' GetIntentResponse (Maybe Statement)
getrsConclusionStatement = lens _getrsConclusionStatement (\ s a -> s{_getrsConclusionStatement = a})
getrsSampleUtterances :: Lens' GetIntentResponse [Text]
getrsSampleUtterances = lens _getrsSampleUtterances (\ s a -> s{_getrsSampleUtterances = a}) . _Default . _Coerce
getrsParentIntentSignature :: Lens' GetIntentResponse (Maybe Text)
getrsParentIntentSignature = lens _getrsParentIntentSignature (\ s a -> s{_getrsParentIntentSignature = a})
getrsCreatedDate :: Lens' GetIntentResponse (Maybe UTCTime)
getrsCreatedDate = lens _getrsCreatedDate (\ s a -> s{_getrsCreatedDate = a}) . mapping _Time
getrsName :: Lens' GetIntentResponse (Maybe Text)
getrsName = lens _getrsName (\ s a -> s{_getrsName = a})
getrsVersion :: Lens' GetIntentResponse (Maybe Text)
getrsVersion = lens _getrsVersion (\ s a -> s{_getrsVersion = a})
getrsFollowUpPrompt :: Lens' GetIntentResponse (Maybe FollowUpPrompt)
getrsFollowUpPrompt = lens _getrsFollowUpPrompt (\ s a -> s{_getrsFollowUpPrompt = a})
getrsLastUpdatedDate :: Lens' GetIntentResponse (Maybe UTCTime)
getrsLastUpdatedDate = lens _getrsLastUpdatedDate (\ s a -> s{_getrsLastUpdatedDate = a}) . mapping _Time
getrsConfirmationPrompt :: Lens' GetIntentResponse (Maybe Prompt)
getrsConfirmationPrompt = lens _getrsConfirmationPrompt (\ s a -> s{_getrsConfirmationPrompt = a})
getrsDialogCodeHook :: Lens' GetIntentResponse (Maybe CodeHook)
getrsDialogCodeHook = lens _getrsDialogCodeHook (\ s a -> s{_getrsDialogCodeHook = a})
getrsDescription :: Lens' GetIntentResponse (Maybe Text)
getrsDescription = lens _getrsDescription (\ s a -> s{_getrsDescription = a})
getrsResponseStatus :: Lens' GetIntentResponse Int
getrsResponseStatus = lens _getrsResponseStatus (\ s a -> s{_getrsResponseStatus = a})
instance NFData GetIntentResponse where