getRecommendation method

Future<GetRecommendationResponse> getRecommendation({
  1. required String agentSpaceId,
  2. required String recommendationId,
  3. int? recommendationVersion,
})

Retrieves a specific recommendation by its ID

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

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

Parameter recommendationId : The unique identifier for the recommendation to retrieve

Parameter recommendationVersion : Specific version of the recommendation to retrieve. If not specified, returns the latest version.

Implementation

Future<GetRecommendationResponse> getRecommendation({
  required String agentSpaceId,
  required String recommendationId,
  int? recommendationVersion,
}) async {
  final $query = <String, List<String>>{
    if (recommendationVersion != null)
      'recommendationVersion': [recommendationVersion.toString()],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/backlog/agent-space/${Uri.encodeComponent(agentSpaceId)}/recommendations/${Uri.encodeComponent(recommendationId)}',
    queryParams: $query,
    hostPrefix: 'dp.',
    exceptionFnMap: _exceptionFns,
  );
  return GetRecommendationResponse.fromJson(response);
}