{-# 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.ListConfigurationSets
    (
    
      listConfigurationSets
    , ListConfigurationSets
    
    , lcsNextToken
    , lcsMaxItems
    
    , listConfigurationSetsResponse
    , ListConfigurationSetsResponse
    
    , lcsrsConfigurationSets
    , lcsrsNextToken
    , lcsrsResponseStatus
    ) 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 ListConfigurationSets = ListConfigurationSets'
    { _lcsNextToken :: !(Maybe Text)
    , _lcsMaxItems  :: !(Maybe Int)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)
listConfigurationSets
    :: ListConfigurationSets
listConfigurationSets =
    ListConfigurationSets'
    { _lcsNextToken = Nothing
    , _lcsMaxItems = Nothing
    }
lcsNextToken :: Lens' ListConfigurationSets (Maybe Text)
lcsNextToken = lens _lcsNextToken (\ s a -> s{_lcsNextToken = a});
lcsMaxItems :: Lens' ListConfigurationSets (Maybe Int)
lcsMaxItems = lens _lcsMaxItems (\ s a -> s{_lcsMaxItems = a});
instance AWSRequest ListConfigurationSets where
        type Rs ListConfigurationSets =
             ListConfigurationSetsResponse
        request = postQuery ses
        response
          = receiveXMLWrapper "ListConfigurationSetsResult"
              (\ s h x ->
                 ListConfigurationSetsResponse' <$>
                   (x .@? "ConfigurationSets" .!@ mempty >>=
                      may (parseXMLList "member"))
                     <*> (x .@? "NextToken")
                     <*> (pure (fromEnum s)))
instance Hashable ListConfigurationSets
instance NFData ListConfigurationSets
instance ToHeaders ListConfigurationSets where
        toHeaders = const mempty
instance ToPath ListConfigurationSets where
        toPath = const "/"
instance ToQuery ListConfigurationSets where
        toQuery ListConfigurationSets'{..}
          = mconcat
              ["Action" =: ("ListConfigurationSets" :: ByteString),
               "Version" =: ("2010-12-01" :: ByteString),
               "NextToken" =: _lcsNextToken,
               "MaxItems" =: _lcsMaxItems]
data ListConfigurationSetsResponse = ListConfigurationSetsResponse'
    { _lcsrsConfigurationSets :: !(Maybe [ConfigurationSet])
    , _lcsrsNextToken         :: !(Maybe Text)
    , _lcsrsResponseStatus    :: !Int
    } deriving (Eq,Read,Show,Data,Typeable,Generic)
listConfigurationSetsResponse
    :: Int 
    -> ListConfigurationSetsResponse
listConfigurationSetsResponse pResponseStatus_ =
    ListConfigurationSetsResponse'
    { _lcsrsConfigurationSets = Nothing
    , _lcsrsNextToken = Nothing
    , _lcsrsResponseStatus = pResponseStatus_
    }
lcsrsConfigurationSets :: Lens' ListConfigurationSetsResponse [ConfigurationSet]
lcsrsConfigurationSets = lens _lcsrsConfigurationSets (\ s a -> s{_lcsrsConfigurationSets = a}) . _Default . _Coerce;
lcsrsNextToken :: Lens' ListConfigurationSetsResponse (Maybe Text)
lcsrsNextToken = lens _lcsrsNextToken (\ s a -> s{_lcsrsNextToken = a});
lcsrsResponseStatus :: Lens' ListConfigurationSetsResponse Int
lcsrsResponseStatus = lens _lcsrsResponseStatus (\ s a -> s{_lcsrsResponseStatus = a});
instance NFData ListConfigurationSetsResponse