module Network.AWS.EC2.ImportVolume
(
importVolume
, ImportVolume
, ivDryRun
, ivDescription
, ivAvailabilityZone
, ivImage
, ivVolume
, importVolumeResponse
, ImportVolumeResponse
, ivrsConversionTask
, ivrsStatus
) 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 ImportVolume = ImportVolume'
{ _ivDryRun :: !(Maybe Bool)
, _ivDescription :: !(Maybe Text)
, _ivAvailabilityZone :: !Text
, _ivImage :: !DiskImageDetail
, _ivVolume :: !VolumeDetail
} deriving (Eq,Read,Show,Data,Typeable,Generic)
importVolume
:: Text
-> DiskImageDetail
-> VolumeDetail
-> ImportVolume
importVolume pAvailabilityZone_ pImage_ pVolume_ =
ImportVolume'
{ _ivDryRun = Nothing
, _ivDescription = Nothing
, _ivAvailabilityZone = pAvailabilityZone_
, _ivImage = pImage_
, _ivVolume = pVolume_
}
ivDryRun :: Lens' ImportVolume (Maybe Bool)
ivDryRun = lens _ivDryRun (\ s a -> s{_ivDryRun = a});
ivDescription :: Lens' ImportVolume (Maybe Text)
ivDescription = lens _ivDescription (\ s a -> s{_ivDescription = a});
ivAvailabilityZone :: Lens' ImportVolume Text
ivAvailabilityZone = lens _ivAvailabilityZone (\ s a -> s{_ivAvailabilityZone = a});
ivImage :: Lens' ImportVolume DiskImageDetail
ivImage = lens _ivImage (\ s a -> s{_ivImage = a});
ivVolume :: Lens' ImportVolume VolumeDetail
ivVolume = lens _ivVolume (\ s a -> s{_ivVolume = a});
instance AWSRequest ImportVolume where
type Rs ImportVolume = ImportVolumeResponse
request = postQuery eC2
response
= receiveXML
(\ s h x ->
ImportVolumeResponse' <$>
(x .@? "conversionTask") <*> (pure (fromEnum s)))
instance ToHeaders ImportVolume where
toHeaders = const mempty
instance ToPath ImportVolume where
toPath = const "/"
instance ToQuery ImportVolume where
toQuery ImportVolume'{..}
= mconcat
["Action" =: ("ImportVolume" :: ByteString),
"Version" =: ("2015-04-15" :: ByteString),
"DryRun" =: _ivDryRun,
"Description" =: _ivDescription,
"AvailabilityZone" =: _ivAvailabilityZone,
"Image" =: _ivImage, "Volume" =: _ivVolume]
data ImportVolumeResponse = ImportVolumeResponse'
{ _ivrsConversionTask :: !(Maybe ConversionTask)
, _ivrsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
importVolumeResponse
:: Int
-> ImportVolumeResponse
importVolumeResponse pStatus_ =
ImportVolumeResponse'
{ _ivrsConversionTask = Nothing
, _ivrsStatus = pStatus_
}
ivrsConversionTask :: Lens' ImportVolumeResponse (Maybe ConversionTask)
ivrsConversionTask = lens _ivrsConversionTask (\ s a -> s{_ivrsConversionTask = a});
ivrsStatus :: Lens' ImportVolumeResponse Int
ivrsStatus = lens _ivrsStatus (\ s a -> s{_ivrsStatus = a});