Skip to content

Refactor(policy-set): convert list to Iterator pattern#95

Open
TanyaSingh369-svg wants to merge 1 commit intohashicorp:next-0.1.3from
TanyaSingh369-svg:refactor/iterator-pattern/policy-set
Open

Refactor(policy-set): convert list to Iterator pattern#95
TanyaSingh369-svg wants to merge 1 commit intohashicorp:next-0.1.3from
TanyaSingh369-svg:refactor/iterator-pattern/policy-set

Conversation

@TanyaSingh369-svg
Copy link

@TanyaSingh369-svg TanyaSingh369-svg commented Feb 25, 2026

Description

Refactored Policy Set resource listing from the previous ModelList-style return to an Iterator pattern.

This aligns PolicySets.list() with other iterator-based resources and enables lazy pagination via the shared _Service._list helper.

Changes include :

-- Converted PolicySets.list() to return Iterator[PolicySet] (generator-based) instead of a list wrapper

-- Removed unused PolicySetList import from policy_set.py

Testing

-- 396 unit tests passing

-- Examples compile successfully

-- No public API breaking changes

-- Models unchanged for backward compatibility

Output from tests

image

Output from examples

image

@TanyaSingh369-svg TanyaSingh369-svg requested a review from a team as a code owner February 25, 2026 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant