module Network.AWS.EC2.CancelBundleTask
(
cancelBundleTask
, CancelBundleTask
, cbtDryRun
, cbtBundleId
, cancelBundleTaskResponse
, CancelBundleTaskResponse
, cbtrsBundleTask
, cbtrsStatus
) where
import Network.AWS.EC2.Types
import Network.AWS.EC2.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data CancelBundleTask = CancelBundleTask'
{ _cbtDryRun :: !(Maybe Bool)
, _cbtBundleId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
cancelBundleTask
:: Text
-> CancelBundleTask
cancelBundleTask pBundleId_ =
CancelBundleTask'
{ _cbtDryRun = Nothing
, _cbtBundleId = pBundleId_
}
cbtDryRun :: Lens' CancelBundleTask (Maybe Bool)
cbtDryRun = lens _cbtDryRun (\ s a -> s{_cbtDryRun = a});
cbtBundleId :: Lens' CancelBundleTask Text
cbtBundleId = lens _cbtBundleId (\ s a -> s{_cbtBundleId = a});
instance AWSRequest CancelBundleTask where
type Rs CancelBundleTask = CancelBundleTaskResponse
request = postQuery eC2
response
= receiveXML
(\ s h x ->
CancelBundleTaskResponse' <$>
(x .@? "bundleInstanceTask") <*> (pure (fromEnum s)))
instance ToHeaders CancelBundleTask where
toHeaders = const mempty
instance ToPath CancelBundleTask where
toPath = const "/"
instance ToQuery CancelBundleTask where
toQuery CancelBundleTask'{..}
= mconcat
["Action" =: ("CancelBundleTask" :: ByteString),
"Version" =: ("2015-04-15" :: ByteString),
"DryRun" =: _cbtDryRun, "BundleId" =: _cbtBundleId]
data CancelBundleTaskResponse = CancelBundleTaskResponse'
{ _cbtrsBundleTask :: !(Maybe BundleTask)
, _cbtrsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
cancelBundleTaskResponse
:: Int
-> CancelBundleTaskResponse
cancelBundleTaskResponse pStatus_ =
CancelBundleTaskResponse'
{ _cbtrsBundleTask = Nothing
, _cbtrsStatus = pStatus_
}
cbtrsBundleTask :: Lens' CancelBundleTaskResponse (Maybe BundleTask)
cbtrsBundleTask = lens _cbtrsBundleTask (\ s a -> s{_cbtrsBundleTask = a});
cbtrsStatus :: Lens' CancelBundleTaskResponse Int
cbtrsStatus = lens _cbtrsStatus (\ s a -> s{_cbtrsStatus = a});