{-# 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.GetBotChannelAssociation
(
getBotChannelAssociation
, GetBotChannelAssociation
, gName
, gBotName
, gBotAlias
, getBotChannelAssociationResponse
, GetBotChannelAssociationResponse
, gbcarsFailureReason
, gbcarsStatus
, gbcarsBotAlias
, gbcarsBotName
, gbcarsBotConfiguration
, gbcarsCreatedDate
, gbcarsName
, gbcarsType
, gbcarsDescription
, gbcarsResponseStatus
) 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 GetBotChannelAssociation = GetBotChannelAssociation'
{ _gName :: !Text
, _gBotName :: !Text
, _gBotAlias :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getBotChannelAssociation
:: Text
-> Text
-> Text
-> GetBotChannelAssociation
getBotChannelAssociation pName_ pBotName_ pBotAlias_ =
GetBotChannelAssociation'
{_gName = pName_, _gBotName = pBotName_, _gBotAlias = pBotAlias_}
gName :: Lens' GetBotChannelAssociation Text
gName = lens _gName (\ s a -> s{_gName = a})
gBotName :: Lens' GetBotChannelAssociation Text
gBotName = lens _gBotName (\ s a -> s{_gBotName = a})
gBotAlias :: Lens' GetBotChannelAssociation Text
gBotAlias = lens _gBotAlias (\ s a -> s{_gBotAlias = a})
instance AWSRequest GetBotChannelAssociation where
type Rs GetBotChannelAssociation =
GetBotChannelAssociationResponse
request = get lexModels
response
= receiveJSON
(\ s h x ->
GetBotChannelAssociationResponse' <$>
(x .?> "failureReason") <*> (x .?> "status") <*>
(x .?> "botAlias")
<*> (x .?> "botName")
<*> (x .?> "botConfiguration" .!@ mempty)
<*> (x .?> "createdDate")
<*> (x .?> "name")
<*> (x .?> "type")
<*> (x .?> "description")
<*> (pure (fromEnum s)))
instance Hashable GetBotChannelAssociation where
instance NFData GetBotChannelAssociation where
instance ToHeaders GetBotChannelAssociation where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToPath GetBotChannelAssociation where
toPath GetBotChannelAssociation'{..}
= mconcat
["/bots/", toBS _gBotName, "/aliases/",
toBS _gBotAlias, "/channels/", toBS _gName]
instance ToQuery GetBotChannelAssociation where
toQuery = const mempty
data GetBotChannelAssociationResponse = GetBotChannelAssociationResponse'
{ _gbcarsFailureReason :: !(Maybe Text)
, _gbcarsStatus :: !(Maybe ChannelStatus)
, _gbcarsBotAlias :: !(Maybe Text)
, _gbcarsBotName :: !(Maybe Text)
, _gbcarsBotConfiguration :: !(Maybe (Sensitive (Map Text Text)))
, _gbcarsCreatedDate :: !(Maybe POSIX)
, _gbcarsName :: !(Maybe Text)
, _gbcarsType :: !(Maybe ChannelType)
, _gbcarsDescription :: !(Maybe Text)
, _gbcarsResponseStatus :: !Int
} deriving (Eq, Show, Data, Typeable, Generic)
getBotChannelAssociationResponse
:: Int
-> GetBotChannelAssociationResponse
getBotChannelAssociationResponse pResponseStatus_ =
GetBotChannelAssociationResponse'
{ _gbcarsFailureReason = Nothing
, _gbcarsStatus = Nothing
, _gbcarsBotAlias = Nothing
, _gbcarsBotName = Nothing
, _gbcarsBotConfiguration = Nothing
, _gbcarsCreatedDate = Nothing
, _gbcarsName = Nothing
, _gbcarsType = Nothing
, _gbcarsDescription = Nothing
, _gbcarsResponseStatus = pResponseStatus_
}
gbcarsFailureReason :: Lens' GetBotChannelAssociationResponse (Maybe Text)
gbcarsFailureReason = lens _gbcarsFailureReason (\ s a -> s{_gbcarsFailureReason = a})
gbcarsStatus :: Lens' GetBotChannelAssociationResponse (Maybe ChannelStatus)
gbcarsStatus = lens _gbcarsStatus (\ s a -> s{_gbcarsStatus = a})
gbcarsBotAlias :: Lens' GetBotChannelAssociationResponse (Maybe Text)
gbcarsBotAlias = lens _gbcarsBotAlias (\ s a -> s{_gbcarsBotAlias = a})
gbcarsBotName :: Lens' GetBotChannelAssociationResponse (Maybe Text)
gbcarsBotName = lens _gbcarsBotName (\ s a -> s{_gbcarsBotName = a})
gbcarsBotConfiguration :: Lens' GetBotChannelAssociationResponse (Maybe (HashMap Text Text))
gbcarsBotConfiguration = lens _gbcarsBotConfiguration (\ s a -> s{_gbcarsBotConfiguration = a}) . mapping (_Sensitive . _Map)
gbcarsCreatedDate :: Lens' GetBotChannelAssociationResponse (Maybe UTCTime)
gbcarsCreatedDate = lens _gbcarsCreatedDate (\ s a -> s{_gbcarsCreatedDate = a}) . mapping _Time
gbcarsName :: Lens' GetBotChannelAssociationResponse (Maybe Text)
gbcarsName = lens _gbcarsName (\ s a -> s{_gbcarsName = a})
gbcarsType :: Lens' GetBotChannelAssociationResponse (Maybe ChannelType)
gbcarsType = lens _gbcarsType (\ s a -> s{_gbcarsType = a})
gbcarsDescription :: Lens' GetBotChannelAssociationResponse (Maybe Text)
gbcarsDescription = lens _gbcarsDescription (\ s a -> s{_gbcarsDescription = a})
gbcarsResponseStatus :: Lens' GetBotChannelAssociationResponse Int
gbcarsResponseStatus = lens _gbcarsResponseStatus (\ s a -> s{_gbcarsResponseStatus = a})
instance NFData GetBotChannelAssociationResponse
where