{-# 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.GetConsoleScreenshot
(
getConsoleScreenshot
, GetConsoleScreenshot
, gcsWakeUp
, gcsDryRun
, gcsInstanceId
, getConsoleScreenshotResponse
, GetConsoleScreenshotResponse
, gcsrsInstanceId
, gcsrsImageData
, gcsrsResponseStatus
) 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 GetConsoleScreenshot = GetConsoleScreenshot'
{ _gcsWakeUp :: !(Maybe Bool)
, _gcsDryRun :: !(Maybe Bool)
, _gcsInstanceId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getConsoleScreenshot
:: Text
-> GetConsoleScreenshot
getConsoleScreenshot pInstanceId_ =
GetConsoleScreenshot'
{ _gcsWakeUp = Nothing
, _gcsDryRun = Nothing
, _gcsInstanceId = pInstanceId_
}
gcsWakeUp :: Lens' GetConsoleScreenshot (Maybe Bool)
gcsWakeUp = lens _gcsWakeUp (\ s a -> s{_gcsWakeUp = a});
gcsDryRun :: Lens' GetConsoleScreenshot (Maybe Bool)
gcsDryRun = lens _gcsDryRun (\ s a -> s{_gcsDryRun = a});
gcsInstanceId :: Lens' GetConsoleScreenshot Text
gcsInstanceId = lens _gcsInstanceId (\ s a -> s{_gcsInstanceId = a});
instance AWSRequest GetConsoleScreenshot where
type Rs GetConsoleScreenshot =
GetConsoleScreenshotResponse
request = postQuery ec2
response
= receiveXML
(\ s h x ->
GetConsoleScreenshotResponse' <$>
(x .@? "instanceId") <*> (x .@? "imageData") <*>
(pure (fromEnum s)))
instance Hashable GetConsoleScreenshot
instance NFData GetConsoleScreenshot
instance ToHeaders GetConsoleScreenshot where
toHeaders = const mempty
instance ToPath GetConsoleScreenshot where
toPath = const "/"
instance ToQuery GetConsoleScreenshot where
toQuery GetConsoleScreenshot'{..}
= mconcat
["Action" =: ("GetConsoleScreenshot" :: ByteString),
"Version" =: ("2016-11-15" :: ByteString),
"WakeUp" =: _gcsWakeUp, "DryRun" =: _gcsDryRun,
"InstanceId" =: _gcsInstanceId]
data GetConsoleScreenshotResponse = GetConsoleScreenshotResponse'
{ _gcsrsInstanceId :: !(Maybe Text)
, _gcsrsImageData :: !(Maybe Text)
, _gcsrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getConsoleScreenshotResponse
:: Int
-> GetConsoleScreenshotResponse
getConsoleScreenshotResponse pResponseStatus_ =
GetConsoleScreenshotResponse'
{ _gcsrsInstanceId = Nothing
, _gcsrsImageData = Nothing
, _gcsrsResponseStatus = pResponseStatus_
}
gcsrsInstanceId :: Lens' GetConsoleScreenshotResponse (Maybe Text)
gcsrsInstanceId = lens _gcsrsInstanceId (\ s a -> s{_gcsrsInstanceId = a});
gcsrsImageData :: Lens' GetConsoleScreenshotResponse (Maybe Text)
gcsrsImageData = lens _gcsrsImageData (\ s a -> s{_gcsrsImageData = a});
gcsrsResponseStatus :: Lens' GetConsoleScreenshotResponse Int
gcsrsResponseStatus = lens _gcsrsResponseStatus (\ s a -> s{_gcsrsResponseStatus = a});
instance NFData GetConsoleScreenshotResponse