updateContactEvaluation method

Future<UpdateContactEvaluationResponse> updateContactEvaluation({
  1. required String evaluationId,
  2. required String instanceId,
  3. Map<String, EvaluationAnswerInput>? answers,
  4. Map<String, EvaluationNote>? notes,
  5. EvaluatorUserUnion? updatedBy,
})

Updates details about a contact evaluation in the specified Connect Customer instance. A contact evaluation must be in draft state. Answers included in the request are merged with existing answers for the given evaluation. An answer or note can be deleted by passing an empty object ({}) to the question identifier.

May throw InternalServiceException. May throw InvalidParameterException. May throw ResourceConflictException. May throw ResourceNotFoundException. May throw ThrottlingException.

Parameter evaluationId : A unique identifier for the contact evaluation.

Parameter instanceId : The identifier of the Connect Customer instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.

Parameter answers : A map of question identifiers to answer value.

Parameter notes : A map of question identifiers to note value.

Parameter updatedBy : The ID of the user who updated the contact evaluation.

Implementation

Future<UpdateContactEvaluationResponse> updateContactEvaluation({
  required String evaluationId,
  required String instanceId,
  Map<String, EvaluationAnswerInput>? answers,
  Map<String, EvaluationNote>? notes,
  EvaluatorUserUnion? updatedBy,
}) async {
  final $payload = <String, dynamic>{
    if (answers != null) 'Answers': answers,
    if (notes != null) 'Notes': notes,
    if (updatedBy != null) 'UpdatedBy': updatedBy,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/contact-evaluations/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(evaluationId)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateContactEvaluationResponse.fromJson(response);
}