startAutomatedReasoningPolicyTestWorkflow method

Future<StartAutomatedReasoningPolicyTestWorkflowResponse> startAutomatedReasoningPolicyTestWorkflow({
  1. required String buildWorkflowId,
  2. required String policyArn,
  3. String? clientRequestToken,
  4. List<String>? testCaseIds,
})

Initiates a test workflow to validate Automated Reasoning policy tests. The workflow executes the specified tests against the policy and generates validation results.

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

Parameter buildWorkflowId : The build workflow identifier. The build workflow must show a COMPLETED status before running tests.

Parameter policyArn : The Amazon Resource Name (ARN) of the Automated Reasoning policy to test.

Parameter clientRequestToken : A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request but doesn't return an error.

Parameter testCaseIds : The list of test identifiers to run. If not provided, all tests for the policy are run.

Implementation

Future<StartAutomatedReasoningPolicyTestWorkflowResponse>
    startAutomatedReasoningPolicyTestWorkflow({
  required String buildWorkflowId,
  required String policyArn,
  String? clientRequestToken,
  List<String>? testCaseIds,
}) async {
  final $payload = <String, dynamic>{
    'clientRequestToken': clientRequestToken ?? _s.generateIdempotencyToken(),
    if (testCaseIds != null) 'testCaseIds': testCaseIds,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/automated-reasoning-policies/${Uri.encodeComponent(policyArn)}/build-workflows/${Uri.encodeComponent(buildWorkflowId)}/test-workflows',
    exceptionFnMap: _exceptionFns,
  );
  return StartAutomatedReasoningPolicyTestWorkflowResponse.fromJson(response);
}