Skip to content

iter_list_usage_totals async

iter_list_usage_totals(
    *,
    config_overrides: Optional[AsyncInspector2ClientConfig] = None,
    max_results: Optional[ListUsageTotalsMaxResults] = None,
    next_token: Optional[ListUsageTotalsNextToken] = None,
    account_ids: Optional[UsageAccountIdList] = None,
) -> AsyncIterator[UsageTotal]
Source code in docs_src/capo_inspector2/_services/async_inspector2.py
async def iter_list_usage_totals(
    self,
    *,
    config_overrides: Optional[AsyncInspector2ClientConfig] = None,
    max_results: Optional[
        "capo_inspector2.types.list_usage_totals_max_results.ListUsageTotalsMaxResults"
    ] = None,
    next_token: Optional[
        "capo_inspector2.types.list_usage_totals_next_token.ListUsageTotalsNextToken"
    ] = None,
    account_ids: Optional[
        "capo_inspector2.types.usage_account_id_list.UsageAccountIdList"
    ] = None,
) -> "AsyncIterator[capo_inspector2.types.usage_total.UsageTotal]":
    _token = next_token
    while True:
        _response = await self.list_usage_totals(
            config_overrides=config_overrides,
            max_results=max_results,
            next_token=_token,
            account_ids=account_ids,
        )
        _page = _resolve_path(_response, ("totals",))
        for _item in _page or []:
            yield _item
        _token = _resolve_path(_response, ("next_token",))
        if not _token:
            break