{-# 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.GetBotAlias
(
getBotAlias
, GetBotAlias
, gbasName
, gbasBotName
, getBotAliasResponse
, GetBotAliasResponse
, gbasrsChecksum
, gbasrsBotVersion
, gbasrsBotName
, gbasrsCreatedDate
, gbasrsName
, gbasrsLastUpdatedDate
, gbasrsDescription
, gbasrsResponseStatus
) 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 GetBotAlias = GetBotAlias'
{ _gbasName :: !Text
, _gbasBotName :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getBotAlias
:: Text
-> Text
-> GetBotAlias
getBotAlias pName_ pBotName_ =
GetBotAlias' {_gbasName = pName_, _gbasBotName = pBotName_}
gbasName :: Lens' GetBotAlias Text
gbasName = lens _gbasName (\ s a -> s{_gbasName = a})
gbasBotName :: Lens' GetBotAlias Text
gbasBotName = lens _gbasBotName (\ s a -> s{_gbasBotName = a})
instance AWSRequest GetBotAlias where
type Rs GetBotAlias = GetBotAliasResponse
request = get lexModels
response
= receiveJSON
(\ s h x ->
GetBotAliasResponse' <$>
(x .?> "checksum") <*> (x .?> "botVersion") <*>
(x .?> "botName")
<*> (x .?> "createdDate")
<*> (x .?> "name")
<*> (x .?> "lastUpdatedDate")
<*> (x .?> "description")
<*> (pure (fromEnum s)))
instance Hashable GetBotAlias where
instance NFData GetBotAlias where
instance ToHeaders GetBotAlias where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToPath GetBotAlias where
toPath GetBotAlias'{..}
= mconcat
["/bots/", toBS _gbasBotName, "/aliases/",
toBS _gbasName]
instance ToQuery GetBotAlias where
toQuery = const mempty
data GetBotAliasResponse = GetBotAliasResponse'
{ _gbasrsChecksum :: !(Maybe Text)
, _gbasrsBotVersion :: !(Maybe Text)
, _gbasrsBotName :: !(Maybe Text)
, _gbasrsCreatedDate :: !(Maybe POSIX)
, _gbasrsName :: !(Maybe Text)
, _gbasrsLastUpdatedDate :: !(Maybe POSIX)
, _gbasrsDescription :: !(Maybe Text)
, _gbasrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getBotAliasResponse
:: Int
-> GetBotAliasResponse
getBotAliasResponse pResponseStatus_ =
GetBotAliasResponse'
{ _gbasrsChecksum = Nothing
, _gbasrsBotVersion = Nothing
, _gbasrsBotName = Nothing
, _gbasrsCreatedDate = Nothing
, _gbasrsName = Nothing
, _gbasrsLastUpdatedDate = Nothing
, _gbasrsDescription = Nothing
, _gbasrsResponseStatus = pResponseStatus_
}
gbasrsChecksum :: Lens' GetBotAliasResponse (Maybe Text)
gbasrsChecksum = lens _gbasrsChecksum (\ s a -> s{_gbasrsChecksum = a})
gbasrsBotVersion :: Lens' GetBotAliasResponse (Maybe Text)
gbasrsBotVersion = lens _gbasrsBotVersion (\ s a -> s{_gbasrsBotVersion = a})
gbasrsBotName :: Lens' GetBotAliasResponse (Maybe Text)
gbasrsBotName = lens _gbasrsBotName (\ s a -> s{_gbasrsBotName = a})
gbasrsCreatedDate :: Lens' GetBotAliasResponse (Maybe UTCTime)
gbasrsCreatedDate = lens _gbasrsCreatedDate (\ s a -> s{_gbasrsCreatedDate = a}) . mapping _Time
gbasrsName :: Lens' GetBotAliasResponse (Maybe Text)
gbasrsName = lens _gbasrsName (\ s a -> s{_gbasrsName = a})
gbasrsLastUpdatedDate :: Lens' GetBotAliasResponse (Maybe UTCTime)
gbasrsLastUpdatedDate = lens _gbasrsLastUpdatedDate (\ s a -> s{_gbasrsLastUpdatedDate = a}) . mapping _Time
gbasrsDescription :: Lens' GetBotAliasResponse (Maybe Text)
gbasrsDescription = lens _gbasrsDescription (\ s a -> s{_gbasrsDescription = a})
gbasrsResponseStatus :: Lens' GetBotAliasResponse Int
gbasrsResponseStatus = lens _gbasrsResponseStatus (\ s a -> s{_gbasrsResponseStatus = a})
instance NFData GetBotAliasResponse where