listBacklogTasks method

Future<ListBacklogTasksResponse> listBacklogTasks({
  1. required String agentSpaceId,
  2. TaskFilter? filter,
  3. int? limit,
  4. String? nextToken,
  5. TaskSortOrder? order,
  6. TaskSortField? sortField,
})

Lists backlog tasks in the specified agent space with optional filtering and sorting

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

Parameter agentSpaceId : The unique identifier for the agent space containing the tasks

Parameter filter : Filter criteria to apply when listing tasks Filtering restrictions: - Each filter field list is limited to a single value - Filtering by Priority and Status at the same time when not filtering by Type is not permitted - Timestamp filters (createdAfter, createdBefore) can be combined with other filters when not sorting by priority

Parameter limit : Maximum number of tasks to return in a single response (1-1000, default: 100)

Parameter nextToken : Token for retrieving the next page of results

Parameter order : Sort order for the tasks based on sortField (default: DESC)

Parameter sortField : Field to sort by Sorting restrictions: - Only sorting on createdAt is supported when using priority or status filters alone. - Sorting by priority is not supported when using Timestamp filters (createdAfter, createdBefore)

Implementation

Future<ListBacklogTasksResponse> listBacklogTasks({
  required String agentSpaceId,
  TaskFilter? filter,
  int? limit,
  String? nextToken,
  TaskSortOrder? order,
  TaskSortField? sortField,
}) async {
  final $payload = <String, dynamic>{
    if (filter != null) 'filter': filter,
    if (limit != null) 'limit': limit,
    if (nextToken != null) 'nextToken': nextToken,
    if (order != null) 'order': order.value,
    if (sortField != null) 'sortField': sortField.value,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/backlog/agent-space/${Uri.encodeComponent(agentSpaceId)}/tasks/list',
    hostPrefix: 'dp.',
    exceptionFnMap: _exceptionFns,
  );
  return ListBacklogTasksResponse.fromJson(response);
}