{-# 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.PutBotAlias
(
putBotAlias
, PutBotAlias
, pbaChecksum
, pbaDescription
, pbaName
, pbaBotVersion
, pbaBotName
, putBotAliasResponse
, PutBotAliasResponse
, pbarsChecksum
, pbarsBotVersion
, pbarsBotName
, pbarsCreatedDate
, pbarsName
, pbarsLastUpdatedDate
, pbarsDescription
, pbarsResponseStatus
) 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 PutBotAlias = PutBotAlias'
{ _pbaChecksum :: !(Maybe Text)
, _pbaDescription :: !(Maybe Text)
, _pbaName :: !Text
, _pbaBotVersion :: !Text
, _pbaBotName :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
putBotAlias
:: Text
-> Text
-> Text
-> PutBotAlias
putBotAlias pName_ pBotVersion_ pBotName_ =
PutBotAlias'
{ _pbaChecksum = Nothing
, _pbaDescription = Nothing
, _pbaName = pName_
, _pbaBotVersion = pBotVersion_
, _pbaBotName = pBotName_
}
pbaChecksum :: Lens' PutBotAlias (Maybe Text)
pbaChecksum = lens _pbaChecksum (\ s a -> s{_pbaChecksum = a})
pbaDescription :: Lens' PutBotAlias (Maybe Text)
pbaDescription = lens _pbaDescription (\ s a -> s{_pbaDescription = a})
pbaName :: Lens' PutBotAlias Text
pbaName = lens _pbaName (\ s a -> s{_pbaName = a})
pbaBotVersion :: Lens' PutBotAlias Text
pbaBotVersion = lens _pbaBotVersion (\ s a -> s{_pbaBotVersion = a})
pbaBotName :: Lens' PutBotAlias Text
pbaBotName = lens _pbaBotName (\ s a -> s{_pbaBotName = a})
instance AWSRequest PutBotAlias where
type Rs PutBotAlias = PutBotAliasResponse
request = putJSON lexModels
response
= receiveJSON
(\ s h x ->
PutBotAliasResponse' <$>
(x .?> "checksum") <*> (x .?> "botVersion") <*>
(x .?> "botName")
<*> (x .?> "createdDate")
<*> (x .?> "name")
<*> (x .?> "lastUpdatedDate")
<*> (x .?> "description")
<*> (pure (fromEnum s)))
instance Hashable PutBotAlias where
instance NFData PutBotAlias where
instance ToHeaders PutBotAlias where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON PutBotAlias where
toJSON PutBotAlias'{..}
= object
(catMaybes
[("checksum" .=) <$> _pbaChecksum,
("description" .=) <$> _pbaDescription,
Just ("botVersion" .= _pbaBotVersion)])
instance ToPath PutBotAlias where
toPath PutBotAlias'{..}
= mconcat
["/bots/", toBS _pbaBotName, "/aliases/",
toBS _pbaName]
instance ToQuery PutBotAlias where
toQuery = const mempty
data PutBotAliasResponse = PutBotAliasResponse'
{ _pbarsChecksum :: !(Maybe Text)
, _pbarsBotVersion :: !(Maybe Text)
, _pbarsBotName :: !(Maybe Text)
, _pbarsCreatedDate :: !(Maybe POSIX)
, _pbarsName :: !(Maybe Text)
, _pbarsLastUpdatedDate :: !(Maybe POSIX)
, _pbarsDescription :: !(Maybe Text)
, _pbarsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
putBotAliasResponse
:: Int
-> PutBotAliasResponse
putBotAliasResponse pResponseStatus_ =
PutBotAliasResponse'
{ _pbarsChecksum = Nothing
, _pbarsBotVersion = Nothing
, _pbarsBotName = Nothing
, _pbarsCreatedDate = Nothing
, _pbarsName = Nothing
, _pbarsLastUpdatedDate = Nothing
, _pbarsDescription = Nothing
, _pbarsResponseStatus = pResponseStatus_
}
pbarsChecksum :: Lens' PutBotAliasResponse (Maybe Text)
pbarsChecksum = lens _pbarsChecksum (\ s a -> s{_pbarsChecksum = a})
pbarsBotVersion :: Lens' PutBotAliasResponse (Maybe Text)
pbarsBotVersion = lens _pbarsBotVersion (\ s a -> s{_pbarsBotVersion = a})
pbarsBotName :: Lens' PutBotAliasResponse (Maybe Text)
pbarsBotName = lens _pbarsBotName (\ s a -> s{_pbarsBotName = a})
pbarsCreatedDate :: Lens' PutBotAliasResponse (Maybe UTCTime)
pbarsCreatedDate = lens _pbarsCreatedDate (\ s a -> s{_pbarsCreatedDate = a}) . mapping _Time
pbarsName :: Lens' PutBotAliasResponse (Maybe Text)
pbarsName = lens _pbarsName (\ s a -> s{_pbarsName = a})
pbarsLastUpdatedDate :: Lens' PutBotAliasResponse (Maybe UTCTime)
pbarsLastUpdatedDate = lens _pbarsLastUpdatedDate (\ s a -> s{_pbarsLastUpdatedDate = a}) . mapping _Time
pbarsDescription :: Lens' PutBotAliasResponse (Maybe Text)
pbarsDescription = lens _pbarsDescription (\ s a -> s{_pbarsDescription = a})
pbarsResponseStatus :: Lens' PutBotAliasResponse Int
pbarsResponseStatus = lens _pbarsResponseStatus (\ s a -> s{_pbarsResponseStatus = a})
instance NFData PutBotAliasResponse where