adcp 1.6.0__py3-none-any.whl → 2.0.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.
Files changed (116) hide show
  1. adcp/__init__.py +19 -221
  2. adcp/adagents.py +11 -12
  3. adcp/client.py +16 -11
  4. adcp/types/generated.py +540 -1129
  5. adcp/types/generated_poc/__init__.py +3 -0
  6. adcp/types/generated_poc/activate_signal_request.py +34 -0
  7. adcp/types/generated_poc/activate_signal_response.py +57 -0
  8. adcp/types/generated_poc/activation_key.py +30 -0
  9. adcp/types/generated_poc/adagents.py +266 -0
  10. adcp/types/generated_poc/asset_type.py +100 -0
  11. adcp/types/generated_poc/audio_asset.py +26 -0
  12. adcp/types/generated_poc/brand_manifest.py +260 -0
  13. adcp/types/generated_poc/brand_manifest_ref.py +361 -0
  14. adcp/types/generated_poc/build_creative_request.py +43 -0
  15. adcp/types/generated_poc/build_creative_response.py +57 -0
  16. adcp/types/generated_poc/channels.py +19 -0
  17. adcp/types/generated_poc/cpc_option.py +39 -0
  18. adcp/types/generated_poc/cpcv_option.py +41 -0
  19. adcp/types/generated_poc/cpm_auction_option.py +54 -0
  20. adcp/types/generated_poc/cpm_fixed_option.py +39 -0
  21. adcp/types/generated_poc/cpp_option.py +60 -0
  22. adcp/types/generated_poc/cpv_option.py +73 -0
  23. adcp/types/generated_poc/create_media_buy_request.py +96 -0
  24. adcp/types/generated_poc/create_media_buy_response.py +66 -0
  25. adcp/types/generated_poc/creative_asset.py +83 -0
  26. adcp/types/generated_poc/creative_assignment.py +27 -0
  27. adcp/types/generated_poc/creative_manifest.py +61 -0
  28. adcp/types/generated_poc/creative_policy.py +34 -0
  29. adcp/types/generated_poc/creative_status.py +14 -0
  30. adcp/types/generated_poc/css_asset.py +20 -0
  31. adcp/types/generated_poc/daast_asset.py +76 -0
  32. adcp/types/generated_poc/delivery_metrics.py +111 -0
  33. adcp/types/generated_poc/delivery_type.py +12 -0
  34. adcp/types/generated_poc/deployment.py +78 -0
  35. adcp/types/generated_poc/destination.py +43 -0
  36. adcp/types/generated_poc/error.py +29 -0
  37. adcp/types/generated_poc/flat_rate_option.py +93 -0
  38. adcp/types/generated_poc/format.py +260 -0
  39. adcp/types/generated_poc/format_id.py +29 -0
  40. adcp/types/generated_poc/frequency_cap.py +19 -0
  41. adcp/types/generated_poc/frequency_cap_scope.py +16 -0
  42. adcp/types/generated_poc/get_media_buy_delivery_request.py +65 -0
  43. adcp/types/generated_poc/get_media_buy_delivery_response.py +220 -0
  44. adcp/types/generated_poc/get_products_request.py +83 -0
  45. adcp/types/generated_poc/get_products_response.py +29 -0
  46. adcp/types/generated_poc/get_signals_request.py +77 -0
  47. adcp/types/generated_poc/get_signals_response.py +65 -0
  48. adcp/types/generated_poc/html_asset.py +18 -0
  49. adcp/types/generated_poc/identifier_types.py +29 -0
  50. adcp/types/generated_poc/image_asset.py +23 -0
  51. adcp/types/generated_poc/index.py +17 -0
  52. adcp/types/generated_poc/javascript_asset.py +25 -0
  53. adcp/types/generated_poc/list_authorized_properties_request.py +39 -0
  54. adcp/types/generated_poc/list_authorized_properties_response.py +85 -0
  55. adcp/types/generated_poc/list_creative_formats_request.py +93 -0
  56. adcp/types/generated_poc/list_creative_formats_response.py +63 -0
  57. adcp/types/generated_poc/list_creatives_request.py +154 -0
  58. adcp/types/generated_poc/list_creatives_response.py +234 -0
  59. adcp/types/generated_poc/markdown_asset.py +43 -0
  60. adcp/types/generated_poc/measurement.py +40 -0
  61. adcp/types/generated_poc/media_buy.py +37 -0
  62. adcp/types/generated_poc/media_buy_status.py +14 -0
  63. adcp/types/generated_poc/pacing.py +13 -0
  64. adcp/types/generated_poc/package.py +61 -0
  65. adcp/types/generated_poc/package_request.py +61 -0
  66. adcp/types/generated_poc/package_status.py +14 -0
  67. adcp/types/generated_poc/performance_feedback.py +89 -0
  68. adcp/types/generated_poc/placement.py +37 -0
  69. adcp/types/generated_poc/preview_creative_request.py +163 -0
  70. adcp/types/generated_poc/preview_creative_response.py +175 -0
  71. adcp/types/generated_poc/preview_render.py +144 -0
  72. adcp/types/generated_poc/pricing_model.py +17 -0
  73. adcp/types/generated_poc/pricing_option.py +365 -0
  74. adcp/types/generated_poc/product.py +211 -0
  75. adcp/types/generated_poc/promoted_offerings.py +102 -0
  76. adcp/types/generated_poc/promoted_products.py +38 -0
  77. adcp/types/generated_poc/property.py +79 -0
  78. adcp/types/generated_poc/protocol_envelope.py +61 -0
  79. adcp/types/generated_poc/provide_performance_feedback_request.py +85 -0
  80. adcp/types/generated_poc/provide_performance_feedback_response.py +59 -0
  81. adcp/types/generated_poc/publisher_identifier_types.py +15 -0
  82. adcp/types/generated_poc/push_notification_config.py +55 -0
  83. adcp/types/generated_poc/reporting_capabilities.py +68 -0
  84. adcp/types/generated_poc/response.py +24 -0
  85. adcp/types/generated_poc/standard_format_ids.py +45 -0
  86. adcp/types/generated_poc/start_timing.py +13 -0
  87. adcp/types/generated_poc/sub_asset.py +55 -0
  88. adcp/types/generated_poc/sync_creatives_request.py +69 -0
  89. adcp/types/generated_poc/sync_creatives_response.py +117 -0
  90. adcp/types/generated_poc/targeting.py +53 -0
  91. adcp/types/generated_poc/task_status.py +19 -0
  92. adcp/types/generated_poc/task_type.py +15 -0
  93. adcp/types/generated_poc/tasks_get_request.py +29 -0
  94. adcp/types/generated_poc/tasks_get_response.py +112 -0
  95. adcp/types/generated_poc/tasks_list_request.py +121 -0
  96. adcp/types/generated_poc/tasks_list_response.py +122 -0
  97. adcp/types/generated_poc/text_asset.py +20 -0
  98. adcp/types/generated_poc/update_media_buy_request.py +160 -0
  99. adcp/types/generated_poc/update_media_buy_response.py +67 -0
  100. adcp/types/generated_poc/url_asset.py +33 -0
  101. adcp/types/generated_poc/vast_asset.py +86 -0
  102. adcp/types/generated_poc/vcpm_auction_option.py +57 -0
  103. adcp/types/generated_poc/vcpm_fixed_option.py +43 -0
  104. adcp/types/generated_poc/video_asset.py +28 -0
  105. adcp/types/generated_poc/webhook_asset.py +65 -0
  106. adcp/types/generated_poc/webhook_payload.py +102 -0
  107. adcp/utils/preview_cache.py +57 -39
  108. adcp/validation.py +172 -0
  109. {adcp-1.6.0.dist-info → adcp-2.0.0.dist-info}/METADATA +3 -1
  110. adcp-2.0.0.dist-info/RECORD +130 -0
  111. adcp/types/tasks.py +0 -511
  112. adcp-1.6.0.dist-info/RECORD +0 -28
  113. {adcp-1.6.0.dist-info → adcp-2.0.0.dist-info}/WHEEL +0 -0
  114. {adcp-1.6.0.dist-info → adcp-2.0.0.dist-info}/entry_points.txt +0 -0
  115. {adcp-1.6.0.dist-info → adcp-2.0.0.dist-info}/licenses/LICENSE +0 -0
  116. {adcp-1.6.0.dist-info → adcp-2.0.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,260 @@
1
+ # generated by datamodel-codegen:
2
+ # filename: format.json
3
+ # timestamp: 2025-11-15T22:03:55+00:00
4
+
5
+ from __future__ import annotations
6
+
7
+ from enum import Enum
8
+ from typing import Annotated, Any, Literal
9
+
10
+ from adcp.types.base import AdCPBaseModel
11
+ from pydantic import AnyUrl, ConfigDict, Field
12
+
13
+ from . import format_id as format_id_1
14
+
15
+
16
+ class AssetType(Enum):
17
+ image = "image"
18
+ video = "video"
19
+ audio = "audio"
20
+ vast = "vast"
21
+ daast = "daast"
22
+ text = "text"
23
+ markdown = "markdown"
24
+ html = "html"
25
+ css = "css"
26
+ javascript = "javascript"
27
+ url = "url"
28
+ webhook = "webhook"
29
+ promoted_offerings = "promoted_offerings"
30
+
31
+
32
+ class AssetsRequired(AdCPBaseModel):
33
+ asset_id: Annotated[
34
+ str,
35
+ Field(
36
+ description="Unique identifier for this asset. Creative manifests MUST use this exact value as the key in the assets object."
37
+ ),
38
+ ]
39
+ asset_role: Annotated[
40
+ str | None,
41
+ Field(
42
+ description="Optional descriptive label for this asset's purpose (e.g., 'hero_image', 'logo'). Not used for referencing assets in manifests—use asset_id instead. This field is for human-readable documentation and UI display only."
43
+ ),
44
+ ] = None
45
+ asset_type: Annotated[AssetType, Field(description="Type of asset")]
46
+ item_type: Annotated[
47
+ Literal["individual"],
48
+ Field(description="Discriminator indicating this is an individual asset requirement"),
49
+ ]
50
+ required: Annotated[bool | None, Field(description="Whether this asset is required")] = None
51
+ requirements: Annotated[
52
+ dict[str, Any] | None,
53
+ Field(
54
+ description="Technical requirements for this asset (dimensions, file size, duration, etc.)"
55
+ ),
56
+ ] = None
57
+
58
+
59
+ class Asset(AdCPBaseModel):
60
+ asset_id: Annotated[str, Field(description="Identifier for this asset within the group")]
61
+ asset_role: Annotated[
62
+ str | None,
63
+ Field(
64
+ description="Optional descriptive label for this asset's purpose (e.g., 'hero_image', 'logo'). Not used for referencing assets in manifests—use asset_id instead. This field is for human-readable documentation and UI display only."
65
+ ),
66
+ ] = None
67
+ asset_type: Annotated[AssetType, Field(description="Type of asset")]
68
+ required: Annotated[
69
+ bool | None, Field(description="Whether this asset is required in each repetition")
70
+ ] = None
71
+ requirements: Annotated[
72
+ dict[str, Any] | None, Field(description="Technical requirements for this asset")
73
+ ] = None
74
+
75
+
76
+ class AssetsRequired1(AdCPBaseModel):
77
+ asset_group_id: Annotated[
78
+ str, Field(description="Identifier for this asset group (e.g., 'product', 'slide', 'card')")
79
+ ]
80
+ assets: Annotated[list[Asset], Field(description="Assets within each repetition of this group")]
81
+ item_type: Annotated[
82
+ Literal["repeatable_group"],
83
+ Field(description="Discriminator indicating this is a repeatable asset group"),
84
+ ]
85
+ max_count: Annotated[int, Field(description="Maximum number of repetitions allowed", ge=1)]
86
+ min_count: Annotated[int, Field(description="Minimum number of repetitions required", ge=1)]
87
+
88
+
89
+ class FormatCard(AdCPBaseModel):
90
+ model_config = ConfigDict(
91
+ extra="forbid",
92
+ )
93
+ format_id: Annotated[
94
+ format_id_1.FormatId,
95
+ Field(
96
+ description="Creative format defining the card layout (typically format_card_standard)"
97
+ ),
98
+ ]
99
+ manifest: Annotated[
100
+ dict[str, Any],
101
+ Field(description="Asset manifest for rendering the card, structure defined by the format"),
102
+ ]
103
+
104
+
105
+ class FormatCardDetailed(AdCPBaseModel):
106
+ model_config = ConfigDict(
107
+ extra="forbid",
108
+ )
109
+ format_id: Annotated[
110
+ format_id_1.FormatId,
111
+ Field(
112
+ description="Creative format defining the detailed card layout (typically format_card_detailed)"
113
+ ),
114
+ ]
115
+ manifest: Annotated[
116
+ dict[str, Any],
117
+ Field(
118
+ description="Asset manifest for rendering the detailed card, structure defined by the format"
119
+ ),
120
+ ]
121
+
122
+
123
+ class Responsive(AdCPBaseModel):
124
+ height: bool
125
+ width: bool
126
+
127
+
128
+ class Unit(Enum):
129
+ px = "px"
130
+ dp = "dp"
131
+ inches = "inches"
132
+ cm = "cm"
133
+
134
+
135
+ class Dimensions(AdCPBaseModel):
136
+ aspect_ratio: Annotated[
137
+ str | None,
138
+ Field(
139
+ description="Fixed aspect ratio constraint (e.g., '16:9', '4:3', '1:1')",
140
+ pattern="^\\d+:\\d+$",
141
+ ),
142
+ ] = None
143
+ height: Annotated[
144
+ float | None, Field(description="Fixed height in specified units", ge=0.0)
145
+ ] = None
146
+ max_height: Annotated[
147
+ float | None, Field(description="Maximum height for responsive renders", ge=0.0)
148
+ ] = None
149
+ max_width: Annotated[
150
+ float | None, Field(description="Maximum width for responsive renders", ge=0.0)
151
+ ] = None
152
+ min_height: Annotated[
153
+ float | None, Field(description="Minimum height for responsive renders", ge=0.0)
154
+ ] = None
155
+ min_width: Annotated[
156
+ float | None, Field(description="Minimum width for responsive renders", ge=0.0)
157
+ ] = None
158
+ responsive: Annotated[
159
+ Responsive | None, Field(description="Indicates which dimensions are responsive/fluid")
160
+ ] = None
161
+ unit: Annotated[Unit, Field(description="Unit of measurement for dimensions")]
162
+ width: Annotated[float | None, Field(description="Fixed width in specified units", ge=0.0)] = (
163
+ None
164
+ )
165
+
166
+
167
+ class Render(AdCPBaseModel):
168
+ dimensions: Annotated[Dimensions, Field(description="Dimensions for this rendered piece")]
169
+ role: Annotated[
170
+ str,
171
+ Field(
172
+ description="Semantic role of this rendered piece (e.g., 'primary', 'companion', 'mobile_variant')"
173
+ ),
174
+ ]
175
+
176
+
177
+ class Type(Enum):
178
+ audio = "audio"
179
+ video = "video"
180
+ display = "display"
181
+ native = "native"
182
+ dooh = "dooh"
183
+ rich_media = "rich_media"
184
+ universal = "universal"
185
+
186
+
187
+ class Format(AdCPBaseModel):
188
+ model_config = ConfigDict(
189
+ extra="forbid",
190
+ )
191
+ assets_required: Annotated[
192
+ list[AssetsRequired | AssetsRequired1] | None,
193
+ Field(
194
+ description="Array of required assets or asset groups for this format. Each asset is identified by its asset_id, which must be used as the key in creative manifests. Can contain individual assets or repeatable asset sequences (e.g., carousel products, slideshow frames)."
195
+ ),
196
+ ] = None
197
+ delivery: Annotated[
198
+ dict[str, Any] | None,
199
+ Field(description="Delivery method specifications (e.g., hosted, VAST, third-party tags)"),
200
+ ] = None
201
+ description: Annotated[
202
+ str | None,
203
+ Field(
204
+ description="Plain text explanation of what this format does and what assets it requires"
205
+ ),
206
+ ] = None
207
+ example_url: Annotated[
208
+ AnyUrl | None,
209
+ Field(
210
+ description="Optional URL to showcase page with examples and interactive demos of this format"
211
+ ),
212
+ ] = None
213
+ format_card: Annotated[
214
+ FormatCard | None,
215
+ Field(
216
+ description="Optional standard visual card (300x400px) for displaying this format in user interfaces. Can be rendered via preview_creative or pre-generated."
217
+ ),
218
+ ] = None
219
+ format_card_detailed: Annotated[
220
+ FormatCardDetailed | None,
221
+ Field(
222
+ description="Optional detailed card with carousel and full specifications. Provides rich format documentation similar to ad spec pages."
223
+ ),
224
+ ] = None
225
+ format_id: Annotated[
226
+ format_id_1.FormatId,
227
+ Field(description="Structured format identifier with agent URL and format name"),
228
+ ]
229
+ name: Annotated[str, Field(description="Human-readable format name")]
230
+ output_format_ids: Annotated[
231
+ list[format_id_1.FormatId] | None,
232
+ Field(
233
+ description="For generative formats: array of format IDs that this format can generate. When a format accepts inputs like brand_manifest and message, this specifies what concrete output formats can be produced (e.g., a generative banner format might output standard image banner formats)."
234
+ ),
235
+ ] = None
236
+ preview_image: Annotated[
237
+ AnyUrl | None,
238
+ Field(
239
+ description="DEPRECATED: Use format_card instead. Optional preview image URL for format browsing/discovery UI. Should be 400x300px (4:3 aspect ratio) PNG or JPG. Used as thumbnail/card image in format browsers. This field is maintained for backward compatibility but format_card provides a more flexible, structured approach."
240
+ ),
241
+ ] = None
242
+ renders: Annotated[
243
+ list[Render] | None,
244
+ Field(
245
+ description="Specification of rendered pieces for this format. Most formats produce a single render. Companion ad formats (video + banner), adaptive formats, and multi-placement formats produce multiple renders. Each render specifies its role and dimensions.",
246
+ min_length=1,
247
+ ),
248
+ ] = None
249
+ supported_macros: Annotated[
250
+ list[str] | None,
251
+ Field(
252
+ description="List of universal macros supported by this format (e.g., MEDIA_BUY_ID, CACHEBUSTER, DEVICE_ID). Used for validation and developer tooling."
253
+ ),
254
+ ] = None
255
+ type: Annotated[
256
+ Type,
257
+ Field(
258
+ description="Media type of this format - determines rendering method and asset requirements"
259
+ ),
260
+ ]
@@ -0,0 +1,29 @@
1
+ # generated by datamodel-codegen:
2
+ # filename: format-id.json
3
+ # timestamp: 2025-11-15T22:03:55+00:00
4
+
5
+ from __future__ import annotations
6
+
7
+ from typing import Annotated
8
+
9
+ from adcp.types.base import AdCPBaseModel
10
+ from pydantic import AnyUrl, ConfigDict, Field
11
+
12
+
13
+ class FormatId(AdCPBaseModel):
14
+ model_config = ConfigDict(
15
+ extra="forbid",
16
+ )
17
+ agent_url: Annotated[
18
+ AnyUrl,
19
+ Field(
20
+ description="URL of the agent that defines this format (e.g., 'https://creatives.adcontextprotocol.org' for standard formats, or 'https://publisher.com/.well-known/adcp/sales' for custom formats)"
21
+ ),
22
+ ]
23
+ id: Annotated[
24
+ str,
25
+ Field(
26
+ description="Format identifier within the agent's namespace (e.g., 'display_300x250', 'video_standard_30s')",
27
+ pattern="^[a-zA-Z0-9_-]+$",
28
+ ),
29
+ ]
@@ -0,0 +1,19 @@
1
+ # generated by datamodel-codegen:
2
+ # filename: frequency-cap.json
3
+ # timestamp: 2025-11-15T22:03:55+00:00
4
+
5
+ from __future__ import annotations
6
+
7
+ from typing import Annotated
8
+
9
+ from adcp.types.base import AdCPBaseModel
10
+ from pydantic import ConfigDict, Field
11
+
12
+
13
+ class FrequencyCap(AdCPBaseModel):
14
+ model_config = ConfigDict(
15
+ extra="forbid",
16
+ )
17
+ suppress_minutes: Annotated[
18
+ float, Field(description="Minutes to suppress after impression", ge=0.0)
19
+ ]
@@ -0,0 +1,16 @@
1
+ # generated by datamodel-codegen:
2
+ # filename: frequency-cap-scope.json
3
+ # timestamp: 2025-11-15T22:03:55+00:00
4
+
5
+ from __future__ import annotations
6
+
7
+ from typing import Annotated, Literal
8
+
9
+ from pydantic import Field, RootModel
10
+
11
+
12
+ class FrequencyCapScope(RootModel[Literal["package"]]):
13
+ root: Annotated[
14
+ Literal["package"],
15
+ Field(description="Scope for frequency cap application", title="Frequency Cap Scope"),
16
+ ]
@@ -0,0 +1,65 @@
1
+ # generated by datamodel-codegen:
2
+ # filename: get-media-buy-delivery-request.json
3
+ # timestamp: 2025-11-15T22:03:55+00:00
4
+
5
+ from __future__ import annotations
6
+
7
+ from enum import Enum
8
+ from typing import Annotated, Any
9
+
10
+ from adcp.types.base import AdCPBaseModel
11
+ from pydantic import ConfigDict, Field
12
+
13
+
14
+ class StatusFilter(Enum):
15
+ active = "active"
16
+ pending = "pending"
17
+ paused = "paused"
18
+ completed = "completed"
19
+ failed = "failed"
20
+ all = "all"
21
+
22
+
23
+ class StatusFilterEnum(Enum):
24
+ active = "active"
25
+ pending = "pending"
26
+ paused = "paused"
27
+ completed = "completed"
28
+ failed = "failed"
29
+
30
+
31
+ class GetMediaBuyDeliveryRequest(AdCPBaseModel):
32
+ model_config = ConfigDict(
33
+ extra="forbid",
34
+ )
35
+ buyer_refs: Annotated[
36
+ list[str] | None, Field(description="Array of buyer reference IDs to get delivery data for")
37
+ ] = None
38
+ context: Annotated[
39
+ dict[str, Any] | None,
40
+ Field(
41
+ description="Initiator-provided context included in the request payload. Agentsmust echo this value back unchanged in responses and webhooks. Use for UI/session hints, correlation tokens, or tracking metadata."
42
+ ),
43
+ ] = None
44
+ end_date: Annotated[
45
+ str | None,
46
+ Field(
47
+ description="End date for reporting period (YYYY-MM-DD)",
48
+ pattern="^\\d{4}-\\d{2}-\\d{2}$",
49
+ ),
50
+ ] = None
51
+ media_buy_ids: Annotated[
52
+ list[str] | None,
53
+ Field(description="Array of publisher media buy IDs to get delivery data for"),
54
+ ] = None
55
+ start_date: Annotated[
56
+ str | None,
57
+ Field(
58
+ description="Start date for reporting period (YYYY-MM-DD)",
59
+ pattern="^\\d{4}-\\d{2}-\\d{2}$",
60
+ ),
61
+ ] = None
62
+ status_filter: Annotated[
63
+ StatusFilter | list[StatusFilterEnum] | None,
64
+ Field(description="Filter by status. Can be a single status or array of statuses"),
65
+ ] = None
@@ -0,0 +1,220 @@
1
+ # generated by datamodel-codegen:
2
+ # filename: get-media-buy-delivery-response.json
3
+ # timestamp: 2025-11-15T22:03:55+00:00
4
+
5
+ from __future__ import annotations
6
+
7
+ from enum import Enum
8
+ from typing import Annotated, Any
9
+
10
+ from adcp.types.base import AdCPBaseModel
11
+ from pydantic import AwareDatetime, ConfigDict, Field
12
+
13
+ from . import error
14
+ from . import pricing_model as pricing_model_1
15
+ from .delivery_metrics import DeliveryMetrics
16
+
17
+
18
+ class AggregatedTotals(AdCPBaseModel):
19
+ model_config = ConfigDict(
20
+ extra="forbid",
21
+ )
22
+ clicks: Annotated[
23
+ float | None,
24
+ Field(description="Total clicks across all media buys (if applicable)", ge=0.0),
25
+ ] = None
26
+ impressions: Annotated[
27
+ float, Field(description="Total impressions delivered across all media buys", ge=0.0)
28
+ ]
29
+ media_buy_count: Annotated[
30
+ int, Field(description="Number of media buys included in the response", ge=0)
31
+ ]
32
+ spend: Annotated[float, Field(description="Total amount spent across all media buys", ge=0.0)]
33
+ video_completions: Annotated[
34
+ float | None,
35
+ Field(description="Total video completions across all media buys (if applicable)", ge=0.0),
36
+ ] = None
37
+
38
+
39
+ class DailyBreakdownItem(AdCPBaseModel):
40
+ model_config = ConfigDict(
41
+ extra="forbid",
42
+ )
43
+ date: Annotated[str, Field(description="Date (YYYY-MM-DD)", pattern="^\\d{4}-\\d{2}-\\d{2}$")]
44
+ impressions: Annotated[float, Field(description="Daily impressions", ge=0.0)]
45
+ spend: Annotated[float, Field(description="Daily spend", ge=0.0)]
46
+
47
+
48
+ class Status(Enum):
49
+ pending = "pending"
50
+ active = "active"
51
+ paused = "paused"
52
+ completed = "completed"
53
+ failed = "failed"
54
+ reporting_delayed = "reporting_delayed"
55
+
56
+
57
+ class Totals(DeliveryMetrics):
58
+ effective_rate: Annotated[
59
+ float | None,
60
+ Field(
61
+ description="Effective rate paid per unit based on pricing_model (e.g., actual CPM for 'cpm', actual cost per completed view for 'cpcv', actual cost per point for 'cpp')",
62
+ ge=0.0,
63
+ ),
64
+ ] = None
65
+
66
+
67
+ class NotificationType(Enum):
68
+ scheduled = "scheduled"
69
+ final = "final"
70
+ delayed = "delayed"
71
+ adjusted = "adjusted"
72
+
73
+
74
+ class ReportingPeriod(AdCPBaseModel):
75
+ model_config = ConfigDict(
76
+ extra="forbid",
77
+ )
78
+ end: Annotated[
79
+ AwareDatetime,
80
+ Field(description="ISO 8601 end timestamp in UTC (e.g., 2024-02-05T23:59:59Z)"),
81
+ ]
82
+ start: Annotated[
83
+ AwareDatetime,
84
+ Field(description="ISO 8601 start timestamp in UTC (e.g., 2024-02-05T00:00:00Z)"),
85
+ ]
86
+
87
+
88
+ class ByPackageItem(DeliveryMetrics):
89
+ buyer_ref: Annotated[
90
+ str | None, Field(description="Buyer's reference identifier for this package")
91
+ ] = None
92
+ currency: Annotated[
93
+ str,
94
+ Field(
95
+ description="ISO 4217 currency code (e.g., USD, EUR, GBP) for this package's pricing. Indicates the currency in which the rate and spend values are denominated. Different packages can use different currencies when supported by the publisher.",
96
+ pattern="^[A-Z]{3}$",
97
+ ),
98
+ ]
99
+ pacing_index: Annotated[
100
+ float | None,
101
+ Field(description="Delivery pace (1.0 = on track, <1.0 = behind, >1.0 = ahead)", ge=0.0),
102
+ ] = None
103
+ package_id: Annotated[str, Field(description="Publisher's package identifier")]
104
+ pricing_model: Annotated[
105
+ pricing_model_1.PricingModel,
106
+ Field(
107
+ description="The pricing model used for this package (e.g., cpm, cpcv, cpp). Indicates how the package is billed and which metrics are most relevant for optimization."
108
+ ),
109
+ ]
110
+ rate: Annotated[
111
+ float,
112
+ Field(
113
+ description="The pricing rate for this package in the specified currency. For fixed-rate pricing, this is the agreed rate (e.g., CPM rate of 12.50 means $12.50 per 1,000 impressions). For auction-based pricing, this represents the effective rate based on actual delivery.",
114
+ ge=0.0,
115
+ ),
116
+ ]
117
+
118
+
119
+ class MediaBuyDelivery(AdCPBaseModel):
120
+ model_config = ConfigDict(
121
+ extra="forbid",
122
+ )
123
+ buyer_ref: Annotated[
124
+ str | None, Field(description="Buyer's reference identifier for this media buy")
125
+ ] = None
126
+ by_package: Annotated[list[ByPackageItem], Field(description="Metrics broken down by package")]
127
+ daily_breakdown: Annotated[
128
+ list[DailyBreakdownItem] | None, Field(description="Day-by-day delivery")
129
+ ] = None
130
+ expected_availability: Annotated[
131
+ AwareDatetime | None,
132
+ Field(
133
+ description="When delayed data is expected to be available (only present when status is reporting_delayed)"
134
+ ),
135
+ ] = None
136
+ is_adjusted: Annotated[
137
+ bool | None,
138
+ Field(
139
+ description="Indicates this delivery contains updated data for a previously reported period. Buyer should replace previous period data with these totals."
140
+ ),
141
+ ] = None
142
+ media_buy_id: Annotated[str, Field(description="Publisher's media buy identifier")]
143
+ pricing_model: Annotated[
144
+ pricing_model_1.PricingModel | None,
145
+ Field(description="Pricing model used for this media buy"),
146
+ ] = None
147
+ status: Annotated[
148
+ Status,
149
+ Field(
150
+ description="Current media buy status. In webhook context, reporting_delayed indicates data temporarily unavailable."
151
+ ),
152
+ ]
153
+ totals: Totals
154
+
155
+
156
+ class GetMediaBuyDeliveryResponse(AdCPBaseModel):
157
+ model_config = ConfigDict(
158
+ extra="forbid",
159
+ )
160
+ aggregated_totals: Annotated[
161
+ AggregatedTotals | None,
162
+ Field(
163
+ description="Combined metrics across all returned media buys. Only included in API responses (get_media_buy_delivery), not in webhook notifications."
164
+ ),
165
+ ] = None
166
+ context: Annotated[
167
+ dict[str, Any] | None,
168
+ Field(
169
+ description="Initiator-provided context echoed inside the task payload. Opaque metadata such as UI/session hints, correlation tokens, or tracking identifiers."
170
+ ),
171
+ ] = None
172
+ currency: Annotated[str, Field(description="ISO 4217 currency code", pattern="^[A-Z]{3}$")]
173
+ errors: Annotated[
174
+ list[error.Error] | None,
175
+ Field(
176
+ description="Task-specific errors and warnings (e.g., missing delivery data, reporting platform issues)"
177
+ ),
178
+ ] = None
179
+ media_buy_deliveries: Annotated[
180
+ list[MediaBuyDelivery],
181
+ Field(
182
+ description="Array of delivery data for media buys. When used in webhook notifications, may contain multiple media buys aggregated by publisher. When used in get_media_buy_delivery API responses, typically contains requested media buys."
183
+ ),
184
+ ]
185
+ next_expected_at: Annotated[
186
+ AwareDatetime | None,
187
+ Field(
188
+ description="ISO 8601 timestamp for next expected notification (only present in webhook deliveries when notification_type is not 'final')"
189
+ ),
190
+ ] = None
191
+ notification_type: Annotated[
192
+ NotificationType | None,
193
+ Field(
194
+ description="Type of webhook notification (only present in webhook deliveries): scheduled = regular periodic update, final = campaign completed, delayed = data not yet available, adjusted = resending period with updated data"
195
+ ),
196
+ ] = None
197
+ partial_data: Annotated[
198
+ bool | None,
199
+ Field(
200
+ description="Indicates if any media buys in this webhook have missing/delayed data (only present in webhook deliveries)"
201
+ ),
202
+ ] = None
203
+ reporting_period: Annotated[
204
+ ReportingPeriod,
205
+ Field(description="Date range for the report. All periods use UTC timezone."),
206
+ ]
207
+ sequence_number: Annotated[
208
+ int | None,
209
+ Field(
210
+ description="Sequential notification number (only present in webhook deliveries, starts at 1)",
211
+ ge=1,
212
+ ),
213
+ ] = None
214
+ unavailable_count: Annotated[
215
+ int | None,
216
+ Field(
217
+ description="Number of media buys with reporting_delayed or failed status (only present in webhook deliveries when partial_data is true)",
218
+ ge=0,
219
+ ),
220
+ ] = None
@@ -0,0 +1,83 @@
1
+ # generated by datamodel-codegen:
2
+ # filename: get-products-request.json
3
+ # timestamp: 2025-11-15T22:03:55+00:00
4
+
5
+ from __future__ import annotations
6
+
7
+ from enum import Enum
8
+ from typing import Annotated, Any
9
+
10
+ from adcp.types.base import AdCPBaseModel
11
+ from pydantic import AnyUrl, ConfigDict, Field
12
+
13
+ from . import brand_manifest_ref as brand_manifest_1
14
+ from . import delivery_type as delivery_type_1
15
+ from . import format_id
16
+
17
+
18
+ class FormatType(Enum):
19
+ video = "video"
20
+ display = "display"
21
+ audio = "audio"
22
+
23
+
24
+ class Filters(AdCPBaseModel):
25
+ model_config = ConfigDict(
26
+ extra="forbid",
27
+ )
28
+ delivery_type: delivery_type_1.DeliveryType | None = None
29
+ format_ids: Annotated[
30
+ list[format_id.FormatId] | None, Field(description="Filter by specific format IDs")
31
+ ] = None
32
+ format_types: Annotated[
33
+ list[FormatType] | None, Field(description="Filter by format types")
34
+ ] = None
35
+ is_fixed_price: Annotated[
36
+ bool | None, Field(description="Filter for fixed price vs auction products")
37
+ ] = None
38
+ min_exposures: Annotated[
39
+ int | None,
40
+ Field(description="Minimum exposures/impressions needed for measurement validity", ge=1),
41
+ ] = None
42
+ standard_formats_only: Annotated[
43
+ bool | None, Field(description="Only return products accepting IAB standard formats")
44
+ ] = None
45
+
46
+
47
+ class GetProductsRequest(AdCPBaseModel):
48
+ model_config = ConfigDict(
49
+ extra="forbid",
50
+ )
51
+ brand_manifest: Annotated[
52
+ brand_manifest_1.BrandManifest | AnyUrl | None,
53
+ Field(
54
+ description="Brand information manifest providing brand context, assets, and product catalog. Can be provided inline or as a URL reference to a hosted manifest.",
55
+ examples=[
56
+ {
57
+ "data": {
58
+ "colors": {"primary": "#FF6B35"},
59
+ "name": "ACME Corporation",
60
+ "url": "https://acmecorp.com",
61
+ },
62
+ "description": "Inline brand manifest",
63
+ },
64
+ {
65
+ "data": "https://cdn.acmecorp.com/brand-manifest.json",
66
+ "description": "URL string reference to hosted manifest",
67
+ },
68
+ ],
69
+ title="Brand Manifest Reference",
70
+ ),
71
+ ] = None
72
+ brief: Annotated[
73
+ str | None, Field(description="Natural language description of campaign requirements")
74
+ ] = None
75
+ context: Annotated[
76
+ dict[str, Any] | None,
77
+ Field(
78
+ description="Initiator-provided context included in the request payload. Agentsmust echo this value back unchanged in responses and webhooks. Use for UI/session hints, correlation tokens, or tracking metadata."
79
+ ),
80
+ ] = None
81
+ filters: Annotated[
82
+ Filters | None, Field(description="Structured filters for product discovery")
83
+ ] = None