adcp 1.2.0__py3-none-any.whl → 1.3.0__py3-none-any.whl

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/types/generated.py CHANGED
@@ -14,20 +14,9 @@ from __future__ import annotations
14
14
  import re
15
15
  from typing import Any, Literal
16
16
 
17
- from pydantic import BaseModel, Field, field_validator
17
+ from pydantic import BaseModel, ConfigDict, Field, field_validator
18
18
 
19
19
 
20
- # ============================================================================
21
- # MISSING SCHEMA TYPES (referenced but not provided by upstream)
22
- # ============================================================================
23
-
24
- # These types are referenced in schemas but don't have schema files
25
- # Defining them as type aliases to maintain type safety
26
- ActivationKey = dict[str, Any]
27
- PackageRequest = dict[str, Any]
28
- PushNotificationConfig = dict[str, Any]
29
- ReportingCapabilities = dict[str, Any]
30
-
31
20
 
32
21
  # ============================================================================
33
22
  # CORE DOMAIN TYPES
@@ -287,13 +276,28 @@ class StartTimingVariant2(BaseModel):
287
276
  StartTiming = StartTimingVariant1 | StartTimingVariant2
288
277
 
289
278
 
290
- class SubAsset(BaseModel):
291
- """Sub-asset for multi-asset creative formats, including carousel images and native ad template variables"""
279
+ # Sub-asset for multi-asset creative formats, including carousel images and native ad template variables
280
+
281
+ class MediaSubAsset(BaseModel):
282
+ model_config = ConfigDict(extra="forbid")
283
+
284
+ asset_kind: Literal["media"] = Field(description="Discriminator indicating this is a media asset with content_uri")
285
+ asset_type: str = Field(description="Type of asset. Common types: thumbnail_image, product_image, featured_image, logo")
286
+ asset_id: str = Field(description="Unique identifier for the asset within the creative")
287
+ content_uri: str = Field(description="URL for media assets (images, videos, etc.)")
288
+
292
289
 
293
- asset_type: str | None = Field(None, description="Type of asset. Common types: headline, body_text, thumbnail_image, product_image, featured_image, logo, cta_text, price_text, sponsor_name, author_name, click_url")
294
- asset_id: str | None = Field(None, description="Unique identifier for the asset within the creative")
295
- content_uri: str | None = Field(None, description="URL for media assets (images, videos, etc.)")
296
- content: Any | None = Field(None, description="Text content for text-based assets like headlines, body text, CTA text, etc.")
290
+ class TextSubAsset(BaseModel):
291
+ model_config = ConfigDict(extra="forbid")
292
+
293
+ asset_kind: Literal["text"] = Field(description="Discriminator indicating this is a text asset with content")
294
+ asset_type: str = Field(description="Type of asset. Common types: headline, body_text, cta_text, price_text, sponsor_name, author_name, click_url")
295
+ asset_id: str = Field(description="Unique identifier for the asset within the creative")
296
+ content: Any = Field(description="Text content for text-based assets like headlines, body text, CTA text, etc.")
297
+
298
+
299
+ # Union type for Sub-Asset
300
+ SubAsset = MediaSubAsset | TextSubAsset
297
301
 
298
302
 
299
303
  class WebhookPayload(BaseModel):
@@ -308,7 +312,7 @@ class WebhookPayload(BaseModel):
308
312
  message: str | None = Field(None, description="Human-readable summary of the current task state. Provides context about what happened and what action may be needed.")
309
313
  context_id: str | None = Field(None, description="Session/conversation identifier. Use this to continue the conversation if input-required status needs clarification or additional parameters.")
310
314
  progress: dict[str, Any] | None = Field(None, description="Progress information for tasks still in 'working' state. Rarely seen in webhooks since 'working' tasks typically complete synchronously, but may appear if a task transitions from 'submitted' to 'working'.")
311
- result: Any | None = Field(None, description="Task-specific payload for this status update. For 'completed', contains the final result. For 'input-required', may contain approval or clarification context. Optional for non-terminal updates.")
315
+ result: Any | None = Field(None, description="Task-specific payload for this status update. Validated against the appropriate response schema based on task_type.")
312
316
  error: Any | None = Field(None, description="Error message for failed tasks. Only present when status is 'failed'.")
313
317
 
314
318
 
@@ -344,12 +348,16 @@ class PromotedProducts(BaseModel):
344
348
  # A destination platform where signals can be activated (DSP, sales agent, etc.)
345
349
 
346
350
  class PlatformDestination(BaseModel):
351
+ model_config = ConfigDict(extra="forbid")
352
+
347
353
  type: Literal["platform"] = Field(description="Discriminator indicating this is a platform-based destination")
348
354
  platform: str = Field(description="Platform identifier for DSPs (e.g., 'the-trade-desk', 'amazon-dsp')")
349
355
  account: str | None = Field(None, description="Optional account identifier on the platform")
350
356
 
351
357
 
352
358
  class AgentDestination(BaseModel):
359
+ model_config = ConfigDict(extra="forbid")
360
+
353
361
  type: Literal["agent"] = Field(description="Discriminator indicating this is an agent URL-based destination")
354
362
  agent_url: str = Field(description="URL identifying the destination agent (for sales agents, etc.)")
355
363
  account: str | None = Field(None, description="Optional account identifier on the agent")
@@ -362,6 +370,8 @@ Destination = PlatformDestination | AgentDestination
362
370
  # A signal deployment to a specific destination platform with activation status and key
363
371
 
364
372
  class PlatformDeployment(BaseModel):
373
+ model_config = ConfigDict(extra="forbid")
374
+
365
375
  type: Literal["platform"] = Field(description="Discriminator indicating this is a platform-based deployment")
366
376
  platform: str = Field(description="Platform identifier for DSPs")
367
377
  account: str | None = Field(None, description="Account identifier if applicable")
@@ -372,6 +382,8 @@ class PlatformDeployment(BaseModel):
372
382
 
373
383
 
374
384
  class AgentDeployment(BaseModel):
385
+ model_config = ConfigDict(extra="forbid")
386
+
375
387
  type: Literal["agent"] = Field(description="Discriminator indicating this is an agent URL-based deployment")
376
388
  agent_url: str = Field(description="URL identifying the destination agent")
377
389
  account: str | None = Field(None, description="Account identifier if applicable")
@@ -385,6 +397,45 @@ class AgentDeployment(BaseModel):
385
397
  Deployment = PlatformDeployment | AgentDeployment
386
398
 
387
399
 
400
+ # Universal identifier for using a signal on a destination platform. Can be either a segment ID or a key-value pair depending on the platform's targeting mechanism.
401
+
402
+ class Segment_idActivationKey(BaseModel):
403
+ model_config = ConfigDict(extra="forbid")
404
+
405
+ type: Literal["segment_id"] = Field(description="Segment ID based targeting")
406
+ segment_id: str = Field(description="The platform-specific segment identifier to use in campaign targeting")
407
+
408
+
409
+ class Key_valueActivationKey(BaseModel):
410
+ model_config = ConfigDict(extra="forbid")
411
+
412
+ type: Literal["key_value"] = Field(description="Key-value pair based targeting")
413
+ key: str = Field(description="The targeting parameter key")
414
+ value: str = Field(description="The targeting parameter value")
415
+
416
+
417
+ # Union type for Activation Key
418
+ ActivationKey = Segment_idActivationKey | Key_valueActivationKey
419
+
420
+
421
+ class PushNotificationConfig(BaseModel):
422
+ """Webhook configuration for asynchronous task notifications. Uses A2A-compatible PushNotificationConfig structure. Supports Bearer tokens (simple) or HMAC signatures (production-recommended)."""
423
+
424
+ url: str = Field(description="Webhook endpoint URL for task status notifications")
425
+ token: str | None = Field(None, description="Optional client-provided token for webhook validation. Echoed back in webhook payload to validate request authenticity.")
426
+ authentication: dict[str, Any] = Field(description="Authentication configuration for webhook delivery (A2A-compatible)")
427
+
428
+
429
+ class ReportingCapabilities(BaseModel):
430
+ """Reporting capabilities available for a product"""
431
+
432
+ available_reporting_frequencies: list[Literal["hourly", "daily", "monthly"]] = Field(description="Supported reporting frequency options")
433
+ expected_delay_minutes: int = Field(description="Expected delay in minutes before reporting data becomes available (e.g., 240 for 4-hour delay)")
434
+ timezone: str = Field(description="Timezone for reporting periods. Use 'UTC' or IANA timezone (e.g., 'America/New_York'). Critical for daily/monthly frequency alignment.")
435
+ supports_webhooks: bool = Field(description="Whether this product supports webhook-based reporting notifications")
436
+ available_metrics: list[Literal["impressions", "spend", "clicks", "ctr", "video_completions", "completion_rate", "conversions", "viewability", "engagement_rate"]] = Field(description="Metrics available in reporting. Impressions and spend are always implicitly included.")
437
+
438
+
388
439
  # Type alias for Advertising Channels
389
440
  # Standard advertising channels supported by AdCP
390
441
  Channels = Literal["display", "video", "audio", "native", "dooh", "ctv", "podcast", "retail", "social"]
@@ -472,17 +523,118 @@ PricingOption = PricingOptionVariant1 | PricingOptionVariant2 | PricingOptionVar
472
523
  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"]
473
524
 
474
525
 
526
+ # VAST (Video Ad Serving Template) tag for third-party video ad serving
527
+
528
+ class UrlVastAsset(BaseModel):
529
+ model_config = ConfigDict(extra="forbid")
530
+
531
+ delivery_type: Literal["url"] = Field(description="Discriminator indicating VAST is delivered via URL endpoint")
532
+ url: str = Field(description="URL endpoint that returns VAST XML")
533
+ vast_version: Literal["2.0", "3.0", "4.0", "4.1", "4.2"] | None = Field(None, description="VAST specification version")
534
+ vpaid_enabled: bool | None = Field(None, description="Whether VPAID (Video Player-Ad Interface Definition) is supported")
535
+ duration_ms: int | None = Field(None, description="Expected video duration in milliseconds (if known)")
536
+ tracking_events: list[Literal["start", "firstQuartile", "midpoint", "thirdQuartile", "complete", "impression", "click", "pause", "resume", "skip", "mute", "unmute", "fullscreen", "exitFullscreen", "playerExpand", "playerCollapse"]] | None = Field(None, description="Tracking events supported by this VAST tag")
537
+
538
+
539
+ class InlineVastAsset(BaseModel):
540
+ model_config = ConfigDict(extra="forbid")
541
+
542
+ delivery_type: Literal["inline"] = Field(description="Discriminator indicating VAST is delivered as inline XML content")
543
+ content: str = Field(description="Inline VAST XML content")
544
+ vast_version: Literal["2.0", "3.0", "4.0", "4.1", "4.2"] | None = Field(None, description="VAST specification version")
545
+ vpaid_enabled: bool | None = Field(None, description="Whether VPAID (Video Player-Ad Interface Definition) is supported")
546
+ duration_ms: int | None = Field(None, description="Expected video duration in milliseconds (if known)")
547
+ tracking_events: list[Literal["start", "firstQuartile", "midpoint", "thirdQuartile", "complete", "impression", "click", "pause", "resume", "skip", "mute", "unmute", "fullscreen", "exitFullscreen", "playerExpand", "playerCollapse"]] | None = Field(None, description="Tracking events supported by this VAST tag")
548
+
549
+
550
+ # Union type for VAST Asset
551
+ VastAsset = UrlVastAsset | InlineVastAsset
552
+
553
+
554
+ # DAAST (Digital Audio Ad Serving Template) tag for third-party audio ad serving
555
+
556
+ class UrlDaastAsset(BaseModel):
557
+ model_config = ConfigDict(extra="forbid")
558
+
559
+ delivery_type: Literal["url"] = Field(description="Discriminator indicating DAAST is delivered via URL endpoint")
560
+ url: str = Field(description="URL endpoint that returns DAAST XML")
561
+ daast_version: Literal["1.0", "1.1"] | None = Field(None, description="DAAST specification version")
562
+ duration_ms: int | None = Field(None, description="Expected audio duration in milliseconds (if known)")
563
+ tracking_events: list[Literal["start", "firstQuartile", "midpoint", "thirdQuartile", "complete", "impression", "pause", "resume", "skip", "mute", "unmute"]] | None = Field(None, description="Tracking events supported by this DAAST tag")
564
+ companion_ads: bool | None = Field(None, description="Whether companion display ads are included")
565
+
566
+
567
+ class InlineDaastAsset(BaseModel):
568
+ model_config = ConfigDict(extra="forbid")
569
+
570
+ delivery_type: Literal["inline"] = Field(description="Discriminator indicating DAAST is delivered as inline XML content")
571
+ content: str = Field(description="Inline DAAST XML content")
572
+ daast_version: Literal["1.0", "1.1"] | None = Field(None, description="DAAST specification version")
573
+ duration_ms: int | None = Field(None, description="Expected audio duration in milliseconds (if known)")
574
+ tracking_events: list[Literal["start", "firstQuartile", "midpoint", "thirdQuartile", "complete", "impression", "pause", "resume", "skip", "mute", "unmute"]] | None = Field(None, description="Tracking events supported by this DAAST tag")
575
+ companion_ads: bool | None = Field(None, description="Whether companion display ads are included")
576
+
577
+
578
+ # Union type for DAAST Asset
579
+ DaastAsset = UrlDaastAsset | InlineDaastAsset
580
+
581
+
582
+ # A single rendered piece of a creative preview with discriminated output format
583
+
584
+ class UrlPreviewRender(BaseModel):
585
+ """URL-only preview format"""
586
+
587
+ model_config = ConfigDict(extra="forbid")
588
+
589
+ render_id: str = Field(description="Unique identifier for this rendered piece within the variant")
590
+ output_format: Literal["url"] = Field(description="Discriminator indicating preview_url is provided")
591
+ preview_url: str = Field(description="URL to an HTML page that renders this piece. Can be embedded in an iframe.")
592
+ role: str = Field(description="Semantic role of this rendered piece. Use 'primary' for main content, 'companion' for associated banners, descriptive strings for device variants or custom roles.")
593
+ dimensions: dict[str, Any] | None = Field(None, description="Dimensions for this rendered piece")
594
+ embedding: dict[str, Any] | None = Field(None, description="Optional security and embedding metadata for safe iframe integration")
595
+
596
+
597
+ class HtmlPreviewRender(BaseModel):
598
+ """HTML-only preview format"""
599
+
600
+ model_config = ConfigDict(extra="forbid")
601
+
602
+ render_id: str = Field(description="Unique identifier for this rendered piece within the variant")
603
+ output_format: Literal["html"] = Field(description="Discriminator indicating preview_html is provided")
604
+ preview_html: str = Field(description="Raw HTML for this rendered piece. Can be embedded directly in the page without iframe. Security warning: Only use with trusted creative agents as this bypasses iframe sandboxing.")
605
+ role: str = Field(description="Semantic role of this rendered piece. Use 'primary' for main content, 'companion' for associated banners, descriptive strings for device variants or custom roles.")
606
+ dimensions: dict[str, Any] | None = Field(None, description="Dimensions for this rendered piece")
607
+ embedding: dict[str, Any] | None = Field(None, description="Optional security and embedding metadata")
608
+
609
+
610
+ class BothPreviewRender(BaseModel):
611
+ """Both URL and HTML preview format"""
612
+
613
+ model_config = ConfigDict(extra="forbid")
614
+
615
+ render_id: str = Field(description="Unique identifier for this rendered piece within the variant")
616
+ output_format: Literal["both"] = Field(description="Discriminator indicating both preview_url and preview_html are provided")
617
+ preview_url: str = Field(description="URL to an HTML page that renders this piece. Can be embedded in an iframe.")
618
+ preview_html: str = Field(description="Raw HTML for this rendered piece. Can be embedded directly in the page without iframe. Security warning: Only use with trusted creative agents as this bypasses iframe sandboxing.")
619
+ role: str = Field(description="Semantic role of this rendered piece. Use 'primary' for main content, 'companion' for associated banners, descriptive strings for device variants or custom roles.")
620
+ dimensions: dict[str, Any] | None = Field(None, description="Dimensions for this rendered piece")
621
+ embedding: dict[str, Any] | None = Field(None, description="Optional security and embedding metadata for safe iframe integration")
622
+
623
+
624
+ # Union type for Preview Render
625
+ PreviewRender = UrlPreviewRender | HtmlPreviewRender | BothPreviewRender
626
+
627
+
475
628
 
476
629
  # ============================================================================
477
630
  # TASK REQUEST/RESPONSE TYPES
478
631
  # ============================================================================
479
632
 
480
633
  class ActivateSignalRequest(BaseModel):
481
- """Request parameters for activating a signal on a specific platform/account"""
634
+ """Request parameters for activating a signal on a specific destination"""
482
635
 
483
636
  signal_agent_segment_id: str = Field(description="The universal identifier for the signal to activate")
484
- platform: str = Field(description="The target platform for activation")
485
- account: str | None = Field(None, description="Account identifier (required for account-specific activation)")
637
+ destinations: list[Destination] = Field(description="Target destination(s) for activation. If the authenticated caller matches one of these destinations, activation keys will be included in the response.")
486
638
 
487
639
 
488
640
  class BuildCreativeRequest(BaseModel):
@@ -527,7 +679,7 @@ class GetSignalsRequest(BaseModel):
527
679
  """Request parameters for discovering signals based on description"""
528
680
 
529
681
  signal_spec: str = Field(description="Natural language description of the desired signals")
530
- deliver_to: dict[str, Any] = Field(description="Where the signals need to be delivered")
682
+ deliver_to: dict[str, Any] = Field(description="Destination platforms where signals need to be activated")
531
683
  filters: dict[str, Any] | None = Field(None, description="Filters to refine results")
532
684
  max_results: int | None = Field(None, description="Maximum number of results to return")
533
685
 
@@ -564,6 +716,21 @@ class ListCreativesRequest(BaseModel):
564
716
  fields: list[Literal["creative_id", "name", "format", "status", "created_date", "updated_date", "tags", "assignments", "performance", "sub_assets"]] | None = Field(None, description="Specific fields to include in response (omit for all fields)")
565
717
 
566
718
 
719
+ class PackageRequest(BaseModel):
720
+ """Package configuration for media buy creation"""
721
+
722
+ buyer_ref: str = Field(description="Buyer's reference identifier for this package")
723
+ product_id: str = Field(description="Product ID for this package")
724
+ format_ids: list[FormatId] | None = Field(None, description="Array of format IDs that will be used for this package - must be supported by the product. If omitted, defaults to all formats supported by the product.")
725
+ budget: float = Field(description="Budget allocation for this package in the media buy's currency")
726
+ pacing: Pacing | None = None
727
+ pricing_option_id: str = Field(description="ID of the selected pricing option from the product's pricing_options array")
728
+ bid_price: float | None = Field(None, description="Bid price for auction-based CPM pricing (required if using cpm-auction-option)")
729
+ targeting_overlay: Targeting | None = None
730
+ creative_ids: list[str] | None = Field(None, description="Creative IDs to assign to this package at creation time (references existing library creatives)")
731
+ creatives: list[CreativeAsset] | None = Field(None, description="Full creative objects to upload and assign to this package at creation time (alternative to creative_ids - creatives will be added to library). Supports both static and generative creatives.")
732
+
733
+
567
734
  class ProvidePerformanceFeedbackRequest(BaseModel):
568
735
  """Request payload for provide_performance_feedback task"""
569
736
 
@@ -588,6 +755,22 @@ class SyncCreativesRequest(BaseModel):
588
755
  push_notification_config: PushNotificationConfig | None = Field(None, description="Optional webhook configuration for async sync notifications. Publisher will send webhook when sync completes if operation takes longer than immediate response time (typically for large bulk operations or manual approval/HITL).")
589
756
 
590
757
 
758
+ class TasksGetRequest(BaseModel):
759
+ """Request parameters for retrieving a specific task by ID with optional conversation history across all AdCP domains"""
760
+
761
+ task_id: str = Field(description="Unique identifier of the task to retrieve")
762
+ include_history: bool | None = Field(None, description="Include full conversation history for this task (may increase response size)")
763
+
764
+
765
+ class TasksListRequest(BaseModel):
766
+ """Request parameters for listing and filtering async tasks across all AdCP domains with state reconciliation capabilities"""
767
+
768
+ filters: dict[str, Any] | None = Field(None, description="Filter criteria for querying tasks")
769
+ sort: dict[str, Any] | None = Field(None, description="Sorting parameters")
770
+ pagination: dict[str, Any] | None = Field(None, description="Pagination parameters")
771
+ include_history: bool | None = Field(None, description="Include full conversation history for each task (may significantly increase response size)")
772
+
773
+
591
774
  class UpdateMediaBuyRequest(BaseModel):
592
775
  """Request parameters for updating campaign and package settings"""
593
776
 
@@ -600,30 +783,26 @@ class UpdateMediaBuyRequest(BaseModel):
600
783
  push_notification_config: PushNotificationConfig | None = Field(None, description="Optional webhook configuration for async update notifications. Publisher will send webhook when update completes if operation takes longer than immediate response time.")
601
784
 
602
785
 
603
- class ActivateSignalResponse(BaseModel):
604
- """Response payload for activate_signal task"""
786
+ # Response containing the transformed or generated creative manifest, ready for use with preview_creative or sync_creatives. Returns either the complete creative manifest OR error information, never both.
605
787
 
606
- decisioning_platform_segment_id: str | None = Field(None, description="The platform-specific ID to use once activated")
607
- estimated_activation_duration_minutes: float | None = Field(None, description="Estimated time to complete (optional)")
608
- deployed_at: str | None = Field(None, description="Timestamp when activation completed (optional)")
609
- errors: list[Error] | None = Field(None, description="Task-specific errors and warnings (e.g., activation failures, platform issues)")
788
+ class BuildCreativeResponseVariant1(BaseModel):
789
+ """Success response - creative manifest generated successfully"""
610
790
 
611
-
612
- class BuildCreativeResponse(BaseModel):
613
- """Response containing the transformed or generated creative manifest, ready for use with preview_creative or sync_creatives"""
791
+ model_config = ConfigDict(extra="forbid")
614
792
 
615
793
  creative_manifest: CreativeManifest = Field(description="The generated or transformed creative manifest")
616
- errors: list[Error] | None = Field(None, description="Task-specific errors and warnings")
617
794
 
618
795
 
619
- class CreateMediaBuyResponse(BaseModel):
620
- """Response payload for create_media_buy task"""
796
+ class BuildCreativeResponseVariant2(BaseModel):
797
+ """Error response - creative generation failed"""
798
+
799
+ model_config = ConfigDict(extra="forbid")
800
+
801
+ errors: list[Error] = Field(description="Array of errors explaining why creative generation failed")
621
802
 
622
- media_buy_id: str | None = Field(None, description="Publisher's unique identifier for the created media buy")
623
- buyer_ref: str = Field(description="Buyer's reference identifier for this media buy")
624
- creative_deadline: str | None = Field(None, description="ISO 8601 timestamp for creative upload deadline")
625
- packages: list[dict[str, Any]] | None = Field(None, description="Array of created packages")
626
- errors: list[Error] | None = Field(None, description="Task-specific errors and warnings (e.g., partial package creation failures)")
803
+
804
+ # Union type for Build Creative Response
805
+ BuildCreativeResponse = BuildCreativeResponseVariant1 | BuildCreativeResponseVariant2
627
806
 
628
807
 
629
808
  class GetMediaBuyDeliveryResponse(BaseModel):
@@ -685,28 +864,50 @@ class ListCreativesResponse(BaseModel):
685
864
  status_summary: dict[str, Any] | None = Field(None, description="Breakdown of creatives by status")
686
865
 
687
866
 
688
- class ProvidePerformanceFeedbackResponse(BaseModel):
689
- """Response payload for provide_performance_feedback task"""
867
+ # Response payload for provide_performance_feedback task. Returns either success confirmation OR error information, never both.
868
+
869
+ class ProvidePerformanceFeedbackResponseVariant1(BaseModel):
870
+ """Success response - feedback received and processed"""
871
+
872
+ model_config = ConfigDict(extra="forbid")
873
+
874
+ success: Literal[True] = Field(description="Whether the performance feedback was successfully received")
875
+
876
+
877
+ class ProvidePerformanceFeedbackResponseVariant2(BaseModel):
878
+ """Error response - feedback rejected or could not be processed"""
879
+
880
+ model_config = ConfigDict(extra="forbid")
690
881
 
691
- success: bool = Field(description="Whether the performance feedback was successfully received")
692
- errors: list[Error] | None = Field(None, description="Task-specific errors and warnings (e.g., invalid measurement period, missing campaign data)")
882
+ errors: list[Error] = Field(description="Array of errors explaining why feedback was rejected (e.g., invalid measurement period, missing campaign data)")
693
883
 
694
884
 
695
- class SyncCreativesResponse(BaseModel):
696
- """Response from creative sync operation with results for each creative"""
885
+ # Union type for Provide Performance Feedback Response
886
+ ProvidePerformanceFeedbackResponse = ProvidePerformanceFeedbackResponseVariant1 | ProvidePerformanceFeedbackResponseVariant2
697
887
 
698
- dry_run: bool | None = Field(None, description="Whether this was a dry run (no actual changes made)")
699
- creatives: list[dict[str, Any]] = Field(description="Results for each creative processed")
700
888
 
889
+ class TasksGetResponse(BaseModel):
890
+ """Response containing detailed information about a specific task including status and optional conversation history across all AdCP domains"""
701
891
 
702
- class UpdateMediaBuyResponse(BaseModel):
703
- """Response payload for update_media_buy task"""
892
+ task_id: str = Field(description="Unique identifier for this task")
893
+ task_type: TaskType = Field(description="Type of AdCP operation")
894
+ domain: Literal["media-buy", "signals"] = Field(description="AdCP domain this task belongs to")
895
+ status: TaskStatus = Field(description="Current task status")
896
+ created_at: str = Field(description="When the task was initially created (ISO 8601)")
897
+ updated_at: str = Field(description="When the task was last updated (ISO 8601)")
898
+ completed_at: str | None = Field(None, description="When the task completed (ISO 8601, only for completed/failed/canceled tasks)")
899
+ has_webhook: bool | None = Field(None, description="Whether this task has webhook configuration")
900
+ progress: dict[str, Any] | None = Field(None, description="Progress information for long-running tasks")
901
+ error: dict[str, Any] | None = Field(None, description="Error details for failed tasks")
902
+ history: list[dict[str, Any]] | None = Field(None, description="Complete conversation history for this task (only included if include_history was true in request)")
704
903
 
705
- media_buy_id: str = Field(description="Publisher's identifier for the media buy")
706
- buyer_ref: str = Field(description="Buyer's reference identifier for the media buy")
707
- implementation_date: Any | None = Field(None, description="ISO 8601 timestamp when changes take effect (null if pending approval)")
708
- affected_packages: list[dict[str, Any]] | None = Field(None, description="Array of packages that were modified")
709
- errors: list[Error] | None = Field(None, description="Task-specific errors and warnings (e.g., partial update failures)")
904
+
905
+ class TasksListResponse(BaseModel):
906
+ """Response from task listing query with filtered results and state reconciliation data across all AdCP domains"""
907
+
908
+ query_summary: dict[str, Any] = Field(description="Summary of the query that was executed")
909
+ tasks: list[dict[str, Any]] = Field(description="Array of tasks matching the query criteria")
910
+ pagination: dict[str, Any] = Field(description="Pagination information")
710
911
 
711
912
 
712
913
 
@@ -761,3 +962,211 @@ class PreviewCreativeResponse(BaseModel):
761
962
 
762
963
  # Batch mode field
763
964
  results: list[dict[str, Any]] | None = Field(default=None, description="Array of preview results for batch processing")
965
+
966
+
967
+ # ============================================================================
968
+ # ONEOF DISCRIMINATED UNIONS FOR RESPONSE TYPES
969
+ # ============================================================================
970
+ # These response types use oneOf semantics: success XOR error, never both.
971
+ # Implemented as Union types with distinct Success/Error variants.
972
+
973
+
974
+ class ActivateSignalSuccess(BaseModel):
975
+ """Successful signal activation response"""
976
+
977
+ decisioning_platform_segment_id: str = Field(
978
+ description="The platform-specific ID to use once activated"
979
+ )
980
+ estimated_activation_duration_minutes: float | None = None
981
+ deployed_at: str | None = None
982
+
983
+
984
+ class ActivateSignalError(BaseModel):
985
+ """Failed signal activation response"""
986
+
987
+ errors: list[Error] = Field(description="Task-specific errors and warnings")
988
+
989
+
990
+ # Override the generated ActivateSignalResponse type alias
991
+ ActivateSignalResponse = ActivateSignalSuccess | ActivateSignalError
992
+
993
+
994
+ class CreateMediaBuySuccess(BaseModel):
995
+ """Successful media buy creation response"""
996
+
997
+ media_buy_id: str = Field(description="The unique ID for the media buy")
998
+ buyer_ref: str = Field(description="The buyer's reference ID for this media buy")
999
+ packages: list[Package] = Field(
1000
+ description="Array of approved packages. Each package is ready for creative assignment."
1001
+ )
1002
+ creative_deadline: str | None = Field(
1003
+ None,
1004
+ description="ISO 8601 date when creatives must be provided for launch",
1005
+ )
1006
+
1007
+
1008
+ class CreateMediaBuyError(BaseModel):
1009
+ """Failed media buy creation response"""
1010
+
1011
+ errors: list[Error] = Field(description="Task-specific errors and warnings")
1012
+
1013
+
1014
+ # Override the generated CreateMediaBuyResponse type alias
1015
+ CreateMediaBuyResponse = CreateMediaBuySuccess | CreateMediaBuyError
1016
+
1017
+
1018
+ class UpdateMediaBuySuccess(BaseModel):
1019
+ """Successful media buy update response"""
1020
+
1021
+ media_buy_id: str = Field(description="The unique ID for the media buy")
1022
+ buyer_ref: str = Field(description="The buyer's reference ID for this media buy")
1023
+ packages: list[Package] = Field(
1024
+ description="Array of updated packages reflecting the changes"
1025
+ )
1026
+
1027
+
1028
+ class UpdateMediaBuyError(BaseModel):
1029
+ """Failed media buy update response"""
1030
+
1031
+ errors: list[Error] = Field(description="Task-specific errors and warnings")
1032
+
1033
+
1034
+ # Override the generated UpdateMediaBuyResponse type alias
1035
+ UpdateMediaBuyResponse = UpdateMediaBuySuccess | UpdateMediaBuyError
1036
+
1037
+
1038
+ class SyncCreativesSuccess(BaseModel):
1039
+ """Successful creative sync response"""
1040
+
1041
+ assignments: list[CreativeAssignment] = Field(
1042
+ description="Array of creative assignments with updated status"
1043
+ )
1044
+
1045
+
1046
+ class SyncCreativesError(BaseModel):
1047
+ """Failed creative sync response"""
1048
+
1049
+ errors: list[Error] = Field(description="Task-specific errors and warnings")
1050
+
1051
+
1052
+ # Override the generated SyncCreativesResponse type alias
1053
+ SyncCreativesResponse = SyncCreativesSuccess | SyncCreativesError
1054
+
1055
+
1056
+ # Explicit exports for module interface
1057
+ __all__ = [
1058
+ "ActivateSignalError",
1059
+ "ActivateSignalRequest",
1060
+ "ActivateSignalResponse",
1061
+ "ActivateSignalSuccess",
1062
+ "ActivationKey",
1063
+ "AgentDeployment",
1064
+ "AgentDestination",
1065
+ "BothPreviewRender",
1066
+ "BrandManifest",
1067
+ "BrandManifestRef",
1068
+ "BrandManifestRefVariant1",
1069
+ "BrandManifestRefVariant2",
1070
+ "BuildCreativeRequest",
1071
+ "BuildCreativeResponse",
1072
+ "BuildCreativeResponseVariant1",
1073
+ "BuildCreativeResponseVariant2",
1074
+ "Channels",
1075
+ "CreateMediaBuyError",
1076
+ "CreateMediaBuyRequest",
1077
+ "CreateMediaBuyResponse",
1078
+ "CreateMediaBuySuccess",
1079
+ "CreativeAsset",
1080
+ "CreativeAssignment",
1081
+ "CreativeManifest",
1082
+ "CreativePolicy",
1083
+ "DaastAsset",
1084
+ "DeliveryMetrics",
1085
+ "DeliveryType",
1086
+ "Deployment",
1087
+ "Destination",
1088
+ "Error",
1089
+ "Format",
1090
+ "FormatId",
1091
+ "FrequencyCap",
1092
+ "GetMediaBuyDeliveryRequest",
1093
+ "GetMediaBuyDeliveryResponse",
1094
+ "GetProductsRequest",
1095
+ "GetProductsResponse",
1096
+ "GetSignalsRequest",
1097
+ "GetSignalsResponse",
1098
+ "HtmlPreviewRender",
1099
+ "InlineDaastAsset",
1100
+ "InlineVastAsset",
1101
+ "Key_valueActivationKey",
1102
+ "ListAuthorizedPropertiesRequest",
1103
+ "ListAuthorizedPropertiesResponse",
1104
+ "ListCreativeFormatsRequest",
1105
+ "ListCreativeFormatsResponse",
1106
+ "ListCreativesRequest",
1107
+ "ListCreativesResponse",
1108
+ "Measurement",
1109
+ "MediaBuy",
1110
+ "MediaBuyStatus",
1111
+ "MediaSubAsset",
1112
+ "Pacing",
1113
+ "Package",
1114
+ "PackageRequest",
1115
+ "PackageStatus",
1116
+ "PerformanceFeedback",
1117
+ "Placement",
1118
+ "PlatformDeployment",
1119
+ "PlatformDestination",
1120
+ "PreviewCreativeRequest",
1121
+ "PreviewCreativeResponse",
1122
+ "PreviewRender",
1123
+ "PricingModel",
1124
+ "PricingOption",
1125
+ "PricingOptionVariant1",
1126
+ "PricingOptionVariant2",
1127
+ "PricingOptionVariant3",
1128
+ "PricingOptionVariant4",
1129
+ "PricingOptionVariant5",
1130
+ "PricingOptionVariant6",
1131
+ "PricingOptionVariant7",
1132
+ "PricingOptionVariant8",
1133
+ "PricingOptionVariant9",
1134
+ "Product",
1135
+ "PromotedProducts",
1136
+ "Property",
1137
+ "ProtocolEnvelope",
1138
+ "ProvidePerformanceFeedbackRequest",
1139
+ "ProvidePerformanceFeedbackResponse",
1140
+ "ProvidePerformanceFeedbackResponseVariant1",
1141
+ "ProvidePerformanceFeedbackResponseVariant2",
1142
+ "PushNotificationConfig",
1143
+ "ReportingCapabilities",
1144
+ "Response",
1145
+ "Segment_idActivationKey",
1146
+ "StandardFormatIds",
1147
+ "StartTiming",
1148
+ "StartTimingVariant1",
1149
+ "StartTimingVariant2",
1150
+ "SubAsset",
1151
+ "SyncCreativesError",
1152
+ "SyncCreativesRequest",
1153
+ "SyncCreativesResponse",
1154
+ "SyncCreativesSuccess",
1155
+ "Targeting",
1156
+ "TaskStatus",
1157
+ "TaskType",
1158
+ "TasksGetRequest",
1159
+ "TasksGetResponse",
1160
+ "TasksListRequest",
1161
+ "TasksListResponse",
1162
+ "TextSubAsset",
1163
+ "UpdateMediaBuyError",
1164
+ "UpdateMediaBuyRequest",
1165
+ "UpdateMediaBuyResponse",
1166
+ "UpdateMediaBuySuccess",
1167
+ "UrlDaastAsset",
1168
+ "UrlPreviewRender",
1169
+ "UrlVastAsset",
1170
+ "VastAsset",
1171
+ "WebhookPayload",
1172
+ ]