Skip to content

iter_list_entities_for_policy

iter_list_entities_for_policy(
    policy_arn: arnType,
    *,
    config_overrides: Optional[IAMClientConfig] = None,
    entity_filter: Optional[EntityType] = None,
    path_prefix: Optional[pathType] = None,
    policy_usage_filter: Optional[PolicyUsageType] = None,
    marker: Optional[markerType] = None,
    max_items: Optional[maxItemsType] = None,
) -> Iterator[ListEntitiesForPolicyResponse]
Source code in docs_src/capo_iam/_services/iam.py
def iter_list_entities_for_policy(
    self,
    policy_arn: "capo_iam.types.arn_type.arnType",
    *,
    config_overrides: Optional[IAMClientConfig] = None,
    entity_filter: Optional["capo_iam.types.entity_type.EntityType"] = None,
    path_prefix: Optional["capo_iam.types.path_type.pathType"] = 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.list_entities_for_policy_response.ListEntitiesForPolicyResponse]":
    _token = marker
    while True:
        _response = self.list_entities_for_policy(
            policy_arn,
            config_overrides=config_overrides,
            entity_filter=entity_filter,
            path_prefix=path_prefix,
            policy_usage_filter=policy_usage_filter,
            marker=_token,
            max_items=max_items,
        )
        yield _response
        _token = _resolve_path(_response, ("marker",))
        if not _token or not _resolve_path(_response, ("is_truncated",)):
            break