Skip to content

describe_budgets async

describe_budgets(
    account_id: AccountId,
    *,
    config_overrides: Optional[AsyncBudgetsClientConfig] = None,
    max_results: Optional[MaxResultsDescribeBudgets] = None,
    next_token: Optional[GenericString] = None,
    show_filter_expression: Optional[NullableBoolean] = None,
) -> DescribeBudgetsResponse

Lists the budgets that are associated with an account.

The Request Syntax section shows the BudgetLimit syntax. For PlannedBudgetLimits, see the Examples section.

Parameters:

  • account_id (AccountId) –

    The accountId that is associated with the budgets that you want to describe.

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

    An integer that represents how many budgets a paginated response contains. The default is 100.

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

    The pagination token that you include in your request to indicate the next set of results that you want to retrieve.

  • show_filter_expression (Optional[NullableBoolean], default: None ) –

    Specifies whether the response includes the filter expression associated with the budgets. By showing the filter expression, you can see detailed filtering logic applied to the budgets, such as Amazon Web Services services or tags that are being tracked.

Raises:

Source code in docs_src/capo_budgets/_services/async_budgets.py
async def describe_budgets(
    self,
    account_id: "capo_budgets.types.account_id.AccountId",
    *,
    config_overrides: Optional[AsyncBudgetsClientConfig] = None,
    max_results: Optional[
        "capo_budgets.types.max_results_describe_budgets.MaxResultsDescribeBudgets"
    ] = None,
    next_token: Optional["capo_budgets.types.generic_string.GenericString"] = None,
    show_filter_expression: Optional[
        "capo_budgets.types.nullable_boolean.NullableBoolean"
    ] = None,
) -> "capo_budgets.types.describe_budgets_response.DescribeBudgetsResponse":
    """<p>Lists the budgets that are associated with an account.</p> <important> <p>The Request Syntax section shows the <code>BudgetLimit</code> syntax. For <code>PlannedBudgetLimits</code>, see the <a href="https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_budgets_DescribeBudgets.html#API_DescribeBudgets_Examples">Examples</a> section.</p> </important>

    Args:
        account_id: <p>The <code>accountId</code> that is associated with the budgets that you want to describe.</p>
        max_results: <p>An integer that represents how many budgets a paginated response contains. The default is 100.</p>
        next_token: <p>The pagination token that you include in your request to indicate the next set of results that you want to retrieve.</p>
        show_filter_expression: <p>Specifies whether the response includes the filter expression associated with the budgets. By showing the filter expression, you can see detailed filtering logic applied to the budgets, such as Amazon Web Services services or tags that are being tracked.</p>

    Raises:
        capo_budgets.errors.access_denied_exception.AccessDeniedException: <p>You are not authorized to use this operation with the given parameters.</p>
        capo_budgets.errors.expired_next_token_exception.ExpiredNextTokenException: <p>The pagination token expired.</p>
        capo_budgets.errors.internal_error_exception.InternalErrorException: <p>An error on the server occurred during the processing of your request. Try again later.</p>
        capo_budgets.errors.invalid_next_token_exception.InvalidNextTokenException: <p>The pagination token is invalid.</p>
        capo_budgets.errors.invalid_parameter_exception.InvalidParameterException: <p>An error on the client occurred. Typically, the cause is an invalid input value.</p>
        capo_budgets.errors.not_found_exception.NotFoundException: <p>We can’t locate the resource that you specified.</p>
        capo_budgets.errors.throttling_exception.ThrottlingException: <p>The number of API requests has exceeded the maximum allowed API request throttling limit for the account.</p>
        capo_budgets.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_budgets.types.describe_budgets_request.DescribeBudgetsRequest]",
    ) -> AsyncOperationResponse[
        "capo_budgets.types.describe_budgets_response.DescribeBudgetsResponse"
    ]:
        import capo_budgets._operations.aws_budget_service_gateway.describe_budgets

        (
            output,
            http_response,
        ) = await capo_budgets._operations.aws_budget_service_gateway.describe_budgets.async_describe_budgets(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeBudgets")
    )
    input_: capo_budgets.types.describe_budgets_request.DescribeBudgetsRequest = {
        "account_id": account_id
    }
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token
    if show_filter_expression is not None:
        input_["show_filter_expression"] = show_filter_expression

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output