createInvalidation2016_11_25 method
Future<CreateInvalidationResult>
createInvalidation2016_11_25({
- required String distributionId,
- 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> createInvalidation2016_11_25({
required String distributionId,
required InvalidationBatch invalidationBatch,
}) async {
ArgumentError.checkNotNull(distributionId, 'distributionId');
ArgumentError.checkNotNull(invalidationBatch, 'invalidationBatch');
final $result = await _protocol.sendRaw(
method: 'POST',
requestUri:
'/2016-11-25/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'),
);
}