{-# 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.ElastiCache.DescribeReservedCacheNodesOfferings
(
describeReservedCacheNodesOfferings
, DescribeReservedCacheNodesOfferings
, drcnoCacheNodeType
, drcnoProductDescription
, drcnoMarker
, drcnoMaxRecords
, drcnoOfferingType
, drcnoDuration
, drcnoReservedCacheNodesOfferingId
, describeReservedCacheNodesOfferingsResponse
, DescribeReservedCacheNodesOfferingsResponse
, drcnorsMarker
, drcnorsReservedCacheNodesOfferings
, drcnorsResponseStatus
) where
import Network.AWS.ElastiCache.Types
import Network.AWS.ElastiCache.Types.Product
import Network.AWS.Lens
import Network.AWS.Pager
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data DescribeReservedCacheNodesOfferings = DescribeReservedCacheNodesOfferings'
{ _drcnoCacheNodeType :: !(Maybe Text)
, _drcnoProductDescription :: !(Maybe Text)
, _drcnoMarker :: !(Maybe Text)
, _drcnoMaxRecords :: !(Maybe Int)
, _drcnoOfferingType :: !(Maybe Text)
, _drcnoDuration :: !(Maybe Text)
, _drcnoReservedCacheNodesOfferingId :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeReservedCacheNodesOfferings
:: DescribeReservedCacheNodesOfferings
describeReservedCacheNodesOfferings =
DescribeReservedCacheNodesOfferings'
{ _drcnoCacheNodeType = Nothing
, _drcnoProductDescription = Nothing
, _drcnoMarker = Nothing
, _drcnoMaxRecords = Nothing
, _drcnoOfferingType = Nothing
, _drcnoDuration = Nothing
, _drcnoReservedCacheNodesOfferingId = Nothing
}
drcnoCacheNodeType :: Lens' DescribeReservedCacheNodesOfferings (Maybe Text)
drcnoCacheNodeType = lens _drcnoCacheNodeType (\ s a -> s{_drcnoCacheNodeType = a});
drcnoProductDescription :: Lens' DescribeReservedCacheNodesOfferings (Maybe Text)
drcnoProductDescription = lens _drcnoProductDescription (\ s a -> s{_drcnoProductDescription = a});
drcnoMarker :: Lens' DescribeReservedCacheNodesOfferings (Maybe Text)
drcnoMarker = lens _drcnoMarker (\ s a -> s{_drcnoMarker = a});
drcnoMaxRecords :: Lens' DescribeReservedCacheNodesOfferings (Maybe Int)
drcnoMaxRecords = lens _drcnoMaxRecords (\ s a -> s{_drcnoMaxRecords = a});
drcnoOfferingType :: Lens' DescribeReservedCacheNodesOfferings (Maybe Text)
drcnoOfferingType = lens _drcnoOfferingType (\ s a -> s{_drcnoOfferingType = a});
drcnoDuration :: Lens' DescribeReservedCacheNodesOfferings (Maybe Text)
drcnoDuration = lens _drcnoDuration (\ s a -> s{_drcnoDuration = a});
drcnoReservedCacheNodesOfferingId :: Lens' DescribeReservedCacheNodesOfferings (Maybe Text)
drcnoReservedCacheNodesOfferingId = lens _drcnoReservedCacheNodesOfferingId (\ s a -> s{_drcnoReservedCacheNodesOfferingId = a});
instance AWSPager DescribeReservedCacheNodesOfferings
where
page rq rs
| stop (rs ^. drcnorsMarker) = Nothing
| stop (rs ^. drcnorsReservedCacheNodesOfferings) =
Nothing
| otherwise =
Just $ rq & drcnoMarker .~ rs ^. drcnorsMarker
instance AWSRequest
DescribeReservedCacheNodesOfferings where
type Rs DescribeReservedCacheNodesOfferings =
DescribeReservedCacheNodesOfferingsResponse
request = postQuery elastiCache
response
= receiveXMLWrapper
"DescribeReservedCacheNodesOfferingsResult"
(\ s h x ->
DescribeReservedCacheNodesOfferingsResponse' <$>
(x .@? "Marker") <*>
(x .@? "ReservedCacheNodesOfferings" .!@ mempty >>=
may (parseXMLList "ReservedCacheNodesOffering"))
<*> (pure (fromEnum s)))
instance Hashable DescribeReservedCacheNodesOfferings
instance NFData DescribeReservedCacheNodesOfferings
instance ToHeaders
DescribeReservedCacheNodesOfferings where
toHeaders = const mempty
instance ToPath DescribeReservedCacheNodesOfferings
where
toPath = const "/"
instance ToQuery DescribeReservedCacheNodesOfferings
where
toQuery DescribeReservedCacheNodesOfferings'{..}
= mconcat
["Action" =:
("DescribeReservedCacheNodesOfferings" ::
ByteString),
"Version" =: ("2015-02-02" :: ByteString),
"CacheNodeType" =: _drcnoCacheNodeType,
"ProductDescription" =: _drcnoProductDescription,
"Marker" =: _drcnoMarker,
"MaxRecords" =: _drcnoMaxRecords,
"OfferingType" =: _drcnoOfferingType,
"Duration" =: _drcnoDuration,
"ReservedCacheNodesOfferingId" =:
_drcnoReservedCacheNodesOfferingId]
data DescribeReservedCacheNodesOfferingsResponse = DescribeReservedCacheNodesOfferingsResponse'
{ _drcnorsMarker :: !(Maybe Text)
, _drcnorsReservedCacheNodesOfferings :: !(Maybe [ReservedCacheNodesOffering])
, _drcnorsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeReservedCacheNodesOfferingsResponse
:: Int
-> DescribeReservedCacheNodesOfferingsResponse
describeReservedCacheNodesOfferingsResponse pResponseStatus_ =
DescribeReservedCacheNodesOfferingsResponse'
{ _drcnorsMarker = Nothing
, _drcnorsReservedCacheNodesOfferings = Nothing
, _drcnorsResponseStatus = pResponseStatus_
}
drcnorsMarker :: Lens' DescribeReservedCacheNodesOfferingsResponse (Maybe Text)
drcnorsMarker = lens _drcnorsMarker (\ s a -> s{_drcnorsMarker = a});
drcnorsReservedCacheNodesOfferings :: Lens' DescribeReservedCacheNodesOfferingsResponse [ReservedCacheNodesOffering]
drcnorsReservedCacheNodesOfferings = lens _drcnorsReservedCacheNodesOfferings (\ s a -> s{_drcnorsReservedCacheNodesOfferings = a}) . _Default . _Coerce;
drcnorsResponseStatus :: Lens' DescribeReservedCacheNodesOfferingsResponse Int
drcnorsResponseStatus = lens _drcnorsResponseStatus (\ s a -> s{_drcnorsResponseStatus = a});
instance NFData
DescribeReservedCacheNodesOfferingsResponse