{-# 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.UpdateConfiguration
(
updateConfiguration
, UpdateConfiguration
, ucData
, ucDescription
, ucConfigurationId
, updateConfigurationResponse
, UpdateConfigurationResponse
, ucrsARN
, ucrsLatestRevision
, ucrsWarnings
, ucrsName
, ucrsId
, ucrsResponseStatus
) 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 UpdateConfiguration = UpdateConfiguration'
{ _ucData :: !(Maybe Text)
, _ucDescription :: !(Maybe Text)
, _ucConfigurationId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateConfiguration
:: Text
-> UpdateConfiguration
updateConfiguration pConfigurationId_ =
UpdateConfiguration'
{ _ucData = Nothing
, _ucDescription = Nothing
, _ucConfigurationId = pConfigurationId_
}
ucData :: Lens' UpdateConfiguration (Maybe Text)
ucData = lens _ucData (\ s a -> s{_ucData = a})
ucDescription :: Lens' UpdateConfiguration (Maybe Text)
ucDescription = lens _ucDescription (\ s a -> s{_ucDescription = a})
ucConfigurationId :: Lens' UpdateConfiguration Text
ucConfigurationId = lens _ucConfigurationId (\ s a -> s{_ucConfigurationId = a})
instance AWSRequest UpdateConfiguration where
type Rs UpdateConfiguration =
UpdateConfigurationResponse
request = putJSON mq
response
= receiveJSON
(\ s h x ->
UpdateConfigurationResponse' <$>
(x .?> "arn") <*> (x .?> "latestRevision") <*>
(x .?> "warnings" .!@ mempty)
<*> (x .?> "name")
<*> (x .?> "id")
<*> (pure (fromEnum s)))
instance Hashable UpdateConfiguration where
instance NFData UpdateConfiguration where
instance ToHeaders UpdateConfiguration where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateConfiguration where
toJSON UpdateConfiguration'{..}
= object
(catMaybes
[("data" .=) <$> _ucData,
("description" .=) <$> _ucDescription])
instance ToPath UpdateConfiguration where
toPath UpdateConfiguration'{..}
= mconcat
["/v1/configurations/", toBS _ucConfigurationId]
instance ToQuery UpdateConfiguration where
toQuery = const mempty
data UpdateConfigurationResponse = UpdateConfigurationResponse'
{ _ucrsARN :: !(Maybe Text)
, _ucrsLatestRevision :: !(Maybe ConfigurationRevision)
, _ucrsWarnings :: !(Maybe [SanitizationWarning])
, _ucrsName :: !(Maybe Text)
, _ucrsId :: !(Maybe Text)
, _ucrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateConfigurationResponse
:: Int
-> UpdateConfigurationResponse
updateConfigurationResponse pResponseStatus_ =
UpdateConfigurationResponse'
{ _ucrsARN = Nothing
, _ucrsLatestRevision = Nothing
, _ucrsWarnings = Nothing
, _ucrsName = Nothing
, _ucrsId = Nothing
, _ucrsResponseStatus = pResponseStatus_
}
ucrsARN :: Lens' UpdateConfigurationResponse (Maybe Text)
ucrsARN = lens _ucrsARN (\ s a -> s{_ucrsARN = a})
ucrsLatestRevision :: Lens' UpdateConfigurationResponse (Maybe ConfigurationRevision)
ucrsLatestRevision = lens _ucrsLatestRevision (\ s a -> s{_ucrsLatestRevision = a})
ucrsWarnings :: Lens' UpdateConfigurationResponse [SanitizationWarning]
ucrsWarnings = lens _ucrsWarnings (\ s a -> s{_ucrsWarnings = a}) . _Default . _Coerce
ucrsName :: Lens' UpdateConfigurationResponse (Maybe Text)
ucrsName = lens _ucrsName (\ s a -> s{_ucrsName = a})
ucrsId :: Lens' UpdateConfigurationResponse (Maybe Text)
ucrsId = lens _ucrsId (\ s a -> s{_ucrsId = a})
ucrsResponseStatus :: Lens' UpdateConfigurationResponse Int
ucrsResponseStatus = lens _ucrsResponseStatus (\ s a -> s{_ucrsResponseStatus = a})
instance NFData UpdateConfigurationResponse where