purchaseReservedCacheNodesOffering method

Future<PurchaseReservedCacheNodesOfferingResult> purchaseReservedCacheNodesOffering({
  1. required String reservedCacheNodesOfferingId,
  2. int? cacheNodeCount,
  3. String? reservedCacheNodeId,
})

Allows you to purchase a reserved cache node offering.

May throw ReservedCacheNodesOfferingNotFoundFault. May throw ReservedCacheNodeAlreadyExistsFault. May throw ReservedCacheNodeQuotaExceededFault. May throw InvalidParameterValueException. May throw InvalidParameterCombinationException.

Parameter reservedCacheNodesOfferingId : The ID of the reserved cache node offering to purchase.

Example: 438012d3-4052-4cc7-b2e3-8d3372e0e706

Parameter cacheNodeCount : The number of cache node instances to reserve.

Default: 1

Parameter reservedCacheNodeId : A customer-specified identifier to track this reservation. Example: myreservationID

Implementation

Future<PurchaseReservedCacheNodesOfferingResult>
    purchaseReservedCacheNodesOffering({
  required String reservedCacheNodesOfferingId,
  int? cacheNodeCount,
  String? reservedCacheNodeId,
}) async {
  ArgumentError.checkNotNull(
      reservedCacheNodesOfferingId, 'reservedCacheNodesOfferingId');
  final $request = <String, dynamic>{};
  $request['ReservedCacheNodesOfferingId'] = reservedCacheNodesOfferingId;
  cacheNodeCount?.also((arg) => $request['CacheNodeCount'] = arg);
  reservedCacheNodeId?.also((arg) => $request['ReservedCacheNodeId'] = arg);
  final $result = await _protocol.send(
    $request,
    action: 'PurchaseReservedCacheNodesOffering',
    version: '2015-02-02',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['PurchaseReservedCacheNodesOfferingMessage'],
    shapes: shapes,
    resultWrapper: 'PurchaseReservedCacheNodesOfferingResult',
  );
  return PurchaseReservedCacheNodesOfferingResult.fromXml($result);
}