{-# 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 #-} -- Derived from AWS service descriptions, licensed under Apache 2.0. -- | -- Module : Network.AWS.SES.DescribeConfigurationSet -- Copyright : (c) 2013-2016 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay -- Stability : auto-generated -- Portability : non-portable (GHC extensions) -- -- Returns the details of the specified configuration set. -- -- -- Configuration sets enable you to publish email sending events. For information about using configuration sets, see the . -- -- This action is throttled at one request per second. -- module Network.AWS.SES.DescribeConfigurationSet ( -- * Creating a Request describeConfigurationSet , DescribeConfigurationSet -- * Request Lenses , dcsConfigurationSetAttributeNames , dcsConfigurationSetName -- * Destructuring the Response , describeConfigurationSetResponse , DescribeConfigurationSetResponse -- * Response Lenses , dcsrsConfigurationSet , dcsrsEventDestinations , dcsrsResponseStatus ) 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 -- | Represents a request to return the details of a configuration set. Configuration sets enable you to publish email sending events. For information about using configuration sets, see the . -- -- -- -- /See:/ 'describeConfigurationSet' smart constructor. data DescribeConfigurationSet = DescribeConfigurationSet' { _dcsConfigurationSetAttributeNames :: !(Maybe [ConfigurationSetAttribute]) , _dcsConfigurationSetName :: !Text } deriving (Eq,Read,Show,Data,Typeable,Generic) -- | Creates a value of 'DescribeConfigurationSet' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'dcsConfigurationSetAttributeNames' - A list of configuration set attributes to return. -- -- * 'dcsConfigurationSetName' - The name of the configuration set to describe. describeConfigurationSet :: Text -- ^ 'dcsConfigurationSetName' -> DescribeConfigurationSet describeConfigurationSet pConfigurationSetName_ = DescribeConfigurationSet' { _dcsConfigurationSetAttributeNames = Nothing , _dcsConfigurationSetName = pConfigurationSetName_ } -- | A list of configuration set attributes to return. dcsConfigurationSetAttributeNames :: Lens' DescribeConfigurationSet [ConfigurationSetAttribute] dcsConfigurationSetAttributeNames = lens _dcsConfigurationSetAttributeNames (\ s a -> s{_dcsConfigurationSetAttributeNames = a}) . _Default . _Coerce; -- | The name of the configuration set to describe. dcsConfigurationSetName :: Lens' DescribeConfigurationSet Text dcsConfigurationSetName = lens _dcsConfigurationSetName (\ s a -> s{_dcsConfigurationSetName = a}); instance AWSRequest DescribeConfigurationSet where type Rs DescribeConfigurationSet = DescribeConfigurationSetResponse request = postQuery ses response = receiveXMLWrapper "DescribeConfigurationSetResult" (\ s h x -> DescribeConfigurationSetResponse' <$> (x .@? "ConfigurationSet") <*> (x .@? "EventDestinations" .!@ mempty >>= may (parseXMLList "member")) <*> (pure (fromEnum s))) instance Hashable DescribeConfigurationSet instance NFData DescribeConfigurationSet instance ToHeaders DescribeConfigurationSet where toHeaders = const mempty instance ToPath DescribeConfigurationSet where toPath = const "/" instance ToQuery DescribeConfigurationSet where toQuery DescribeConfigurationSet'{..} = mconcat ["Action" =: ("DescribeConfigurationSet" :: ByteString), "Version" =: ("2010-12-01" :: ByteString), "ConfigurationSetAttributeNames" =: toQuery (toQueryList "member" <$> _dcsConfigurationSetAttributeNames), "ConfigurationSetName" =: _dcsConfigurationSetName] -- | Represents the details of a configuration set. Configuration sets enable you to publish email sending events. For information about using configuration sets, see the . -- -- -- -- /See:/ 'describeConfigurationSetResponse' smart constructor. data DescribeConfigurationSetResponse = DescribeConfigurationSetResponse' { _dcsrsConfigurationSet :: !(Maybe ConfigurationSet) , _dcsrsEventDestinations :: !(Maybe [EventDestination]) , _dcsrsResponseStatus :: !Int } deriving (Eq,Read,Show,Data,Typeable,Generic) -- | Creates a value of 'DescribeConfigurationSetResponse' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'dcsrsConfigurationSet' - The configuration set object associated with the specified configuration set. -- -- * 'dcsrsEventDestinations' - A list of event destinations associated with the configuration set. -- -- * 'dcsrsResponseStatus' - -- | The response status code. describeConfigurationSetResponse :: Int -- ^ 'dcsrsResponseStatus' -> DescribeConfigurationSetResponse describeConfigurationSetResponse pResponseStatus_ = DescribeConfigurationSetResponse' { _dcsrsConfigurationSet = Nothing , _dcsrsEventDestinations = Nothing , _dcsrsResponseStatus = pResponseStatus_ } -- | The configuration set object associated with the specified configuration set. dcsrsConfigurationSet :: Lens' DescribeConfigurationSetResponse (Maybe ConfigurationSet) dcsrsConfigurationSet = lens _dcsrsConfigurationSet (\ s a -> s{_dcsrsConfigurationSet = a}); -- | A list of event destinations associated with the configuration set. dcsrsEventDestinations :: Lens' DescribeConfigurationSetResponse [EventDestination] dcsrsEventDestinations = lens _dcsrsEventDestinations (\ s a -> s{_dcsrsEventDestinations = a}) . _Default . _Coerce; -- | -- | The response status code. dcsrsResponseStatus :: Lens' DescribeConfigurationSetResponse Int dcsrsResponseStatus = lens _dcsrsResponseStatus (\ s a -> s{_dcsrsResponseStatus = a}); instance NFData DescribeConfigurationSetResponse