updateEvaluationForm method

Future<UpdateEvaluationFormResponse> updateEvaluationForm({
  1. required String evaluationFormId,
  2. required int evaluationFormVersion,
  3. required String instanceId,
  4. required List<EvaluationFormItem> items,
  5. required String title,
  6. bool? asDraft,
  7. EvaluationFormAutoEvaluationConfiguration? autoEvaluationConfiguration,
  8. String? clientToken,
  9. bool? createNewVersion,
  10. String? description,
  11. EvaluationFormLanguageConfiguration? languageConfiguration,
  12. EvaluationReviewConfiguration? reviewConfiguration,
  13. EvaluationFormScoringStrategy? scoringStrategy,
  14. EvaluationFormTargetConfiguration? targetConfiguration,
})

Updates details about a specific evaluation form version in the specified Connect Customer instance. Question and section identifiers cannot be duplicated within the same evaluation form.

This operation does not support partial updates. Instead it does a full update of evaluation form content.

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

Parameter evaluationFormId : The unique identifier for the evaluation form.

Parameter evaluationFormVersion : A version of the evaluation form to update.

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 items : Items that are part of the evaluation form. The total number of sections and questions must not exceed 100 each. Questions must be contained in a section.

Parameter title : A title of the evaluation form.

Parameter asDraft : A boolean flag indicating whether to update evaluation form to draft state.

Parameter autoEvaluationConfiguration : Whether automated evaluations are enabled.

Parameter clientToken : A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see Making retries safe with idempotent APIs.

Parameter createNewVersion : A flag indicating whether the operation must create a new version.

Parameter description : The description of the evaluation form.

Parameter languageConfiguration : Configuration for language settings of the evaluation form.

Parameter reviewConfiguration : Configuration for evaluation review settings of the evaluation form.

Parameter scoringStrategy : A scoring strategy of the evaluation form.

Parameter targetConfiguration : Configuration that specifies the target for the evaluation form.

Implementation

Future<UpdateEvaluationFormResponse> updateEvaluationForm({
  required String evaluationFormId,
  required int evaluationFormVersion,
  required String instanceId,
  required List<EvaluationFormItem> items,
  required String title,
  bool? asDraft,
  EvaluationFormAutoEvaluationConfiguration? autoEvaluationConfiguration,
  String? clientToken,
  bool? createNewVersion,
  String? description,
  EvaluationFormLanguageConfiguration? languageConfiguration,
  EvaluationReviewConfiguration? reviewConfiguration,
  EvaluationFormScoringStrategy? scoringStrategy,
  EvaluationFormTargetConfiguration? targetConfiguration,
}) async {
  final $payload = <String, dynamic>{
    'EvaluationFormVersion': evaluationFormVersion,
    'Items': items,
    'Title': title,
    if (asDraft != null) 'AsDraft': asDraft,
    if (autoEvaluationConfiguration != null)
      'AutoEvaluationConfiguration': autoEvaluationConfiguration,
    'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (createNewVersion != null) 'CreateNewVersion': createNewVersion,
    if (description != null) 'Description': description,
    if (languageConfiguration != null)
      'LanguageConfiguration': languageConfiguration,
    if (reviewConfiguration != null)
      'ReviewConfiguration': reviewConfiguration,
    if (scoringStrategy != null) 'ScoringStrategy': scoringStrategy,
    if (targetConfiguration != null)
      'TargetConfiguration': targetConfiguration,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri:
        '/evaluation-forms/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(evaluationFormId)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateEvaluationFormResponse.fromJson(response);
}