Skip to content

iter_list_goals async

iter_list_goals(
    agent_space_id: AgentSpaceIdentifier,
    *,
    config_overrides: Optional[AsyncDevOpsAgentClientConfig] = None,
    status: Optional[GoalStatus] = None,
    goal_type: Optional[GoalType] = None,
    limit: Optional[int] = None,
    next_token: Optional[NextToken] = None,
) -> AsyncIterator[Goal]
Source code in docs_src/capo_devops_agent/_services/async_dev_ops_agent.py
async def iter_list_goals(
    self,
    agent_space_id: "capo_devops_agent.types.agent_space_identifier.AgentSpaceIdentifier",
    *,
    config_overrides: Optional[AsyncDevOpsAgentClientConfig] = None,
    status: Optional["capo_devops_agent.types.goal_status.GoalStatus"] = None,
    goal_type: Optional["capo_devops_agent.types.goal_type.GoalType"] = None,
    limit: Optional[int] = None,
    next_token: Optional["capo_devops_agent.types.next_token.NextToken"] = None,
) -> "AsyncIterator[capo_devops_agent.types.goal.Goal]":
    _token = next_token
    while True:
        _response = await self.list_goals(
            agent_space_id,
            config_overrides=config_overrides,
            status=status,
            goal_type=goal_type,
            limit=limit,
            next_token=_token,
        )
        _page = _resolve_path(_response, ("goals",))
        for _item in _page or []:
            yield _item
        _token = _resolve_path(_response, ("next_token",))
        if not _token:
            break