{-# 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.DMS.DeleteEventSubscription
(
deleteEventSubscription
, DeleteEventSubscription
, desSubscriptionName
, deleteEventSubscriptionResponse
, DeleteEventSubscriptionResponse
, desersEventSubscription
, desersResponseStatus
) where
import Network.AWS.DMS.Types
import Network.AWS.DMS.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype DeleteEventSubscription = DeleteEventSubscription'
{ _desSubscriptionName :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteEventSubscription
:: Text
-> DeleteEventSubscription
deleteEventSubscription pSubscriptionName_ =
DeleteEventSubscription' {_desSubscriptionName = pSubscriptionName_}
desSubscriptionName :: Lens' DeleteEventSubscription Text
desSubscriptionName = lens _desSubscriptionName (\ s a -> s{_desSubscriptionName = a})
instance AWSRequest DeleteEventSubscription where
type Rs DeleteEventSubscription =
DeleteEventSubscriptionResponse
request = postJSON dms
response
= receiveJSON
(\ s h x ->
DeleteEventSubscriptionResponse' <$>
(x .?> "EventSubscription") <*> (pure (fromEnum s)))
instance Hashable DeleteEventSubscription where
instance NFData DeleteEventSubscription where
instance ToHeaders DeleteEventSubscription where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonDMSv20160101.DeleteEventSubscription" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DeleteEventSubscription where
toJSON DeleteEventSubscription'{..}
= object
(catMaybes
[Just ("SubscriptionName" .= _desSubscriptionName)])
instance ToPath DeleteEventSubscription where
toPath = const "/"
instance ToQuery DeleteEventSubscription where
toQuery = const mempty
data DeleteEventSubscriptionResponse = DeleteEventSubscriptionResponse'
{ _desersEventSubscription :: !(Maybe EventSubscription)
, _desersResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteEventSubscriptionResponse
:: Int
-> DeleteEventSubscriptionResponse
deleteEventSubscriptionResponse pResponseStatus_ =
DeleteEventSubscriptionResponse'
{ _desersEventSubscription = Nothing
, _desersResponseStatus = pResponseStatus_
}
desersEventSubscription :: Lens' DeleteEventSubscriptionResponse (Maybe EventSubscription)
desersEventSubscription = lens _desersEventSubscription (\ s a -> s{_desersEventSubscription = a})
desersResponseStatus :: Lens' DeleteEventSubscriptionResponse Int
desersResponseStatus = lens _desersResponseStatus (\ s a -> s{_desersResponseStatus = a})
instance NFData DeleteEventSubscriptionResponse where