{-# 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.GetSendQuota
    (
    
      getSendQuota
    , GetSendQuota
    
    , getSendQuotaResponse
    , GetSendQuotaResponse
    
    , gsqrsMaxSendRate
    , gsqrsSentLast24Hours
    , gsqrsMax24HourSend
    , gsqrsResponseStatus
    ) 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 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 Hashable GetSendQuota
instance NFData GetSendQuota
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)
    , _gsqrsResponseStatus  :: !Int
    } deriving (Eq,Read,Show,Data,Typeable,Generic)
getSendQuotaResponse
    :: Int 
    -> GetSendQuotaResponse
getSendQuotaResponse pResponseStatus_ =
    GetSendQuotaResponse'
    { _gsqrsMaxSendRate = Nothing
    , _gsqrsSentLast24Hours = Nothing
    , _gsqrsMax24HourSend = Nothing
    , _gsqrsResponseStatus = pResponseStatus_
    }
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});
gsqrsResponseStatus :: Lens' GetSendQuotaResponse Int
gsqrsResponseStatus = lens _gsqrsResponseStatus (\ s a -> s{_gsqrsResponseStatus = a});
instance NFData GetSendQuotaResponse