createInvalidation2019_03_26 method

Future<CreateInvalidationResult> createInvalidation2019_03_26({
  1. required String distributionId,
  2. required InvalidationBatch invalidationBatch,
})

Create a new invalidation.

May throw AccessDenied. May throw MissingBody. May throw InvalidArgument. May throw NoSuchDistribution. May throw BatchTooLarge. May throw TooManyInvalidationsInProgress. May throw InconsistentQuantities.

Parameter distributionId : The distribution's id.

Parameter invalidationBatch : The batch information for the invalidation.

Implementation

Future<CreateInvalidationResult> createInvalidation2019_03_26({
  required String distributionId,
  required InvalidationBatch invalidationBatch,
}) async {
  ArgumentError.checkNotNull(distributionId, 'distributionId');
  ArgumentError.checkNotNull(invalidationBatch, 'invalidationBatch');
  final $result = await _protocol.sendRaw(
    method: 'POST',
    requestUri:
        '/2019-03-26/distribution/${Uri.encodeComponent(distributionId)}/invalidation',
    payload: invalidationBatch.toXml('InvalidationBatch'),
    exceptionFnMap: _exceptionFns,
  );
  final $elem = await _s.xmlFromResponse($result);
  return CreateInvalidationResult(
    invalidation: Invalidation.fromXml($elem),
    location: _s.extractHeaderStringValue($result.headers, 'Location'),
  );
}