{-# 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.DeleteCertificate
(
deleteCertificate
, DeleteCertificate
, dcCertificateARN
, deleteCertificateResponse
, DeleteCertificateResponse
, dccrsCertificate
, dccrsResponseStatus
) 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 DeleteCertificate = DeleteCertificate'
{ _dcCertificateARN :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteCertificate
:: Text
-> DeleteCertificate
deleteCertificate pCertificateARN_ =
DeleteCertificate'
{ _dcCertificateARN = pCertificateARN_
}
dcCertificateARN :: Lens' DeleteCertificate Text
dcCertificateARN = lens _dcCertificateARN (\ s a -> s{_dcCertificateARN = a});
instance AWSRequest DeleteCertificate where
type Rs DeleteCertificate = DeleteCertificateResponse
request = postJSON dms
response
= receiveJSON
(\ s h x ->
DeleteCertificateResponse' <$>
(x .?> "Certificate") <*> (pure (fromEnum s)))
instance Hashable DeleteCertificate
instance NFData DeleteCertificate
instance ToHeaders DeleteCertificate where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonDMSv20160101.DeleteCertificate" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DeleteCertificate where
toJSON DeleteCertificate'{..}
= object
(catMaybes
[Just ("CertificateArn" .= _dcCertificateARN)])
instance ToPath DeleteCertificate where
toPath = const "/"
instance ToQuery DeleteCertificate where
toQuery = const mempty
data DeleteCertificateResponse = DeleteCertificateResponse'
{ _dccrsCertificate :: !(Maybe Certificate)
, _dccrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteCertificateResponse
:: Int
-> DeleteCertificateResponse
deleteCertificateResponse pResponseStatus_ =
DeleteCertificateResponse'
{ _dccrsCertificate = Nothing
, _dccrsResponseStatus = pResponseStatus_
}
dccrsCertificate :: Lens' DeleteCertificateResponse (Maybe Certificate)
dccrsCertificate = lens _dccrsCertificate (\ s a -> s{_dccrsCertificate = a});
dccrsResponseStatus :: Lens' DeleteCertificateResponse Int
dccrsResponseStatus = lens _dccrsResponseStatus (\ s a -> s{_dccrsResponseStatus = a});
instance NFData DeleteCertificateResponse