module Network.AWS.EC2.CancelImportTask
(
CancelImportTask
, cancelImportTask
, citCancelReason
, citDryRun
, citImportTaskId
, CancelImportTaskResponse
, cancelImportTaskResponse
, citrImportTaskId
, citrPreviousState
, citrState
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.EC2.Types
import qualified GHC.Exts
data CancelImportTask = CancelImportTask
{ _citCancelReason :: Maybe Text
, _citDryRun :: Maybe Bool
, _citImportTaskId :: Maybe Text
} deriving (Eq, Ord, Read, Show)
cancelImportTask :: CancelImportTask
cancelImportTask = CancelImportTask
{ _citDryRun = Nothing
, _citImportTaskId = Nothing
, _citCancelReason = Nothing
}
citCancelReason :: Lens' CancelImportTask (Maybe Text)
citCancelReason = lens _citCancelReason (\s a -> s { _citCancelReason = a })
citDryRun :: Lens' CancelImportTask (Maybe Bool)
citDryRun = lens _citDryRun (\s a -> s { _citDryRun = a })
citImportTaskId :: Lens' CancelImportTask (Maybe Text)
citImportTaskId = lens _citImportTaskId (\s a -> s { _citImportTaskId = a })
data CancelImportTaskResponse = CancelImportTaskResponse
{ _citrImportTaskId :: Maybe Text
, _citrPreviousState :: Maybe Text
, _citrState :: Maybe Text
} deriving (Eq, Ord, Read, Show)
cancelImportTaskResponse :: CancelImportTaskResponse
cancelImportTaskResponse = CancelImportTaskResponse
{ _citrImportTaskId = Nothing
, _citrState = Nothing
, _citrPreviousState = Nothing
}
citrImportTaskId :: Lens' CancelImportTaskResponse (Maybe Text)
citrImportTaskId = lens _citrImportTaskId (\s a -> s { _citrImportTaskId = a })
citrPreviousState :: Lens' CancelImportTaskResponse (Maybe Text)
citrPreviousState =
lens _citrPreviousState (\s a -> s { _citrPreviousState = a })
citrState :: Lens' CancelImportTaskResponse (Maybe Text)
citrState = lens _citrState (\s a -> s { _citrState = a })
instance ToPath CancelImportTask where
toPath = const "/"
instance ToQuery CancelImportTask where
toQuery CancelImportTask{..} = mconcat
[ "CancelReason" =? _citCancelReason
, "DryRun" =? _citDryRun
, "ImportTaskId" =? _citImportTaskId
]
instance ToHeaders CancelImportTask
instance AWSRequest CancelImportTask where
type Sv CancelImportTask = EC2
type Rs CancelImportTask = CancelImportTaskResponse
request = post "CancelImportTask"
response = xmlResponse
instance FromXML CancelImportTaskResponse where
parseXML x = CancelImportTaskResponse
<$> x .@? "importTaskId"
<*> x .@? "previousState"
<*> x .@? "state"