module Network.AWS.Redshift.ModifyEventSubscription
(
ModifyEventSubscription
, modifyEventSubscription
, mesEnabled
, mesEventCategories
, mesSeverity
, mesSnsTopicArn
, mesSourceIds
, mesSourceType
, mesSubscriptionName
, ModifyEventSubscriptionResponse
, modifyEventSubscriptionResponse
, mesrEventSubscription
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.Redshift.Types
import qualified GHC.Exts
data ModifyEventSubscription = ModifyEventSubscription
{ _mesEnabled :: Maybe Bool
, _mesEventCategories :: List "member" Text
, _mesSeverity :: Maybe Text
, _mesSnsTopicArn :: Maybe Text
, _mesSourceIds :: List "member" Text
, _mesSourceType :: Maybe Text
, _mesSubscriptionName :: Text
} deriving (Eq, Ord, Read, Show)
modifyEventSubscription :: Text
-> ModifyEventSubscription
modifyEventSubscription p1 = ModifyEventSubscription
{ _mesSubscriptionName = p1
, _mesSnsTopicArn = Nothing
, _mesSourceType = Nothing
, _mesSourceIds = mempty
, _mesEventCategories = mempty
, _mesSeverity = Nothing
, _mesEnabled = Nothing
}
mesEnabled :: Lens' ModifyEventSubscription (Maybe Bool)
mesEnabled = lens _mesEnabled (\s a -> s { _mesEnabled = a })
mesEventCategories :: Lens' ModifyEventSubscription [Text]
mesEventCategories =
lens _mesEventCategories (\s a -> s { _mesEventCategories = a })
. _List
mesSeverity :: Lens' ModifyEventSubscription (Maybe Text)
mesSeverity = lens _mesSeverity (\s a -> s { _mesSeverity = a })
mesSnsTopicArn :: Lens' ModifyEventSubscription (Maybe Text)
mesSnsTopicArn = lens _mesSnsTopicArn (\s a -> s { _mesSnsTopicArn = a })
mesSourceIds :: Lens' ModifyEventSubscription [Text]
mesSourceIds = lens _mesSourceIds (\s a -> s { _mesSourceIds = a }) . _List
mesSourceType :: Lens' ModifyEventSubscription (Maybe Text)
mesSourceType = lens _mesSourceType (\s a -> s { _mesSourceType = a })
mesSubscriptionName :: Lens' ModifyEventSubscription Text
mesSubscriptionName =
lens _mesSubscriptionName (\s a -> s { _mesSubscriptionName = a })
newtype ModifyEventSubscriptionResponse = ModifyEventSubscriptionResponse
{ _mesrEventSubscription :: Maybe EventSubscription
} deriving (Eq, Read, Show)
modifyEventSubscriptionResponse :: ModifyEventSubscriptionResponse
modifyEventSubscriptionResponse = ModifyEventSubscriptionResponse
{ _mesrEventSubscription = Nothing
}
mesrEventSubscription :: Lens' ModifyEventSubscriptionResponse (Maybe EventSubscription)
mesrEventSubscription =
lens _mesrEventSubscription (\s a -> s { _mesrEventSubscription = a })
instance ToPath ModifyEventSubscription where
toPath = const "/"
instance ToQuery ModifyEventSubscription where
toQuery ModifyEventSubscription{..} = mconcat
[ "Enabled" =? _mesEnabled
, "EventCategories" =? _mesEventCategories
, "Severity" =? _mesSeverity
, "SnsTopicArn" =? _mesSnsTopicArn
, "SourceIds" =? _mesSourceIds
, "SourceType" =? _mesSourceType
, "SubscriptionName" =? _mesSubscriptionName
]
instance ToHeaders ModifyEventSubscription
instance AWSRequest ModifyEventSubscription where
type Sv ModifyEventSubscription = Redshift
type Rs ModifyEventSubscription = ModifyEventSubscriptionResponse
request = post "ModifyEventSubscription"
response = xmlResponse
instance FromXML ModifyEventSubscriptionResponse where
parseXML = withElement "ModifyEventSubscriptionResult" $ \x -> ModifyEventSubscriptionResponse
<$> x .@? "EventSubscription"