Skip to content

Migrate SDK to new agent-stack API response format#2

Open
amalshaji-plivo wants to merge 1 commit intoplivo:mainfrom
amalshaji-plivo:fix/migrate-to-new-api-response-format
Open

Migrate SDK to new agent-stack API response format#2
amalshaji-plivo wants to merge 1 commit intoplivo:mainfrom
amalshaji-plivo:fix/migrate-to-new-api-response-format

Conversation

@amalshaji-plivo
Copy link
Contributor

Summary

  • Update test mocks and assertions to match the standardized Plivo flat JSON response format from agent-stack PR #19 (fix/api-response-cleanup)
  • POST/action endpoints now return 201 with api_id + message fields
  • List endpoints use "objects" (not "data") and "meta" with {limit, offset, total_count, previous, next}
  • GET single-resource endpoints include api_id at root
  • Update AgentResource.list() docstring to document new response shape

Verified against:

  • agent-stack/plivo-voice-core/crates/api/src/response.rsApiResponse<T> struct
  • agent-stack/plivo-voice-core/crates/api/src/models.rsPaginatedResponse, PaginationMeta, ConnectCallResponse, AssignNumberResponse
  • agent-stack/plivo-voice-core/crates/api/src/routes/ — all route handlers
  • references/plivo-python/plivo/base.pyMeta class, ListResponseObject (confirms objects/meta/api_id convention)

Test plan

  • pytest tests/ -v — all 73 tests pass
  • ruff check src/ tests/ — clean

Update mock responses and assertions to match the standardized
response format from agent-stack PR #19: api_id at root, objects/meta
for lists, 201 status for POST/action endpoints.
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