module Network.AWS.LexModels.GetSlotType
(
getSlotType
, GetSlotType
, gstName
, gstVersion
, getSlotTypeResponse
, GetSlotTypeResponse
, getrsChecksum
, getrsValueSelectionStrategy
, getrsCreatedDate
, getrsName
, getrsVersion
, getrsLastUpdatedDate
, getrsDescription
, getrsEnumerationValues
, 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 GetSlotType = GetSlotType'
{ _gstName :: !Text
, _gstVersion :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getSlotType
:: Text
-> Text
-> GetSlotType
getSlotType pName_ pVersion_ =
GetSlotType' {_gstName = pName_, _gstVersion = pVersion_}
gstName :: Lens' GetSlotType Text
gstName = lens _gstName (\ s a -> s{_gstName = a});
gstVersion :: Lens' GetSlotType Text
gstVersion = lens _gstVersion (\ s a -> s{_gstVersion = a});
instance AWSRequest GetSlotType where
type Rs GetSlotType = GetSlotTypeResponse
request = get lexModels
response
= receiveJSON
(\ s h x ->
GetSlotTypeResponse' <$>
(x .?> "checksum") <*>
(x .?> "valueSelectionStrategy")
<*> (x .?> "createdDate")
<*> (x .?> "name")
<*> (x .?> "version")
<*> (x .?> "lastUpdatedDate")
<*> (x .?> "description")
<*> (x .?> "enumerationValues")
<*> (pure (fromEnum s)))
instance Hashable GetSlotType where
instance NFData GetSlotType where
instance ToHeaders GetSlotType where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToPath GetSlotType where
toPath GetSlotType'{..}
= mconcat
["/slottypes/", toBS _gstName, "/versions/",
toBS _gstVersion]
instance ToQuery GetSlotType where
toQuery = const mempty
data GetSlotTypeResponse = GetSlotTypeResponse'
{ _getrsChecksum :: !(Maybe Text)
, _getrsValueSelectionStrategy :: !(Maybe SlotValueSelectionStrategy)
, _getrsCreatedDate :: !(Maybe POSIX)
, _getrsName :: !(Maybe Text)
, _getrsVersion :: !(Maybe Text)
, _getrsLastUpdatedDate :: !(Maybe POSIX)
, _getrsDescription :: !(Maybe Text)
, _getrsEnumerationValues :: !(Maybe (List1 EnumerationValue))
, _getrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getSlotTypeResponse
:: Int
-> GetSlotTypeResponse
getSlotTypeResponse pResponseStatus_ =
GetSlotTypeResponse'
{ _getrsChecksum = Nothing
, _getrsValueSelectionStrategy = Nothing
, _getrsCreatedDate = Nothing
, _getrsName = Nothing
, _getrsVersion = Nothing
, _getrsLastUpdatedDate = Nothing
, _getrsDescription = Nothing
, _getrsEnumerationValues = Nothing
, _getrsResponseStatus = pResponseStatus_
}
getrsChecksum :: Lens' GetSlotTypeResponse (Maybe Text)
getrsChecksum = lens _getrsChecksum (\ s a -> s{_getrsChecksum = a});
getrsValueSelectionStrategy :: Lens' GetSlotTypeResponse (Maybe SlotValueSelectionStrategy)
getrsValueSelectionStrategy = lens _getrsValueSelectionStrategy (\ s a -> s{_getrsValueSelectionStrategy = a});
getrsCreatedDate :: Lens' GetSlotTypeResponse (Maybe UTCTime)
getrsCreatedDate = lens _getrsCreatedDate (\ s a -> s{_getrsCreatedDate = a}) . mapping _Time;
getrsName :: Lens' GetSlotTypeResponse (Maybe Text)
getrsName = lens _getrsName (\ s a -> s{_getrsName = a});
getrsVersion :: Lens' GetSlotTypeResponse (Maybe Text)
getrsVersion = lens _getrsVersion (\ s a -> s{_getrsVersion = a});
getrsLastUpdatedDate :: Lens' GetSlotTypeResponse (Maybe UTCTime)
getrsLastUpdatedDate = lens _getrsLastUpdatedDate (\ s a -> s{_getrsLastUpdatedDate = a}) . mapping _Time;
getrsDescription :: Lens' GetSlotTypeResponse (Maybe Text)
getrsDescription = lens _getrsDescription (\ s a -> s{_getrsDescription = a});
getrsEnumerationValues :: Lens' GetSlotTypeResponse (Maybe (NonEmpty EnumerationValue))
getrsEnumerationValues = lens _getrsEnumerationValues (\ s a -> s{_getrsEnumerationValues = a}) . mapping _List1;
getrsResponseStatus :: Lens' GetSlotTypeResponse Int
getrsResponseStatus = lens _getrsResponseStatus (\ s a -> s{_getrsResponseStatus = a});
instance NFData GetSlotTypeResponse where