-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Labels
asyncAsync client implementationAsync client implementationcoreCore API moduleCore API moduleenhancementNew feature or requestNew feature or request
Description
User Story
As a developer using pyOFSC in async applications
I want async versions of resource GET (read-only) methods
So that I can fetch resource data without blocking in async/await contexts
Description
Implement async versions of all resource GET operations in AsyncOFSCore.
Methods to Implement (18 total)
Currently in Sync Client
get_resources()- GET/rest/ofscCore/v1/resourcesget_resource(resource_id)- GET/rest/ofscCore/v1/resources/{resourceId}get_resource_descendants(resource_id)- GET/rest/ofscCore/v1/resources/{resourceId}/descendantsget_resource_users(resource_id)- GET/rest/ofscCore/v1/resources/{resourceId}/usersget_resource_inventories(resource_id)- GET/rest/ofscCore/v1/resources/{resourceId}/inventoriesget_resource_workskills(resource_id)- GET/rest/ofscCore/v1/resources/{resourceId}/workSkillsget_resource_workzones(resource_id)- GET/rest/ofscCore/v1/resources/{resourceId}/workZonesget_resource_workschedules(resource_id)- GET/rest/ofscCore/v1/resources/{resourceId}/workSchedulesget_resource_calendar(resource_id)- GET/rest/ofscCore/v1/resources/{resourceId}/workSchedules/calendarViewget_resource_locations(resource_id)- GET/rest/ofscCore/v1/resources/{resourceId}/locationsget_position_history(resource_id)- GET/rest/ofscCore/v1/resources/{resourceId}/positionHistoryget_assigned_locations(resource_id)- GET/rest/ofscCore/v1/resources/{resourceId}/assignedLocationsget_resource_route(resource_id, date)- GET/rest/ofscCore/v1/resources/{resourceId}/routes/{date}
New Methods (Not in Sync)
get_resource_children(resource_id)- GET/rest/ofscCore/v1/resources/{resourceId}/childrenget_resource_assistants(resource_id)- GET/rest/ofscCore/v1/resources/{resourceId}/assistantsget_resource_location(resource_id, location_id)- GET/rest/ofscCore/v1/resources/{resourceId}/locations/{locationId}get_resource_plans(resource_id)- GET/rest/ofscCore/v1/resources/{resourceId}/plansget_calendars()- GET/rest/ofscCore/v1/calendars
Acceptance Criteria
- All methods use Pydantic models only (no raw dict responses)
- Models exist/created in
ofsc/models.pyfor all responses - Saved responses captured in
tests/saved_responses/resources/ - Live tests with
@pytest.mark.uses_real_datamarker - Model validation tests against saved responses
- Methods follow async pattern (httpx, error handling)
- All tests passing
Technical Design
File: ofsc/async_client/core.py
Pattern: Follow async metadata implementation pattern
Related Files
ofsc/async_client/core.py- Implement async methodsofsc/models.py- Resource modelstests/async/test_async_resources_get.py- Create test filetests/saved_responses/resources/- API response files
Metadata
Metadata
Assignees
Labels
asyncAsync client implementationAsync client implementationcoreCore API moduleCore API moduleenhancementNew feature or requestNew feature or request