Skip to content

iter_list_contracts async

iter_list_contracts(
    *,
    config_overrides: Optional[AsyncBillingClientConfig] = None,
    next_token: Optional[PageToken] = None,
    max_results: Optional[int] = None,
) -> AsyncIterator[ContractSummary]
Source code in docs_src/capo_billing/_services/async_billing.py
async def iter_list_contracts(
    self,
    *,
    config_overrides: Optional[AsyncBillingClientConfig] = None,
    next_token: Optional["capo_billing.types.page_token.PageToken"] = None,
    max_results: Optional[int] = None,
) -> "AsyncIterator[capo_billing.types.contract_summary.ContractSummary]":
    _token = next_token
    while True:
        _response = await self.list_contracts(
            config_overrides=config_overrides,
            next_token=_token,
            max_results=max_results,
        )
        _page = _resolve_path(_response, ("items",))
        for _item in _page or []:
            yield _item
        _token = _resolve_path(_response, ("next_token",))
        if not _token:
            break