Skip to content

list_automated_reasoning_policies

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

Lists all Automated Reasoning policies in your account, with optional filtering by policy ARN. This helps you manage and discover existing policies.

Parameters:

  • policy_arn (Optional[AutomatedReasoningPolicyArn], default: None ) –

    Optional filter to list only the policy versions with the specified Amazon Resource Name (ARN). If not provided, the DRAFT versions for all policies are listed.

  • 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 policies to return in a single call.

Raises:

Source code in docs_src/capo_bedrock/_services/bedrock.py
def list_automated_reasoning_policies(
    self,
    *,
    config_overrides: Optional[BedrockClientConfig] = None,
    policy_arn: Optional[
        "capo_bedrock.types.automated_reasoning_policy_arn.AutomatedReasoningPolicyArn"
    ] = 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_policies_response.ListAutomatedReasoningPoliciesResponse":
    """<p>Lists all Automated Reasoning policies in your account, with optional filtering by policy ARN. This helps you manage and discover existing policies.</p>

    Args:
        policy_arn: <p>Optional filter to list only the policy versions with the specified Amazon Resource Name (ARN). If not provided, the DRAFT versions for all policies are listed.</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 policies 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_policies_request.ListAutomatedReasoningPoliciesRequest]",
    ) -> OperationResponse[
        "capo_bedrock.types.list_automated_reasoning_policies_response.ListAutomatedReasoningPoliciesResponse"
    ]:
        import capo_bedrock._operations.amazon_bedrock_control_plane_service.list_automated_reasoning_policies

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

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

        return capo_bedrock.types.list_automated_reasoning_policies_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "ListAutomatedReasoningPolicies", redact_output=_redact_output
        ),
    )
    input_: capo_bedrock.types.list_automated_reasoning_policies_request.ListAutomatedReasoningPoliciesRequest = {}
    if policy_arn is not None:
        input_["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