Skip to content

iter_get_credit_allocation_history async

iter_get_credit_allocation_history(
    account_id: AccountId,
    start_date: datetime,
    end_date: datetime,
    *,
    config_overrides: Optional[AsyncBillingClientConfig] = None,
    credit_id: Optional[int] = None,
    next_token: Optional[PageToken] = None,
    max_results: Optional[int] = None,
) -> AsyncIterator[CreditAllocationHistoryEntry]
Source code in docs_src/capo_billing/_services/async_billing.py
async def iter_get_credit_allocation_history(
    self,
    account_id: "capo_billing.types.account_id.AccountId",
    start_date: datetime.datetime,
    end_date: datetime.datetime,
    *,
    config_overrides: Optional[AsyncBillingClientConfig] = None,
    credit_id: Optional[int] = None,
    next_token: Optional["capo_billing.types.page_token.PageToken"] = None,
    max_results: Optional[int] = None,
) -> "AsyncIterator[capo_billing.types.credit_allocation_history_entry.CreditAllocationHistoryEntry]":
    _token = next_token
    while True:
        _response = await self.get_credit_allocation_history(
            account_id,
            start_date,
            end_date,
            config_overrides=config_overrides,
            credit_id=credit_id,
            next_token=_token,
            max_results=max_results,
        )
        _page = _resolve_path(_response, ("credit_allocation_history_list",))
        for _item in _page or []:
            yield _item
        _token = _resolve_path(_response, ("next_token",))
        if not _token:
            break