module Network.AWS.Inspector.DeleteApplication
(
deleteApplication
, DeleteApplication
, dApplicationARN
, deleteApplicationResponse
, DeleteApplicationResponse
, drsMessage
, drsResponseStatus
) where
import Network.AWS.Inspector.Types
import Network.AWS.Inspector.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype DeleteApplication = DeleteApplication'
{ _dApplicationARN :: Maybe Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteApplication
:: DeleteApplication
deleteApplication =
DeleteApplication'
{ _dApplicationARN = Nothing
}
dApplicationARN :: Lens' DeleteApplication (Maybe Text)
dApplicationARN = lens _dApplicationARN (\ s a -> s{_dApplicationARN = a});
instance AWSRequest DeleteApplication where
type Rs DeleteApplication = DeleteApplicationResponse
request = postJSON inspector
response
= receiveJSON
(\ s h x ->
DeleteApplicationResponse' <$>
(x .?> "message") <*> (pure (fromEnum s)))
instance ToHeaders DeleteApplication where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("InspectorService.DeleteApplication" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DeleteApplication where
toJSON DeleteApplication'{..}
= object
(catMaybes
[("applicationArn" .=) <$> _dApplicationARN])
instance ToPath DeleteApplication where
toPath = const "/"
instance ToQuery DeleteApplication where
toQuery = const mempty
data DeleteApplicationResponse = DeleteApplicationResponse'
{ _drsMessage :: !(Maybe Text)
, _drsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteApplicationResponse
:: Int
-> DeleteApplicationResponse
deleteApplicationResponse pResponseStatus_ =
DeleteApplicationResponse'
{ _drsMessage = Nothing
, _drsResponseStatus = pResponseStatus_
}
drsMessage :: Lens' DeleteApplicationResponse (Maybe Text)
drsMessage = lens _drsMessage (\ s a -> s{_drsMessage = a});
drsResponseStatus :: Lens' DeleteApplicationResponse Int
drsResponseStatus = lens _drsResponseStatus (\ s a -> s{_drsResponseStatus = a});