Skip to content

iter_list_policies async

iter_list_policies(
    *,
    config_overrides: Optional[AsyncIAMClientConfig] = None,
    scope: Optional[policyScopeType] = None,
    only_attached: Optional[booleanType] = None,
    path_prefix: Optional[policyPathType] = None,
    policy_usage_filter: Optional[PolicyUsageType] = None,
    marker: Optional[markerType] = None,
    max_items: Optional[maxItemsType] = None,
) -> AsyncIterator[Policy]
Source code in docs_src/capo_iam/_services/async_iam.py
async def iter_list_policies(
    self,
    *,
    config_overrides: Optional[AsyncIAMClientConfig] = None,
    scope: Optional["capo_iam.types.policy_scope_type.policyScopeType"] = None,
    only_attached: Optional["capo_iam.types.boolean_type.booleanType"] = None,
    path_prefix: Optional["capo_iam.types.policy_path_type.policyPathType"] = None,
    policy_usage_filter: Optional[
        "capo_iam.types.policy_usage_type.PolicyUsageType"
    ] = None,
    marker: Optional["capo_iam.types.marker_type.markerType"] = None,
    max_items: Optional["capo_iam.types.max_items_type.maxItemsType"] = None,
) -> "AsyncIterator[capo_iam.types.policy.Policy]":
    _token = marker
    while True:
        _response = await self.list_policies(
            config_overrides=config_overrides,
            scope=scope,
            only_attached=only_attached,
            path_prefix=path_prefix,
            policy_usage_filter=policy_usage_filter,
            marker=_token,
            max_items=max_items,
        )
        _page = _resolve_path(_response, ("policies",))
        for _item in _page or []:
            yield _item
        _token = _resolve_path(_response, ("marker",))
        if not _token or not _resolve_path(_response, ("is_truncated",)):
            break