module Network.AWS.SES.GetSendQuota
(
getSendQuota
, GetSendQuota
, getSendQuotaResponse
, GetSendQuotaResponse
, gsqrsMaxSendRate
, gsqrsSentLast24Hours
, gsqrsMax24HourSend
, gsqrsStatus
) where
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.SES.Types
import Network.AWS.SES.Types.Product
data GetSendQuota =
GetSendQuota'
deriving (Eq,Read,Show,Data,Typeable,Generic)
getSendQuota
:: GetSendQuota
getSendQuota = GetSendQuota'
instance AWSRequest GetSendQuota where
type Rs GetSendQuota = GetSendQuotaResponse
request = postQuery sES
response
= receiveXMLWrapper "GetSendQuotaResult"
(\ s h x ->
GetSendQuotaResponse' <$>
(x .@? "MaxSendRate") <*> (x .@? "SentLast24Hours")
<*> (x .@? "Max24HourSend")
<*> (pure (fromEnum s)))
instance ToHeaders GetSendQuota where
toHeaders = const mempty
instance ToPath GetSendQuota where
toPath = const "/"
instance ToQuery GetSendQuota where
toQuery
= const
(mconcat
["Action" =: ("GetSendQuota" :: ByteString),
"Version" =: ("2010-12-01" :: ByteString)])
data GetSendQuotaResponse = GetSendQuotaResponse'
{ _gsqrsMaxSendRate :: !(Maybe Double)
, _gsqrsSentLast24Hours :: !(Maybe Double)
, _gsqrsMax24HourSend :: !(Maybe Double)
, _gsqrsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getSendQuotaResponse
:: Int
-> GetSendQuotaResponse
getSendQuotaResponse pStatus_ =
GetSendQuotaResponse'
{ _gsqrsMaxSendRate = Nothing
, _gsqrsSentLast24Hours = Nothing
, _gsqrsMax24HourSend = Nothing
, _gsqrsStatus = pStatus_
}
gsqrsMaxSendRate :: Lens' GetSendQuotaResponse (Maybe Double)
gsqrsMaxSendRate = lens _gsqrsMaxSendRate (\ s a -> s{_gsqrsMaxSendRate = a});
gsqrsSentLast24Hours :: Lens' GetSendQuotaResponse (Maybe Double)
gsqrsSentLast24Hours = lens _gsqrsSentLast24Hours (\ s a -> s{_gsqrsSentLast24Hours = a});
gsqrsMax24HourSend :: Lens' GetSendQuotaResponse (Maybe Double)
gsqrsMax24HourSend = lens _gsqrsMax24HourSend (\ s a -> s{_gsqrsMax24HourSend = a});
gsqrsStatus :: Lens' GetSendQuotaResponse Int
gsqrsStatus = lens _gsqrsStatus (\ s a -> s{_gsqrsStatus = a});