From 4f0c0d5aa65dfc0e8f539ea22a0cd326abf0a830 Mon Sep 17 00:00:00 2001 From: Brian O'Kelley Date: Tue, 18 Nov 2025 22:13:29 -0500 Subject: [PATCH 1/2] feat: expose all types through stable public API with union aliases MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add 134 missing base types to stable.py exports (202 total) - Add 4 semantic aliases for AuthorizedAgents discriminated union variants - Add 4 union type aliases (Deployment, Destination, AuthorizedAgent, PublisherProperties) - Update types/__init__.py to export all types from stable and aliases modules - Fix test imports to use _generated instead of generated_poc - All 295 tests passing Users can now import all types from adcp.types or adcp package without accessing internal modules. Union type aliases simplify type hints for discriminated unions. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/adcp/types/__init__.py | 506 ++++++++++++++++++++++++++++++++++--- src/adcp/types/aliases.py | 244 +++++++++++++++++- src/adcp/types/stable.py | 272 +++++++++++++++++++- tests/test_type_aliases.py | 4 +- 4 files changed, 988 insertions(+), 38 deletions(-) diff --git a/src/adcp/types/__init__.py b/src/adcp/types/__init__.py index 6a89c4f..61d5270 100644 --- a/src/adcp/types/__init__.py +++ b/src/adcp/types/__init__.py @@ -10,24 +10,82 @@ adcp.types or adcp.types.stable for stable, versioned types. """ +# Import all semantic aliases from aliases module from adcp.types.aliases import ( + # Activation responses + ActivateSignalErrorResponse, + ActivateSignalSuccessResponse, + # Agent deployment aliases + AgentDeployment, + AgentDestination, + # Authorized agent variants + AuthorizedAgent, + AuthorizedAgentsByInlineProperties, + AuthorizedAgentsByPropertyId, + AuthorizedAgentsByPropertyTag, + AuthorizedAgentsByPublisherProperties, + # Preview/render aliases BothPreviewRender, + # Build creative responses + BuildCreativeErrorResponse, + BuildCreativeSuccessResponse, + # Create media buy responses + CreateMediaBuyErrorResponse, + CreateMediaBuySuccessResponse, + # Package aliases CreatedPackageReference, + # Deployment union + Deployment, + # Destination union + Destination, + # Preview renders HtmlPreviewRender, + # Asset aliases InlineDaastAsset, InlineVastAsset, + # SubAsset aliases MediaSubAsset, + # Platform deployment + PlatformDeployment, + PlatformDestination, + # Preview requests + PreviewCreativeFormatRequest, + PreviewCreativeInteractiveResponse, + PreviewCreativeManifestRequest, + PreviewCreativeStaticResponse, + # Property types PropertyId, + PropertyIdActivationKey, PropertyTag, + PropertyTagActivationKey, + # Performance feedback + ProvidePerformanceFeedbackErrorResponse, + ProvidePerformanceFeedbackSuccessResponse, + # Publisher properties variants + PublisherProperties, PublisherPropertiesAll, PublisherPropertiesById, PublisherPropertiesByTag, + # Sync creatives + SyncCreativesErrorResponse, + SyncCreativesSuccessResponse, + # Text assets TextSubAsset, + # Update media buy + UpdateMediaBuyErrorResponse, + UpdateMediaBuyPackagesRequest, + UpdateMediaBuyPropertiesRequest, + UpdateMediaBuySuccessResponse, + # URL assets UrlDaastAsset, UrlPreviewRender, UrlVastAsset, ) + +# Import base types from adcp.types.base import AdCPBaseModel + +# Import core types (non-generated) from adcp.types.core import ( Activity, ActivityType, @@ -41,34 +99,215 @@ TaskStatus as CoreTaskStatus, ) -# Import stable public API types +# Import all stable public API types from adcp.types.stable import ( + Action, + ActivateSignalRequest, + ActivateSignalResponse, + AffectedPackage, + AggregatedTotals, + Asset, + AssetSelectors, + AssetType, + AssetTypeSchema, + AssetsRequired, + AssignedPackage, + Assignments, + AudioAsset, + Authentication, + AuthorizedAgents, + AuthorizedSalesAgents, + AvailableMetric, + AvailableReportingFrequency, BrandManifest, - # Pricing options + BuildCreativeRequest, + BuildCreativeResponse, + ByPackageItem, + Capability, + CatalogType, + CoBranding, + Colors, + Contact, + ContentLength, + Country, CpcPricingOption, CpcvPricingOption, CpmAuctionPricingOption, CpmFixedRatePricingOption, CppPricingOption, CpvPricingOption, + CreateMediaBuyRequest, + CreateMediaBuyResponse, Creative, + CreativeAgent, + CreativeAsset, + CreativeAssignment, + CreativeManifest, + CreativePolicy, CreativeStatus, + CssAsset, + DaastVersion, + DailyBreakdownItem, + DeliverTo, + DeliveryMeasurement, + DeliveryMetrics, + DeliveryType, + Details, + Dimensions, + Direction, + Disclaimer, + Domain, + DomainBreakdown, + DoohMetrics, + Duration, + Embedding, Error, + FeedFormat, + FeedbackSource, + FieldModel, + FileSize, + Filters, FlatRatePricingOption, + Fonts, Format, + FormatCard, + FormatCardDetailed, + FormatId, + FormatType, + FrequencyCap, + FrequencyCapScope, + GeoCountryAnyOfItem, + GetMediaBuyDeliveryRequest, + GetMediaBuyDeliveryResponse, + GetProductsRequest, + GetProductsResponse, + GetSignalsRequest, + GetSignalsResponse, + HistoryItem, + HtmlAsset, + Identifier, + ImageAsset, + Input, + JavascriptAsset, + LandingPage, + ListAuthorizedPropertiesRequest, + ListAuthorizedPropertiesResponse, + ListCreativeFormatsRequest, + ListCreativeFormatsResponse, + ListCreativesRequest, + ListCreativesResponse, + Logo, + MarkdownAsset, + MarkdownFlavor, + Measurement, + MeasurementPeriod, MediaBuy, + MediaBuyDelivery, MediaBuyStatus, + Metadata, + Method, + MetricType, + ModuleType, + NotificationType, + Offering, + OutputFormat, + Pacing, Package, + PackageRequest, + Packages, PackageStatus, + Pagination, + Parameters, + Performance, + PerformanceFeedback, + Placement, + Preview, + PreviewCreativeRequest, + PreviewCreativeResponse, + PreviewRender, + PriceGuidance, + Pricing, PricingModel, + PrimaryCountry, Product, + ProductCard, + ProductCardDetailed, + ProductCatalog, + Progress, + PromotedOfferings, + PromotedProducts, Property, + PropertyIdentifierTypes, + PropertyType, + ProtocolEnvelope, + ProtocolResponse, + ProvidePerformanceFeedbackRequest, + ProvidePerformanceFeedbackResponse, + PublisherDomain, + PublisherIdentifierTypes, + PushNotificationConfig, + Quality, + QuartileData, + QuerySummary, + Render, + ReportingCapabilities, + ReportingFrequency, + ReportingPeriod, + ReportingWebhook, + Request, + RequestedMetric, + Requirements, + Response, + ResponseType, + Responsive, + Results, + Scheme, + Security, + Signal, + SignalType, + Sort, + SortApplied, + StandardFormatIds, + Status, + StatusFilter, + StatusFilterEnum, + StatusSummary, + SyncCreativesRequest, + SyncCreativesResponse, + Tag, + Tags, + TargetingOverlay, + Task, + TasksGetRequest, + TasksGetResponse, + TasksListRequest, + TasksListResponse, + TaskStatus as GeneratedTaskStatus, + TaskType, + TextAsset, + Totals, + TrackingEvent, + Type, + Unit, + UpdateFrequency, + UpdateMediaBuyRequest, + UpdateMediaBuyResponse, + UrlAsset, + UrlType, + ValidationMode, + VastVersion, VcpmAuctionPricingOption, VcpmFixedRatePricingOption, + VenueBreakdownItem, + VideoAsset, + ViewThreshold, + WebhookAsset, + WebhookPayload, ) # Note: CoreTaskStatus is for internal task tracking -# Generated TaskStatus from AdCP schema is available via adcp.types.stable +# GeneratedTaskStatus from AdCP schema is available via adcp.types.stable +# We export CoreTaskStatus as "TaskStatus" for backward compatibility TaskStatus = CoreTaskStatus __all__ = [ @@ -82,46 +321,253 @@ "Activity", "ActivityType", "DebugInfo", - # Semantic aliases for discriminated unions + # All stable types + "Action", + "ActivateSignalErrorResponse", + "ActivateSignalRequest", + "ActivateSignalResponse", + "ActivateSignalSuccessResponse", + "AffectedPackage", + "AgentDeployment", + "AgentDestination", + "AggregatedTotals", + "Asset", + "AssetSelectors", + "AssetType", + "AssetTypeSchema", + "AssetsRequired", + "AssignedPackage", + "Assignments", + "AudioAsset", + "Authentication", + "AuthorizedAgent", + "AuthorizedAgents", + "AuthorizedAgentsByInlineProperties", + "AuthorizedAgentsByPropertyId", + "AuthorizedAgentsByPropertyTag", + "AuthorizedAgentsByPublisherProperties", + "AuthorizedSalesAgents", + "AvailableMetric", + "AvailableReportingFrequency", "BothPreviewRender", - "HtmlPreviewRender", - "InlineDaastAsset", - "InlineVastAsset", - "MediaSubAsset", - "TextSubAsset", - "UrlDaastAsset", - "UrlPreviewRender", - "UrlVastAsset", - # Package type aliases - "CreatedPackageReference", - # Publisher properties types - "PropertyId", - "PropertyTag", - # Publisher properties aliases - "PublisherPropertiesAll", - "PublisherPropertiesById", - "PublisherPropertiesByTag", - # Stable API types (commonly used) "BrandManifest", + "BuildCreativeErrorResponse", + "BuildCreativeRequest", + "BuildCreativeResponse", + "BuildCreativeSuccessResponse", + "ByPackageItem", + "Capability", + "CatalogType", + "CoBranding", + "Colors", + "Contact", + "ContentLength", + "Country", + "CpcPricingOption", + "CpcvPricingOption", + "CpmAuctionPricingOption", + "CpmFixedRatePricingOption", + "CppPricingOption", + "CpvPricingOption", + "CreateMediaBuyErrorResponse", + "CreateMediaBuyRequest", + "CreateMediaBuyResponse", + "CreateMediaBuySuccessResponse", + "CreatedPackageReference", "Creative", + "CreativeAgent", + "CreativeAsset", + "CreativeAssignment", + "CreativeManifest", + "CreativePolicy", "CreativeStatus", + "CssAsset", + "DaastVersion", + "DailyBreakdownItem", + "DeliverTo", + "DeliveryMeasurement", + "DeliveryMetrics", + "DeliveryType", + "Deployment", + "Destination", + "Details", + "Dimensions", + "Direction", + "Disclaimer", + "Domain", + "DomainBreakdown", + "DoohMetrics", + "Duration", + "Embedding", "Error", + "FeedFormat", + "FeedbackSource", + "FieldModel", + "FileSize", + "Filters", + "FlatRatePricingOption", + "Fonts", "Format", + "FormatCard", + "FormatCardDetailed", + "FormatId", + "FormatType", + "FrequencyCap", + "FrequencyCapScope", + "GeoCountryAnyOfItem", + "GetMediaBuyDeliveryRequest", + "GetMediaBuyDeliveryResponse", + "GetProductsRequest", + "GetProductsResponse", + "GetSignalsRequest", + "GetSignalsResponse", + "HistoryItem", + "HtmlAsset", + "HtmlPreviewRender", + "Identifier", + "ImageAsset", + "InlineDaastAsset", + "InlineVastAsset", + "Input", + "JavascriptAsset", + "LandingPage", + "ListAuthorizedPropertiesRequest", + "ListAuthorizedPropertiesResponse", + "ListCreativeFormatsRequest", + "ListCreativeFormatsResponse", + "ListCreativesRequest", + "ListCreativesResponse", + "Logo", + "MarkdownAsset", + "MarkdownFlavor", + "Measurement", + "MeasurementPeriod", "MediaBuy", + "MediaBuyDelivery", "MediaBuyStatus", + "MediaSubAsset", + "Metadata", + "Method", + "MetricType", + "ModuleType", + "NotificationType", + "Offering", + "OutputFormat", + "Pacing", "Package", + "PackageRequest", "PackageStatus", + "Packages", + "Pagination", + "Parameters", + "Performance", + "PerformanceFeedback", + "Placement", + "PlatformDeployment", + "PlatformDestination", + "Preview", + "PreviewCreativeFormatRequest", + "PreviewCreativeInteractiveResponse", + "PreviewCreativeManifestRequest", + "PreviewCreativeRequest", + "PreviewCreativeResponse", + "PreviewCreativeStaticResponse", + "PreviewRender", + "PriceGuidance", + "Pricing", "PricingModel", + "PrimaryCountry", "Product", + "ProductCard", + "ProductCardDetailed", + "ProductCatalog", + "Progress", + "PromotedOfferings", + "PromotedProducts", "Property", - # Pricing options - "CpcPricingOption", - "CpcvPricingOption", - "CpmAuctionPricingOption", - "CpmFixedRatePricingOption", - "CppPricingOption", - "CpvPricingOption", - "FlatRatePricingOption", + "PropertyId", + "PropertyIdActivationKey", + "PropertyIdentifierTypes", + "PropertyTag", + "PropertyTagActivationKey", + "PropertyType", + "ProtocolEnvelope", + "ProtocolResponse", + "ProvidePerformanceFeedbackErrorResponse", + "ProvidePerformanceFeedbackRequest", + "ProvidePerformanceFeedbackResponse", + "ProvidePerformanceFeedbackSuccessResponse", + "PublisherDomain", + "PublisherIdentifierTypes", + "PublisherProperties", + "PublisherPropertiesAll", + "PublisherPropertiesById", + "PublisherPropertiesByTag", + "PushNotificationConfig", + "Quality", + "QuartileData", + "QuerySummary", + "Render", + "ReportingCapabilities", + "ReportingFrequency", + "ReportingPeriod", + "ReportingWebhook", + "Request", + "RequestedMetric", + "Requirements", + "Response", + "ResponseType", + "Responsive", + "Results", + "Scheme", + "Security", + "Signal", + "SignalType", + "Sort", + "SortApplied", + "StandardFormatIds", + "Status", + "StatusFilter", + "StatusFilterEnum", + "StatusSummary", + "SyncCreativesErrorResponse", + "SyncCreativesRequest", + "SyncCreativesResponse", + "SyncCreativesSuccessResponse", + "Tag", + "Tags", + "TargetingOverlay", + "Task", + "TaskType", + "TasksGetRequest", + "TasksGetResponse", + "TasksListRequest", + "TasksListResponse", + "TextAsset", + "TextSubAsset", + "Totals", + "TrackingEvent", + "Type", + "Unit", + "UpdateFrequency", + "UpdateMediaBuyErrorResponse", + "UpdateMediaBuyPackagesRequest", + "UpdateMediaBuyPropertiesRequest", + "UpdateMediaBuyRequest", + "UpdateMediaBuyResponse", + "UpdateMediaBuySuccessResponse", + "UrlAsset", + "UrlDaastAsset", + "UrlPreviewRender", + "UrlType", + "UrlVastAsset", + "ValidationMode", + "VastVersion", "VcpmAuctionPricingOption", "VcpmFixedRatePricingOption", + "VenueBreakdownItem", + "VideoAsset", + "ViewThreshold", + "WebhookAsset", + "WebhookPayload", ] diff --git a/src/adcp/types/aliases.py b/src/adcp/types/aliases.py index 437221f..c81da49 100644 --- a/src/adcp/types/aliases.py +++ b/src/adcp/types/aliases.py @@ -38,6 +38,11 @@ # Activation keys ActivationKey1, ActivationKey2, + # Authorized agents + AuthorizedAgents, + AuthorizedAgents1, + AuthorizedAgents2, + AuthorizedAgents3, # Build creative responses BuildCreativeResponse1, BuildCreativeResponse2, @@ -479,6 +484,226 @@ ``` """ +# ============================================================================ +# AUTHORIZED AGENTS ALIASES - Authorization Type Discriminated Unions +# ============================================================================ +# The AdCP adagents.json schema defines AuthorizedAgents as a discriminated +# union with four variants based on the `authorization_type` field: +# +# 1. Property IDs (authorization_type='property_ids'): +# - Agent authorized for specific property IDs +# - Requires property_ids array +# +# 2. Property Tags (authorization_type='property_tags'): +# - Agent authorized for properties matching tags +# - Requires property_tags array +# +# 3. Inline Properties (authorization_type='inline_properties'): +# - Agent authorized with inline property definitions +# - Requires properties array with full Property objects +# +# 4. Publisher Properties (authorization_type='publisher_properties'): +# - Agent authorized for properties from other publisher domains +# - Requires publisher_properties array +# +# These define which sales agents are authorized to sell inventory and which +# properties they can access. + +AuthorizedAgentsByPropertyId = AuthorizedAgents +"""Authorized agent with specific property IDs. + +This variant uses authorization_type='property_ids' for agents authorized +to sell specific properties identified by their IDs. + +Fields: +- authorization_type: Literal['property_ids'] +- authorized_for: Human-readable description +- property_ids: List of PropertyId (non-empty) +- url: Agent's API endpoint URL + +Example: + ```python + from adcp.types.aliases import AuthorizedAgentsByPropertyId, PropertyId + + agent = AuthorizedAgentsByPropertyId( + authorization_type="property_ids", + authorized_for="Premium display inventory", + property_ids=[PropertyId("homepage"), PropertyId("sports")], + url="https://agent.example.com" + ) + ``` +""" + +AuthorizedAgentsByPropertyTag = AuthorizedAgents1 +"""Authorized agent with property tags. + +This variant uses authorization_type='property_tags' for agents authorized +to sell properties identified by matching tags. + +Fields: +- authorization_type: Literal['property_tags'] +- authorized_for: Human-readable description +- property_tags: List of PropertyTag (non-empty) +- url: Agent's API endpoint URL + +Example: + ```python + from adcp.types.aliases import AuthorizedAgentsByPropertyTag, PropertyTag + + agent = AuthorizedAgentsByPropertyTag( + authorization_type="property_tags", + authorized_for="Video inventory", + property_tags=[PropertyTag("video"), PropertyTag("premium")], + url="https://agent.example.com" + ) + ``` +""" + +AuthorizedAgentsByInlineProperties = AuthorizedAgents2 +"""Authorized agent with inline property definitions. + +This variant uses authorization_type='inline_properties' for agents with +inline Property objects rather than references to the top-level properties array. + +Fields: +- authorization_type: Literal['inline_properties'] +- authorized_for: Human-readable description +- properties: List of Property objects (non-empty) +- url: Agent's API endpoint URL + +Example: + ```python + from adcp.types.aliases import AuthorizedAgentsByInlineProperties + from adcp.types.stable import Property + + agent = AuthorizedAgentsByInlineProperties( + authorization_type="inline_properties", + authorized_for="Custom inventory bundle", + properties=[...], # Full Property objects + url="https://agent.example.com" + ) + ``` +""" + +AuthorizedAgentsByPublisherProperties = AuthorizedAgents3 +"""Authorized agent for properties from other publishers. + +This variant uses authorization_type='publisher_properties' for agents +authorized to sell inventory from other publisher domains. + +Fields: +- authorization_type: Literal['publisher_properties'] +- authorized_for: Human-readable description +- publisher_properties: List of PublisherPropertySelector variants (non-empty) +- url: Agent's API endpoint URL + +Example: + ```python + from adcp.types.aliases import ( + AuthorizedAgentsByPublisherProperties, + PublisherPropertiesAll + ) + + agent = AuthorizedAgentsByPublisherProperties( + authorization_type="publisher_properties", + authorized_for="Network inventory across publishers", + publisher_properties=[ + PublisherPropertiesAll( + publisher_domain="publisher1.com", + selection_type="all" + ) + ], + url="https://agent.example.com" + ) + ``` +""" + +# ============================================================================ +# UNION TYPE ALIASES - For Type Hints and Pattern Matching +# ============================================================================ +# These union aliases provide convenient types for function signatures, +# type hints, and pattern matching without having to manually construct +# the union each time. + +# Deployment union (for signals) +Deployment = PlatformDeployment | AgentDeployment +"""Union type for all deployment variants. + +Use this for type hints when a function accepts any deployment type: + +Example: + ```python + def process_deployment(deployment: Deployment) -> None: + if isinstance(deployment, PlatformDeployment): + print(f"Platform: {deployment.platform}") + elif isinstance(deployment, AgentDeployment): + print(f"Agent: {deployment.agent_url}") + ``` +""" + +# Destination union (for signals) +Destination = PlatformDestination | AgentDestination +"""Union type for all destination variants. + +Use this for type hints when a function accepts any destination type: + +Example: + ```python + def format_destination(dest: Destination) -> str: + if isinstance(dest, PlatformDestination): + return f"Platform: {dest.platform}" + elif isinstance(dest, AgentDestination): + return f"Agent: {dest.agent_url}" + ``` +""" + +# Authorized agent union (for adagents.json) +AuthorizedAgent = ( + AuthorizedAgentsByPropertyId + | AuthorizedAgentsByPropertyTag + | AuthorizedAgentsByInlineProperties + | AuthorizedAgentsByPublisherProperties +) +"""Union type for all authorized agent variants. + +Use this for type hints when processing agents from adagents.json: + +Example: + ```python + def validate_agent(agent: AuthorizedAgent) -> bool: + match agent.authorization_type: + case "property_ids": + return len(agent.property_ids) > 0 + case "property_tags": + return len(agent.property_tags) > 0 + case "inline_properties": + return len(agent.properties) > 0 + case "publisher_properties": + return len(agent.publisher_properties) > 0 + ``` +""" + +# Publisher properties union (for product requests) +PublisherProperties = ( + PublisherPropertiesAll | PublisherPropertiesById | PublisherPropertiesByTag +) +"""Union type for all publisher properties variants. + +Use this for type hints in product filtering: + +Example: + ```python + def filter_products(props: PublisherProperties) -> None: + match props.selection_type: + case "all": + print("All properties from publisher") + case "by_id": + print(f"Properties: {props.property_ids}") + case "by_tag": + print(f"Tags: {props.property_tags}") + ``` +""" + # ============================================================================ # EXPORTS # ============================================================================ @@ -500,6 +725,13 @@ "UrlDaastAsset", "UrlPreviewRender", "UrlVastAsset", + # Authorized agent variants + "AuthorizedAgentsByPropertyId", + "AuthorizedAgentsByPropertyTag", + "AuthorizedAgentsByInlineProperties", + "AuthorizedAgentsByPublisherProperties", + # Authorized agent union + "AuthorizedAgent", # Build creative responses "BuildCreativeSuccessResponse", "BuildCreativeErrorResponse", @@ -530,14 +762,20 @@ # Publisher properties types "PropertyId", "PropertyTag", - # Publisher properties aliases + # Publisher properties variants "PublisherPropertiesAll", "PublisherPropertiesById", "PublisherPropertiesByTag", - # Deployment aliases + # Publisher properties union + "PublisherProperties", + # Deployment variants "PlatformDeployment", "AgentDeployment", - # Destination aliases + # Deployment union + "Deployment", + # Destination variants "PlatformDestination", "AgentDestination", + # Destination union + "Destination", ] diff --git a/src/adcp/types/stable.py b/src/adcp/types/stable.py index 0149ea4..0a61822 100644 --- a/src/adcp/types/stable.py +++ b/src/adcp/types/stable.py @@ -25,12 +25,35 @@ # Core request/response types ActivateSignalRequest, ActivateSignalResponse, + Action, + AffectedPackage, + AggregatedTotals, # Assets + Asset, + AssetSelectors, + AssetType, + AssetTypeSchema, + AssetsRequired, + AssignedPackage, + Assignments, AudioAsset, + Authentication, + AuthorizedAgents, + AuthorizedSalesAgents, + AvailableMetric, + AvailableReportingFrequency, # Core domain types BrandManifest, # Clean single type after upstream schema fix BuildCreativeRequest, BuildCreativeResponse, + ByPackageItem, + Capability, + CatalogType, + CoBranding, + Colors, + Contact, + ContentLength, + Country, # Pricing options CpcPricingOption, CpcvPricingOption, @@ -41,45 +64,145 @@ CreateMediaBuyRequest, CreateMediaBuyResponse, Creative, + CreativeAgent, + CreativeAsset, + CreativeAssignment, CreativeManifest, + CreativePolicy, # Enums and constants CreativeStatus, CssAsset, + DaastVersion, + DailyBreakdownItem, + DeliverTo, + DeliveryMeasurement, + DeliveryMetrics, + DeliveryType, + Details, + Dimensions, + Direction, + Disclaimer, + Domain, + DomainBreakdown, + DoohMetrics, + Duration, + Embedding, Error, + FeedFormat, + FeedbackSource, + FieldModel, + FileSize, + Filters, FlatRatePricingOption, + Fonts, Format, + FormatCard, + FormatCardDetailed, FormatId, + FormatType, + FrequencyCap, + FrequencyCapScope, + GeoCountryAnyOfItem, GetMediaBuyDeliveryRequest, GetMediaBuyDeliveryResponse, GetProductsRequest, GetProductsResponse, GetSignalsRequest, GetSignalsResponse, + HistoryItem, HtmlAsset, + Identifier, ImageAsset, + Input, JavascriptAsset, + LandingPage, ListAuthorizedPropertiesRequest, ListAuthorizedPropertiesResponse, ListCreativeFormatsRequest, ListCreativeFormatsResponse, ListCreativesRequest, ListCreativesResponse, + Logo, MarkdownAsset, + MarkdownFlavor, + Measurement, + MeasurementPeriod, MediaBuy, + MediaBuyDelivery, MediaBuyStatus, + Metadata, + Method, + MetricType, + ModuleType, + NotificationType, + Offering, + OutputFormat, + Pacing, PackageRequest, + Packages, PackageStatus, + Pagination, + Parameters, + Performance, + PerformanceFeedback, + Placement, + Preview, PreviewCreativeRequest, PreviewCreativeResponse, + PreviewRender, PriceGuidance, + Pricing, PricingModel, + PrimaryCountry, Product, + ProductCard, + ProductCardDetailed, + ProductCatalog, + Progress, + PromotedOfferings, + PromotedProducts, Property, + PropertyIdentifierTypes, + PropertyType, + ProtocolEnvelope, + ProtocolResponse, ProvidePerformanceFeedbackRequest, ProvidePerformanceFeedbackResponse, + PublisherDomain, + PublisherIdentifierTypes, PushNotificationConfig, + Quality, + QuartileData, + QuerySummary, + Render, + ReportingCapabilities, + ReportingFrequency, + ReportingPeriod, + ReportingWebhook, + Request, + RequestedMetric, + Requirements, + Response, + ResponseType, + Responsive, + Results, + Scheme, + Security, + Signal, + SignalType, + Sort, + SortApplied, + StandardFormatIds, + Status, + StatusFilter, + StatusFilterEnum, + StatusSummary, SyncCreativesRequest, SyncCreativesResponse, + Tag, + Tags, + TargetingOverlay, + Task, TasksGetRequest, TasksGetResponse, TasksListRequest, @@ -87,12 +210,22 @@ TaskStatus, TaskType, TextAsset, + Totals, + TrackingEvent, + Type, + Unit, + UpdateFrequency, UpdateMediaBuyRequest, UpdateMediaBuyResponse, UrlAsset, + UrlType, + ValidationMode, + VastVersion, VcpmAuctionPricingOption, VcpmFixedRatePricingOption, + VenueBreakdownItem, VideoAsset, + ViewThreshold, WebhookAsset, WebhookPayload, ) @@ -113,46 +246,118 @@ # Request/Response types "ActivateSignalRequest", "ActivateSignalResponse", + "Action", + "AffectedPackage", + "AggregatedTotals", "BuildCreativeRequest", "BuildCreativeResponse", + "ByPackageItem", "CreateMediaBuyRequest", "CreateMediaBuyResponse", + "DailyBreakdownItem", + "Details", + "Domain", + "DomainBreakdown", "GetMediaBuyDeliveryRequest", "GetMediaBuyDeliveryResponse", "GetProductsRequest", "GetProductsResponse", "GetSignalsRequest", "GetSignalsResponse", + "HistoryItem", "ListAuthorizedPropertiesRequest", "ListAuthorizedPropertiesResponse", "ListCreativeFormatsRequest", "ListCreativeFormatsResponse", "ListCreativesRequest", "ListCreativesResponse", + "MediaBuyDelivery", "PreviewCreativeRequest", "PreviewCreativeResponse", + "Progress", + "ProtocolEnvelope", + "ProtocolResponse", "ProvidePerformanceFeedbackRequest", "ProvidePerformanceFeedbackResponse", + "QuerySummary", + "SortApplied", + "StatusSummary", "SyncCreativesRequest", "SyncCreativesResponse", + "Task", "TasksGetRequest", "TasksGetResponse", "TasksListRequest", "TasksListResponse", + "Totals", "UpdateMediaBuyRequest", "UpdateMediaBuyResponse", # Domain types - "BrandManifest", # Stable alias for BrandManifest1 (temporary until upstream fix) + "Asset", + "AssetSelectors", + "AssetType", + "AssetTypeSchema", + "AssetsRequired", + "AssignedPackage", + "Assignments", + "BrandManifest", + "Capability", + "CoBranding", + "Colors", + "Contact", "Creative", + "CreativeAgent", + "CreativeAsset", + "CreativeAssignment", "CreativeManifest", + "CreativePolicy", + "DeliveryMeasurement", + "DeliveryMetrics", + "Disclaimer", + "DoohMetrics", + "Embedding", "Error", + "FeedFormat", + "Filters", + "Fonts", "Format", + "FormatCard", + "FormatCardDetailed", "FormatId", + "Identifier", + "Input", + "LandingPage", + "Logo", "MediaBuy", + "Metadata", + "Offering", "Package", "PackageRequest", + "Packages", + "Parameters", + "Performance", + "PerformanceFeedback", + "Placement", + "Preview", + "PreviewRender", + "Pricing", "Product", + "ProductCard", + "ProductCardDetailed", + "ProductCatalog", + "PromotedOfferings", + "PromotedProducts", "Property", + "QuartileData", + "Render", + "Request", + "Response", + "Results", + "Signal", + "Tag", + "Tags", + "TargetingOverlay", + "VenueBreakdownItem", # Pricing-related types "CpcPricingOption", "CpcvPricingOption", @@ -164,15 +369,76 @@ "PriceGuidance", "VcpmAuctionPricingOption", "VcpmFixedRatePricingOption", - # Status enums + # Status enums & simple types + "CatalogType", + "ContentLength", + "Country", "CreativeStatus", + "DaastVersion", + "DeliverTo", + "DeliveryType", + "Dimensions", + "Direction", + "Duration", + "FeedbackSource", + "FieldModel", + "FileSize", + "FormatType", + "FrequencyCap", + "FrequencyCapScope", + "GeoCountryAnyOfItem", + "MarkdownFlavor", + "Measurement", + "MeasurementPeriod", "MediaBuyStatus", + "Method", + "MetricType", + "ModuleType", + "NotificationType", + "OutputFormat", + "Pacing", "PackageStatus", + "Pagination", "PricingModel", + "PrimaryCountry", + "PropertyIdentifierTypes", + "PropertyType", + "PublisherDomain", + "PublisherIdentifierTypes", + "Quality", + "ResponseType", + "Responsive", + "SignalType", + "Sort", + "StandardFormatIds", + "Status", + "StatusFilter", + "StatusFilterEnum", "TaskStatus", "TaskType", - # Configuration types + "TrackingEvent", + "Type", + "Unit", + "UpdateFrequency", + "UrlType", + "ValidationMode", + "VastVersion", + "ViewThreshold", + # Configuration & infrastructure types + "Authentication", + "AuthorizedAgents", + "AuthorizedSalesAgents", + "AvailableMetric", + "AvailableReportingFrequency", "PushNotificationConfig", + "ReportingCapabilities", + "ReportingFrequency", + "ReportingPeriod", + "ReportingWebhook", + "RequestedMetric", + "Requirements", + "Scheme", + "Security", # Assets "AudioAsset", "CssAsset", diff --git a/tests/test_type_aliases.py b/tests/test_type_aliases.py index 044244c..23e8cfd 100644 --- a/tests/test_type_aliases.py +++ b/tests/test_type_aliases.py @@ -561,7 +561,7 @@ def test_deployment_aliases_imports(): def test_deployment_aliases_point_to_correct_types(): """Test that Deployment aliases point to the correct generated types.""" from adcp import AgentDeployment, PlatformDeployment - from adcp.types.generated_poc.deployment import Deployment1, Deployment2 + from adcp.types._generated import Deployment1, Deployment2 # Verify aliases point to correct types assert PlatformDeployment is Deployment1 @@ -607,7 +607,7 @@ def test_destination_aliases_imports(): def test_destination_aliases_point_to_correct_types(): """Test that Destination aliases point to the correct generated types.""" from adcp import AgentDestination, PlatformDestination - from adcp.types.generated_poc.destination import Destination1, Destination2 + from adcp.types._generated import Destination1, Destination2 # Verify aliases point to correct types assert PlatformDestination is Destination1 From 8f3b0228649859754d19d7271519bf9a7f9fdadd Mon Sep 17 00:00:00 2001 From: Brian O'Kelley Date: Tue, 18 Nov 2025 22:16:16 -0500 Subject: [PATCH 2/2] fix: resolve linting errors in type exports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Run ruff --fix to auto-format import statements - Add GeneratedTaskStatus to __all__ exports All 295 tests passing. Fixes CI linting failures. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/adcp/types/__init__.py | 13 ++++++++----- src/adcp/types/stable.py | 6 +++--- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/adcp/types/__init__.py b/src/adcp/types/__init__.py index 61d5270..6b725b4 100644 --- a/src/adcp/types/__init__.py +++ b/src/adcp/types/__init__.py @@ -29,11 +29,11 @@ # Build creative responses BuildCreativeErrorResponse, BuildCreativeSuccessResponse, + # Package aliases + CreatedPackageReference, # Create media buy responses CreateMediaBuyErrorResponse, CreateMediaBuySuccessResponse, - # Package aliases - CreatedPackageReference, # Deployment union Deployment, # Destination union @@ -108,9 +108,9 @@ AggregatedTotals, Asset, AssetSelectors, + AssetsRequired, AssetType, AssetTypeSchema, - AssetsRequired, AssignedPackage, Assignments, AudioAsset, @@ -162,8 +162,8 @@ Duration, Embedding, Error, - FeedFormat, FeedbackSource, + FeedFormat, FieldModel, FileSize, Filters, @@ -282,7 +282,6 @@ TasksGetResponse, TasksListRequest, TasksListResponse, - TaskStatus as GeneratedTaskStatus, TaskType, TextAsset, Totals, @@ -304,6 +303,9 @@ WebhookAsset, WebhookPayload, ) +from adcp.types.stable import ( + TaskStatus as GeneratedTaskStatus, +) # Note: CoreTaskStatus is for internal task tracking # GeneratedTaskStatus from AdCP schema is available via adcp.types.stable @@ -317,6 +319,7 @@ "Protocol", "TaskResult", "TaskStatus", + "GeneratedTaskStatus", "WebhookMetadata", "Activity", "ActivityType", diff --git a/src/adcp/types/stable.py b/src/adcp/types/stable.py index 0a61822..d067c2f 100644 --- a/src/adcp/types/stable.py +++ b/src/adcp/types/stable.py @@ -22,18 +22,18 @@ from __future__ import annotations from adcp.types._generated import ( + Action, # Core request/response types ActivateSignalRequest, ActivateSignalResponse, - Action, AffectedPackage, AggregatedTotals, # Assets Asset, AssetSelectors, + AssetsRequired, AssetType, AssetTypeSchema, - AssetsRequired, AssignedPackage, Assignments, AudioAsset, @@ -88,8 +88,8 @@ Duration, Embedding, Error, - FeedFormat, FeedbackSource, + FeedFormat, FieldModel, FileSize, Filters,