startAutomatedReasoningPolicyBuildWorkflow method

Future<StartAutomatedReasoningPolicyBuildWorkflowResponse> startAutomatedReasoningPolicyBuildWorkflow({
  1. required AutomatedReasoningPolicyBuildWorkflowType buildWorkflowType,
  2. required String policyArn,
  3. required AutomatedReasoningPolicyBuildWorkflowSource sourceContent,
  4. String? clientRequestToken,
})

Starts a new build workflow for an Automated Reasoning policy. This initiates the process of analyzing source documents and generating policy rules, variables, and types.

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

Parameter buildWorkflowType : The type of build workflow to start (e.g., DOCUMENT_INGESTION for processing new documents, POLICY_REPAIR for fixing existing policies).

Parameter policyArn : The Amazon Resource Name (ARN) of the Automated Reasoning policy for which to start the build workflow.

Parameter sourceContent : The source content for the build workflow, such as documents to analyze or repair instructions for existing policies.

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

Implementation

Future<StartAutomatedReasoningPolicyBuildWorkflowResponse>
    startAutomatedReasoningPolicyBuildWorkflow({
  required AutomatedReasoningPolicyBuildWorkflowType buildWorkflowType,
  required String policyArn,
  required AutomatedReasoningPolicyBuildWorkflowSource sourceContent,
  String? clientRequestToken,
}) async {
  final headers = <String, String>{
    if (clientRequestToken != null)
      'x-amz-client-token': clientRequestToken.toString(),
  };
  final response = await _protocol.send(
    payload: sourceContent,
    method: 'POST',
    requestUri:
        '/automated-reasoning-policies/${Uri.encodeComponent(policyArn)}/build-workflows/${Uri.encodeComponent(buildWorkflowType.value)}/start',
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
  return StartAutomatedReasoningPolicyBuildWorkflowResponse.fromJson(
      response);
}