module Network.AWS.ElastiCache.DescribeCacheParameters
(
describeCacheParameters
, DescribeCacheParameters
, dcpMaxRecords
, dcpMarker
, dcpSource
, dcpCacheParameterGroupName
, describeCacheParametersResponse
, DescribeCacheParametersResponse
, dcprsCacheNodeTypeSpecificParameters
, dcprsParameters
, dcprsMarker
, dcprsStatus
) where
import Network.AWS.ElastiCache.Types
import Network.AWS.ElastiCache.Types.Product
import Network.AWS.Pager
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data DescribeCacheParameters = DescribeCacheParameters'
{ _dcpMaxRecords :: !(Maybe Int)
, _dcpMarker :: !(Maybe Text)
, _dcpSource :: !(Maybe Text)
, _dcpCacheParameterGroupName :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeCacheParameters
:: Text
-> DescribeCacheParameters
describeCacheParameters pCacheParameterGroupName_ =
DescribeCacheParameters'
{ _dcpMaxRecords = Nothing
, _dcpMarker = Nothing
, _dcpSource = Nothing
, _dcpCacheParameterGroupName = pCacheParameterGroupName_
}
dcpMaxRecords :: Lens' DescribeCacheParameters (Maybe Int)
dcpMaxRecords = lens _dcpMaxRecords (\ s a -> s{_dcpMaxRecords = a});
dcpMarker :: Lens' DescribeCacheParameters (Maybe Text)
dcpMarker = lens _dcpMarker (\ s a -> s{_dcpMarker = a});
dcpSource :: Lens' DescribeCacheParameters (Maybe Text)
dcpSource = lens _dcpSource (\ s a -> s{_dcpSource = a});
dcpCacheParameterGroupName :: Lens' DescribeCacheParameters Text
dcpCacheParameterGroupName = lens _dcpCacheParameterGroupName (\ s a -> s{_dcpCacheParameterGroupName = a});
instance AWSPager DescribeCacheParameters where
page rq rs
| stop (rs ^. dcprsMarker) = Nothing
| stop (rs ^. dcprsParameters) = Nothing
| otherwise =
Just $ rq & dcpMarker .~ rs ^. dcprsMarker
instance AWSRequest DescribeCacheParameters where
type Sv DescribeCacheParameters = ElastiCache
type Rs DescribeCacheParameters =
DescribeCacheParametersResponse
request = postQuery
response
= receiveXMLWrapper "DescribeCacheParametersResult"
(\ s h x ->
DescribeCacheParametersResponse' <$>
(x .@? "CacheNodeTypeSpecificParameters" .!@ mempty
>>=
may (parseXMLList "CacheNodeTypeSpecificParameter"))
<*>
(x .@? "Parameters" .!@ mempty >>=
may (parseXMLList "Parameter"))
<*> (x .@? "Marker")
<*> (pure (fromEnum s)))
instance ToHeaders DescribeCacheParameters where
toHeaders = const mempty
instance ToPath DescribeCacheParameters where
toPath = const "/"
instance ToQuery DescribeCacheParameters where
toQuery DescribeCacheParameters'{..}
= mconcat
["Action" =:
("DescribeCacheParameters" :: ByteString),
"Version" =: ("2015-02-02" :: ByteString),
"MaxRecords" =: _dcpMaxRecords,
"Marker" =: _dcpMarker, "Source" =: _dcpSource,
"CacheParameterGroupName" =:
_dcpCacheParameterGroupName]
data DescribeCacheParametersResponse = DescribeCacheParametersResponse'
{ _dcprsCacheNodeTypeSpecificParameters :: !(Maybe [CacheNodeTypeSpecificParameter])
, _dcprsParameters :: !(Maybe [Parameter])
, _dcprsMarker :: !(Maybe Text)
, _dcprsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeCacheParametersResponse
:: Int
-> DescribeCacheParametersResponse
describeCacheParametersResponse pStatus_ =
DescribeCacheParametersResponse'
{ _dcprsCacheNodeTypeSpecificParameters = Nothing
, _dcprsParameters = Nothing
, _dcprsMarker = Nothing
, _dcprsStatus = pStatus_
}
dcprsCacheNodeTypeSpecificParameters :: Lens' DescribeCacheParametersResponse [CacheNodeTypeSpecificParameter]
dcprsCacheNodeTypeSpecificParameters = lens _dcprsCacheNodeTypeSpecificParameters (\ s a -> s{_dcprsCacheNodeTypeSpecificParameters = a}) . _Default . _Coerce;
dcprsParameters :: Lens' DescribeCacheParametersResponse [Parameter]
dcprsParameters = lens _dcprsParameters (\ s a -> s{_dcprsParameters = a}) . _Default . _Coerce;
dcprsMarker :: Lens' DescribeCacheParametersResponse (Maybe Text)
dcprsMarker = lens _dcprsMarker (\ s a -> s{_dcprsMarker = a});
dcprsStatus :: Lens' DescribeCacheParametersResponse Int
dcprsStatus = lens _dcprsStatus (\ s a -> s{_dcprsStatus = a});