updateRecommendation method

Future<UpdateRecommendationResponse> updateRecommendation({
  1. required String agentSpaceId,
  2. required String recommendationId,
  3. String? additionalContext,
  4. String? clientToken,
  5. RecommendationStatus? status,
})

Updates an existing recommendation with new content, status, or metadata

May throw AccessDeniedException. May throw ConflictException. 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 update

Parameter additionalContext : Additional context for recommendation

Parameter clientToken : A unique token that ensures idempotency of the request

Parameter status : Current status of the recommendation

Implementation

Future<UpdateRecommendationResponse> updateRecommendation({
  required String agentSpaceId,
  required String recommendationId,
  String? additionalContext,
  String? clientToken,
  RecommendationStatus? status,
}) async {
  final $payload = <String, dynamic>{
    if (additionalContext != null) 'additionalContext': additionalContext,
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (status != null) 'status': status.value,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PATCH',
    requestUri:
        '/backlog/agent-space/${Uri.encodeComponent(agentSpaceId)}/recommendations/${Uri.encodeComponent(recommendationId)}',
    hostPrefix: 'dp.',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateRecommendationResponse.fromJson(response);
}