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