{-# 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.SES.GetSendStatistics
(
getSendStatistics
, GetSendStatistics
, getSendStatisticsResponse
, GetSendStatisticsResponse
, gssrsSendDataPoints
, gssrsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.SES.Types
import Network.AWS.SES.Types.Product
data GetSendStatistics =
GetSendStatistics'
deriving (Eq,Read,Show,Data,Typeable,Generic)
getSendStatistics
:: GetSendStatistics
getSendStatistics = GetSendStatistics'
instance AWSRequest GetSendStatistics where
type Rs GetSendStatistics = GetSendStatisticsResponse
request = postQuery ses
response
= receiveXMLWrapper "GetSendStatisticsResult"
(\ s h x ->
GetSendStatisticsResponse' <$>
(x .@? "SendDataPoints" .!@ mempty >>=
may (parseXMLList "member"))
<*> (pure (fromEnum s)))
instance Hashable GetSendStatistics
instance NFData GetSendStatistics
instance ToHeaders GetSendStatistics where
toHeaders = const mempty
instance ToPath GetSendStatistics where
toPath = const "/"
instance ToQuery GetSendStatistics where
toQuery
= const
(mconcat
["Action" =: ("GetSendStatistics" :: ByteString),
"Version" =: ("2010-12-01" :: ByteString)])
data GetSendStatisticsResponse = GetSendStatisticsResponse'
{ _gssrsSendDataPoints :: !(Maybe [SendDataPoint])
, _gssrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getSendStatisticsResponse
:: Int
-> GetSendStatisticsResponse
getSendStatisticsResponse pResponseStatus_ =
GetSendStatisticsResponse'
{ _gssrsSendDataPoints = Nothing
, _gssrsResponseStatus = pResponseStatus_
}
gssrsSendDataPoints :: Lens' GetSendStatisticsResponse [SendDataPoint]
gssrsSendDataPoints = lens _gssrsSendDataPoints (\ s a -> s{_gssrsSendDataPoints = a}) . _Default . _Coerce;
gssrsResponseStatus :: Lens' GetSendStatisticsResponse Int
gssrsResponseStatus = lens _gssrsResponseStatus (\ s a -> s{_gssrsResponseStatus = a});
instance NFData GetSendStatisticsResponse