listPreparedStatements method

Future<ListPreparedStatementsOutput> listPreparedStatements({
  1. required String workGroup,
  2. int? maxResults,
  3. String? nextToken,
})

Lists the prepared statements in the specified workgroup.

May throw InternalServerException. May throw InvalidRequestException.

Parameter workGroup : The workgroup to list the prepared statements for.

Parameter maxResults : The maximum number of results 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.

Implementation

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

  return ListPreparedStatementsOutput.fromJson(jsonResponse.body);
}