def iter_list_policies(
self,
*,
config_overrides: Optional[IAMClientConfig] = 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,
) -> "Iterator[capo_iam.types.policy.Policy]":
_token = marker
while True:
_response = 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