module Network.AWS.RDS.ModifyEventSubscription
(
modifyEventSubscription
, ModifyEventSubscription
, mesSNSTopicARN
, mesEnabled
, mesSourceType
, mesEventCategories
, mesSubscriptionName
, modifyEventSubscriptionResponse
, ModifyEventSubscriptionResponse
, mesrsEventSubscription
, mesrsStatus
) where
import Network.AWS.Prelude
import Network.AWS.RDS.Types
import Network.AWS.RDS.Types.Product
import Network.AWS.Request
import Network.AWS.Response
data ModifyEventSubscription = ModifyEventSubscription'
{ _mesSNSTopicARN :: !(Maybe Text)
, _mesEnabled :: !(Maybe Bool)
, _mesSourceType :: !(Maybe Text)
, _mesEventCategories :: !(Maybe [Text])
, _mesSubscriptionName :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
modifyEventSubscription
:: Text
-> ModifyEventSubscription
modifyEventSubscription pSubscriptionName_ =
ModifyEventSubscription'
{ _mesSNSTopicARN = Nothing
, _mesEnabled = Nothing
, _mesSourceType = Nothing
, _mesEventCategories = Nothing
, _mesSubscriptionName = pSubscriptionName_
}
mesSNSTopicARN :: Lens' ModifyEventSubscription (Maybe Text)
mesSNSTopicARN = lens _mesSNSTopicARN (\ s a -> s{_mesSNSTopicARN = a});
mesEnabled :: Lens' ModifyEventSubscription (Maybe Bool)
mesEnabled = lens _mesEnabled (\ s a -> s{_mesEnabled = a});
mesSourceType :: Lens' ModifyEventSubscription (Maybe Text)
mesSourceType = lens _mesSourceType (\ s a -> s{_mesSourceType = a});
mesEventCategories :: Lens' ModifyEventSubscription [Text]
mesEventCategories = lens _mesEventCategories (\ s a -> s{_mesEventCategories = a}) . _Default . _Coerce;
mesSubscriptionName :: Lens' ModifyEventSubscription Text
mesSubscriptionName = lens _mesSubscriptionName (\ s a -> s{_mesSubscriptionName = a});
instance AWSRequest ModifyEventSubscription where
type Sv ModifyEventSubscription = RDS
type Rs ModifyEventSubscription =
ModifyEventSubscriptionResponse
request = postQuery
response
= receiveXMLWrapper "ModifyEventSubscriptionResult"
(\ s h x ->
ModifyEventSubscriptionResponse' <$>
(x .@? "EventSubscription") <*> (pure (fromEnum s)))
instance ToHeaders ModifyEventSubscription where
toHeaders = const mempty
instance ToPath ModifyEventSubscription where
toPath = const "/"
instance ToQuery ModifyEventSubscription where
toQuery ModifyEventSubscription'{..}
= mconcat
["Action" =:
("ModifyEventSubscription" :: ByteString),
"Version" =: ("2014-10-31" :: ByteString),
"SnsTopicArn" =: _mesSNSTopicARN,
"Enabled" =: _mesEnabled,
"SourceType" =: _mesSourceType,
"EventCategories" =:
toQuery
(toQueryList "EventCategory" <$>
_mesEventCategories),
"SubscriptionName" =: _mesSubscriptionName]
data ModifyEventSubscriptionResponse = ModifyEventSubscriptionResponse'
{ _mesrsEventSubscription :: !(Maybe EventSubscription)
, _mesrsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
modifyEventSubscriptionResponse
:: Int
-> ModifyEventSubscriptionResponse
modifyEventSubscriptionResponse pStatus_ =
ModifyEventSubscriptionResponse'
{ _mesrsEventSubscription = Nothing
, _mesrsStatus = pStatus_
}
mesrsEventSubscription :: Lens' ModifyEventSubscriptionResponse (Maybe EventSubscription)
mesrsEventSubscription = lens _mesrsEventSubscription (\ s a -> s{_mesrsEventSubscription = a});
mesrsStatus :: Lens' ModifyEventSubscriptionResponse Int
mesrsStatus = lens _mesrsStatus (\ s a -> s{_mesrsStatus = a});