{-# 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.EC2.DeleteFlowLogs
(
deleteFlowLogs
, DeleteFlowLogs
, dflFlowLogIds
, deleteFlowLogsResponse
, DeleteFlowLogsResponse
, dflrsUnsuccessful
, dflrsResponseStatus
) where
import Network.AWS.EC2.Types
import Network.AWS.EC2.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype DeleteFlowLogs = DeleteFlowLogs'
{ _dflFlowLogIds :: [Text]
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteFlowLogs
:: DeleteFlowLogs
deleteFlowLogs =
DeleteFlowLogs'
{ _dflFlowLogIds = mempty
}
dflFlowLogIds :: Lens' DeleteFlowLogs [Text]
dflFlowLogIds = lens _dflFlowLogIds (\ s a -> s{_dflFlowLogIds = a}) . _Coerce;
instance AWSRequest DeleteFlowLogs where
type Rs DeleteFlowLogs = DeleteFlowLogsResponse
request = postQuery ec2
response
= receiveXML
(\ s h x ->
DeleteFlowLogsResponse' <$>
(x .@? "unsuccessful" .!@ mempty >>=
may (parseXMLList "item"))
<*> (pure (fromEnum s)))
instance Hashable DeleteFlowLogs
instance NFData DeleteFlowLogs
instance ToHeaders DeleteFlowLogs where
toHeaders = const mempty
instance ToPath DeleteFlowLogs where
toPath = const "/"
instance ToQuery DeleteFlowLogs where
toQuery DeleteFlowLogs'{..}
= mconcat
["Action" =: ("DeleteFlowLogs" :: ByteString),
"Version" =: ("2016-04-01" :: ByteString),
toQueryList "FlowLogId" _dflFlowLogIds]
data DeleteFlowLogsResponse = DeleteFlowLogsResponse'
{ _dflrsUnsuccessful :: !(Maybe [UnsuccessfulItem])
, _dflrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteFlowLogsResponse
:: Int
-> DeleteFlowLogsResponse
deleteFlowLogsResponse pResponseStatus_ =
DeleteFlowLogsResponse'
{ _dflrsUnsuccessful = Nothing
, _dflrsResponseStatus = pResponseStatus_
}
dflrsUnsuccessful :: Lens' DeleteFlowLogsResponse [UnsuccessfulItem]
dflrsUnsuccessful = lens _dflrsUnsuccessful (\ s a -> s{_dflrsUnsuccessful = a}) . _Default . _Coerce;
dflrsResponseStatus :: Lens' DeleteFlowLogsResponse Int
dflrsResponseStatus = lens _dflrsResponseStatus (\ s a -> s{_dflrsResponseStatus = a});
instance NFData DeleteFlowLogsResponse