createInvalidation2018_06_18 method

Future<CreateInvalidationResult> createInvalidation2018_06_18(
  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> createInvalidation2018_06_18({
  @_s.required String distributionId,
  @_s.required InvalidationBatch invalidationBatch,
}) async {
  ArgumentError.checkNotNull(distributionId, 'distributionId');
  ArgumentError.checkNotNull(invalidationBatch, 'invalidationBatch');
  final $result = await _protocol.sendRaw(
    method: 'POST',
    requestUri:
        '/2018-06-18/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'),
  );
}