{-# 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.GetSlotType
(
getSlotType
, GetSlotType
, gstName
, gstVersion
, getSlotTypeResponse
, GetSlotTypeResponse
, gstsrsChecksum
, gstsrsValueSelectionStrategy
, gstsrsCreatedDate
, gstsrsName
, gstsrsVersion
, gstsrsLastUpdatedDate
, gstsrsDescription
, gstsrsEnumerationValues
, gstsrsResponseStatus
) 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'
{ _gstsrsChecksum :: !(Maybe Text)
, _gstsrsValueSelectionStrategy :: !(Maybe SlotValueSelectionStrategy)
, _gstsrsCreatedDate :: !(Maybe POSIX)
, _gstsrsName :: !(Maybe Text)
, _gstsrsVersion :: !(Maybe Text)
, _gstsrsLastUpdatedDate :: !(Maybe POSIX)
, _gstsrsDescription :: !(Maybe Text)
, _gstsrsEnumerationValues :: !(Maybe (List1 EnumerationValue))
, _gstsrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getSlotTypeResponse
:: Int
-> GetSlotTypeResponse
getSlotTypeResponse pResponseStatus_ =
GetSlotTypeResponse'
{ _gstsrsChecksum = Nothing
, _gstsrsValueSelectionStrategy = Nothing
, _gstsrsCreatedDate = Nothing
, _gstsrsName = Nothing
, _gstsrsVersion = Nothing
, _gstsrsLastUpdatedDate = Nothing
, _gstsrsDescription = Nothing
, _gstsrsEnumerationValues = Nothing
, _gstsrsResponseStatus = pResponseStatus_
}
gstsrsChecksum :: Lens' GetSlotTypeResponse (Maybe Text)
gstsrsChecksum = lens _gstsrsChecksum (\ s a -> s{_gstsrsChecksum = a})
gstsrsValueSelectionStrategy :: Lens' GetSlotTypeResponse (Maybe SlotValueSelectionStrategy)
gstsrsValueSelectionStrategy = lens _gstsrsValueSelectionStrategy (\ s a -> s{_gstsrsValueSelectionStrategy = a})
gstsrsCreatedDate :: Lens' GetSlotTypeResponse (Maybe UTCTime)
gstsrsCreatedDate = lens _gstsrsCreatedDate (\ s a -> s{_gstsrsCreatedDate = a}) . mapping _Time
gstsrsName :: Lens' GetSlotTypeResponse (Maybe Text)
gstsrsName = lens _gstsrsName (\ s a -> s{_gstsrsName = a})
gstsrsVersion :: Lens' GetSlotTypeResponse (Maybe Text)
gstsrsVersion = lens _gstsrsVersion (\ s a -> s{_gstsrsVersion = a})
gstsrsLastUpdatedDate :: Lens' GetSlotTypeResponse (Maybe UTCTime)
gstsrsLastUpdatedDate = lens _gstsrsLastUpdatedDate (\ s a -> s{_gstsrsLastUpdatedDate = a}) . mapping _Time
gstsrsDescription :: Lens' GetSlotTypeResponse (Maybe Text)
gstsrsDescription = lens _gstsrsDescription (\ s a -> s{_gstsrsDescription = a})
gstsrsEnumerationValues :: Lens' GetSlotTypeResponse (Maybe (NonEmpty EnumerationValue))
gstsrsEnumerationValues = lens _gstsrsEnumerationValues (\ s a -> s{_gstsrsEnumerationValues = a}) . mapping _List1
gstsrsResponseStatus :: Lens' GetSlotTypeResponse Int
gstsrsResponseStatus = lens _gstsrsResponseStatus (\ s a -> s{_gstsrsResponseStatus = a})
instance NFData GetSlotTypeResponse where