Skip to content

list_automated_reasoning_policy_test_cases

list_automated_reasoning_policy_test_cases(
    policy_arn: AutomatedReasoningPolicyArn,
    *,
    config_overrides: Optional[BedrockClientConfig] = None,
    next_token: Optional[PaginationToken] = None,
    max_results: Optional[MaxResults] = None,
) -> ListAutomatedReasoningPolicyTestCasesResponse

Lists tests for an Automated Reasoning policy. We recommend using pagination to ensure that the operation returns quickly and successfully.

Parameters:

  • policy_arn (AutomatedReasoningPolicyArn) –

    The Amazon Resource Name (ARN) of the Automated Reasoning policy for which to list tests.

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

    The pagination token from a previous request to retrieve the next page of results.

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

    The maximum number of tests to return in a single call.

Raises:

Source code in docs_src/capo_bedrock/_services/bedrock.py
def list_automated_reasoning_policy_test_cases(
    self,
    policy_arn: "capo_bedrock.types.automated_reasoning_policy_arn.AutomatedReasoningPolicyArn",
    *,
    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_cases_response.ListAutomatedReasoningPolicyTestCasesResponse":
    """<p>Lists tests for an Automated Reasoning policy. We recommend using pagination to ensure that the operation returns quickly and successfully.</p>

    Args:
        policy_arn: <p>The Amazon Resource Name (ARN) of the Automated Reasoning policy for which to list tests.</p>
        next_token: <p>The pagination token from a previous request to retrieve the next page of results.</p>
        max_results: <p>The maximum number of tests to return in a single call.</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.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_cases_request.ListAutomatedReasoningPolicyTestCasesRequest]",
    ) -> OperationResponse[
        "capo_bedrock.types.list_automated_reasoning_policy_test_cases_response.ListAutomatedReasoningPolicyTestCasesResponse"
    ]:
        import capo_bedrock._operations.amazon_bedrock_control_plane_service.list_automated_reasoning_policy_test_cases

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

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

        return capo_bedrock.types.list_automated_reasoning_policy_test_cases_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "ListAutomatedReasoningPolicyTestCases", redact_output=_redact_output
        ),
    )
    input_: capo_bedrock.types.list_automated_reasoning_policy_test_cases_request.ListAutomatedReasoningPolicyTestCasesRequest = {
        "policy_arn": policy_arn
    }
    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