module Network.AWS.RDS.DescribeReservedDBInstancesOfferings
(
describeReservedDBInstancesOfferings
, DescribeReservedDBInstancesOfferings
, drdioProductDescription
, drdioFilters
, drdioDBInstanceClass
, drdioMaxRecords
, drdioMultiAZ
, drdioMarker
, drdioReservedDBInstancesOfferingId
, drdioOfferingType
, drdioDuration
, describeReservedDBInstancesOfferingsResponse
, DescribeReservedDBInstancesOfferingsResponse
, drdiorsMarker
, drdiorsReservedDBInstancesOfferings
, drdiorsStatus
) where
import Network.AWS.Pager
import Network.AWS.Prelude
import Network.AWS.RDS.Types
import Network.AWS.RDS.Types.Product
import Network.AWS.Request
import Network.AWS.Response
data DescribeReservedDBInstancesOfferings = DescribeReservedDBInstancesOfferings'
{ _drdioProductDescription :: !(Maybe Text)
, _drdioFilters :: !(Maybe [Filter])
, _drdioDBInstanceClass :: !(Maybe Text)
, _drdioMaxRecords :: !(Maybe Int)
, _drdioMultiAZ :: !(Maybe Bool)
, _drdioMarker :: !(Maybe Text)
, _drdioReservedDBInstancesOfferingId :: !(Maybe Text)
, _drdioOfferingType :: !(Maybe Text)
, _drdioDuration :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeReservedDBInstancesOfferings
:: DescribeReservedDBInstancesOfferings
describeReservedDBInstancesOfferings =
DescribeReservedDBInstancesOfferings'
{ _drdioProductDescription = Nothing
, _drdioFilters = Nothing
, _drdioDBInstanceClass = Nothing
, _drdioMaxRecords = Nothing
, _drdioMultiAZ = Nothing
, _drdioMarker = Nothing
, _drdioReservedDBInstancesOfferingId = Nothing
, _drdioOfferingType = Nothing
, _drdioDuration = Nothing
}
drdioProductDescription :: Lens' DescribeReservedDBInstancesOfferings (Maybe Text)
drdioProductDescription = lens _drdioProductDescription (\ s a -> s{_drdioProductDescription = a});
drdioFilters :: Lens' DescribeReservedDBInstancesOfferings [Filter]
drdioFilters = lens _drdioFilters (\ s a -> s{_drdioFilters = a}) . _Default . _Coerce;
drdioDBInstanceClass :: Lens' DescribeReservedDBInstancesOfferings (Maybe Text)
drdioDBInstanceClass = lens _drdioDBInstanceClass (\ s a -> s{_drdioDBInstanceClass = a});
drdioMaxRecords :: Lens' DescribeReservedDBInstancesOfferings (Maybe Int)
drdioMaxRecords = lens _drdioMaxRecords (\ s a -> s{_drdioMaxRecords = a});
drdioMultiAZ :: Lens' DescribeReservedDBInstancesOfferings (Maybe Bool)
drdioMultiAZ = lens _drdioMultiAZ (\ s a -> s{_drdioMultiAZ = a});
drdioMarker :: Lens' DescribeReservedDBInstancesOfferings (Maybe Text)
drdioMarker = lens _drdioMarker (\ s a -> s{_drdioMarker = a});
drdioReservedDBInstancesOfferingId :: Lens' DescribeReservedDBInstancesOfferings (Maybe Text)
drdioReservedDBInstancesOfferingId = lens _drdioReservedDBInstancesOfferingId (\ s a -> s{_drdioReservedDBInstancesOfferingId = a});
drdioOfferingType :: Lens' DescribeReservedDBInstancesOfferings (Maybe Text)
drdioOfferingType = lens _drdioOfferingType (\ s a -> s{_drdioOfferingType = a});
drdioDuration :: Lens' DescribeReservedDBInstancesOfferings (Maybe Text)
drdioDuration = lens _drdioDuration (\ s a -> s{_drdioDuration = a});
instance AWSPager
DescribeReservedDBInstancesOfferings where
page rq rs
| stop (rs ^. drdiorsMarker) = Nothing
| stop (rs ^. drdiorsReservedDBInstancesOfferings) =
Nothing
| otherwise =
Just $ rq & drdioMarker .~ rs ^. drdiorsMarker
instance AWSRequest
DescribeReservedDBInstancesOfferings where
type Sv DescribeReservedDBInstancesOfferings = RDS
type Rs DescribeReservedDBInstancesOfferings =
DescribeReservedDBInstancesOfferingsResponse
request = postQuery
response
= receiveXMLWrapper
"DescribeReservedDBInstancesOfferingsResult"
(\ s h x ->
DescribeReservedDBInstancesOfferingsResponse' <$>
(x .@? "Marker") <*>
(x .@? "ReservedDBInstancesOfferings" .!@ mempty >>=
may (parseXMLList "ReservedDBInstancesOffering"))
<*> (pure (fromEnum s)))
instance ToHeaders
DescribeReservedDBInstancesOfferings where
toHeaders = const mempty
instance ToPath DescribeReservedDBInstancesOfferings
where
toPath = const "/"
instance ToQuery DescribeReservedDBInstancesOfferings
where
toQuery DescribeReservedDBInstancesOfferings'{..}
= mconcat
["Action" =:
("DescribeReservedDBInstancesOfferings" ::
ByteString),
"Version" =: ("2014-10-31" :: ByteString),
"ProductDescription" =: _drdioProductDescription,
"Filters" =:
toQuery (toQueryList "Filter" <$> _drdioFilters),
"DBInstanceClass" =: _drdioDBInstanceClass,
"MaxRecords" =: _drdioMaxRecords,
"MultiAZ" =: _drdioMultiAZ, "Marker" =: _drdioMarker,
"ReservedDBInstancesOfferingId" =:
_drdioReservedDBInstancesOfferingId,
"OfferingType" =: _drdioOfferingType,
"Duration" =: _drdioDuration]
data DescribeReservedDBInstancesOfferingsResponse = DescribeReservedDBInstancesOfferingsResponse'
{ _drdiorsMarker :: !(Maybe Text)
, _drdiorsReservedDBInstancesOfferings :: !(Maybe [ReservedDBInstancesOffering])
, _drdiorsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeReservedDBInstancesOfferingsResponse
:: Int
-> DescribeReservedDBInstancesOfferingsResponse
describeReservedDBInstancesOfferingsResponse pStatus_ =
DescribeReservedDBInstancesOfferingsResponse'
{ _drdiorsMarker = Nothing
, _drdiorsReservedDBInstancesOfferings = Nothing
, _drdiorsStatus = pStatus_
}
drdiorsMarker :: Lens' DescribeReservedDBInstancesOfferingsResponse (Maybe Text)
drdiorsMarker = lens _drdiorsMarker (\ s a -> s{_drdiorsMarker = a});
drdiorsReservedDBInstancesOfferings :: Lens' DescribeReservedDBInstancesOfferingsResponse [ReservedDBInstancesOffering]
drdiorsReservedDBInstancesOfferings = lens _drdiorsReservedDBInstancesOfferings (\ s a -> s{_drdiorsReservedDBInstancesOfferings = a}) . _Default . _Coerce;
drdiorsStatus :: Lens' DescribeReservedDBInstancesOfferingsResponse Int
drdiorsStatus = lens _drdiorsStatus (\ s a -> s{_drdiorsStatus = a});