module Network.AWS.DMS.DeleteEndpoint
(
deleteEndpoint
, DeleteEndpoint
, deEndpointARN
, deleteEndpointResponse
, DeleteEndpointResponse
, delrsEndpoint
, delrsResponseStatus
) 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 DeleteEndpoint = DeleteEndpoint'
{ _deEndpointARN :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteEndpoint
:: Text
-> DeleteEndpoint
deleteEndpoint pEndpointARN_ = DeleteEndpoint' {_deEndpointARN = pEndpointARN_}
deEndpointARN :: Lens' DeleteEndpoint Text
deEndpointARN = lens _deEndpointARN (\ s a -> s{_deEndpointARN = a});
instance AWSRequest DeleteEndpoint where
type Rs DeleteEndpoint = DeleteEndpointResponse
request = postJSON dms
response
= receiveJSON
(\ s h x ->
DeleteEndpointResponse' <$>
(x .?> "Endpoint") <*> (pure (fromEnum s)))
instance Hashable DeleteEndpoint where
instance NFData DeleteEndpoint where
instance ToHeaders DeleteEndpoint where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonDMSv20160101.DeleteEndpoint" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DeleteEndpoint where
toJSON DeleteEndpoint'{..}
= object
(catMaybes [Just ("EndpointArn" .= _deEndpointARN)])
instance ToPath DeleteEndpoint where
toPath = const "/"
instance ToQuery DeleteEndpoint where
toQuery = const mempty
data DeleteEndpointResponse = DeleteEndpointResponse'
{ _delrsEndpoint :: !(Maybe Endpoint)
, _delrsResponseStatus :: !Int
} deriving (Eq, Show, Data, Typeable, Generic)
deleteEndpointResponse
:: Int
-> DeleteEndpointResponse
deleteEndpointResponse pResponseStatus_ =
DeleteEndpointResponse'
{_delrsEndpoint = Nothing, _delrsResponseStatus = pResponseStatus_}
delrsEndpoint :: Lens' DeleteEndpointResponse (Maybe Endpoint)
delrsEndpoint = lens _delrsEndpoint (\ s a -> s{_delrsEndpoint = a});
delrsResponseStatus :: Lens' DeleteEndpointResponse Int
delrsResponseStatus = lens _delrsResponseStatus (\ s a -> s{_delrsResponseStatus = a});
instance NFData DeleteEndpointResponse where