updateReviewTemplateAnswer method

Future<UpdateReviewTemplateAnswerOutput> updateReviewTemplateAnswer({
  1. required String lensAlias,
  2. required String questionId,
  3. required String templateArn,
  4. Map<String, ChoiceUpdate>? choiceUpdates,
  5. bool? isApplicable,
  6. String? notes,
  7. AnswerReason? reason,
  8. List<String>? selectedChoices,
})

Update a review template answer.

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

Parameter templateArn : The review template ARN.

Parameter choiceUpdates : A list of choices to be updated.

Parameter reason : The update reason.

Implementation

Future<UpdateReviewTemplateAnswerOutput> updateReviewTemplateAnswer({
  required String lensAlias,
  required String questionId,
  required String templateArn,
  Map<String, ChoiceUpdate>? choiceUpdates,
  bool? isApplicable,
  String? notes,
  AnswerReason? reason,
  List<String>? selectedChoices,
}) async {
  final $payload = <String, dynamic>{
    if (choiceUpdates != null) 'ChoiceUpdates': choiceUpdates,
    if (isApplicable != null) 'IsApplicable': isApplicable,
    if (notes != null) 'Notes': notes,
    if (reason != null) 'Reason': reason.value,
    if (selectedChoices != null) 'SelectedChoices': selectedChoices,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PATCH',
    requestUri:
        '/reviewTemplates/${Uri.encodeComponent(templateArn)}/lensReviews/${Uri.encodeComponent(lensAlias)}/answers/${Uri.encodeComponent(questionId)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateReviewTemplateAnswerOutput.fromJson(response);
}