cancelJob method

Future<CancelJobOutput> cancelJob({
  1. required String jobId,
  2. String? aPIVersion,
})

This operation cancels a specified job. Only the job owner can cancel it. The operation fails if the job has already started or is complete.

May throw InvalidJobIdException. May throw ExpiredJobIdException. May throw CanceledJobIdException. May throw UnableToCancelJobIdException. May throw InvalidAccessKeyIdException. May throw InvalidVersionException.

Implementation

Future<CancelJobOutput> cancelJob({
  required String jobId,
  String? aPIVersion,
}) async {
  ArgumentError.checkNotNull(jobId, 'jobId');
  final $request = <String, dynamic>{};
  $request['JobId'] = jobId;
  aPIVersion?.also((arg) => $request['APIVersion'] = arg);
  final $result = await _protocol.send(
    $request,
    action: 'CancelJob',
    version: '2010-06-01',
    method: 'POST',
    requestUri: '/?Operation=CancelJob',
    exceptionFnMap: _exceptionFns,
    shape: shapes['CancelJobInput'],
    shapes: shapes,
    resultWrapper: 'CancelJobResult',
  );
  return CancelJobOutput.fromXml($result);
}