module Network.AWS.ElastiCache.DescribeReservedCacheNodesOfferings
(
DescribeReservedCacheNodesOfferings
, describeReservedCacheNodesOfferings
, drcnoCacheNodeType
, drcnoDuration
, drcnoMarker
, drcnoMaxRecords
, drcnoOfferingType
, drcnoProductDescription
, drcnoReservedCacheNodesOfferingId
, DescribeReservedCacheNodesOfferingsResponse
, describeReservedCacheNodesOfferingsResponse
, drcnorMarker
, drcnorReservedCacheNodesOfferings
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.ElastiCache.Types
import qualified GHC.Exts
data DescribeReservedCacheNodesOfferings = DescribeReservedCacheNodesOfferings
{ _drcnoCacheNodeType :: Maybe Text
, _drcnoDuration :: Maybe Text
, _drcnoMarker :: Maybe Text
, _drcnoMaxRecords :: Maybe Int
, _drcnoOfferingType :: Maybe Text
, _drcnoProductDescription :: Maybe Text
, _drcnoReservedCacheNodesOfferingId :: Maybe Text
} deriving (Eq, Ord, Show)
describeReservedCacheNodesOfferings :: DescribeReservedCacheNodesOfferings
describeReservedCacheNodesOfferings = DescribeReservedCacheNodesOfferings
{ _drcnoReservedCacheNodesOfferingId = Nothing
, _drcnoCacheNodeType = Nothing
, _drcnoDuration = Nothing
, _drcnoProductDescription = Nothing
, _drcnoOfferingType = Nothing
, _drcnoMaxRecords = Nothing
, _drcnoMarker = Nothing
}
drcnoCacheNodeType :: Lens' DescribeReservedCacheNodesOfferings (Maybe Text)
drcnoCacheNodeType =
lens _drcnoCacheNodeType (\s a -> s { _drcnoCacheNodeType = a })
drcnoDuration :: Lens' DescribeReservedCacheNodesOfferings (Maybe Text)
drcnoDuration = lens _drcnoDuration (\s a -> s { _drcnoDuration = 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 })
drcnoProductDescription :: Lens' DescribeReservedCacheNodesOfferings (Maybe Text)
drcnoProductDescription =
lens _drcnoProductDescription (\s a -> s { _drcnoProductDescription = a })
drcnoReservedCacheNodesOfferingId :: Lens' DescribeReservedCacheNodesOfferings (Maybe Text)
drcnoReservedCacheNodesOfferingId =
lens _drcnoReservedCacheNodesOfferingId
(\s a -> s { _drcnoReservedCacheNodesOfferingId = a })
data DescribeReservedCacheNodesOfferingsResponse = DescribeReservedCacheNodesOfferingsResponse
{ _drcnorMarker :: Maybe Text
, _drcnorReservedCacheNodesOfferings :: List "member" ReservedCacheNodesOffering
} deriving (Eq, Show)
describeReservedCacheNodesOfferingsResponse :: DescribeReservedCacheNodesOfferingsResponse
describeReservedCacheNodesOfferingsResponse = DescribeReservedCacheNodesOfferingsResponse
{ _drcnorMarker = Nothing
, _drcnorReservedCacheNodesOfferings = mempty
}
drcnorMarker :: Lens' DescribeReservedCacheNodesOfferingsResponse (Maybe Text)
drcnorMarker = lens _drcnorMarker (\s a -> s { _drcnorMarker = a })
drcnorReservedCacheNodesOfferings :: Lens' DescribeReservedCacheNodesOfferingsResponse [ReservedCacheNodesOffering]
drcnorReservedCacheNodesOfferings =
lens _drcnorReservedCacheNodesOfferings
(\s a -> s { _drcnorReservedCacheNodesOfferings = a })
. _List
instance ToPath DescribeReservedCacheNodesOfferings where
toPath = const "/"
instance ToQuery DescribeReservedCacheNodesOfferings where
toQuery DescribeReservedCacheNodesOfferings{..} = mconcat
[ "CacheNodeType" =? _drcnoCacheNodeType
, "Duration" =? _drcnoDuration
, "Marker" =? _drcnoMarker
, "MaxRecords" =? _drcnoMaxRecords
, "OfferingType" =? _drcnoOfferingType
, "ProductDescription" =? _drcnoProductDescription
, "ReservedCacheNodesOfferingId" =? _drcnoReservedCacheNodesOfferingId
]
instance ToHeaders DescribeReservedCacheNodesOfferings
instance AWSRequest DescribeReservedCacheNodesOfferings where
type Sv DescribeReservedCacheNodesOfferings = ElastiCache
type Rs DescribeReservedCacheNodesOfferings = DescribeReservedCacheNodesOfferingsResponse
request = post "DescribeReservedCacheNodesOfferings"
response = xmlResponse
instance FromXML DescribeReservedCacheNodesOfferingsResponse where
parseXML = withElement "DescribeReservedCacheNodesOfferingsResult" $ \x -> DescribeReservedCacheNodesOfferingsResponse
<$> x .@? "Marker"
<*> x .@? "ReservedCacheNodesOfferings" .!@ mempty
instance AWSPager DescribeReservedCacheNodesOfferings where
page rq rs
| stop (rq ^. drcnoMarker) = Nothing
| otherwise = (\x -> rq & drcnoMarker ?~ x)
<$> (rs ^. drcnorMarker)