{-# 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.CreateIntentVersion
(
createIntentVersion
, CreateIntentVersion
, civChecksum
, civName
, createIntentVersionResponse
, CreateIntentVersionResponse
, civrsFulfillmentActivity
, civrsSlots
, civrsRejectionStatement
, civrsChecksum
, civrsConclusionStatement
, civrsSampleUtterances
, civrsParentIntentSignature
, civrsCreatedDate
, civrsName
, civrsVersion
, civrsFollowUpPrompt
, civrsLastUpdatedDate
, civrsConfirmationPrompt
, civrsDialogCodeHook
, civrsDescription
, civrsResponseStatus
) 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 CreateIntentVersion = CreateIntentVersion'
{ _civChecksum :: !(Maybe Text)
, _civName :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createIntentVersion
:: Text
-> CreateIntentVersion
createIntentVersion pName_ =
CreateIntentVersion' {_civChecksum = Nothing, _civName = pName_}
civChecksum :: Lens' CreateIntentVersion (Maybe Text)
civChecksum = lens _civChecksum (\ s a -> s{_civChecksum = a})
civName :: Lens' CreateIntentVersion Text
civName = lens _civName (\ s a -> s{_civName = a})
instance AWSRequest CreateIntentVersion where
type Rs CreateIntentVersion =
CreateIntentVersionResponse
request = postJSON lexModels
response
= receiveJSON
(\ s h x ->
CreateIntentVersionResponse' <$>
(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 CreateIntentVersion where
instance NFData CreateIntentVersion where
instance ToHeaders CreateIntentVersion where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON CreateIntentVersion where
toJSON CreateIntentVersion'{..}
= object
(catMaybes [("checksum" .=) <$> _civChecksum])
instance ToPath CreateIntentVersion where
toPath CreateIntentVersion'{..}
= mconcat ["/intents/", toBS _civName, "/versions"]
instance ToQuery CreateIntentVersion where
toQuery = const mempty
data CreateIntentVersionResponse = CreateIntentVersionResponse'
{ _civrsFulfillmentActivity :: !(Maybe FulfillmentActivity)
, _civrsSlots :: !(Maybe [Slot])
, _civrsRejectionStatement :: !(Maybe Statement)
, _civrsChecksum :: !(Maybe Text)
, _civrsConclusionStatement :: !(Maybe Statement)
, _civrsSampleUtterances :: !(Maybe [Text])
, _civrsParentIntentSignature :: !(Maybe Text)
, _civrsCreatedDate :: !(Maybe POSIX)
, _civrsName :: !(Maybe Text)
, _civrsVersion :: !(Maybe Text)
, _civrsFollowUpPrompt :: !(Maybe FollowUpPrompt)
, _civrsLastUpdatedDate :: !(Maybe POSIX)
, _civrsConfirmationPrompt :: !(Maybe Prompt)
, _civrsDialogCodeHook :: !(Maybe CodeHook)
, _civrsDescription :: !(Maybe Text)
, _civrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createIntentVersionResponse
:: Int
-> CreateIntentVersionResponse
createIntentVersionResponse pResponseStatus_ =
CreateIntentVersionResponse'
{ _civrsFulfillmentActivity = Nothing
, _civrsSlots = Nothing
, _civrsRejectionStatement = Nothing
, _civrsChecksum = Nothing
, _civrsConclusionStatement = Nothing
, _civrsSampleUtterances = Nothing
, _civrsParentIntentSignature = Nothing
, _civrsCreatedDate = Nothing
, _civrsName = Nothing
, _civrsVersion = Nothing
, _civrsFollowUpPrompt = Nothing
, _civrsLastUpdatedDate = Nothing
, _civrsConfirmationPrompt = Nothing
, _civrsDialogCodeHook = Nothing
, _civrsDescription = Nothing
, _civrsResponseStatus = pResponseStatus_
}
civrsFulfillmentActivity :: Lens' CreateIntentVersionResponse (Maybe FulfillmentActivity)
civrsFulfillmentActivity = lens _civrsFulfillmentActivity (\ s a -> s{_civrsFulfillmentActivity = a})
civrsSlots :: Lens' CreateIntentVersionResponse [Slot]
civrsSlots = lens _civrsSlots (\ s a -> s{_civrsSlots = a}) . _Default . _Coerce
civrsRejectionStatement :: Lens' CreateIntentVersionResponse (Maybe Statement)
civrsRejectionStatement = lens _civrsRejectionStatement (\ s a -> s{_civrsRejectionStatement = a})
civrsChecksum :: Lens' CreateIntentVersionResponse (Maybe Text)
civrsChecksum = lens _civrsChecksum (\ s a -> s{_civrsChecksum = a})
civrsConclusionStatement :: Lens' CreateIntentVersionResponse (Maybe Statement)
civrsConclusionStatement = lens _civrsConclusionStatement (\ s a -> s{_civrsConclusionStatement = a})
civrsSampleUtterances :: Lens' CreateIntentVersionResponse [Text]
civrsSampleUtterances = lens _civrsSampleUtterances (\ s a -> s{_civrsSampleUtterances = a}) . _Default . _Coerce
civrsParentIntentSignature :: Lens' CreateIntentVersionResponse (Maybe Text)
civrsParentIntentSignature = lens _civrsParentIntentSignature (\ s a -> s{_civrsParentIntentSignature = a})
civrsCreatedDate :: Lens' CreateIntentVersionResponse (Maybe UTCTime)
civrsCreatedDate = lens _civrsCreatedDate (\ s a -> s{_civrsCreatedDate = a}) . mapping _Time
civrsName :: Lens' CreateIntentVersionResponse (Maybe Text)
civrsName = lens _civrsName (\ s a -> s{_civrsName = a})
civrsVersion :: Lens' CreateIntentVersionResponse (Maybe Text)
civrsVersion = lens _civrsVersion (\ s a -> s{_civrsVersion = a})
civrsFollowUpPrompt :: Lens' CreateIntentVersionResponse (Maybe FollowUpPrompt)
civrsFollowUpPrompt = lens _civrsFollowUpPrompt (\ s a -> s{_civrsFollowUpPrompt = a})
civrsLastUpdatedDate :: Lens' CreateIntentVersionResponse (Maybe UTCTime)
civrsLastUpdatedDate = lens _civrsLastUpdatedDate (\ s a -> s{_civrsLastUpdatedDate = a}) . mapping _Time
civrsConfirmationPrompt :: Lens' CreateIntentVersionResponse (Maybe Prompt)
civrsConfirmationPrompt = lens _civrsConfirmationPrompt (\ s a -> s{_civrsConfirmationPrompt = a})
civrsDialogCodeHook :: Lens' CreateIntentVersionResponse (Maybe CodeHook)
civrsDialogCodeHook = lens _civrsDialogCodeHook (\ s a -> s{_civrsDialogCodeHook = a})
civrsDescription :: Lens' CreateIntentVersionResponse (Maybe Text)
civrsDescription = lens _civrsDescription (\ s a -> s{_civrsDescription = a})
civrsResponseStatus :: Lens' CreateIntentVersionResponse Int
civrsResponseStatus = lens _civrsResponseStatus (\ s a -> s{_civrsResponseStatus = a})
instance NFData CreateIntentVersionResponse where