module Network.AWS.EC2.ImportVolume
(
ImportVolume
, importVolume
, ivAvailabilityZone
, ivDescription
, ivDryRun
, ivImage
, ivVolume
, ImportVolumeResponse
, importVolumeResponse
, ivrConversionTask
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.EC2.Types
import qualified GHC.Exts
data ImportVolume = ImportVolume
{ _ivAvailabilityZone :: Text
, _ivDescription :: Maybe Text
, _ivDryRun :: Maybe Bool
, _ivImage :: DiskImageDetail
, _ivVolume :: VolumeDetail
} deriving (Eq, Show)
importVolume :: Text
-> DiskImageDetail
-> VolumeDetail
-> ImportVolume
importVolume p1 p2 p3 = ImportVolume
{ _ivAvailabilityZone = p1
, _ivImage = p2
, _ivVolume = p3
, _ivDryRun = Nothing
, _ivDescription = Nothing
}
ivAvailabilityZone :: Lens' ImportVolume Text
ivAvailabilityZone =
lens _ivAvailabilityZone (\s a -> s { _ivAvailabilityZone = a })
ivDescription :: Lens' ImportVolume (Maybe Text)
ivDescription = lens _ivDescription (\s a -> s { _ivDescription = a })
ivDryRun :: Lens' ImportVolume (Maybe Bool)
ivDryRun = lens _ivDryRun (\s a -> s { _ivDryRun = 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 })
newtype ImportVolumeResponse = ImportVolumeResponse
{ _ivrConversionTask :: Maybe ConversionTask
} deriving (Eq, Show)
importVolumeResponse :: ImportVolumeResponse
importVolumeResponse = ImportVolumeResponse
{ _ivrConversionTask = Nothing
}
ivrConversionTask :: Lens' ImportVolumeResponse (Maybe ConversionTask)
ivrConversionTask =
lens _ivrConversionTask (\s a -> s { _ivrConversionTask = a })
instance ToPath ImportVolume where
toPath = const "/"
instance ToQuery ImportVolume where
toQuery ImportVolume{..} = mconcat
[ "availabilityZone" =? _ivAvailabilityZone
, "description" =? _ivDescription
, "dryRun" =? _ivDryRun
, "image" =? _ivImage
, "volume" =? _ivVolume
]
instance ToHeaders ImportVolume
instance AWSRequest ImportVolume where
type Sv ImportVolume = EC2
type Rs ImportVolume = ImportVolumeResponse
request = post "ImportVolume"
response = xmlResponse
instance FromXML ImportVolumeResponse where
parseXML x = ImportVolumeResponse
<$> x .@? "conversionTask"