module Network.AWS.RDS.DownloadDBLogFilePortion
(
downloadDBLogFilePortion
, DownloadDBLogFilePortion
, ddlfpNumberOfLines
, ddlfpMarker
, ddlfpDBInstanceIdentifier
, ddlfpLogFileName
, downloadDBLogFilePortionResponse
, DownloadDBLogFilePortionResponse
, ddlfprsLogFileData
, ddlfprsAdditionalDataPending
, ddlfprsMarker
, ddlfprsStatus
) where
import Network.AWS.Pager
import Network.AWS.Prelude
import Network.AWS.RDS.Types
import Network.AWS.RDS.Types.Product
import Network.AWS.Request
import Network.AWS.Response
data DownloadDBLogFilePortion = DownloadDBLogFilePortion'
{ _ddlfpNumberOfLines :: !(Maybe Int)
, _ddlfpMarker :: !(Maybe Text)
, _ddlfpDBInstanceIdentifier :: !Text
, _ddlfpLogFileName :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
downloadDBLogFilePortion
:: Text
-> Text
-> DownloadDBLogFilePortion
downloadDBLogFilePortion pDBInstanceIdentifier_ pLogFileName_ =
DownloadDBLogFilePortion'
{ _ddlfpNumberOfLines = Nothing
, _ddlfpMarker = Nothing
, _ddlfpDBInstanceIdentifier = pDBInstanceIdentifier_
, _ddlfpLogFileName = pLogFileName_
}
ddlfpNumberOfLines :: Lens' DownloadDBLogFilePortion (Maybe Int)
ddlfpNumberOfLines = lens _ddlfpNumberOfLines (\ s a -> s{_ddlfpNumberOfLines = a});
ddlfpMarker :: Lens' DownloadDBLogFilePortion (Maybe Text)
ddlfpMarker = lens _ddlfpMarker (\ s a -> s{_ddlfpMarker = a});
ddlfpDBInstanceIdentifier :: Lens' DownloadDBLogFilePortion Text
ddlfpDBInstanceIdentifier = lens _ddlfpDBInstanceIdentifier (\ s a -> s{_ddlfpDBInstanceIdentifier = a});
ddlfpLogFileName :: Lens' DownloadDBLogFilePortion Text
ddlfpLogFileName = lens _ddlfpLogFileName (\ s a -> s{_ddlfpLogFileName = a});
instance AWSPager DownloadDBLogFilePortion where
page rq rs
| stop (rs ^. ddlfprsAdditionalDataPending) = Nothing
| isNothing (rs ^. ddlfprsMarker) = Nothing
| otherwise =
Just $ rq & ddlfpMarker .~ rs ^. ddlfprsMarker
instance AWSRequest DownloadDBLogFilePortion where
type Sv DownloadDBLogFilePortion = RDS
type Rs DownloadDBLogFilePortion =
DownloadDBLogFilePortionResponse
request = postQuery
response
= receiveXMLWrapper "DownloadDBLogFilePortionResult"
(\ s h x ->
DownloadDBLogFilePortionResponse' <$>
(x .@? "LogFileData") <*>
(x .@? "AdditionalDataPending")
<*> (x .@? "Marker")
<*> (pure (fromEnum s)))
instance ToHeaders DownloadDBLogFilePortion where
toHeaders = const mempty
instance ToPath DownloadDBLogFilePortion where
toPath = const "/"
instance ToQuery DownloadDBLogFilePortion where
toQuery DownloadDBLogFilePortion'{..}
= mconcat
["Action" =:
("DownloadDBLogFilePortion" :: ByteString),
"Version" =: ("2014-10-31" :: ByteString),
"NumberOfLines" =: _ddlfpNumberOfLines,
"Marker" =: _ddlfpMarker,
"DBInstanceIdentifier" =: _ddlfpDBInstanceIdentifier,
"LogFileName" =: _ddlfpLogFileName]
data DownloadDBLogFilePortionResponse = DownloadDBLogFilePortionResponse'
{ _ddlfprsLogFileData :: !(Maybe Text)
, _ddlfprsAdditionalDataPending :: !(Maybe Bool)
, _ddlfprsMarker :: !(Maybe Text)
, _ddlfprsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
downloadDBLogFilePortionResponse
:: Int
-> DownloadDBLogFilePortionResponse
downloadDBLogFilePortionResponse pStatus_ =
DownloadDBLogFilePortionResponse'
{ _ddlfprsLogFileData = Nothing
, _ddlfprsAdditionalDataPending = Nothing
, _ddlfprsMarker = Nothing
, _ddlfprsStatus = pStatus_
}
ddlfprsLogFileData :: Lens' DownloadDBLogFilePortionResponse (Maybe Text)
ddlfprsLogFileData = lens _ddlfprsLogFileData (\ s a -> s{_ddlfprsLogFileData = a});
ddlfprsAdditionalDataPending :: Lens' DownloadDBLogFilePortionResponse (Maybe Bool)
ddlfprsAdditionalDataPending = lens _ddlfprsAdditionalDataPending (\ s a -> s{_ddlfprsAdditionalDataPending = a});
ddlfprsMarker :: Lens' DownloadDBLogFilePortionResponse (Maybe Text)
ddlfprsMarker = lens _ddlfprsMarker (\ s a -> s{_ddlfprsMarker = a});
ddlfprsStatus :: Lens' DownloadDBLogFilePortionResponse Int
ddlfprsStatus = lens _ddlfprsStatus (\ s a -> s{_ddlfprsStatus = a});