cancelQuery method

Future<CancelQueryResponse> cancelQuery({
  1. required String queryId,
})

Cancels a query that has been issued. Cancellation is provided only if the query has not completed running before the cancellation request was issued. Because cancellation is an idempotent operation, subsequent cancellation requests will return a CancellationMessage, indicating that the query has already been canceled. See code sample for details.

May throw AccessDeniedException. May throw InternalServerException. May throw InvalidEndpointException. May throw ThrottlingException. May throw ValidationException.

Parameter queryId : The ID of the query that needs to be cancelled. QueryID is returned as part of the query result.

Implementation

Future<CancelQueryResponse> cancelQuery({
  required String queryId,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'Timestream_20181101.CancelQuery'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'QueryId': queryId,
    },
  );

  return CancelQueryResponse.fromJson(jsonResponse.body);
}