Skip to content

list_automated_reasoning_policy_test_results

list_automated_reasoning_policy_test_results(
    policy_arn: AutomatedReasoningPolicyArn,
    build_workflow_id: AutomatedReasoningPolicyBuildWorkflowId,
    *,
    config_overrides: Optional[BedrockClientConfig] = None,
    next_token: Optional[PaginationToken] = None,
    max_results: Optional[MaxResults] = None,
) -> ListAutomatedReasoningPolicyTestResultsResponse

Lists test results for an Automated Reasoning policy, showing how the policy performed against various test scenarios and validation checks.

Parameters:

  • policy_arn (AutomatedReasoningPolicyArn) –

    The Amazon Resource Name (ARN) of the Automated Reasoning policy whose test results you want to list.

  • build_workflow_id (AutomatedReasoningPolicyBuildWorkflowId) –

    The unique identifier of the build workflow whose test results you want to list.

  • next_token (Optional[PaginationToken], default: None ) –

    A pagination token from a previous request to continue listing test results from where the previous request left off.

  • max_results (Optional[MaxResults], default: None ) –

    The maximum number of test results to return in a single response. Valid range is 1-100.

Raises:

Source code in docs_src/capo_bedrock/_services/bedrock.py
def list_automated_reasoning_policy_test_results(
    self,
    policy_arn: "capo_bedrock.types.automated_reasoning_policy_arn.AutomatedReasoningPolicyArn",
    build_workflow_id: "capo_bedrock.types.automated_reasoning_policy_build_workflow_id.AutomatedReasoningPolicyBuildWorkflowId",
    *,
    config_overrides: Optional[BedrockClientConfig] = None,
    next_token: Optional[
        "capo_bedrock.types.pagination_token.PaginationToken"
    ] = None,
    max_results: Optional["capo_bedrock.types.max_results.MaxResults"] = None,
) -> "capo_bedrock.types.list_automated_reasoning_policy_test_results_response.ListAutomatedReasoningPolicyTestResultsResponse":
    """<p>Lists test results for an Automated Reasoning policy, showing how the policy performed against various test scenarios and validation checks.</p>

    Args:
        policy_arn: <p>The Amazon Resource Name (ARN) of the Automated Reasoning policy whose test results you want to list.</p>
        build_workflow_id: <p>The unique identifier of the build workflow whose test results you want to list.</p>
        next_token: <p>A pagination token from a previous request to continue listing test results from where the previous request left off.</p>
        max_results: <p>The maximum number of test results to return in a single response. Valid range is 1-100.</p>

    Raises:
        capo_bedrock.errors.access_denied_exception.AccessDeniedException: <p>The request is denied because of missing access permissions.</p>
        capo_bedrock.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry your request.</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.list_automated_reasoning_policy_test_results_request.ListAutomatedReasoningPolicyTestResultsRequest]",
    ) -> OperationResponse[
        "capo_bedrock.types.list_automated_reasoning_policy_test_results_response.ListAutomatedReasoningPolicyTestResultsResponse"
    ]:
        import capo_bedrock._operations.amazon_bedrock_control_plane_service.list_automated_reasoning_policy_test_results

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

    def _redact_output(
        output: "capo_bedrock.types.list_automated_reasoning_policy_test_results_response.ListAutomatedReasoningPolicyTestResultsResponse",
    ) -> dict[str, Any]:
        import capo_bedrock.types.list_automated_reasoning_policy_test_results_response

        return capo_bedrock.types.list_automated_reasoning_policy_test_results_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "ListAutomatedReasoningPolicyTestResults", redact_output=_redact_output
        ),
    )
    input_: capo_bedrock.types.list_automated_reasoning_policy_test_results_request.ListAutomatedReasoningPolicyTestResultsRequest = {
        "policy_arn": policy_arn,
        "build_workflow_id": build_workflow_id,
    }
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

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