Merged
Conversation
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add get_all_workzones(limit=100) async generator that yields individual Workzone objects one by one, fetching pages on demand via get_workzones(). Implements lazy pagination using a true Python async generator with yield, reusing existing get_workzones() for consistent error handling. - Add AsyncGenerator import from collections.abc - Add 4 mocked tests in TestAsyncGetAllWorkzones - Regenerate docs/ENDPOINTS.md - Update README with async generator feature note Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add `_to_csv_param()` static helper to AsyncClientBase supporting CsvList, list[str], and str - Remove cross-module import of `_convert_model_to_api_params` from sync capacity.py - Replace 8+ inline isinstance(x, list) CSV conversions with `self._to_csv_param()` - Migrate update_quota, update_booking_closing_schedule, update_booking_statuses to `_patch_item()` - Migrate show_booking_grid to `_post_item()` 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…plication Closes #152 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Owner
Author
|
Closes #152 — refactored |
Implements lazy pagination of all resources using an async generator, following the same pattern as get_all_workzones (#112). - Add get_all_resources() to AsyncOFSCoreResourcesMixin in ofsc/async_client/core/resources.py, delegating to get_resources() with hasMore + offset loop, yielding individual Resource objects - Pass through all get_resources() params: fields, expand_inventories, expand_workskills, expand_workzones, expand_workschedules - Add TestAsyncGetAllResources (4 mocked tests) to tests/async/test_async_resources_get.py - Update README to mention get_all_resources in async generators section 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ainst manual pagination
…SCore 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Release 2.25.0 (minor)
This release adds async generator support for lazy iteration over large collections in both the metadata and core APIs, and refactors
async_client/capacity.pyto reduce code duplication.Changes
Async Generator:
get_all_workzones—AsyncOFSMetadata(#112)Adds
get_all_workzones(limit: int = 100) -> AsyncGenerator[Workzone, None]toAsyncOFSMetadata. Lazily paginates all workzones, yielding individualWorkzoneobjects one by one — no need to load the entire list into memory.Async Generator:
get_all_resources—AsyncOFSCore(#158)Applies the same lazy-iteration pattern to resources. Adds
get_all_resources(limit, fields, expand_*)toAsyncOFSCoreResourcesMixin. Supports all filter/expand parameters of the underlyingget_resourcescall and handles pagination automatically.Refactor:
async_client/capacity.pycode deduplication (#152)Extracts a
_to_csv_param()helper to eliminate repeated list-to-CSV conversions across ~10 methods, standardizesmodel_dump()usage, and cleans up cross-module import of the sync_convert_model_to_api_params().Closes
Checklist
🤖 Generated with Claude Code