listCalculationExecutions method

Future<ListCalculationExecutionsResponse> listCalculationExecutions({
  1. required String sessionId,
  2. int? maxResults,
  3. String? nextToken,
  4. CalculationExecutionState? stateFilter,
})

Lists the calculations that have been submitted to a session in descending order. Newer calculations are listed first; older calculations are listed later.

May throw InternalServerException. May throw InvalidRequestException. May throw ResourceNotFoundException.

Parameter sessionId : The session ID.

Parameter maxResults : The maximum number of calculation executions to return.

Parameter nextToken : A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.

Parameter stateFilter : A filter for a specific calculation execution state. A description of each state follows.

CREATING - The calculation is in the process of being created.

CREATED - The calculation has been created and is ready to run.

QUEUED - The calculation has been queued for processing.

RUNNING - The calculation is running.

CANCELING - A request to cancel the calculation has been received and the system is working to stop it.

CANCELED - The calculation is no longer running as the result of a cancel request.

COMPLETED - The calculation has completed without error.

FAILED - The calculation failed and is no longer running.

Implementation

Future<ListCalculationExecutionsResponse> listCalculationExecutions({
  required String sessionId,
  int? maxResults,
  String? nextToken,
  CalculationExecutionState? stateFilter,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonAthena.ListCalculationExecutions'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'SessionId': sessionId,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
      if (stateFilter != null) 'StateFilter': stateFilter.value,
    },
  );

  return ListCalculationExecutionsResponse.fromJson(jsonResponse.body);
}