module Network.AWS.CloudHSM.DeleteHSM
(
deleteHSM
, DeleteHSM
, dhHSMARN
, deleteHSMResponse
, DeleteHSMResponse
, dhsmrsResponseStatus
, dhsmrsStatus
) where
import Network.AWS.CloudHSM.Types
import Network.AWS.CloudHSM.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype DeleteHSM = DeleteHSM'
{ _dhHSMARN :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteHSM
:: Text
-> DeleteHSM
deleteHSM pHSMARN_ =
DeleteHSM'
{ _dhHSMARN = pHSMARN_
}
dhHSMARN :: Lens' DeleteHSM Text
dhHSMARN = lens _dhHSMARN (\ s a -> s{_dhHSMARN = a});
instance AWSRequest DeleteHSM where
type Rs DeleteHSM = DeleteHSMResponse
request = postJSON cloudHSM
response
= receiveJSON
(\ s h x ->
DeleteHSMResponse' <$>
(pure (fromEnum s)) <*> (x .:> "Status"))
instance Hashable DeleteHSM
instance NFData DeleteHSM
instance ToHeaders DeleteHSM where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("CloudHsmFrontendService.DeleteHsm" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DeleteHSM where
toJSON DeleteHSM'{..}
= object (catMaybes [Just ("HsmArn" .= _dhHSMARN)])
instance ToPath DeleteHSM where
toPath = const "/"
instance ToQuery DeleteHSM where
toQuery = const mempty
data DeleteHSMResponse = DeleteHSMResponse'
{ _dhsmrsResponseStatus :: !Int
, _dhsmrsStatus :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteHSMResponse
:: Int
-> Text
-> DeleteHSMResponse
deleteHSMResponse pResponseStatus_ pStatus_ =
DeleteHSMResponse'
{ _dhsmrsResponseStatus = pResponseStatus_
, _dhsmrsStatus = pStatus_
}
dhsmrsResponseStatus :: Lens' DeleteHSMResponse Int
dhsmrsResponseStatus = lens _dhsmrsResponseStatus (\ s a -> s{_dhsmrsResponseStatus = a});
dhsmrsStatus :: Lens' DeleteHSMResponse Text
dhsmrsStatus = lens _dhsmrsStatus (\ s a -> s{_dhsmrsStatus = a});
instance NFData DeleteHSMResponse