submitContactEvaluation method

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

Submits a contact evaluation in the specified Connect Customer instance. Answers included in the request are merged with existing answers for the given evaluation. If no answers or notes are passed, the evaluation is submitted with the existing answers and notes. You can delete an answer or note by passing an empty object ({}) to the question identifier.

If a contact evaluation is already in submitted state, this operation will trigger a resubmission.

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 submittedBy : The ID of the user who submitted the contact evaluation.

Implementation

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