|
16 | 16 | from pydantic import BaseModel, Field |
17 | 17 |
|
18 | 18 |
|
| 19 | +# ============================================================================ |
| 20 | +# MISSING SCHEMA TYPES (referenced but not provided by upstream) |
| 21 | +# ============================================================================ |
| 22 | + |
| 23 | +# These types are referenced in schemas but don't have schema files |
| 24 | +# Defining them as type aliases to maintain type safety |
| 25 | +FormatId = str |
| 26 | +PackageRequest = dict[str, Any] |
| 27 | +PushNotificationConfig = dict[str, Any] |
| 28 | +ReportingCapabilities = dict[str, Any] |
| 29 | + |
| 30 | + |
19 | 31 | # ============================================================================ |
20 | 32 | # CORE DOMAIN TYPES |
21 | 33 | # ============================================================================ |
@@ -111,10 +123,9 @@ class BrandManifest(BaseModel): |
111 | 123 | metadata: dict[str, Any] | None = Field(None, description="Additional brand metadata") |
112 | 124 |
|
113 | 125 |
|
114 | | -class BrandManifestRef(BaseModel): |
115 | | - """Brand manifest provided either as an inline object or a URL string pointing to a hosted manifest""" |
116 | | - |
117 | | - pass |
| 126 | +# Type alias for Brand Manifest Reference |
| 127 | +# Brand manifest provided either as an inline object or a URL string pointing to a hosted manifest |
| 128 | +BrandManifestRef = Any |
118 | 129 |
|
119 | 130 |
|
120 | 131 | class Format(BaseModel): |
@@ -240,10 +251,9 @@ class PerformanceFeedback(BaseModel): |
240 | 251 | applied_at: str | None = Field(None, description="ISO 8601 timestamp when feedback was applied to optimization algorithms") |
241 | 252 |
|
242 | 253 |
|
243 | | -class StartTiming(BaseModel): |
244 | | - """Campaign start timing: 'asap' or ISO 8601 date-time""" |
245 | | - |
246 | | - pass |
| 254 | +# Type alias for Start Timing |
| 255 | +# Campaign start timing: 'asap' or ISO 8601 date-time |
| 256 | +StartTiming = Any |
247 | 257 |
|
248 | 258 |
|
249 | 259 | class SubAsset(BaseModel): |
@@ -300,6 +310,56 @@ class PromotedProducts(BaseModel): |
300 | 310 | manifest_query: str | None = Field(None, description="Natural language query to select products from the brand manifest (e.g., 'all Kraft Heinz pasta sauces', 'organic products under $20')") |
301 | 311 |
|
302 | 312 |
|
| 313 | +# Type alias for Advertising Channels |
| 314 | +# Standard advertising channels supported by AdCP |
| 315 | +Channels = Literal["display", "video", "audio", "native", "dooh", "ctv", "podcast", "retail", "social"] |
| 316 | + |
| 317 | + |
| 318 | +# Type alias for Delivery Type |
| 319 | +# Type of inventory delivery |
| 320 | +DeliveryType = Literal["guaranteed", "non_guaranteed"] |
| 321 | + |
| 322 | + |
| 323 | +# Type alias for Pacing |
| 324 | +# Budget pacing strategy |
| 325 | +Pacing = Literal["even", "asap", "front_loaded"] |
| 326 | + |
| 327 | + |
| 328 | +# Type alias for Package Status |
| 329 | +# Status of a package |
| 330 | +PackageStatus = Literal["draft", "active", "paused", "completed"] |
| 331 | + |
| 332 | + |
| 333 | +# Type alias for Media Buy Status |
| 334 | +# Status of a media buy |
| 335 | +MediaBuyStatus = Literal["pending_activation", "active", "paused", "completed"] |
| 336 | + |
| 337 | + |
| 338 | +# Type alias for Task Type |
| 339 | +# Valid AdCP task types across all domains. These represent the complete set of operations that can be tracked via the task management system. |
| 340 | +TaskType = Literal["create_media_buy", "update_media_buy", "sync_creatives", "activate_signal", "get_signals"] |
| 341 | + |
| 342 | + |
| 343 | +# Type alias for Task Status |
| 344 | +# Standardized task status values based on A2A TaskState enum. Indicates the current state of any AdCP operation. |
| 345 | +TaskStatus = Literal["submitted", "working", "input-required", "completed", "canceled", "failed", "rejected", "auth-required", "unknown"] |
| 346 | + |
| 347 | + |
| 348 | +# Type alias for Pricing Model |
| 349 | +# Supported pricing models for advertising products |
| 350 | +PricingModel = Literal["cpm", "vcpm", "cpc", "cpcv", "cpv", "cpp", "flat_rate"] |
| 351 | + |
| 352 | + |
| 353 | +# Type alias for Pricing Option |
| 354 | +# A pricing model option offered by a publisher for a product. Each pricing model has its own schema with model-specific requirements. |
| 355 | +PricingOption = Any |
| 356 | + |
| 357 | + |
| 358 | +# Type alias for Standard Format IDs |
| 359 | +# Enumeration of all standard creative format identifiers in AdCP |
| 360 | +StandardFormatIds = Literal["display_300x250", "display_728x90", "display_320x50", "display_160x600", "display_970x250", "display_336x280", "display_expandable_300x250", "display_expandable_728x90", "display_interstitial_320x480", "display_interstitial_desktop", "display_dynamic_300x250", "display_responsive", "native_in_feed", "native_content_recommendation", "native_product", "video_skippable_15s", "video_skippable_30s", "video_non_skippable_15s", "video_non_skippable_30s", "video_outstream_autoplay", "video_vertical_story", "video_rewarded_30s", "video_pause_ad", "video_ctv_non_skippable_30s", "audio_standard_15s", "audio_standard_30s", "audio_podcast_host_read", "audio_programmatic", "universal_carousel", "universal_canvas", "universal_takeover", "universal_gallery", "universal_reveal", "dooh_landscape_static", "dooh_portrait_video"] |
| 361 | + |
| 362 | + |
303 | 363 |
|
304 | 364 | # ============================================================================ |
305 | 365 | # TASK REQUEST/RESPONSE TYPES |
|
0 commit comments