feat: sync upstream schemas and add get_media_buys#136
Merged
Conversation
- 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>
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.
Summary
adcontextprotocol.org(26 updated, including newget-media-buys-request/response,creative-feature-result,creative-approval-statusand updates to catalog, media-buy, package, pricing-option, and protocol schemas)CatalogType.appto match upstream enum updateget_media_buysacross the full SDK stack: abstract base, A2A adapter, MCP adapter, client, and type exportsTest plan
pytest tests/ --ignore=tests/integration)test_get_media_buys_parses_response— validates response deserialization into typedGetMediaBuysResponsewith nested packages/creative approvalstest_all_client_methods— confirmsget_media_buysmethod exists on clienttest_method_calls_correct_tool_name[get_media_buys-...]— confirms adapter dispatchtest_request_response_types_are_exported— confirmsGetMediaBuysRequest/GetMediaBuysResponseexported from top-leveladcppackage🤖 Generated with Claude Code