module Network.AWS.Redshift.PurchaseReservedNodeOffering
(
purchaseReservedNodeOffering
, PurchaseReservedNodeOffering
, prnoNodeCount
, prnoReservedNodeOfferingId
, purchaseReservedNodeOfferingResponse
, PurchaseReservedNodeOfferingResponse
, prnorsReservedNode
, prnorsStatus
) where
import Network.AWS.Prelude
import Network.AWS.Redshift.Types
import Network.AWS.Redshift.Types.Product
import Network.AWS.Request
import Network.AWS.Response
data PurchaseReservedNodeOffering = PurchaseReservedNodeOffering'
{ _prnoNodeCount :: !(Maybe Int)
, _prnoReservedNodeOfferingId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
purchaseReservedNodeOffering
:: Text
-> PurchaseReservedNodeOffering
purchaseReservedNodeOffering pReservedNodeOfferingId_ =
PurchaseReservedNodeOffering'
{ _prnoNodeCount = Nothing
, _prnoReservedNodeOfferingId = pReservedNodeOfferingId_
}
prnoNodeCount :: Lens' PurchaseReservedNodeOffering (Maybe Int)
prnoNodeCount = lens _prnoNodeCount (\ s a -> s{_prnoNodeCount = a});
prnoReservedNodeOfferingId :: Lens' PurchaseReservedNodeOffering Text
prnoReservedNodeOfferingId = lens _prnoReservedNodeOfferingId (\ s a -> s{_prnoReservedNodeOfferingId = a});
instance AWSRequest PurchaseReservedNodeOffering
where
type Rs PurchaseReservedNodeOffering =
PurchaseReservedNodeOfferingResponse
request = postQuery redshift
response
= receiveXMLWrapper
"PurchaseReservedNodeOfferingResult"
(\ s h x ->
PurchaseReservedNodeOfferingResponse' <$>
(x .@? "ReservedNode") <*> (pure (fromEnum s)))
instance ToHeaders PurchaseReservedNodeOffering where
toHeaders = const mempty
instance ToPath PurchaseReservedNodeOffering where
toPath = const "/"
instance ToQuery PurchaseReservedNodeOffering where
toQuery PurchaseReservedNodeOffering'{..}
= mconcat
["Action" =:
("PurchaseReservedNodeOffering" :: ByteString),
"Version" =: ("2012-12-01" :: ByteString),
"NodeCount" =: _prnoNodeCount,
"ReservedNodeOfferingId" =:
_prnoReservedNodeOfferingId]
data PurchaseReservedNodeOfferingResponse = PurchaseReservedNodeOfferingResponse'
{ _prnorsReservedNode :: !(Maybe ReservedNode)
, _prnorsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
purchaseReservedNodeOfferingResponse
:: Int
-> PurchaseReservedNodeOfferingResponse
purchaseReservedNodeOfferingResponse pStatus_ =
PurchaseReservedNodeOfferingResponse'
{ _prnorsReservedNode = Nothing
, _prnorsStatus = pStatus_
}
prnorsReservedNode :: Lens' PurchaseReservedNodeOfferingResponse (Maybe ReservedNode)
prnorsReservedNode = lens _prnorsReservedNode (\ s a -> s{_prnorsReservedNode = a});
prnorsStatus :: Lens' PurchaseReservedNodeOfferingResponse Int
prnorsStatus = lens _prnorsStatus (\ s a -> s{_prnorsStatus = a});