listQueryExecutions method

Future<ListQueryExecutionsOutput> listQueryExecutions({
  1. int? maxResults,
  2. String? nextToken,
  3. String? workGroup,
})

Provides a list of available query execution IDs for the queries in the specified workgroup. If a workgroup is not specified, returns a list of query execution IDs for the primary workgroup. Requires you to have access to the workgroup in which the queries ran.

For code samples using the AWS SDK for Java, see Examples and Code Samples in the Amazon Athena User Guide.

May throw InternalServerException. May throw InvalidRequestException.

Parameter maxResults : The maximum number of query executions to return in this request.

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 workGroup : The name of the workgroup from which queries are being returned. If a workgroup is not specified, a list of available query execution IDs for the queries in the primary workgroup is returned.

Implementation

Future<ListQueryExecutionsOutput> listQueryExecutions({
  int? maxResults,
  String? nextToken,
  String? workGroup,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    0,
    50,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    1,
    1024,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonAthena.ListQueryExecutions'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
      if (workGroup != null) 'WorkGroup': workGroup,
    },
  );

  return ListQueryExecutionsOutput.fromJson(jsonResponse.body);
}