adcp 2.14.0__tar.gz → 2.16.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {adcp-2.14.0/src/adcp.egg-info → adcp-2.16.0}/PKG-INFO +1 -1
- {adcp-2.14.0 → adcp-2.16.0}/pyproject.toml +1 -1
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/__init__.py +1 -1
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/__init__.py +21 -1
- adcp-2.16.0/src/adcp/types/_ergonomic.py +464 -0
- adcp-2.16.0/src/adcp/types/coercion.py +194 -0
- {adcp-2.14.0 → adcp-2.16.0/src/adcp.egg-info}/PKG-INFO +1 -1
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp.egg-info/SOURCES.txt +3 -0
- adcp-2.16.0/tests/test_type_coercion.py +614 -0
- {adcp-2.14.0 → adcp-2.16.0}/LICENSE +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/MANIFEST.in +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/README.md +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/setup.cfg +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/ADCP_VERSION +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/__main__.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/adagents.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/client.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/config.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/exceptions.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/protocols/__init__.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/protocols/a2a.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/protocols/base.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/protocols/mcp.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/py.typed +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/simple.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/testing/__init__.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/testing/test_helpers.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/_generated.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/aliases.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/base.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/core.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/__init__.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/adagents.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/__init__.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/activation_key.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/assets/__init__.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/assets/audio_asset.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/assets/css_asset.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/assets/daast_asset.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/assets/html_asset.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/assets/image_asset.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/assets/javascript_asset.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/assets/text_asset.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/assets/url_asset.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/assets/vast_asset.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/assets/video_asset.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/assets/webhook_asset.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/async_response_data.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/brand_manifest.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/brand_manifest_ref.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/context.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/creative_asset.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/creative_assignment.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/creative_filters.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/creative_manifest.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/creative_policy.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/delivery_metrics.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/deployment.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/destination.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/error.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/ext.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/format.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/format_id.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/frequency_cap.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/mcp_webhook_payload.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/measurement.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/media_buy.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/package.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/performance_feedback.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/placement.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/pricing_option.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/product.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/product_filters.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/promoted_offerings.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/promoted_products.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/property.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/property_id.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/property_tag.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/protocol_envelope.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/publisher_property_selector.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/push_notification_config.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/reporting_capabilities.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/response.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/signal_filters.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/start_timing.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/sub_asset.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/core/targeting.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/creative/__init__.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/creative/list_creative_formats_request.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/creative/list_creative_formats_response.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/creative/preview_creative_request.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/creative/preview_creative_response.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/creative/preview_render.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/enums/__init__.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/enums/adcp_domain.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/enums/asset_content_type.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/enums/auth_scheme.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/enums/available_metric.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/enums/channels.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/enums/co_branding_requirement.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/enums/creative_action.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/enums/creative_agent_capability.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/enums/creative_sort_field.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/enums/creative_status.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/enums/daast_tracking_event.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/enums/daast_version.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/enums/delivery_type.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/enums/dimension_unit.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/enums/feed_format.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/enums/feedback_source.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/enums/format_category.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/enums/format_id_parameter.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/enums/frequency_cap_scope.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/enums/history_entry_type.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/enums/http_method.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/enums/identifier_types.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/enums/javascript_module_type.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/enums/landing_page_requirement.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/enums/markdown_flavor.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/enums/media_buy_status.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/enums/metric_type.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/enums/notification_type.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/enums/pacing.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/enums/preview_output_format.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/enums/pricing_model.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/enums/property_type.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/enums/publisher_identifier_types.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/enums/reporting_frequency.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/enums/signal_catalog_type.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/enums/sort_direction.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/enums/standard_format_ids.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/enums/task_status.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/enums/task_type.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/enums/update_frequency.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/enums/url_asset_type.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/enums/validation_mode.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/enums/vast_tracking_event.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/enums/vast_version.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/enums/webhook_response_type.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/enums/webhook_security_method.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/media_buy/__init__.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/media_buy/build_creative_request.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/media_buy/build_creative_response.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/media_buy/create_media_buy_async_response_input_required.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/media_buy/create_media_buy_async_response_submitted.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/media_buy/create_media_buy_async_response_working.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/media_buy/create_media_buy_request.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/media_buy/create_media_buy_response.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/media_buy/get_media_buy_delivery_request.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/media_buy/get_media_buy_delivery_response.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/media_buy/get_products_async_response_input_required.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/media_buy/get_products_async_response_submitted.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/media_buy/get_products_async_response_working.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/media_buy/get_products_request.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/media_buy/get_products_response.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/media_buy/list_authorized_properties_request.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/media_buy/list_authorized_properties_response.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/media_buy/list_creative_formats_request.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/media_buy/list_creative_formats_response.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/media_buy/list_creatives_request.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/media_buy/list_creatives_response.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/media_buy/package_request.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/media_buy/provide_performance_feedback_request.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/media_buy/provide_performance_feedback_response.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/media_buy/sync_creatives_async_response_input_required.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/media_buy/sync_creatives_async_response_submitted.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/media_buy/sync_creatives_async_response_working.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/media_buy/sync_creatives_request.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/media_buy/sync_creatives_response.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/media_buy/update_media_buy_async_response_input_required.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/media_buy/update_media_buy_async_response_submitted.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/media_buy/update_media_buy_async_response_working.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/media_buy/update_media_buy_request.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/media_buy/update_media_buy_response.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/pricing_options/__init__.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/pricing_options/cpc_option.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/pricing_options/cpcv_option.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/pricing_options/cpm_auction_option.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/pricing_options/cpm_fixed_option.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/pricing_options/cpp_option.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/pricing_options/cpv_option.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/pricing_options/flat_rate_option.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/pricing_options/vcpm_auction_option.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/pricing_options/vcpm_fixed_option.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/protocols/__init__.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/protocols/adcp_extension.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/signals/__init__.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/signals/activate_signal_request.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/signals/activate_signal_response.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/signals/get_signals_request.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/types/generated_poc/signals/get_signals_response.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/utils/__init__.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/utils/operation_id.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/utils/preview_cache.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/utils/response_parser.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/validation.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp/webhooks.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp.egg-info/dependency_links.txt +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp.egg-info/entry_points.txt +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp.egg-info/requires.txt +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/src/adcp.egg-info/top_level.txt +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/tests/test_adagents.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/tests/test_cli.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/tests/test_client.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/tests/test_code_generation.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/tests/test_discriminated_unions.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/tests/test_format_id_validation.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/tests/test_helpers.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/tests/test_preview_html.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/tests/test_protocols.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/tests/test_public_api.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/tests/test_response_parser.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/tests/test_response_str.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/tests/test_simple_api.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/tests/test_type_aliases.py +0 -0
- {adcp-2.14.0 → adcp-2.16.0}/tests/test_webhook_handling.py +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "adcp"
|
|
7
|
-
version = "2.
|
|
7
|
+
version = "2.16.0"
|
|
8
8
|
description = "Official Python client for the Ad Context Protocol (AdCP)"
|
|
9
9
|
authors = [
|
|
10
10
|
{name = "AdCP Community", email = "maintainers@adcontextprotocol.org"}
|
|
@@ -6,13 +6,33 @@ Users should import from here or directly from adcp.
|
|
|
6
6
|
Examples:
|
|
7
7
|
from adcp.types import Product, CreativeFilters
|
|
8
8
|
from adcp import Product, CreativeFilters
|
|
9
|
+
|
|
10
|
+
Type Coercion:
|
|
11
|
+
For developer ergonomics, request types accept flexible input:
|
|
12
|
+
|
|
13
|
+
- Enum fields accept string values:
|
|
14
|
+
ListCreativeFormatsRequest(type="video") # Works!
|
|
15
|
+
ListCreativeFormatsRequest(type=FormatCategory.video) # Also works
|
|
16
|
+
|
|
17
|
+
- Context fields accept dicts:
|
|
18
|
+
GetProductsRequest(context={"key": "value"}) # Works!
|
|
19
|
+
|
|
20
|
+
- FieldModel lists accept strings:
|
|
21
|
+
ListCreativesRequest(fields=["creative_id", "name"]) # Works!
|
|
22
|
+
|
|
23
|
+
See adcp.types.coercion for implementation details.
|
|
9
24
|
"""
|
|
10
25
|
|
|
11
26
|
from __future__ import annotations
|
|
12
27
|
|
|
28
|
+
# Apply type coercion to generated types (must be imported before other types)
|
|
29
|
+
from adcp.types import (
|
|
30
|
+
_ergonomic, # noqa: F401
|
|
31
|
+
aliases, # noqa: F401
|
|
32
|
+
)
|
|
33
|
+
|
|
13
34
|
# Also make submodules available for advanced use
|
|
14
35
|
from adcp.types import _generated as generated # noqa: F401
|
|
15
|
-
from adcp.types import aliases # noqa: F401
|
|
16
36
|
|
|
17
37
|
# Import all types from generated code
|
|
18
38
|
from adcp.types._generated import (
|
|
@@ -0,0 +1,464 @@
|
|
|
1
|
+
# AUTO-GENERATED by scripts/generate_ergonomic_coercion.py
|
|
2
|
+
# Do not edit manually - changes will be overwritten on next type generation.
|
|
3
|
+
# To regenerate: python scripts/generate_types.py
|
|
4
|
+
"""Apply type coercion to generated types for better ergonomics.
|
|
5
|
+
|
|
6
|
+
This module patches the generated types to accept more flexible input types
|
|
7
|
+
while maintaining type safety. It uses Pydantic's model_rebuild() to add
|
|
8
|
+
BeforeValidator annotations to fields.
|
|
9
|
+
|
|
10
|
+
Why import-time patching?
|
|
11
|
+
We apply coercion at module load time rather than lazily because:
|
|
12
|
+
1. Pydantic validation runs during __init__, before any lazy access
|
|
13
|
+
2. model_rebuild() is the standard Pydantic pattern for post-hoc changes
|
|
14
|
+
3. The cost is minimal (~10-20ms for all types, once at import)
|
|
15
|
+
4. After import, there is zero runtime overhead
|
|
16
|
+
5. This approach maintains full type checker compatibility
|
|
17
|
+
|
|
18
|
+
Coercion rules applied:
|
|
19
|
+
1. Enum fields accept string values (e.g., "video" for FormatCategory.video)
|
|
20
|
+
2. List[Enum] fields accept list of strings (e.g., ["image", "video"])
|
|
21
|
+
3. ContextObject fields accept dict values
|
|
22
|
+
4. ExtensionObject fields accept dict values
|
|
23
|
+
5. FieldModel (enum) lists accept string lists
|
|
24
|
+
|
|
25
|
+
Note: List variance issues (list[Subclass] not assignable to list[BaseClass])
|
|
26
|
+
are a fundamental Python typing limitation. Users extending library types
|
|
27
|
+
should use Sequence[T] in their own code or cast() for type checker appeasement.
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
from __future__ import annotations
|
|
31
|
+
|
|
32
|
+
from typing import Annotated, Any
|
|
33
|
+
|
|
34
|
+
from pydantic import BeforeValidator
|
|
35
|
+
|
|
36
|
+
from adcp.types.coercion import (
|
|
37
|
+
coerce_subclass_list,
|
|
38
|
+
coerce_to_enum,
|
|
39
|
+
coerce_to_enum_list,
|
|
40
|
+
coerce_to_model,
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
# Import types that need coercion
|
|
44
|
+
from adcp.types.generated_poc.core.context import ContextObject
|
|
45
|
+
from adcp.types.generated_poc.core.creative_asset import CreativeAsset
|
|
46
|
+
from adcp.types.generated_poc.core.creative_assignment import CreativeAssignment
|
|
47
|
+
from adcp.types.generated_poc.core.error import Error
|
|
48
|
+
from adcp.types.generated_poc.core.ext import ExtensionObject
|
|
49
|
+
from adcp.types.generated_poc.core.format import Format
|
|
50
|
+
from adcp.types.generated_poc.core.package import Package
|
|
51
|
+
from adcp.types.generated_poc.core.product import Product
|
|
52
|
+
from adcp.types.generated_poc.enums.asset_content_type import AssetContentType
|
|
53
|
+
from adcp.types.generated_poc.enums.creative_sort_field import CreativeSortField
|
|
54
|
+
from adcp.types.generated_poc.enums.format_category import FormatCategory
|
|
55
|
+
from adcp.types.generated_poc.enums.pacing import Pacing
|
|
56
|
+
from adcp.types.generated_poc.enums.sort_direction import SortDirection
|
|
57
|
+
from adcp.types.generated_poc.media_buy.create_media_buy_request import (
|
|
58
|
+
CreateMediaBuyRequest,
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
# Response types
|
|
62
|
+
from adcp.types.generated_poc.media_buy.create_media_buy_response import (
|
|
63
|
+
CreateMediaBuyResponse1,
|
|
64
|
+
)
|
|
65
|
+
from adcp.types.generated_poc.media_buy.get_media_buy_delivery_response import (
|
|
66
|
+
GetMediaBuyDeliveryResponse,
|
|
67
|
+
MediaBuyDelivery,
|
|
68
|
+
NotificationType,
|
|
69
|
+
)
|
|
70
|
+
from adcp.types.generated_poc.media_buy.get_products_request import GetProductsRequest
|
|
71
|
+
from adcp.types.generated_poc.media_buy.get_products_response import GetProductsResponse
|
|
72
|
+
from adcp.types.generated_poc.media_buy.list_creative_formats_request import (
|
|
73
|
+
ListCreativeFormatsRequest,
|
|
74
|
+
)
|
|
75
|
+
from adcp.types.generated_poc.media_buy.list_creative_formats_response import (
|
|
76
|
+
CreativeAgent,
|
|
77
|
+
ListCreativeFormatsResponse,
|
|
78
|
+
)
|
|
79
|
+
from adcp.types.generated_poc.media_buy.list_creatives_request import (
|
|
80
|
+
FieldModel,
|
|
81
|
+
ListCreativesRequest,
|
|
82
|
+
Sort,
|
|
83
|
+
)
|
|
84
|
+
from adcp.types.generated_poc.media_buy.list_creatives_response import (
|
|
85
|
+
Creative,
|
|
86
|
+
ListCreativesResponse,
|
|
87
|
+
)
|
|
88
|
+
from adcp.types.generated_poc.media_buy.package_request import PackageRequest
|
|
89
|
+
from adcp.types.generated_poc.media_buy.update_media_buy_request import (
|
|
90
|
+
Packages,
|
|
91
|
+
Packages1,
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
def _apply_coercion() -> None:
|
|
96
|
+
"""Apply coercion validators to generated types.
|
|
97
|
+
|
|
98
|
+
This function modifies the generated types in-place to accept
|
|
99
|
+
more flexible input types.
|
|
100
|
+
"""
|
|
101
|
+
# Apply coercion to ListCreativeFormatsRequest
|
|
102
|
+
# - asset_types: list[AssetContentType | str] | None
|
|
103
|
+
# - context: ContextObject | dict | None
|
|
104
|
+
# - ext: ExtensionObject | dict | None
|
|
105
|
+
# - type: FormatCategory | str | None
|
|
106
|
+
_patch_field_annotation(
|
|
107
|
+
ListCreativeFormatsRequest,
|
|
108
|
+
"asset_types",
|
|
109
|
+
Annotated[
|
|
110
|
+
list[AssetContentType] | None,
|
|
111
|
+
BeforeValidator(coerce_to_enum_list(AssetContentType)),
|
|
112
|
+
],
|
|
113
|
+
)
|
|
114
|
+
_patch_field_annotation(
|
|
115
|
+
ListCreativeFormatsRequest,
|
|
116
|
+
"context",
|
|
117
|
+
Annotated[ContextObject | None, BeforeValidator(coerce_to_model(ContextObject))],
|
|
118
|
+
)
|
|
119
|
+
_patch_field_annotation(
|
|
120
|
+
ListCreativeFormatsRequest,
|
|
121
|
+
"ext",
|
|
122
|
+
Annotated[ExtensionObject | None, BeforeValidator(coerce_to_model(ExtensionObject))],
|
|
123
|
+
)
|
|
124
|
+
_patch_field_annotation(
|
|
125
|
+
ListCreativeFormatsRequest,
|
|
126
|
+
"type",
|
|
127
|
+
Annotated[FormatCategory | None, BeforeValidator(coerce_to_enum(FormatCategory))],
|
|
128
|
+
)
|
|
129
|
+
ListCreativeFormatsRequest.model_rebuild(force=True)
|
|
130
|
+
|
|
131
|
+
# Apply coercion to ListCreativesRequest
|
|
132
|
+
# - context: ContextObject | dict | None
|
|
133
|
+
# - ext: ExtensionObject | dict | None
|
|
134
|
+
# - fields: list[FieldModel | str] | None
|
|
135
|
+
_patch_field_annotation(
|
|
136
|
+
ListCreativesRequest,
|
|
137
|
+
"context",
|
|
138
|
+
Annotated[ContextObject | None, BeforeValidator(coerce_to_model(ContextObject))],
|
|
139
|
+
)
|
|
140
|
+
_patch_field_annotation(
|
|
141
|
+
ListCreativesRequest,
|
|
142
|
+
"ext",
|
|
143
|
+
Annotated[ExtensionObject | None, BeforeValidator(coerce_to_model(ExtensionObject))],
|
|
144
|
+
)
|
|
145
|
+
_patch_field_annotation(
|
|
146
|
+
ListCreativesRequest,
|
|
147
|
+
"fields",
|
|
148
|
+
Annotated[
|
|
149
|
+
list[FieldModel] | None,
|
|
150
|
+
BeforeValidator(coerce_to_enum_list(FieldModel)),
|
|
151
|
+
],
|
|
152
|
+
)
|
|
153
|
+
ListCreativesRequest.model_rebuild(force=True)
|
|
154
|
+
|
|
155
|
+
# Apply coercion to Sort
|
|
156
|
+
# - direction: SortDirection | str | None
|
|
157
|
+
# - field: CreativeSortField | str | None
|
|
158
|
+
_patch_field_annotation(
|
|
159
|
+
Sort,
|
|
160
|
+
"direction",
|
|
161
|
+
Annotated[SortDirection | None, BeforeValidator(coerce_to_enum(SortDirection))],
|
|
162
|
+
)
|
|
163
|
+
_patch_field_annotation(
|
|
164
|
+
Sort,
|
|
165
|
+
"field",
|
|
166
|
+
Annotated[CreativeSortField | None, BeforeValidator(coerce_to_enum(CreativeSortField))],
|
|
167
|
+
)
|
|
168
|
+
Sort.model_rebuild(force=True)
|
|
169
|
+
|
|
170
|
+
# Apply coercion to GetProductsRequest
|
|
171
|
+
# - context: ContextObject | dict | None
|
|
172
|
+
# - ext: ExtensionObject | dict | None
|
|
173
|
+
_patch_field_annotation(
|
|
174
|
+
GetProductsRequest,
|
|
175
|
+
"context",
|
|
176
|
+
Annotated[ContextObject | None, BeforeValidator(coerce_to_model(ContextObject))],
|
|
177
|
+
)
|
|
178
|
+
_patch_field_annotation(
|
|
179
|
+
GetProductsRequest,
|
|
180
|
+
"ext",
|
|
181
|
+
Annotated[ExtensionObject | None, BeforeValidator(coerce_to_model(ExtensionObject))],
|
|
182
|
+
)
|
|
183
|
+
GetProductsRequest.model_rebuild(force=True)
|
|
184
|
+
|
|
185
|
+
# Apply coercion to PackageRequest
|
|
186
|
+
# - creatives: list[CreativeAsset] (accepts subclass instances)
|
|
187
|
+
# - ext: ExtensionObject | dict | None
|
|
188
|
+
# - pacing: Pacing | str | None
|
|
189
|
+
_patch_field_annotation(
|
|
190
|
+
PackageRequest,
|
|
191
|
+
"creatives",
|
|
192
|
+
Annotated[
|
|
193
|
+
list[CreativeAsset] | None,
|
|
194
|
+
BeforeValidator(coerce_subclass_list(CreativeAsset)),
|
|
195
|
+
],
|
|
196
|
+
)
|
|
197
|
+
_patch_field_annotation(
|
|
198
|
+
PackageRequest,
|
|
199
|
+
"ext",
|
|
200
|
+
Annotated[ExtensionObject | None, BeforeValidator(coerce_to_model(ExtensionObject))],
|
|
201
|
+
)
|
|
202
|
+
_patch_field_annotation(
|
|
203
|
+
PackageRequest,
|
|
204
|
+
"pacing",
|
|
205
|
+
Annotated[Pacing | None, BeforeValidator(coerce_to_enum(Pacing))],
|
|
206
|
+
)
|
|
207
|
+
PackageRequest.model_rebuild(force=True)
|
|
208
|
+
|
|
209
|
+
# Apply coercion to CreateMediaBuyRequest
|
|
210
|
+
# - context: ContextObject | dict | None
|
|
211
|
+
# - ext: ExtensionObject | dict | None
|
|
212
|
+
# - packages: list[PackageRequest] (accepts subclass instances)
|
|
213
|
+
_patch_field_annotation(
|
|
214
|
+
CreateMediaBuyRequest,
|
|
215
|
+
"context",
|
|
216
|
+
Annotated[ContextObject | None, BeforeValidator(coerce_to_model(ContextObject))],
|
|
217
|
+
)
|
|
218
|
+
_patch_field_annotation(
|
|
219
|
+
CreateMediaBuyRequest,
|
|
220
|
+
"ext",
|
|
221
|
+
Annotated[ExtensionObject | None, BeforeValidator(coerce_to_model(ExtensionObject))],
|
|
222
|
+
)
|
|
223
|
+
_patch_field_annotation(
|
|
224
|
+
CreateMediaBuyRequest,
|
|
225
|
+
"packages",
|
|
226
|
+
Annotated[
|
|
227
|
+
list[PackageRequest],
|
|
228
|
+
BeforeValidator(coerce_subclass_list(PackageRequest)),
|
|
229
|
+
],
|
|
230
|
+
)
|
|
231
|
+
CreateMediaBuyRequest.model_rebuild(force=True)
|
|
232
|
+
|
|
233
|
+
# Apply coercion to Packages
|
|
234
|
+
# - creative_assignments: list[CreativeAssignment] (accepts subclass instances)
|
|
235
|
+
# - creatives: list[CreativeAsset] (accepts subclass instances)
|
|
236
|
+
# - pacing: Pacing | str | None
|
|
237
|
+
_patch_field_annotation(
|
|
238
|
+
Packages,
|
|
239
|
+
"creative_assignments",
|
|
240
|
+
Annotated[
|
|
241
|
+
list[CreativeAssignment] | None,
|
|
242
|
+
BeforeValidator(coerce_subclass_list(CreativeAssignment)),
|
|
243
|
+
],
|
|
244
|
+
)
|
|
245
|
+
_patch_field_annotation(
|
|
246
|
+
Packages,
|
|
247
|
+
"creatives",
|
|
248
|
+
Annotated[
|
|
249
|
+
list[CreativeAsset] | None,
|
|
250
|
+
BeforeValidator(coerce_subclass_list(CreativeAsset)),
|
|
251
|
+
],
|
|
252
|
+
)
|
|
253
|
+
_patch_field_annotation(
|
|
254
|
+
Packages,
|
|
255
|
+
"pacing",
|
|
256
|
+
Annotated[Pacing | None, BeforeValidator(coerce_to_enum(Pacing))],
|
|
257
|
+
)
|
|
258
|
+
Packages.model_rebuild(force=True)
|
|
259
|
+
|
|
260
|
+
# Apply coercion to Packages1
|
|
261
|
+
# - creative_assignments: list[CreativeAssignment] (accepts subclass instances)
|
|
262
|
+
# - creatives: list[CreativeAsset] (accepts subclass instances)
|
|
263
|
+
# - pacing: Pacing | str | None
|
|
264
|
+
_patch_field_annotation(
|
|
265
|
+
Packages1,
|
|
266
|
+
"creative_assignments",
|
|
267
|
+
Annotated[
|
|
268
|
+
list[CreativeAssignment] | None,
|
|
269
|
+
BeforeValidator(coerce_subclass_list(CreativeAssignment)),
|
|
270
|
+
],
|
|
271
|
+
)
|
|
272
|
+
_patch_field_annotation(
|
|
273
|
+
Packages1,
|
|
274
|
+
"creatives",
|
|
275
|
+
Annotated[
|
|
276
|
+
list[CreativeAsset] | None,
|
|
277
|
+
BeforeValidator(coerce_subclass_list(CreativeAsset)),
|
|
278
|
+
],
|
|
279
|
+
)
|
|
280
|
+
_patch_field_annotation(
|
|
281
|
+
Packages1,
|
|
282
|
+
"pacing",
|
|
283
|
+
Annotated[Pacing | None, BeforeValidator(coerce_to_enum(Pacing))],
|
|
284
|
+
)
|
|
285
|
+
Packages1.model_rebuild(force=True)
|
|
286
|
+
|
|
287
|
+
# Apply coercion to GetProductsResponse
|
|
288
|
+
# - context: ContextObject | dict | None
|
|
289
|
+
# - errors: list[Error] (accepts subclass instances)
|
|
290
|
+
# - ext: ExtensionObject | dict | None
|
|
291
|
+
# - products: list[Product] (accepts subclass instances)
|
|
292
|
+
_patch_field_annotation(
|
|
293
|
+
GetProductsResponse,
|
|
294
|
+
"context",
|
|
295
|
+
Annotated[ContextObject | None, BeforeValidator(coerce_to_model(ContextObject))],
|
|
296
|
+
)
|
|
297
|
+
_patch_field_annotation(
|
|
298
|
+
GetProductsResponse,
|
|
299
|
+
"errors",
|
|
300
|
+
Annotated[
|
|
301
|
+
list[Error] | None,
|
|
302
|
+
BeforeValidator(coerce_subclass_list(Error)),
|
|
303
|
+
],
|
|
304
|
+
)
|
|
305
|
+
_patch_field_annotation(
|
|
306
|
+
GetProductsResponse,
|
|
307
|
+
"ext",
|
|
308
|
+
Annotated[ExtensionObject | None, BeforeValidator(coerce_to_model(ExtensionObject))],
|
|
309
|
+
)
|
|
310
|
+
_patch_field_annotation(
|
|
311
|
+
GetProductsResponse,
|
|
312
|
+
"products",
|
|
313
|
+
Annotated[
|
|
314
|
+
list[Product],
|
|
315
|
+
BeforeValidator(coerce_subclass_list(Product)),
|
|
316
|
+
],
|
|
317
|
+
)
|
|
318
|
+
GetProductsResponse.model_rebuild(force=True)
|
|
319
|
+
|
|
320
|
+
# Apply coercion to ListCreativesResponse
|
|
321
|
+
# - context: ContextObject | dict | None
|
|
322
|
+
# - creatives: list[Creative] (accepts subclass instances)
|
|
323
|
+
# - ext: ExtensionObject | dict | None
|
|
324
|
+
_patch_field_annotation(
|
|
325
|
+
ListCreativesResponse,
|
|
326
|
+
"context",
|
|
327
|
+
Annotated[ContextObject | None, BeforeValidator(coerce_to_model(ContextObject))],
|
|
328
|
+
)
|
|
329
|
+
_patch_field_annotation(
|
|
330
|
+
ListCreativesResponse,
|
|
331
|
+
"creatives",
|
|
332
|
+
Annotated[
|
|
333
|
+
list[Creative],
|
|
334
|
+
BeforeValidator(coerce_subclass_list(Creative)),
|
|
335
|
+
],
|
|
336
|
+
)
|
|
337
|
+
_patch_field_annotation(
|
|
338
|
+
ListCreativesResponse,
|
|
339
|
+
"ext",
|
|
340
|
+
Annotated[ExtensionObject | None, BeforeValidator(coerce_to_model(ExtensionObject))],
|
|
341
|
+
)
|
|
342
|
+
ListCreativesResponse.model_rebuild(force=True)
|
|
343
|
+
|
|
344
|
+
# Apply coercion to ListCreativeFormatsResponse
|
|
345
|
+
# - context: ContextObject | dict | None
|
|
346
|
+
# - creative_agents: list[CreativeAgent] (accepts subclass instances)
|
|
347
|
+
# - errors: list[Error] (accepts subclass instances)
|
|
348
|
+
# - ext: ExtensionObject | dict | None
|
|
349
|
+
# - formats: list[Format] (accepts subclass instances)
|
|
350
|
+
_patch_field_annotation(
|
|
351
|
+
ListCreativeFormatsResponse,
|
|
352
|
+
"context",
|
|
353
|
+
Annotated[ContextObject | None, BeforeValidator(coerce_to_model(ContextObject))],
|
|
354
|
+
)
|
|
355
|
+
_patch_field_annotation(
|
|
356
|
+
ListCreativeFormatsResponse,
|
|
357
|
+
"creative_agents",
|
|
358
|
+
Annotated[
|
|
359
|
+
list[CreativeAgent] | None,
|
|
360
|
+
BeforeValidator(coerce_subclass_list(CreativeAgent)),
|
|
361
|
+
],
|
|
362
|
+
)
|
|
363
|
+
_patch_field_annotation(
|
|
364
|
+
ListCreativeFormatsResponse,
|
|
365
|
+
"errors",
|
|
366
|
+
Annotated[
|
|
367
|
+
list[Error] | None,
|
|
368
|
+
BeforeValidator(coerce_subclass_list(Error)),
|
|
369
|
+
],
|
|
370
|
+
)
|
|
371
|
+
_patch_field_annotation(
|
|
372
|
+
ListCreativeFormatsResponse,
|
|
373
|
+
"ext",
|
|
374
|
+
Annotated[ExtensionObject | None, BeforeValidator(coerce_to_model(ExtensionObject))],
|
|
375
|
+
)
|
|
376
|
+
_patch_field_annotation(
|
|
377
|
+
ListCreativeFormatsResponse,
|
|
378
|
+
"formats",
|
|
379
|
+
Annotated[
|
|
380
|
+
list[Format],
|
|
381
|
+
BeforeValidator(coerce_subclass_list(Format)),
|
|
382
|
+
],
|
|
383
|
+
)
|
|
384
|
+
ListCreativeFormatsResponse.model_rebuild(force=True)
|
|
385
|
+
|
|
386
|
+
# Apply coercion to CreateMediaBuyResponse1
|
|
387
|
+
# - context: ContextObject | dict | None
|
|
388
|
+
# - ext: ExtensionObject | dict | None
|
|
389
|
+
# - packages: list[Package] (accepts subclass instances)
|
|
390
|
+
_patch_field_annotation(
|
|
391
|
+
CreateMediaBuyResponse1,
|
|
392
|
+
"context",
|
|
393
|
+
Annotated[ContextObject | None, BeforeValidator(coerce_to_model(ContextObject))],
|
|
394
|
+
)
|
|
395
|
+
_patch_field_annotation(
|
|
396
|
+
CreateMediaBuyResponse1,
|
|
397
|
+
"ext",
|
|
398
|
+
Annotated[ExtensionObject | None, BeforeValidator(coerce_to_model(ExtensionObject))],
|
|
399
|
+
)
|
|
400
|
+
_patch_field_annotation(
|
|
401
|
+
CreateMediaBuyResponse1,
|
|
402
|
+
"packages",
|
|
403
|
+
Annotated[
|
|
404
|
+
list[Package],
|
|
405
|
+
BeforeValidator(coerce_subclass_list(Package)),
|
|
406
|
+
],
|
|
407
|
+
)
|
|
408
|
+
CreateMediaBuyResponse1.model_rebuild(force=True)
|
|
409
|
+
|
|
410
|
+
# Apply coercion to GetMediaBuyDeliveryResponse
|
|
411
|
+
# - context: ContextObject | dict | None
|
|
412
|
+
# - errors: list[Error] (accepts subclass instances)
|
|
413
|
+
# - ext: ExtensionObject | dict | None
|
|
414
|
+
# - media_buy_deliveries: list[MediaBuyDelivery] (accepts subclass instances)
|
|
415
|
+
# - notification_type: NotificationType | str | None
|
|
416
|
+
_patch_field_annotation(
|
|
417
|
+
GetMediaBuyDeliveryResponse,
|
|
418
|
+
"context",
|
|
419
|
+
Annotated[ContextObject | None, BeforeValidator(coerce_to_model(ContextObject))],
|
|
420
|
+
)
|
|
421
|
+
_patch_field_annotation(
|
|
422
|
+
GetMediaBuyDeliveryResponse,
|
|
423
|
+
"errors",
|
|
424
|
+
Annotated[
|
|
425
|
+
list[Error] | None,
|
|
426
|
+
BeforeValidator(coerce_subclass_list(Error)),
|
|
427
|
+
],
|
|
428
|
+
)
|
|
429
|
+
_patch_field_annotation(
|
|
430
|
+
GetMediaBuyDeliveryResponse,
|
|
431
|
+
"ext",
|
|
432
|
+
Annotated[ExtensionObject | None, BeforeValidator(coerce_to_model(ExtensionObject))],
|
|
433
|
+
)
|
|
434
|
+
_patch_field_annotation(
|
|
435
|
+
GetMediaBuyDeliveryResponse,
|
|
436
|
+
"media_buy_deliveries",
|
|
437
|
+
Annotated[
|
|
438
|
+
list[MediaBuyDelivery],
|
|
439
|
+
BeforeValidator(coerce_subclass_list(MediaBuyDelivery)),
|
|
440
|
+
],
|
|
441
|
+
)
|
|
442
|
+
_patch_field_annotation(
|
|
443
|
+
GetMediaBuyDeliveryResponse,
|
|
444
|
+
"notification_type",
|
|
445
|
+
Annotated[NotificationType | None, BeforeValidator(coerce_to_enum(NotificationType))],
|
|
446
|
+
)
|
|
447
|
+
GetMediaBuyDeliveryResponse.model_rebuild(force=True)
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
def _patch_field_annotation(
|
|
451
|
+
model: type,
|
|
452
|
+
field_name: str,
|
|
453
|
+
new_annotation: Any,
|
|
454
|
+
) -> None:
|
|
455
|
+
"""Patch a field annotation on a Pydantic model.
|
|
456
|
+
|
|
457
|
+
This modifies the model's __annotations__ dict to add
|
|
458
|
+
BeforeValidator coercion.
|
|
459
|
+
"""
|
|
460
|
+
model.__annotations__[field_name] = new_annotation
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+
# Apply coercion when module is imported
|
|
464
|
+
_apply_coercion()
|