module Network.AWS.EC2.CancelImportTask
(
cancelImportTask
, CancelImportTask
, citCancelReason
, citImportTaskId
, citDryRun
, cancelImportTaskResponse
, CancelImportTaskResponse
, citrsState
, citrsImportTaskId
, citrsPreviousState
, citrsStatus
) 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 CancelImportTask = CancelImportTask'
{ _citCancelReason :: !(Maybe Text)
, _citImportTaskId :: !(Maybe Text)
, _citDryRun :: !(Maybe Bool)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
cancelImportTask
:: CancelImportTask
cancelImportTask =
CancelImportTask'
{ _citCancelReason = Nothing
, _citImportTaskId = Nothing
, _citDryRun = Nothing
}
citCancelReason :: Lens' CancelImportTask (Maybe Text)
citCancelReason = lens _citCancelReason (\ s a -> s{_citCancelReason = a});
citImportTaskId :: Lens' CancelImportTask (Maybe Text)
citImportTaskId = lens _citImportTaskId (\ s a -> s{_citImportTaskId = a});
citDryRun :: Lens' CancelImportTask (Maybe Bool)
citDryRun = lens _citDryRun (\ s a -> s{_citDryRun = a});
instance AWSRequest CancelImportTask where
type Rs CancelImportTask = CancelImportTaskResponse
request = postQuery eC2
response
= receiveXML
(\ s h x ->
CancelImportTaskResponse' <$>
(x .@? "state") <*> (x .@? "importTaskId") <*>
(x .@? "previousState")
<*> (pure (fromEnum s)))
instance ToHeaders CancelImportTask where
toHeaders = const mempty
instance ToPath CancelImportTask where
toPath = const "/"
instance ToQuery CancelImportTask where
toQuery CancelImportTask'{..}
= mconcat
["Action" =: ("CancelImportTask" :: ByteString),
"Version" =: ("2015-04-15" :: ByteString),
"CancelReason" =: _citCancelReason,
"ImportTaskId" =: _citImportTaskId,
"DryRun" =: _citDryRun]
data CancelImportTaskResponse = CancelImportTaskResponse'
{ _citrsState :: !(Maybe Text)
, _citrsImportTaskId :: !(Maybe Text)
, _citrsPreviousState :: !(Maybe Text)
, _citrsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
cancelImportTaskResponse
:: Int
-> CancelImportTaskResponse
cancelImportTaskResponse pStatus_ =
CancelImportTaskResponse'
{ _citrsState = Nothing
, _citrsImportTaskId = Nothing
, _citrsPreviousState = Nothing
, _citrsStatus = pStatus_
}
citrsState :: Lens' CancelImportTaskResponse (Maybe Text)
citrsState = lens _citrsState (\ s a -> s{_citrsState = a});
citrsImportTaskId :: Lens' CancelImportTaskResponse (Maybe Text)
citrsImportTaskId = lens _citrsImportTaskId (\ s a -> s{_citrsImportTaskId = a});
citrsPreviousState :: Lens' CancelImportTaskResponse (Maybe Text)
citrsPreviousState = lens _citrsPreviousState (\ s a -> s{_citrsPreviousState = a});
citrsStatus :: Lens' CancelImportTaskResponse Int
citrsStatus = lens _citrsStatus (\ s a -> s{_citrsStatus = a});