{-# 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.MQ.UpdateBroker
(
updateBroker
, UpdateBroker
, ubConfiguration
, ubBrokerId
, updateBrokerResponse
, UpdateBrokerResponse
, ubrsConfiguration
, ubrsBrokerId
, ubrsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.MQ.Types
import Network.AWS.MQ.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data UpdateBroker = UpdateBroker'
{ _ubConfiguration :: !(Maybe ConfigurationId)
, _ubBrokerId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateBroker
:: Text
-> UpdateBroker
updateBroker pBrokerId_ =
UpdateBroker' {_ubConfiguration = Nothing, _ubBrokerId = pBrokerId_}
ubConfiguration :: Lens' UpdateBroker (Maybe ConfigurationId)
ubConfiguration = lens _ubConfiguration (\ s a -> s{_ubConfiguration = a})
ubBrokerId :: Lens' UpdateBroker Text
ubBrokerId = lens _ubBrokerId (\ s a -> s{_ubBrokerId = a})
instance AWSRequest UpdateBroker where
type Rs UpdateBroker = UpdateBrokerResponse
request = putJSON mq
response
= receiveJSON
(\ s h x ->
UpdateBrokerResponse' <$>
(x .?> "configuration") <*> (x .?> "brokerId") <*>
(pure (fromEnum s)))
instance Hashable UpdateBroker where
instance NFData UpdateBroker where
instance ToHeaders UpdateBroker where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateBroker where
toJSON UpdateBroker'{..}
= object
(catMaybes
[("configuration" .=) <$> _ubConfiguration])
instance ToPath UpdateBroker where
toPath UpdateBroker'{..}
= mconcat ["/v1/brokers/", toBS _ubBrokerId]
instance ToQuery UpdateBroker where
toQuery = const mempty
data UpdateBrokerResponse = UpdateBrokerResponse'
{ _ubrsConfiguration :: !(Maybe ConfigurationId)
, _ubrsBrokerId :: !(Maybe Text)
, _ubrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateBrokerResponse
:: Int
-> UpdateBrokerResponse
updateBrokerResponse pResponseStatus_ =
UpdateBrokerResponse'
{ _ubrsConfiguration = Nothing
, _ubrsBrokerId = Nothing
, _ubrsResponseStatus = pResponseStatus_
}
ubrsConfiguration :: Lens' UpdateBrokerResponse (Maybe ConfigurationId)
ubrsConfiguration = lens _ubrsConfiguration (\ s a -> s{_ubrsConfiguration = a})
ubrsBrokerId :: Lens' UpdateBrokerResponse (Maybe Text)
ubrsBrokerId = lens _ubrsBrokerId (\ s a -> s{_ubrsBrokerId = a})
ubrsResponseStatus :: Lens' UpdateBrokerResponse Int
ubrsResponseStatus = lens _ubrsResponseStatus (\ s a -> s{_ubrsResponseStatus = a})
instance NFData UpdateBrokerResponse where