{-# 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.ImportSnapshot
(
importSnapshot
, ImportSnapshot
, isDiskContainer
, isClientToken
, isRoleName
, isDescription
, isDryRun
, isClientData
, importSnapshotResponse
, ImportSnapshotResponse
, isrsSnapshotTaskDetail
, isrsImportTaskId
, isrsDescription
, isrsResponseStatus
) 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 ImportSnapshot = ImportSnapshot'
{ _isDiskContainer :: !(Maybe SnapshotDiskContainer)
, _isClientToken :: !(Maybe Text)
, _isRoleName :: !(Maybe Text)
, _isDescription :: !(Maybe Text)
, _isDryRun :: !(Maybe Bool)
, _isClientData :: !(Maybe ClientData)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
importSnapshot
:: ImportSnapshot
importSnapshot =
ImportSnapshot'
{ _isDiskContainer = Nothing
, _isClientToken = Nothing
, _isRoleName = Nothing
, _isDescription = Nothing
, _isDryRun = Nothing
, _isClientData = Nothing
}
isDiskContainer :: Lens' ImportSnapshot (Maybe SnapshotDiskContainer)
isDiskContainer = lens _isDiskContainer (\ s a -> s{_isDiskContainer = a});
isClientToken :: Lens' ImportSnapshot (Maybe Text)
isClientToken = lens _isClientToken (\ s a -> s{_isClientToken = a});
isRoleName :: Lens' ImportSnapshot (Maybe Text)
isRoleName = lens _isRoleName (\ s a -> s{_isRoleName = a});
isDescription :: Lens' ImportSnapshot (Maybe Text)
isDescription = lens _isDescription (\ s a -> s{_isDescription = a});
isDryRun :: Lens' ImportSnapshot (Maybe Bool)
isDryRun = lens _isDryRun (\ s a -> s{_isDryRun = a});
isClientData :: Lens' ImportSnapshot (Maybe ClientData)
isClientData = lens _isClientData (\ s a -> s{_isClientData = a});
instance AWSRequest ImportSnapshot where
type Rs ImportSnapshot = ImportSnapshotResponse
request = postQuery ec2
response
= receiveXML
(\ s h x ->
ImportSnapshotResponse' <$>
(x .@? "snapshotTaskDetail") <*>
(x .@? "importTaskId")
<*> (x .@? "description")
<*> (pure (fromEnum s)))
instance Hashable ImportSnapshot
instance NFData ImportSnapshot
instance ToHeaders ImportSnapshot where
toHeaders = const mempty
instance ToPath ImportSnapshot where
toPath = const "/"
instance ToQuery ImportSnapshot where
toQuery ImportSnapshot'{..}
= mconcat
["Action" =: ("ImportSnapshot" :: ByteString),
"Version" =: ("2016-11-15" :: ByteString),
"DiskContainer" =: _isDiskContainer,
"ClientToken" =: _isClientToken,
"RoleName" =: _isRoleName,
"Description" =: _isDescription,
"DryRun" =: _isDryRun, "ClientData" =: _isClientData]
data ImportSnapshotResponse = ImportSnapshotResponse'
{ _isrsSnapshotTaskDetail :: !(Maybe SnapshotTaskDetail)
, _isrsImportTaskId :: !(Maybe Text)
, _isrsDescription :: !(Maybe Text)
, _isrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
importSnapshotResponse
:: Int
-> ImportSnapshotResponse
importSnapshotResponse pResponseStatus_ =
ImportSnapshotResponse'
{ _isrsSnapshotTaskDetail = Nothing
, _isrsImportTaskId = Nothing
, _isrsDescription = Nothing
, _isrsResponseStatus = pResponseStatus_
}
isrsSnapshotTaskDetail :: Lens' ImportSnapshotResponse (Maybe SnapshotTaskDetail)
isrsSnapshotTaskDetail = lens _isrsSnapshotTaskDetail (\ s a -> s{_isrsSnapshotTaskDetail = a});
isrsImportTaskId :: Lens' ImportSnapshotResponse (Maybe Text)
isrsImportTaskId = lens _isrsImportTaskId (\ s a -> s{_isrsImportTaskId = a});
isrsDescription :: Lens' ImportSnapshotResponse (Maybe Text)
isrsDescription = lens _isrsDescription (\ s a -> s{_isrsDescription = a});
isrsResponseStatus :: Lens' ImportSnapshotResponse Int
isrsResponseStatus = lens _isrsResponseStatus (\ s a -> s{_isrsResponseStatus = a});
instance NFData ImportSnapshotResponse