listTasks method

Future<ListTasksOutput> listTasks({
  1. int? maxResults,
  2. String? nextToken,
  3. TaskState? state,
})

Returns a list of tasks that can be filtered by state.

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

Parameter maxResults : The maximum number of tasks per page.

Parameter nextToken : A pagination token to continue to the next page of tasks.

Parameter state : A structure used to filter the list of tasks.

Implementation

Future<ListTasksOutput> listTasks({
  int? maxResults,
  String? nextToken,
  TaskState? state,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final $query = <String, List<String>>{
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
    if (state != null) 'state': [state.value],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/tasks',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListTasksOutput.fromJson(response);
}