Skip to content

start_automated_reasoning_policy_build_workflow

start_automated_reasoning_policy_build_workflow(
    policy_arn: AutomatedReasoningPolicyArn,
    build_workflow_type: AutomatedReasoningPolicyBuildWorkflowType,
    source_content: AutomatedReasoningPolicyBuildWorkflowSource,
    *,
    config_overrides: Optional[BedrockClientConfig] = None,
    client_request_token: Optional[IdempotencyToken] = None,
) -> StartAutomatedReasoningPolicyBuildWorkflowResponse

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.

Parameters:

  • policy_arn (AutomatedReasoningPolicyArn) –

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

  • build_workflow_type (AutomatedReasoningPolicyBuildWorkflowType) –

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

  • client_request_token (Optional[IdempotencyToken], default: None ) –

    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.

  • source_content (AutomatedReasoningPolicyBuildWorkflowSource) –

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

Raises:

  • AccessDeniedException –

    The request is denied because of missing access permissions.

  • ConflictException –

    Error occurred because of a conflict while performing an operation.

  • InternalServerException –

    An internal server error occurred. Retry your request.

  • ResourceInUseException –

    Thrown when attempting to delete or modify a resource that is currently being used by other resources or operations. For example, trying to delete an Automated Reasoning policy that is referenced by an active guardrail.

  • ResourceNotFoundException –

    The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.

  • ServiceQuotaExceededException –

    The number of requests exceeds the service quota. Resubmit your request later.

  • ThrottlingException –

    The number of requests exceeds the limit. Resubmit your request later.

  • ValidationException –

    Input validation failed. Check your request parameters and retry the request.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_bedrock/_services/bedrock.py
def start_automated_reasoning_policy_build_workflow(
    self,
    policy_arn: "capo_bedrock.types.automated_reasoning_policy_arn.AutomatedReasoningPolicyArn",
    build_workflow_type: "capo_bedrock.types.automated_reasoning_policy_build_workflow_type.AutomatedReasoningPolicyBuildWorkflowType",
    source_content: "capo_bedrock.types.automated_reasoning_policy_build_workflow_source.AutomatedReasoningPolicyBuildWorkflowSource",
    *,
    config_overrides: Optional[BedrockClientConfig] = None,
    client_request_token: Optional[
        "capo_bedrock.types.idempotency_token.IdempotencyToken"
    ] = None,
) -> "capo_bedrock.types.start_automated_reasoning_policy_build_workflow_response.StartAutomatedReasoningPolicyBuildWorkflowResponse":
    """<p>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.</p>

    Args:
        policy_arn: <p>The Amazon Resource Name (ARN) of the Automated Reasoning policy for which to start the build workflow.</p>
        build_workflow_type: <p>The type of build workflow to start (e.g., DOCUMENT_INGESTION for processing new documents, POLICY_REPAIR for fixing existing policies).</p>
        client_request_token: <p>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.</p>
        source_content: <p>The source content for the build workflow, such as documents to analyze or repair instructions for existing policies.</p>

    Raises:
        capo_bedrock.errors.access_denied_exception.AccessDeniedException: <p>The request is denied because of missing access permissions.</p>
        capo_bedrock.errors.conflict_exception.ConflictException: <p>Error occurred because of a conflict while performing an operation.</p>
        capo_bedrock.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry your request.</p>
        capo_bedrock.errors.resource_in_use_exception.ResourceInUseException: <p>Thrown when attempting to delete or modify a resource that is currently being used by other resources or operations. For example, trying to delete an Automated Reasoning policy that is referenced by an active guardrail.</p>
        capo_bedrock.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.</p>
        capo_bedrock.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The number of requests exceeds the service quota. Resubmit your request later.</p>
        capo_bedrock.errors.throttling_exception.ThrottlingException: <p>The number of requests exceeds the limit. Resubmit your request later.</p>
        capo_bedrock.errors.validation_exception.ValidationException: <p>Input validation failed. Check your request parameters and retry the request.</p>
        capo_bedrock.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_bedrock.types.start_automated_reasoning_policy_build_workflow_request.StartAutomatedReasoningPolicyBuildWorkflowRequest]",
    ) -> OperationResponse[
        "capo_bedrock.types.start_automated_reasoning_policy_build_workflow_response.StartAutomatedReasoningPolicyBuildWorkflowResponse"
    ]:
        import capo_bedrock._operations.amazon_bedrock_control_plane_service.start_automated_reasoning_policy_build_workflow

        output, http_response = (
            capo_bedrock._operations.amazon_bedrock_control_plane_service.start_automated_reasoning_policy_build_workflow.start_automated_reasoning_policy_build_workflow(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_bedrock.types.start_automated_reasoning_policy_build_workflow_request.StartAutomatedReasoningPolicyBuildWorkflowRequest",
    ) -> dict[str, Any]:
        import capo_bedrock.types.start_automated_reasoning_policy_build_workflow_request

        return capo_bedrock.types.start_automated_reasoning_policy_build_workflow_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "StartAutomatedReasoningPolicyBuildWorkflow", redact_input=_redact_input
        ),
    )
    input_: capo_bedrock.types.start_automated_reasoning_policy_build_workflow_request.StartAutomatedReasoningPolicyBuildWorkflowRequest = {
        "policy_arn": policy_arn,
        "build_workflow_type": build_workflow_type,
        "source_content": source_content,
    }
    if client_request_token is None:
        client_request_token = str(uuid.uuid4())
    input_["client_request_token"] = client_request_token

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output