{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.EC2.CreateFpgaImage
(
createFpgaImage
, CreateFpgaImage
, creClientToken
, creLogsStorageLocation
, creName
, creDescription
, creDryRun
, creInputStorageLocation
, createFpgaImageResponse
, CreateFpgaImageResponse
, cfirsFpgaImageId
, cfirsFpgaImageGlobalId
, cfirsResponseStatus
) where
import Network.AWS.EC2.Types
import Network.AWS.EC2.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data CreateFpgaImage = CreateFpgaImage'
{ _creClientToken :: !(Maybe Text)
, _creLogsStorageLocation :: !(Maybe StorageLocation)
, _creName :: !(Maybe Text)
, _creDescription :: !(Maybe Text)
, _creDryRun :: !(Maybe Bool)
, _creInputStorageLocation :: !StorageLocation
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createFpgaImage
:: StorageLocation
-> CreateFpgaImage
createFpgaImage pInputStorageLocation_ =
CreateFpgaImage'
{ _creClientToken = Nothing
, _creLogsStorageLocation = Nothing
, _creName = Nothing
, _creDescription = Nothing
, _creDryRun = Nothing
, _creInputStorageLocation = pInputStorageLocation_
}
creClientToken :: Lens' CreateFpgaImage (Maybe Text)
creClientToken = lens _creClientToken (\ s a -> s{_creClientToken = a})
creLogsStorageLocation :: Lens' CreateFpgaImage (Maybe StorageLocation)
creLogsStorageLocation = lens _creLogsStorageLocation (\ s a -> s{_creLogsStorageLocation = a})
creName :: Lens' CreateFpgaImage (Maybe Text)
creName = lens _creName (\ s a -> s{_creName = a})
creDescription :: Lens' CreateFpgaImage (Maybe Text)
creDescription = lens _creDescription (\ s a -> s{_creDescription = a})
creDryRun :: Lens' CreateFpgaImage (Maybe Bool)
creDryRun = lens _creDryRun (\ s a -> s{_creDryRun = a})
creInputStorageLocation :: Lens' CreateFpgaImage StorageLocation
creInputStorageLocation = lens _creInputStorageLocation (\ s a -> s{_creInputStorageLocation = a})
instance AWSRequest CreateFpgaImage where
type Rs CreateFpgaImage = CreateFpgaImageResponse
request = postQuery ec2
response
= receiveXML
(\ s h x ->
CreateFpgaImageResponse' <$>
(x .@? "fpgaImageId") <*> (x .@? "fpgaImageGlobalId")
<*> (pure (fromEnum s)))
instance Hashable CreateFpgaImage where
instance NFData CreateFpgaImage where
instance ToHeaders CreateFpgaImage where
toHeaders = const mempty
instance ToPath CreateFpgaImage where
toPath = const "/"
instance ToQuery CreateFpgaImage where
toQuery CreateFpgaImage'{..}
= mconcat
["Action" =: ("CreateFpgaImage" :: ByteString),
"Version" =: ("2016-11-15" :: ByteString),
"ClientToken" =: _creClientToken,
"LogsStorageLocation" =: _creLogsStorageLocation,
"Name" =: _creName, "Description" =: _creDescription,
"DryRun" =: _creDryRun,
"InputStorageLocation" =: _creInputStorageLocation]
data CreateFpgaImageResponse = CreateFpgaImageResponse'
{ _cfirsFpgaImageId :: !(Maybe Text)
, _cfirsFpgaImageGlobalId :: !(Maybe Text)
, _cfirsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createFpgaImageResponse
:: Int
-> CreateFpgaImageResponse
createFpgaImageResponse pResponseStatus_ =
CreateFpgaImageResponse'
{ _cfirsFpgaImageId = Nothing
, _cfirsFpgaImageGlobalId = Nothing
, _cfirsResponseStatus = pResponseStatus_
}
cfirsFpgaImageId :: Lens' CreateFpgaImageResponse (Maybe Text)
cfirsFpgaImageId = lens _cfirsFpgaImageId (\ s a -> s{_cfirsFpgaImageId = a})
cfirsFpgaImageGlobalId :: Lens' CreateFpgaImageResponse (Maybe Text)
cfirsFpgaImageGlobalId = lens _cfirsFpgaImageGlobalId (\ s a -> s{_cfirsFpgaImageGlobalId = a})
cfirsResponseStatus :: Lens' CreateFpgaImageResponse Int
cfirsResponseStatus = lens _cfirsResponseStatus (\ s a -> s{_cfirsResponseStatus = a})
instance NFData CreateFpgaImageResponse where