module Network.AWS.Redshift.PurchaseReservedNodeOffering
(
PurchaseReservedNodeOffering
, purchaseReservedNodeOffering
, prnoNodeCount
, prnoReservedNodeOfferingId
, PurchaseReservedNodeOfferingResponse
, purchaseReservedNodeOfferingResponse
, prnorReservedNode
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.Redshift.Types
import qualified GHC.Exts
data PurchaseReservedNodeOffering = PurchaseReservedNodeOffering
{ _prnoNodeCount :: Maybe Int
, _prnoReservedNodeOfferingId :: Text
} deriving (Eq, Ord, Show)
purchaseReservedNodeOffering :: Text
-> PurchaseReservedNodeOffering
purchaseReservedNodeOffering p1 = PurchaseReservedNodeOffering
{ _prnoReservedNodeOfferingId = p1
, _prnoNodeCount = Nothing
}
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 })
newtype PurchaseReservedNodeOfferingResponse = PurchaseReservedNodeOfferingResponse
{ _prnorReservedNode :: Maybe ReservedNode
} deriving (Eq, Show)
purchaseReservedNodeOfferingResponse :: PurchaseReservedNodeOfferingResponse
purchaseReservedNodeOfferingResponse = PurchaseReservedNodeOfferingResponse
{ _prnorReservedNode = Nothing
}
prnorReservedNode :: Lens' PurchaseReservedNodeOfferingResponse (Maybe ReservedNode)
prnorReservedNode =
lens _prnorReservedNode (\s a -> s { _prnorReservedNode = a })
instance ToPath PurchaseReservedNodeOffering where
toPath = const "/"
instance ToQuery PurchaseReservedNodeOffering where
toQuery PurchaseReservedNodeOffering{..} = mconcat
[ "NodeCount" =? _prnoNodeCount
, "ReservedNodeOfferingId" =? _prnoReservedNodeOfferingId
]
instance ToHeaders PurchaseReservedNodeOffering
instance AWSRequest PurchaseReservedNodeOffering where
type Sv PurchaseReservedNodeOffering = Redshift
type Rs PurchaseReservedNodeOffering = PurchaseReservedNodeOfferingResponse
request = post "PurchaseReservedNodeOffering"
response = xmlResponse
instance FromXML PurchaseReservedNodeOfferingResponse where
parseXML = withElement "PurchaseReservedNodeOfferingResult" $ \x -> PurchaseReservedNodeOfferingResponse
<$> x .@? "ReservedNode"