{-# 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.CreateSlotTypeVersion
(
createSlotTypeVersion
, CreateSlotTypeVersion
, cstvChecksum
, cstvName
, createSlotTypeVersionResponse
, CreateSlotTypeVersionResponse
, cstvrsChecksum
, cstvrsValueSelectionStrategy
, cstvrsCreatedDate
, cstvrsName
, cstvrsVersion
, cstvrsLastUpdatedDate
, cstvrsDescription
, cstvrsEnumerationValues
, cstvrsResponseStatus
) 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 CreateSlotTypeVersion = CreateSlotTypeVersion'
{ _cstvChecksum :: !(Maybe Text)
, _cstvName :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createSlotTypeVersion
:: Text
-> CreateSlotTypeVersion
createSlotTypeVersion pName_ =
CreateSlotTypeVersion' {_cstvChecksum = Nothing, _cstvName = pName_}
cstvChecksum :: Lens' CreateSlotTypeVersion (Maybe Text)
cstvChecksum = lens _cstvChecksum (\ s a -> s{_cstvChecksum = a})
cstvName :: Lens' CreateSlotTypeVersion Text
cstvName = lens _cstvName (\ s a -> s{_cstvName = a})
instance AWSRequest CreateSlotTypeVersion where
type Rs CreateSlotTypeVersion =
CreateSlotTypeVersionResponse
request = postJSON lexModels
response
= receiveJSON
(\ s h x ->
CreateSlotTypeVersionResponse' <$>
(x .?> "checksum") <*>
(x .?> "valueSelectionStrategy")
<*> (x .?> "createdDate")
<*> (x .?> "name")
<*> (x .?> "version")
<*> (x .?> "lastUpdatedDate")
<*> (x .?> "description")
<*> (x .?> "enumerationValues")
<*> (pure (fromEnum s)))
instance Hashable CreateSlotTypeVersion where
instance NFData CreateSlotTypeVersion where
instance ToHeaders CreateSlotTypeVersion where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON CreateSlotTypeVersion where
toJSON CreateSlotTypeVersion'{..}
= object
(catMaybes [("checksum" .=) <$> _cstvChecksum])
instance ToPath CreateSlotTypeVersion where
toPath CreateSlotTypeVersion'{..}
= mconcat
["/slottypes/", toBS _cstvName, "/versions"]
instance ToQuery CreateSlotTypeVersion where
toQuery = const mempty
data CreateSlotTypeVersionResponse = CreateSlotTypeVersionResponse'
{ _cstvrsChecksum :: !(Maybe Text)
, _cstvrsValueSelectionStrategy :: !(Maybe SlotValueSelectionStrategy)
, _cstvrsCreatedDate :: !(Maybe POSIX)
, _cstvrsName :: !(Maybe Text)
, _cstvrsVersion :: !(Maybe Text)
, _cstvrsLastUpdatedDate :: !(Maybe POSIX)
, _cstvrsDescription :: !(Maybe Text)
, _cstvrsEnumerationValues :: !(Maybe (List1 EnumerationValue))
, _cstvrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createSlotTypeVersionResponse
:: Int
-> CreateSlotTypeVersionResponse
createSlotTypeVersionResponse pResponseStatus_ =
CreateSlotTypeVersionResponse'
{ _cstvrsChecksum = Nothing
, _cstvrsValueSelectionStrategy = Nothing
, _cstvrsCreatedDate = Nothing
, _cstvrsName = Nothing
, _cstvrsVersion = Nothing
, _cstvrsLastUpdatedDate = Nothing
, _cstvrsDescription = Nothing
, _cstvrsEnumerationValues = Nothing
, _cstvrsResponseStatus = pResponseStatus_
}
cstvrsChecksum :: Lens' CreateSlotTypeVersionResponse (Maybe Text)
cstvrsChecksum = lens _cstvrsChecksum (\ s a -> s{_cstvrsChecksum = a})
cstvrsValueSelectionStrategy :: Lens' CreateSlotTypeVersionResponse (Maybe SlotValueSelectionStrategy)
cstvrsValueSelectionStrategy = lens _cstvrsValueSelectionStrategy (\ s a -> s{_cstvrsValueSelectionStrategy = a})
cstvrsCreatedDate :: Lens' CreateSlotTypeVersionResponse (Maybe UTCTime)
cstvrsCreatedDate = lens _cstvrsCreatedDate (\ s a -> s{_cstvrsCreatedDate = a}) . mapping _Time
cstvrsName :: Lens' CreateSlotTypeVersionResponse (Maybe Text)
cstvrsName = lens _cstvrsName (\ s a -> s{_cstvrsName = a})
cstvrsVersion :: Lens' CreateSlotTypeVersionResponse (Maybe Text)
cstvrsVersion = lens _cstvrsVersion (\ s a -> s{_cstvrsVersion = a})
cstvrsLastUpdatedDate :: Lens' CreateSlotTypeVersionResponse (Maybe UTCTime)
cstvrsLastUpdatedDate = lens _cstvrsLastUpdatedDate (\ s a -> s{_cstvrsLastUpdatedDate = a}) . mapping _Time
cstvrsDescription :: Lens' CreateSlotTypeVersionResponse (Maybe Text)
cstvrsDescription = lens _cstvrsDescription (\ s a -> s{_cstvrsDescription = a})
cstvrsEnumerationValues :: Lens' CreateSlotTypeVersionResponse (Maybe (NonEmpty EnumerationValue))
cstvrsEnumerationValues = lens _cstvrsEnumerationValues (\ s a -> s{_cstvrsEnumerationValues = a}) . mapping _List1
cstvrsResponseStatus :: Lens' CreateSlotTypeVersionResponse Int
cstvrsResponseStatus = lens _cstvrsResponseStatus (\ s a -> s{_cstvrsResponseStatus = a})
instance NFData CreateSlotTypeVersionResponse where