{-# 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.CopyFpgaImage
(
copyFpgaImage
, CopyFpgaImage
, cfiClientToken
, cfiName
, cfiDescription
, cfiDryRun
, cfiSourceFpgaImageId
, cfiSourceRegion
, copyFpgaImageResponse
, CopyFpgaImageResponse
, crsFpgaImageId
, crsResponseStatus
) 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 CopyFpgaImage = CopyFpgaImage'
{ _cfiClientToken :: !(Maybe Text)
, _cfiName :: !(Maybe Text)
, _cfiDescription :: !(Maybe Text)
, _cfiDryRun :: !(Maybe Bool)
, _cfiSourceFpgaImageId :: !Text
, _cfiSourceRegion :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
copyFpgaImage
:: Text
-> Text
-> CopyFpgaImage
copyFpgaImage pSourceFpgaImageId_ pSourceRegion_ =
CopyFpgaImage'
{ _cfiClientToken = Nothing
, _cfiName = Nothing
, _cfiDescription = Nothing
, _cfiDryRun = Nothing
, _cfiSourceFpgaImageId = pSourceFpgaImageId_
, _cfiSourceRegion = pSourceRegion_
}
cfiClientToken :: Lens' CopyFpgaImage (Maybe Text)
cfiClientToken = lens _cfiClientToken (\ s a -> s{_cfiClientToken = a})
cfiName :: Lens' CopyFpgaImage (Maybe Text)
cfiName = lens _cfiName (\ s a -> s{_cfiName = a})
cfiDescription :: Lens' CopyFpgaImage (Maybe Text)
cfiDescription = lens _cfiDescription (\ s a -> s{_cfiDescription = a})
cfiDryRun :: Lens' CopyFpgaImage (Maybe Bool)
cfiDryRun = lens _cfiDryRun (\ s a -> s{_cfiDryRun = a})
cfiSourceFpgaImageId :: Lens' CopyFpgaImage Text
cfiSourceFpgaImageId = lens _cfiSourceFpgaImageId (\ s a -> s{_cfiSourceFpgaImageId = a})
cfiSourceRegion :: Lens' CopyFpgaImage Text
cfiSourceRegion = lens _cfiSourceRegion (\ s a -> s{_cfiSourceRegion = a})
instance AWSRequest CopyFpgaImage where
type Rs CopyFpgaImage = CopyFpgaImageResponse
request = postQuery ec2
response
= receiveXML
(\ s h x ->
CopyFpgaImageResponse' <$>
(x .@? "fpgaImageId") <*> (pure (fromEnum s)))
instance Hashable CopyFpgaImage where
instance NFData CopyFpgaImage where
instance ToHeaders CopyFpgaImage where
toHeaders = const mempty
instance ToPath CopyFpgaImage where
toPath = const "/"
instance ToQuery CopyFpgaImage where
toQuery CopyFpgaImage'{..}
= mconcat
["Action" =: ("CopyFpgaImage" :: ByteString),
"Version" =: ("2016-11-15" :: ByteString),
"ClientToken" =: _cfiClientToken, "Name" =: _cfiName,
"Description" =: _cfiDescription,
"DryRun" =: _cfiDryRun,
"SourceFpgaImageId" =: _cfiSourceFpgaImageId,
"SourceRegion" =: _cfiSourceRegion]
data CopyFpgaImageResponse = CopyFpgaImageResponse'
{ _crsFpgaImageId :: !(Maybe Text)
, _crsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
copyFpgaImageResponse
:: Int
-> CopyFpgaImageResponse
copyFpgaImageResponse pResponseStatus_ =
CopyFpgaImageResponse'
{_crsFpgaImageId = Nothing, _crsResponseStatus = pResponseStatus_}
crsFpgaImageId :: Lens' CopyFpgaImageResponse (Maybe Text)
crsFpgaImageId = lens _crsFpgaImageId (\ s a -> s{_crsFpgaImageId = a})
crsResponseStatus :: Lens' CopyFpgaImageResponse Int
crsResponseStatus = lens _crsResponseStatus (\ s a -> s{_crsResponseStatus = a})
instance NFData CopyFpgaImageResponse where