updateTestCase method

Future<void> updateTestCase({
  1. required String instanceId,
  2. required String testCaseId,
  3. String? content,
  4. String? description,
  5. TestCaseEntryPoint? entryPoint,
  6. String? initializationData,
  7. String? lastModifiedRegion,
  8. DateTime? lastModifiedTime,
  9. String? name,
  10. TestCaseStatus? status,
})

Updates any of the metadata for a test case, such as the name, description, and status or content of an existing test case. This API doesn't allow customers to update the tags of the test case resource for the specified Amazon Connect instance.

May throw AccessDeniedException. May throw DuplicateResourceException. May throw InternalServiceException. May throw InvalidParameterException. May throw InvalidRequestException. May throw InvalidTestCaseException. May throw ResourceNotFoundException. May throw ThrottlingException.

Parameter instanceId : The identifier of the Amazon Connect instance.

Parameter testCaseId : The identifier of the test case to update.

Parameter content : The JSON string that represents the content of the test.

Parameter description : The description of the test case.

Parameter entryPoint : Defines the starting point for your test.

Parameter initializationData : Defines the test attributes for precise data representation.

Parameter lastModifiedRegion : The region in which the resource was last modified

Parameter lastModifiedTime : The time at which the resource was last modified.

Parameter name : The name of the test case.

Parameter status : Indicates the test status as either SAVED or PUBLISHED. The PUBLISHED status will initiate validation on the content. The SAVED status does not initiate validation of the content.

Implementation

Future<void> updateTestCase({
  required String instanceId,
  required String testCaseId,
  String? content,
  String? description,
  TestCaseEntryPoint? entryPoint,
  String? initializationData,
  String? lastModifiedRegion,
  DateTime? lastModifiedTime,
  String? name,
  TestCaseStatus? status,
}) async {
  final headers = <String, String>{
    if (lastModifiedRegion != null)
      'x-amz-last-modified-region': lastModifiedRegion.toString(),
    if (lastModifiedTime != null)
      'x-amz-last-modified-time': _s.rfc822ToJson(lastModifiedTime),
  };
  final $payload = <String, dynamic>{
    if (content != null) 'Content': content,
    if (description != null) 'Description': description,
    if (entryPoint != null) 'EntryPoint': entryPoint,
    if (initializationData != null) 'InitializationData': initializationData,
    if (name != null) 'Name': name,
    if (status != null) 'Status': status.value,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/test-cases/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(testCaseId)}',
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
}