Skip to content

iter_list_investigations async

iter_list_investigations(
    case_id: CaseId,
    *,
    config_overrides: Optional[AsyncSecurityIRClientConfig] = None,
    next_token: Optional[str] = None,
    max_results: Optional[int] = None,
) -> AsyncIterator[InvestigationAction]
Source code in docs_src/capo_security_ir/_services/async_security_ir.py
async def iter_list_investigations(
    self,
    case_id: "capo_security_ir.types.case_id.CaseId",
    *,
    config_overrides: Optional[AsyncSecurityIRClientConfig] = None,
    next_token: Optional[str] = None,
    max_results: Optional[int] = None,
) -> (
    "AsyncIterator[capo_security_ir.types.investigation_action.InvestigationAction]"
):
    _token = next_token
    while True:
        _response = await self.list_investigations(
            case_id,
            config_overrides=config_overrides,
            next_token=_token,
            max_results=max_results,
        )
        _page = _resolve_path(_response, ("investigation_actions",))
        for _item in _page or []:
            yield _item
        _token = _resolve_path(_response, ("next_token",))
        if not _token:
            break