listRecommendations method

Future<ListRecommendationsResponse> listRecommendations({
  1. required String agentSpaceId,
  2. String? goalId,
  3. int? limit,
  4. String? nextToken,
  5. RecommendationPriority? priority,
  6. RecommendationStatus? status,
  7. String? taskId,
})

Lists recommendations for the specified agent space

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

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

Parameter goalId : Optional goal ID to filter recommendations by specific goal

Parameter limit : Maximum number of recommendations to return in a single response

Parameter nextToken : Token for retrieving the next page of results

Parameter priority : Optional priority to filter recommendations by priority level

Parameter status : Optional status to filter recommendations by their current status

Parameter taskId : Optional task ID to filter recommendations by specific task

Implementation

Future<ListRecommendationsResponse> listRecommendations({
  required String agentSpaceId,
  String? goalId,
  int? limit,
  String? nextToken,
  RecommendationPriority? priority,
  RecommendationStatus? status,
  String? taskId,
}) async {
  final $payload = <String, dynamic>{
    if (goalId != null) 'goalId': goalId,
    if (limit != null) 'limit': limit,
    if (nextToken != null) 'nextToken': nextToken,
    if (priority != null) 'priority': priority.value,
    if (status != null) 'status': status.value,
    if (taskId != null) 'taskId': taskId,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/backlog/agent-space/${Uri.encodeComponent(agentSpaceId)}/recommendations/list',
    hostPrefix: 'dp.',
    exceptionFnMap: _exceptionFns,
  );
  return ListRecommendationsResponse.fromJson(response);
}