module Network.AWS.EC2.ImportImage
(
ImportImage
, importImage
, ii1Architecture
, ii1ClientData
, ii1ClientToken
, ii1Description
, ii1DiskContainers
, ii1DryRun
, ii1Hypervisor
, ii1LicenseType
, ii1Platform
, ii1RoleName
, ImportImageResponse
, importImageResponse
, iirArchitecture
, iirDescription
, iirHypervisor
, iirImageId
, iirImportTaskId
, iirLicenseType
, iirPlatform
, iirProgress
, iirSnapshotDetails
, iirStatus
, iirStatusMessage
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.EC2.Types
import qualified GHC.Exts
data ImportImage = ImportImage
{ _ii1Architecture :: Maybe Text
, _ii1ClientData :: Maybe ClientData
, _ii1ClientToken :: Maybe Text
, _ii1Description :: Maybe Text
, _ii1DiskContainers :: List "item" ImageDiskContainer
, _ii1DryRun :: Maybe Bool
, _ii1Hypervisor :: Maybe Text
, _ii1LicenseType :: Maybe Text
, _ii1Platform :: Maybe Text
, _ii1RoleName :: Maybe Text
} deriving (Eq, Read, Show)
importImage :: ImportImage
importImage = ImportImage
{ _ii1DryRun = Nothing
, _ii1Description = Nothing
, _ii1DiskContainers = mempty
, _ii1LicenseType = Nothing
, _ii1Hypervisor = Nothing
, _ii1Architecture = Nothing
, _ii1Platform = Nothing
, _ii1ClientData = Nothing
, _ii1ClientToken = Nothing
, _ii1RoleName = Nothing
}
ii1Architecture :: Lens' ImportImage (Maybe Text)
ii1Architecture = lens _ii1Architecture (\s a -> s { _ii1Architecture = a })
ii1ClientData :: Lens' ImportImage (Maybe ClientData)
ii1ClientData = lens _ii1ClientData (\s a -> s { _ii1ClientData = a })
ii1ClientToken :: Lens' ImportImage (Maybe Text)
ii1ClientToken = lens _ii1ClientToken (\s a -> s { _ii1ClientToken = a })
ii1Description :: Lens' ImportImage (Maybe Text)
ii1Description = lens _ii1Description (\s a -> s { _ii1Description = a })
ii1DiskContainers :: Lens' ImportImage [ImageDiskContainer]
ii1DiskContainers =
lens _ii1DiskContainers (\s a -> s { _ii1DiskContainers = a })
. _List
ii1DryRun :: Lens' ImportImage (Maybe Bool)
ii1DryRun = lens _ii1DryRun (\s a -> s { _ii1DryRun = a })
ii1Hypervisor :: Lens' ImportImage (Maybe Text)
ii1Hypervisor = lens _ii1Hypervisor (\s a -> s { _ii1Hypervisor = a })
ii1LicenseType :: Lens' ImportImage (Maybe Text)
ii1LicenseType = lens _ii1LicenseType (\s a -> s { _ii1LicenseType = a })
ii1Platform :: Lens' ImportImage (Maybe Text)
ii1Platform = lens _ii1Platform (\s a -> s { _ii1Platform = a })
ii1RoleName :: Lens' ImportImage (Maybe Text)
ii1RoleName = lens _ii1RoleName (\s a -> s { _ii1RoleName = a })
data ImportImageResponse = ImportImageResponse
{ _iirArchitecture :: Maybe Text
, _iirDescription :: Maybe Text
, _iirHypervisor :: Maybe Text
, _iirImageId :: Maybe Text
, _iirImportTaskId :: Maybe Text
, _iirLicenseType :: Maybe Text
, _iirPlatform :: Maybe Text
, _iirProgress :: Maybe Text
, _iirSnapshotDetails :: List "item" SnapshotDetail
, _iirStatus :: Maybe Text
, _iirStatusMessage :: Maybe Text
} deriving (Eq, Read, Show)
importImageResponse :: ImportImageResponse
importImageResponse = ImportImageResponse
{ _iirImportTaskId = Nothing
, _iirArchitecture = Nothing
, _iirLicenseType = Nothing
, _iirPlatform = Nothing
, _iirHypervisor = Nothing
, _iirDescription = Nothing
, _iirSnapshotDetails = mempty
, _iirImageId = Nothing
, _iirProgress = Nothing
, _iirStatusMessage = Nothing
, _iirStatus = Nothing
}
iirArchitecture :: Lens' ImportImageResponse (Maybe Text)
iirArchitecture = lens _iirArchitecture (\s a -> s { _iirArchitecture = a })
iirDescription :: Lens' ImportImageResponse (Maybe Text)
iirDescription = lens _iirDescription (\s a -> s { _iirDescription = a })
iirHypervisor :: Lens' ImportImageResponse (Maybe Text)
iirHypervisor = lens _iirHypervisor (\s a -> s { _iirHypervisor = a })
iirImageId :: Lens' ImportImageResponse (Maybe Text)
iirImageId = lens _iirImageId (\s a -> s { _iirImageId = a })
iirImportTaskId :: Lens' ImportImageResponse (Maybe Text)
iirImportTaskId = lens _iirImportTaskId (\s a -> s { _iirImportTaskId = a })
iirLicenseType :: Lens' ImportImageResponse (Maybe Text)
iirLicenseType = lens _iirLicenseType (\s a -> s { _iirLicenseType = a })
iirPlatform :: Lens' ImportImageResponse (Maybe Text)
iirPlatform = lens _iirPlatform (\s a -> s { _iirPlatform = a })
iirProgress :: Lens' ImportImageResponse (Maybe Text)
iirProgress = lens _iirProgress (\s a -> s { _iirProgress = a })
iirSnapshotDetails :: Lens' ImportImageResponse [SnapshotDetail]
iirSnapshotDetails =
lens _iirSnapshotDetails (\s a -> s { _iirSnapshotDetails = a })
. _List
iirStatus :: Lens' ImportImageResponse (Maybe Text)
iirStatus = lens _iirStatus (\s a -> s { _iirStatus = a })
iirStatusMessage :: Lens' ImportImageResponse (Maybe Text)
iirStatusMessage = lens _iirStatusMessage (\s a -> s { _iirStatusMessage = a })
instance ToPath ImportImage where
toPath = const "/"
instance ToQuery ImportImage where
toQuery ImportImage{..} = mconcat
[ "Architecture" =? _ii1Architecture
, "ClientData" =? _ii1ClientData
, "ClientToken" =? _ii1ClientToken
, "Description" =? _ii1Description
, "DiskContainer" `toQueryList` _ii1DiskContainers
, "DryRun" =? _ii1DryRun
, "Hypervisor" =? _ii1Hypervisor
, "LicenseType" =? _ii1LicenseType
, "Platform" =? _ii1Platform
, "RoleName" =? _ii1RoleName
]
instance ToHeaders ImportImage
instance AWSRequest ImportImage where
type Sv ImportImage = EC2
type Rs ImportImage = ImportImageResponse
request = post "ImportImage"
response = xmlResponse
instance FromXML ImportImageResponse where
parseXML x = ImportImageResponse
<$> x .@? "architecture"
<*> x .@? "description"
<*> x .@? "hypervisor"
<*> x .@? "imageId"
<*> x .@? "importTaskId"
<*> x .@? "licenseType"
<*> x .@? "platform"
<*> x .@? "progress"
<*> x .@? "snapshotDetailSet" .!@ mempty
<*> x .@? "status"
<*> x .@? "statusMessage"