module Network.AWS.Redshift.ModifyEventSubscription
(
modifyEventSubscription
, ModifyEventSubscription
, mesSNSTopicARN
, mesEnabled
, mesSourceType
, mesSeverity
, mesEventCategories
, mesSourceIds
, mesSubscriptionName
, modifyEventSubscriptionResponse
, ModifyEventSubscriptionResponse
, mesrsEventSubscription
, mesrsResponseStatus
) where
import Network.AWS.Prelude
import Network.AWS.Redshift.Types
import Network.AWS.Redshift.Types.Product
import Network.AWS.Request
import Network.AWS.Response
data ModifyEventSubscription = ModifyEventSubscription'
{ _mesSNSTopicARN :: !(Maybe Text)
, _mesEnabled :: !(Maybe Bool)
, _mesSourceType :: !(Maybe Text)
, _mesSeverity :: !(Maybe Text)
, _mesEventCategories :: !(Maybe [Text])
, _mesSourceIds :: !(Maybe [Text])
, _mesSubscriptionName :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
modifyEventSubscription
:: Text
-> ModifyEventSubscription
modifyEventSubscription pSubscriptionName_ =
ModifyEventSubscription'
{ _mesSNSTopicARN = Nothing
, _mesEnabled = Nothing
, _mesSourceType = Nothing
, _mesSeverity = Nothing
, _mesEventCategories = Nothing
, _mesSourceIds = 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});
mesSeverity :: Lens' ModifyEventSubscription (Maybe Text)
mesSeverity = lens _mesSeverity (\ s a -> s{_mesSeverity = a});
mesEventCategories :: Lens' ModifyEventSubscription [Text]
mesEventCategories = lens _mesEventCategories (\ s a -> s{_mesEventCategories = a}) . _Default . _Coerce;
mesSourceIds :: Lens' ModifyEventSubscription [Text]
mesSourceIds = lens _mesSourceIds (\ s a -> s{_mesSourceIds = a}) . _Default . _Coerce;
mesSubscriptionName :: Lens' ModifyEventSubscription Text
mesSubscriptionName = lens _mesSubscriptionName (\ s a -> s{_mesSubscriptionName = a});
instance AWSRequest ModifyEventSubscription where
type Rs ModifyEventSubscription =
ModifyEventSubscriptionResponse
request = postQuery redshift
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" =: ("2012-12-01" :: ByteString),
"SnsTopicArn" =: _mesSNSTopicARN,
"Enabled" =: _mesEnabled,
"SourceType" =: _mesSourceType,
"Severity" =: _mesSeverity,
"EventCategories" =:
toQuery
(toQueryList "EventCategory" <$>
_mesEventCategories),
"SourceIds" =:
toQuery (toQueryList "SourceId" <$> _mesSourceIds),
"SubscriptionName" =: _mesSubscriptionName]
data ModifyEventSubscriptionResponse = ModifyEventSubscriptionResponse'
{ _mesrsEventSubscription :: !(Maybe EventSubscription)
, _mesrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
modifyEventSubscriptionResponse
:: Int
-> ModifyEventSubscriptionResponse
modifyEventSubscriptionResponse pResponseStatus_ =
ModifyEventSubscriptionResponse'
{ _mesrsEventSubscription = Nothing
, _mesrsResponseStatus = pResponseStatus_
}
mesrsEventSubscription :: Lens' ModifyEventSubscriptionResponse (Maybe EventSubscription)
mesrsEventSubscription = lens _mesrsEventSubscription (\ s a -> s{_mesrsEventSubscription = a});
mesrsResponseStatus :: Lens' ModifyEventSubscriptionResponse Int
mesrsResponseStatus = lens _mesrsResponseStatus (\ s a -> s{_mesrsResponseStatus = a});