module Network.AWS.EC2.RegisterImage
(
RegisterImage
, registerImage
, ri1Architecture
, ri1BlockDeviceMappings
, ri1Description
, ri1DryRun
, ri1ImageLocation
, ri1KernelId
, ri1Name
, ri1RamdiskId
, ri1RootDeviceName
, ri1SriovNetSupport
, ri1VirtualizationType
, RegisterImageResponse
, registerImageResponse
, rirImageId
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.EC2.Types
import qualified GHC.Exts
data RegisterImage = RegisterImage
{ _ri1Architecture :: Maybe ArchitectureValues
, _ri1BlockDeviceMappings :: List "BlockDeviceMapping" BlockDeviceMapping
, _ri1Description :: Maybe Text
, _ri1DryRun :: Maybe Bool
, _ri1ImageLocation :: Maybe Text
, _ri1KernelId :: Maybe Text
, _ri1Name :: Text
, _ri1RamdiskId :: Maybe Text
, _ri1RootDeviceName :: Maybe Text
, _ri1SriovNetSupport :: Maybe Text
, _ri1VirtualizationType :: Maybe Text
} deriving (Eq, Show)
registerImage :: Text
-> RegisterImage
registerImage p1 = RegisterImage
{ _ri1Name = p1
, _ri1DryRun = Nothing
, _ri1ImageLocation = Nothing
, _ri1Description = Nothing
, _ri1Architecture = Nothing
, _ri1KernelId = Nothing
, _ri1RamdiskId = Nothing
, _ri1RootDeviceName = Nothing
, _ri1BlockDeviceMappings = mempty
, _ri1VirtualizationType = Nothing
, _ri1SriovNetSupport = Nothing
}
ri1Architecture :: Lens' RegisterImage (Maybe ArchitectureValues)
ri1Architecture = lens _ri1Architecture (\s a -> s { _ri1Architecture = a })
ri1BlockDeviceMappings :: Lens' RegisterImage [BlockDeviceMapping]
ri1BlockDeviceMappings =
lens _ri1BlockDeviceMappings (\s a -> s { _ri1BlockDeviceMappings = a })
. _List
ri1Description :: Lens' RegisterImage (Maybe Text)
ri1Description = lens _ri1Description (\s a -> s { _ri1Description = a })
ri1DryRun :: Lens' RegisterImage (Maybe Bool)
ri1DryRun = lens _ri1DryRun (\s a -> s { _ri1DryRun = a })
ri1ImageLocation :: Lens' RegisterImage (Maybe Text)
ri1ImageLocation = lens _ri1ImageLocation (\s a -> s { _ri1ImageLocation = a })
ri1KernelId :: Lens' RegisterImage (Maybe Text)
ri1KernelId = lens _ri1KernelId (\s a -> s { _ri1KernelId = a })
ri1Name :: Lens' RegisterImage Text
ri1Name = lens _ri1Name (\s a -> s { _ri1Name = a })
ri1RamdiskId :: Lens' RegisterImage (Maybe Text)
ri1RamdiskId = lens _ri1RamdiskId (\s a -> s { _ri1RamdiskId = a })
ri1RootDeviceName :: Lens' RegisterImage (Maybe Text)
ri1RootDeviceName =
lens _ri1RootDeviceName (\s a -> s { _ri1RootDeviceName = a })
ri1SriovNetSupport :: Lens' RegisterImage (Maybe Text)
ri1SriovNetSupport =
lens _ri1SriovNetSupport (\s a -> s { _ri1SriovNetSupport = a })
ri1VirtualizationType :: Lens' RegisterImage (Maybe Text)
ri1VirtualizationType =
lens _ri1VirtualizationType (\s a -> s { _ri1VirtualizationType = a })
newtype RegisterImageResponse = RegisterImageResponse
{ _rirImageId :: Maybe Text
} deriving (Eq, Ord, Show, Monoid)
registerImageResponse :: RegisterImageResponse
registerImageResponse = RegisterImageResponse
{ _rirImageId = Nothing
}
rirImageId :: Lens' RegisterImageResponse (Maybe Text)
rirImageId = lens _rirImageId (\s a -> s { _rirImageId = a })
instance ToPath RegisterImage where
toPath = const "/"
instance ToQuery RegisterImage where
toQuery RegisterImage{..} = mconcat
[ "architecture" =? _ri1Architecture
, "BlockDeviceMapping" =? _ri1BlockDeviceMappings
, "description" =? _ri1Description
, "dryRun" =? _ri1DryRun
, "ImageLocation" =? _ri1ImageLocation
, "kernelId" =? _ri1KernelId
, "name" =? _ri1Name
, "ramdiskId" =? _ri1RamdiskId
, "rootDeviceName" =? _ri1RootDeviceName
, "sriovNetSupport" =? _ri1SriovNetSupport
, "virtualizationType" =? _ri1VirtualizationType
]
instance ToHeaders RegisterImage
instance AWSRequest RegisterImage where
type Sv RegisterImage = EC2
type Rs RegisterImage = RegisterImageResponse
request = post "RegisterImage"
response = xmlResponse
instance FromXML RegisterImageResponse where
parseXML x = RegisterImageResponse
<$> x .@? "imageId"