Skip to content

iter_list_objectives

iter_list_objectives(
    *,
    config_overrides: Optional[ControlCatalogClientConfig] = None,
    max_results: Optional[MaxListObjectivesResults] = None,
    next_token: Optional[PaginationToken] = None,
    objective_filter: Optional[ObjectiveFilter] = None,
) -> Iterator[ObjectiveSummary]
Source code in docs_src/capo_controlcatalog/_services/control_catalog.py
def iter_list_objectives(
    self,
    *,
    config_overrides: Optional[ControlCatalogClientConfig] = None,
    max_results: Optional[
        "capo_controlcatalog.types.max_list_objectives_results.MaxListObjectivesResults"
    ] = None,
    next_token: Optional[
        "capo_controlcatalog.types.pagination_token.PaginationToken"
    ] = None,
    objective_filter: Optional[
        "capo_controlcatalog.types.objective_filter.ObjectiveFilter"
    ] = None,
) -> "Iterator[capo_controlcatalog.types.objective_summary.ObjectiveSummary]":
    _token = next_token
    while True:
        _response = self.list_objectives(
            config_overrides=config_overrides,
            max_results=max_results,
            next_token=_token,
            objective_filter=objective_filter,
        )
        _page = _resolve_path(_response, ("objectives",))
        for _item in _page or []:
            yield _item
        _token = _resolve_path(_response, ("next_token",))
        if not _token:
            break