Skip to content

Comments

feat: sync upstream schemas and add get_media_buys#136

Merged
bokelley merged 5 commits intomainfrom
bokelley/media-buys-sync
Feb 23, 2026
Merged

feat: sync upstream schemas and add get_media_buys#136
bokelley merged 5 commits intomainfrom
bokelley/media-buys-sync

Conversation

@bokelley
Copy link
Contributor

Summary

  • Synced 305 schemas from adcontextprotocol.org (26 updated, including new get-media-buys-request/response, creative-feature-result, creative-approval-status and updates to catalog, media-buy, package, pricing-option, and protocol schemas)
  • Added CatalogType.app to match upstream enum update
  • Implemented get_media_buys across the full SDK stack: abstract base, A2A adapter, MCP adapter, client, and type exports

Test plan

  • 622 unit tests passing (pytest tests/ --ignore=tests/integration)
  • test_get_media_buys_parses_response — validates response deserialization into typed GetMediaBuysResponse with nested packages/creative approvals
  • test_all_client_methods — confirms get_media_buys method exists on client
  • test_method_calls_correct_tool_name[get_media_buys-...] — confirms adapter dispatch
  • test_request_response_types_are_exported — confirms GetMediaBuysRequest / GetMediaBuysResponse exported from top-level adcp package
  • ruff linting passes
  • black formatting applied

🤖 Generated with Claude Code

bokelley and others added 5 commits February 22, 2026 20:30
- Sync 305 schemas from adcontextprotocol.org, including new
  get-media-buys-request/response schemas and updates to catalog,
  media-buy, package, pricing-option, and protocol schemas
- Add CatalogType.app enum value from upstream schema update
- Add GetMediaBuysRequest/GetMediaBuysResponse generated types
- Implement get_media_buys on ProtocolAdapter (abstract), A2AAdapter,
  MCPAdapter, and ADCPClient
- Export GetMediaBuysRequest/GetMediaBuysResponse from adcp.types and
  the top-level adcp package
- Add response deserialization test and public API export test

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add DeliveryStatus (superset from get_media_buys_response, includes
  not_delivering) and Package as MediaBuyPackage to _generated.py imports
- Export CreativeApproval, DeliveryStatus, MediaBuyPackage, Snapshot,
  SnapshotUnavailableReason from adcp.types and the top-level adcp package
- Add snapshot deserialization test covering delivering, not_delivering,
  and snapshot_unavailable_reason paths
- Add new types to test_public_api.py export coverage

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ryStatus aliases

- Add get_media_buys_response to known_collisions for Package and DeliveryStatus
  so the script generates qualified imports (_PackageFromGetMediaBuysResponse,
  _DeliveryStatusFromGetMediaBuysResponse)
- Add MediaBuyPackage = _PackageFromGetMediaBuysResponse alias (distinct enriched
  package view from get_media_buys endpoint)
- Add DeliveryStatus = _DeliveryStatusFromGetMediaBuysResponse alias (superset
  that includes not_delivering, needed for automated-optimization use cases)
- Regenerate _generated.py with new aliases (724 total exports)
- Fix ruff I001 import sort in adcp/__init__.py

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rify adapter params in tests

- Filter out underscore-prefixed names from _generated.py __all__ so internal
  collision aliases (_PackageFromPackage, _DeliveryStatusFrom*) don't appear
  in public exports or IDE autocomplete
- Add adapter call param assertions to get_media_buys tests: verify
  get_media_buys(account_id="acct-1") → adapter called with
  {"account_id": "acct-1", "include_snapshot": False}, and
  get_media_buys(include_snapshot=True) → {"include_snapshot": True}
- Regenerate _generated.py

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The previous filter excluded all private names from __all__, but
aliases.py imports _PackageFromPackage from _generated.py. Mypy
requires that imported names appear in __all__ when they start with _.

Now only exclude private names that are alias targets (internal
intermediates like _PackageFromGetMediaBuysResponse), not names
that external modules need to import directly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@bokelley bokelley merged commit 3625a2b into main Feb 23, 2026
8 checks passed
@bokelley bokelley deleted the bokelley/media-buys-sync branch February 23, 2026 02:13
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