adcp 1.6.1__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.
- adcp/__init__.py +19 -221
- adcp/adagents.py +11 -12
- adcp/client.py +16 -11
- adcp/types/generated.py +540 -1134
- adcp/types/generated_poc/__init__.py +3 -0
- adcp/types/generated_poc/activate_signal_request.py +34 -0
- adcp/types/generated_poc/activate_signal_response.py +57 -0
- adcp/types/generated_poc/activation_key.py +30 -0
- adcp/types/generated_poc/adagents.py +266 -0
- adcp/types/generated_poc/asset_type.py +100 -0
- adcp/types/generated_poc/audio_asset.py +26 -0
- adcp/types/generated_poc/brand_manifest.py +260 -0
- adcp/types/generated_poc/brand_manifest_ref.py +361 -0
- adcp/types/generated_poc/build_creative_request.py +43 -0
- adcp/types/generated_poc/build_creative_response.py +57 -0
- adcp/types/generated_poc/channels.py +19 -0
- adcp/types/generated_poc/cpc_option.py +39 -0
- adcp/types/generated_poc/cpcv_option.py +41 -0
- adcp/types/generated_poc/cpm_auction_option.py +54 -0
- adcp/types/generated_poc/cpm_fixed_option.py +39 -0
- adcp/types/generated_poc/cpp_option.py +60 -0
- adcp/types/generated_poc/cpv_option.py +73 -0
- adcp/types/generated_poc/create_media_buy_request.py +96 -0
- adcp/types/generated_poc/create_media_buy_response.py +66 -0
- adcp/types/generated_poc/creative_asset.py +83 -0
- adcp/types/generated_poc/creative_assignment.py +27 -0
- adcp/types/generated_poc/creative_manifest.py +61 -0
- adcp/types/generated_poc/creative_policy.py +34 -0
- adcp/types/generated_poc/creative_status.py +14 -0
- adcp/types/generated_poc/css_asset.py +20 -0
- adcp/types/generated_poc/daast_asset.py +76 -0
- adcp/types/generated_poc/delivery_metrics.py +111 -0
- adcp/types/generated_poc/delivery_type.py +12 -0
- adcp/types/generated_poc/deployment.py +78 -0
- adcp/types/generated_poc/destination.py +43 -0
- adcp/types/generated_poc/error.py +29 -0
- adcp/types/generated_poc/flat_rate_option.py +93 -0
- adcp/types/generated_poc/format.py +260 -0
- adcp/types/generated_poc/format_id.py +29 -0
- adcp/types/generated_poc/frequency_cap.py +19 -0
- adcp/types/generated_poc/frequency_cap_scope.py +16 -0
- adcp/types/generated_poc/get_media_buy_delivery_request.py +65 -0
- adcp/types/generated_poc/get_media_buy_delivery_response.py +220 -0
- adcp/types/generated_poc/get_products_request.py +83 -0
- adcp/types/generated_poc/get_products_response.py +29 -0
- adcp/types/generated_poc/get_signals_request.py +77 -0
- adcp/types/generated_poc/get_signals_response.py +65 -0
- adcp/types/generated_poc/html_asset.py +18 -0
- adcp/types/generated_poc/identifier_types.py +29 -0
- adcp/types/generated_poc/image_asset.py +23 -0
- adcp/types/generated_poc/index.py +17 -0
- adcp/types/generated_poc/javascript_asset.py +25 -0
- adcp/types/generated_poc/list_authorized_properties_request.py +39 -0
- adcp/types/generated_poc/list_authorized_properties_response.py +85 -0
- adcp/types/generated_poc/list_creative_formats_request.py +93 -0
- adcp/types/generated_poc/list_creative_formats_response.py +63 -0
- adcp/types/generated_poc/list_creatives_request.py +154 -0
- adcp/types/generated_poc/list_creatives_response.py +234 -0
- adcp/types/generated_poc/markdown_asset.py +43 -0
- adcp/types/generated_poc/measurement.py +40 -0
- adcp/types/generated_poc/media_buy.py +37 -0
- adcp/types/generated_poc/media_buy_status.py +14 -0
- adcp/types/generated_poc/pacing.py +13 -0
- adcp/types/generated_poc/package.py +61 -0
- adcp/types/generated_poc/package_request.py +61 -0
- adcp/types/generated_poc/package_status.py +14 -0
- adcp/types/generated_poc/performance_feedback.py +89 -0
- adcp/types/generated_poc/placement.py +37 -0
- adcp/types/generated_poc/preview_creative_request.py +163 -0
- adcp/types/generated_poc/preview_creative_response.py +175 -0
- adcp/types/generated_poc/preview_render.py +144 -0
- adcp/types/generated_poc/pricing_model.py +17 -0
- adcp/types/generated_poc/pricing_option.py +365 -0
- adcp/types/generated_poc/product.py +211 -0
- adcp/types/generated_poc/promoted_offerings.py +102 -0
- adcp/types/generated_poc/promoted_products.py +38 -0
- adcp/types/generated_poc/property.py +79 -0
- adcp/types/generated_poc/protocol_envelope.py +61 -0
- adcp/types/generated_poc/provide_performance_feedback_request.py +85 -0
- adcp/types/generated_poc/provide_performance_feedback_response.py +59 -0
- adcp/types/generated_poc/publisher_identifier_types.py +15 -0
- adcp/types/generated_poc/push_notification_config.py +55 -0
- adcp/types/generated_poc/reporting_capabilities.py +68 -0
- adcp/types/generated_poc/response.py +24 -0
- adcp/types/generated_poc/standard_format_ids.py +45 -0
- adcp/types/generated_poc/start_timing.py +13 -0
- adcp/types/generated_poc/sub_asset.py +55 -0
- adcp/types/generated_poc/sync_creatives_request.py +69 -0
- adcp/types/generated_poc/sync_creatives_response.py +117 -0
- adcp/types/generated_poc/targeting.py +53 -0
- adcp/types/generated_poc/task_status.py +19 -0
- adcp/types/generated_poc/task_type.py +15 -0
- adcp/types/generated_poc/tasks_get_request.py +29 -0
- adcp/types/generated_poc/tasks_get_response.py +112 -0
- adcp/types/generated_poc/tasks_list_request.py +121 -0
- adcp/types/generated_poc/tasks_list_response.py +122 -0
- adcp/types/generated_poc/text_asset.py +20 -0
- adcp/types/generated_poc/update_media_buy_request.py +160 -0
- adcp/types/generated_poc/update_media_buy_response.py +67 -0
- adcp/types/generated_poc/url_asset.py +33 -0
- adcp/types/generated_poc/vast_asset.py +86 -0
- adcp/types/generated_poc/vcpm_auction_option.py +57 -0
- adcp/types/generated_poc/vcpm_fixed_option.py +43 -0
- adcp/types/generated_poc/video_asset.py +28 -0
- adcp/types/generated_poc/webhook_asset.py +65 -0
- adcp/types/generated_poc/webhook_payload.py +102 -0
- adcp/utils/preview_cache.py +54 -41
- adcp/validation.py +172 -0
- {adcp-1.6.1.dist-info → adcp-2.0.0.dist-info}/METADATA +3 -1
- adcp-2.0.0.dist-info/RECORD +130 -0
- adcp/types/tasks.py +0 -511
- adcp-1.6.1.dist-info/RECORD +0 -28
- {adcp-1.6.1.dist-info → adcp-2.0.0.dist-info}/WHEEL +0 -0
- {adcp-1.6.1.dist-info → adcp-2.0.0.dist-info}/entry_points.txt +0 -0
- {adcp-1.6.1.dist-info → adcp-2.0.0.dist-info}/licenses/LICENSE +0 -0
- {adcp-1.6.1.dist-info → adcp-2.0.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# generated by datamodel-codegen:
|
|
2
|
+
# filename: performance-feedback.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
|
|
9
|
+
|
|
10
|
+
from adcp.types.base import AdCPBaseModel
|
|
11
|
+
from pydantic import AwareDatetime, ConfigDict, Field
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class FeedbackSource(Enum):
|
|
15
|
+
buyer_attribution = "buyer_attribution"
|
|
16
|
+
third_party_measurement = "third_party_measurement"
|
|
17
|
+
platform_analytics = "platform_analytics"
|
|
18
|
+
verification_partner = "verification_partner"
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class MeasurementPeriod(AdCPBaseModel):
|
|
22
|
+
model_config = ConfigDict(
|
|
23
|
+
extra="forbid",
|
|
24
|
+
)
|
|
25
|
+
end: Annotated[
|
|
26
|
+
AwareDatetime, Field(description="ISO 8601 end timestamp for measurement period")
|
|
27
|
+
]
|
|
28
|
+
start: Annotated[
|
|
29
|
+
AwareDatetime, Field(description="ISO 8601 start timestamp for measurement period")
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class MetricType(Enum):
|
|
34
|
+
overall_performance = "overall_performance"
|
|
35
|
+
conversion_rate = "conversion_rate"
|
|
36
|
+
brand_lift = "brand_lift"
|
|
37
|
+
click_through_rate = "click_through_rate"
|
|
38
|
+
completion_rate = "completion_rate"
|
|
39
|
+
viewability = "viewability"
|
|
40
|
+
brand_safety = "brand_safety"
|
|
41
|
+
cost_efficiency = "cost_efficiency"
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class Status(Enum):
|
|
45
|
+
accepted = "accepted"
|
|
46
|
+
queued = "queued"
|
|
47
|
+
applied = "applied"
|
|
48
|
+
rejected = "rejected"
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
class PerformanceFeedback(AdCPBaseModel):
|
|
52
|
+
model_config = ConfigDict(
|
|
53
|
+
extra="forbid",
|
|
54
|
+
)
|
|
55
|
+
applied_at: Annotated[
|
|
56
|
+
AwareDatetime | None,
|
|
57
|
+
Field(
|
|
58
|
+
description="ISO 8601 timestamp when feedback was applied to optimization algorithms"
|
|
59
|
+
),
|
|
60
|
+
] = None
|
|
61
|
+
creative_id: Annotated[
|
|
62
|
+
str | None, Field(description="Specific creative asset (if feedback is creative-specific)")
|
|
63
|
+
] = None
|
|
64
|
+
feedback_id: Annotated[
|
|
65
|
+
str, Field(description="Unique identifier for this performance feedback submission")
|
|
66
|
+
]
|
|
67
|
+
feedback_source: Annotated[FeedbackSource, Field(description="Source of the performance data")]
|
|
68
|
+
measurement_period: Annotated[
|
|
69
|
+
MeasurementPeriod, Field(description="Time period for performance measurement")
|
|
70
|
+
]
|
|
71
|
+
media_buy_id: Annotated[str, Field(description="Publisher's media buy identifier")]
|
|
72
|
+
metric_type: Annotated[MetricType, Field(description="The business metric being measured")]
|
|
73
|
+
package_id: Annotated[
|
|
74
|
+
str | None,
|
|
75
|
+
Field(
|
|
76
|
+
description="Specific package within the media buy (if feedback is package-specific)"
|
|
77
|
+
),
|
|
78
|
+
] = None
|
|
79
|
+
performance_index: Annotated[
|
|
80
|
+
float,
|
|
81
|
+
Field(
|
|
82
|
+
description="Normalized performance score (0.0 = no value, 1.0 = expected, >1.0 = above expected)",
|
|
83
|
+
ge=0.0,
|
|
84
|
+
),
|
|
85
|
+
]
|
|
86
|
+
status: Annotated[Status, Field(description="Processing status of the performance feedback")]
|
|
87
|
+
submitted_at: Annotated[
|
|
88
|
+
AwareDatetime, Field(description="ISO 8601 timestamp when feedback was submitted")
|
|
89
|
+
]
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# generated by datamodel-codegen:
|
|
2
|
+
# filename: placement.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
|
+
from . import format_id
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class Placement(AdCPBaseModel):
|
|
16
|
+
model_config = ConfigDict(
|
|
17
|
+
extra="forbid",
|
|
18
|
+
)
|
|
19
|
+
description: Annotated[
|
|
20
|
+
str | None, Field(description="Detailed description of where and how the placement appears")
|
|
21
|
+
] = None
|
|
22
|
+
format_ids: Annotated[
|
|
23
|
+
list[format_id.FormatId] | None,
|
|
24
|
+
Field(
|
|
25
|
+
description="Format IDs supported by this specific placement (subset of product's formats)",
|
|
26
|
+
min_length=1,
|
|
27
|
+
),
|
|
28
|
+
] = None
|
|
29
|
+
name: Annotated[
|
|
30
|
+
str,
|
|
31
|
+
Field(
|
|
32
|
+
description="Human-readable name for the placement (e.g., 'Homepage Banner', 'Article Sidebar')"
|
|
33
|
+
),
|
|
34
|
+
]
|
|
35
|
+
placement_id: Annotated[
|
|
36
|
+
str, Field(description="Unique identifier for the placement within the product")
|
|
37
|
+
]
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# generated by datamodel-codegen:
|
|
2
|
+
# filename: preview-creative-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, Literal
|
|
9
|
+
|
|
10
|
+
from adcp.types.base import AdCPBaseModel
|
|
11
|
+
from pydantic import ConfigDict, Field, RootModel
|
|
12
|
+
|
|
13
|
+
from . import creative_manifest as creative_manifest_1
|
|
14
|
+
from . import format_id as format_id_1
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class Input(AdCPBaseModel):
|
|
18
|
+
model_config = ConfigDict(
|
|
19
|
+
extra="forbid",
|
|
20
|
+
)
|
|
21
|
+
context_description: Annotated[
|
|
22
|
+
str | None,
|
|
23
|
+
Field(
|
|
24
|
+
description="Natural language description of the context for AI-generated content (e.g., 'User just searched for running shoes', 'Podcast discussing weather patterns', 'Article about electric vehicles')"
|
|
25
|
+
),
|
|
26
|
+
] = None
|
|
27
|
+
macros: Annotated[
|
|
28
|
+
dict[str, str] | None,
|
|
29
|
+
Field(
|
|
30
|
+
description="Macro values to use for this preview. Supports all universal macros from the format's supported_macros list. See docs/media-buy/creatives/universal-macros.md for available macros."
|
|
31
|
+
),
|
|
32
|
+
] = None
|
|
33
|
+
name: Annotated[
|
|
34
|
+
str,
|
|
35
|
+
Field(
|
|
36
|
+
description="Human-readable name for this input set (e.g., 'Sunny morning on mobile', 'Evening podcast ad', 'Desktop dark mode')"
|
|
37
|
+
),
|
|
38
|
+
]
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class OutputFormat(Enum):
|
|
42
|
+
url = "url"
|
|
43
|
+
html = "html"
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
class Input2(AdCPBaseModel):
|
|
47
|
+
model_config = ConfigDict(
|
|
48
|
+
extra="forbid",
|
|
49
|
+
)
|
|
50
|
+
context_description: Annotated[
|
|
51
|
+
str | None,
|
|
52
|
+
Field(description="Natural language description of the context for AI-generated content"),
|
|
53
|
+
] = None
|
|
54
|
+
macros: Annotated[
|
|
55
|
+
dict[str, str] | None, Field(description="Macro values to use for this preview")
|
|
56
|
+
] = None
|
|
57
|
+
name: Annotated[str, Field(description="Human-readable name for this input set")]
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
class PreviewCreativeRequest1(AdCPBaseModel):
|
|
61
|
+
model_config = ConfigDict(
|
|
62
|
+
extra="forbid",
|
|
63
|
+
)
|
|
64
|
+
context: Annotated[
|
|
65
|
+
dict[str, Any] | None,
|
|
66
|
+
Field(
|
|
67
|
+
description="Initiator-provided context included in the request payload. Agents must echo this value back unchanged in responses and webhooks. Use for UI/session hints, correlation tokens, or tracking metadata."
|
|
68
|
+
),
|
|
69
|
+
] = None
|
|
70
|
+
creative_manifest: Annotated[
|
|
71
|
+
creative_manifest_1.CreativeManifest,
|
|
72
|
+
Field(
|
|
73
|
+
description="Complete creative manifest with all required assets (including promoted_offerings if required by the format)"
|
|
74
|
+
),
|
|
75
|
+
]
|
|
76
|
+
format_id: Annotated[
|
|
77
|
+
format_id_1.FormatId, Field(description="Format identifier for rendering the preview")
|
|
78
|
+
]
|
|
79
|
+
inputs: Annotated[
|
|
80
|
+
list[Input] | None,
|
|
81
|
+
Field(
|
|
82
|
+
description="Array of input sets for generating multiple preview variants. Each input set defines macros and context values for one preview rendering. If not provided, creative agent will generate default previews."
|
|
83
|
+
),
|
|
84
|
+
] = None
|
|
85
|
+
output_format: Annotated[
|
|
86
|
+
OutputFormat | None,
|
|
87
|
+
Field(
|
|
88
|
+
description="Output format for previews. 'url' returns preview_url (iframe-embeddable URL), 'html' returns preview_html (raw HTML for direct embedding). Default: 'url' for backward compatibility."
|
|
89
|
+
),
|
|
90
|
+
] = OutputFormat.url
|
|
91
|
+
request_type: Annotated[
|
|
92
|
+
Literal["single"],
|
|
93
|
+
Field(description="Discriminator indicating this is a single preview request"),
|
|
94
|
+
]
|
|
95
|
+
template_id: Annotated[
|
|
96
|
+
str | None, Field(description="Specific template ID for custom format rendering")
|
|
97
|
+
] = None
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
class Request(AdCPBaseModel):
|
|
101
|
+
model_config = ConfigDict(
|
|
102
|
+
extra="forbid",
|
|
103
|
+
)
|
|
104
|
+
creative_manifest: Annotated[
|
|
105
|
+
creative_manifest_1.CreativeManifest,
|
|
106
|
+
Field(description="Complete creative manifest with all required assets"),
|
|
107
|
+
]
|
|
108
|
+
format_id: Annotated[
|
|
109
|
+
format_id_1.FormatId, Field(description="Format identifier for rendering the preview")
|
|
110
|
+
]
|
|
111
|
+
inputs: Annotated[
|
|
112
|
+
list[Input2] | None,
|
|
113
|
+
Field(description="Array of input sets for generating multiple preview variants"),
|
|
114
|
+
] = None
|
|
115
|
+
output_format: Annotated[
|
|
116
|
+
OutputFormat | None,
|
|
117
|
+
Field(
|
|
118
|
+
description="Output format for this preview. 'url' returns preview_url, 'html' returns preview_html."
|
|
119
|
+
),
|
|
120
|
+
] = OutputFormat.url
|
|
121
|
+
template_id: Annotated[
|
|
122
|
+
str | None, Field(description="Specific template ID for custom format rendering")
|
|
123
|
+
] = None
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
class PreviewCreativeRequest2(AdCPBaseModel):
|
|
127
|
+
model_config = ConfigDict(
|
|
128
|
+
extra="forbid",
|
|
129
|
+
)
|
|
130
|
+
context: Annotated[
|
|
131
|
+
dict[str, Any] | None,
|
|
132
|
+
Field(
|
|
133
|
+
description="Initiator-provided context included in the request payload. Agents must echo this value back unchanged in responses and webhooks. Use for UI/session hints, correlation tokens, or tracking metadata."
|
|
134
|
+
),
|
|
135
|
+
] = None
|
|
136
|
+
output_format: Annotated[
|
|
137
|
+
OutputFormat | None,
|
|
138
|
+
Field(
|
|
139
|
+
description="Default output format for all requests in this batch. Individual requests can override this. 'url' returns preview_url (iframe-embeddable URL), 'html' returns preview_html (raw HTML for direct embedding)."
|
|
140
|
+
),
|
|
141
|
+
] = OutputFormat.url
|
|
142
|
+
request_type: Annotated[
|
|
143
|
+
Literal["batch"],
|
|
144
|
+
Field(description="Discriminator indicating this is a batch preview request"),
|
|
145
|
+
]
|
|
146
|
+
requests: Annotated[
|
|
147
|
+
list[Request],
|
|
148
|
+
Field(
|
|
149
|
+
description="Array of preview requests (1-50 items). Each follows the single request structure.",
|
|
150
|
+
max_length=50,
|
|
151
|
+
min_length=1,
|
|
152
|
+
),
|
|
153
|
+
]
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
class PreviewCreativeRequest(RootModel[PreviewCreativeRequest1 | PreviewCreativeRequest2]):
|
|
157
|
+
root: Annotated[
|
|
158
|
+
PreviewCreativeRequest1 | PreviewCreativeRequest2,
|
|
159
|
+
Field(
|
|
160
|
+
description="Request to generate previews of one or more creative manifests. Accepts either a single creative request or an array of requests for batch processing.",
|
|
161
|
+
title="Preview Creative Request",
|
|
162
|
+
),
|
|
163
|
+
]
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
# generated by datamodel-codegen:
|
|
2
|
+
# filename: preview-creative-response.json
|
|
3
|
+
# timestamp: 2025-11-15T22:03:55+00:00
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from typing import Annotated, Any, Literal
|
|
8
|
+
|
|
9
|
+
from adcp.types.base import AdCPBaseModel
|
|
10
|
+
from pydantic import AnyUrl, AwareDatetime, ConfigDict, Field, RootModel
|
|
11
|
+
|
|
12
|
+
from . import preview_render
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class Input(AdCPBaseModel):
|
|
16
|
+
context_description: Annotated[
|
|
17
|
+
str | None, Field(description="Context description applied to this variant")
|
|
18
|
+
] = None
|
|
19
|
+
macros: Annotated[
|
|
20
|
+
dict[str, str] | None, Field(description="Macro values applied to this variant")
|
|
21
|
+
] = None
|
|
22
|
+
name: Annotated[str, Field(description="Human-readable name for this variant")]
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class Error(AdCPBaseModel):
|
|
26
|
+
code: Annotated[
|
|
27
|
+
str,
|
|
28
|
+
Field(
|
|
29
|
+
description="Error code (e.g., 'invalid_manifest', 'unsupported_format', 'missing_assets')"
|
|
30
|
+
),
|
|
31
|
+
]
|
|
32
|
+
details: Annotated[dict[str, Any] | None, Field(description="Additional error context")] = None
|
|
33
|
+
message: Annotated[str, Field(description="Human-readable error message")]
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class Input4(AdCPBaseModel):
|
|
37
|
+
context_description: str | None = None
|
|
38
|
+
macros: dict[str, str] | None = None
|
|
39
|
+
name: str
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class Preview(AdCPBaseModel):
|
|
43
|
+
input: Annotated[
|
|
44
|
+
Input,
|
|
45
|
+
Field(
|
|
46
|
+
description="The input parameters that generated this preview variant. Echoes back the request input or shows defaults used."
|
|
47
|
+
),
|
|
48
|
+
]
|
|
49
|
+
preview_id: Annotated[str, Field(description="Unique identifier for this preview variant")]
|
|
50
|
+
renders: Annotated[
|
|
51
|
+
list[
|
|
52
|
+
preview_render.PreviewRender1
|
|
53
|
+
| preview_render.PreviewRender2
|
|
54
|
+
| preview_render.PreviewRender3
|
|
55
|
+
],
|
|
56
|
+
Field(
|
|
57
|
+
description="Array of rendered pieces for this preview variant. Most formats render as a single piece. Companion ad formats (video + banner), multi-placement formats, and adaptive formats render as multiple pieces.",
|
|
58
|
+
min_length=1,
|
|
59
|
+
),
|
|
60
|
+
]
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
class PreviewCreativeResponse1(AdCPBaseModel):
|
|
64
|
+
model_config = ConfigDict(
|
|
65
|
+
extra="forbid",
|
|
66
|
+
)
|
|
67
|
+
context: Annotated[
|
|
68
|
+
dict[str, Any] | None,
|
|
69
|
+
Field(
|
|
70
|
+
description="Initiator-provided context echoed inside the preview payload. Opaque metadata such as UI/session hints, correlation tokens, or tracking identifiers."
|
|
71
|
+
),
|
|
72
|
+
] = None
|
|
73
|
+
expires_at: Annotated[
|
|
74
|
+
AwareDatetime, Field(description="ISO 8601 timestamp when preview links expire")
|
|
75
|
+
]
|
|
76
|
+
interactive_url: Annotated[
|
|
77
|
+
AnyUrl | None,
|
|
78
|
+
Field(
|
|
79
|
+
description="Optional URL to an interactive testing page that shows all preview variants with controls to switch between them, modify macro values, and test different scenarios."
|
|
80
|
+
),
|
|
81
|
+
] = None
|
|
82
|
+
previews: Annotated[
|
|
83
|
+
list[Preview],
|
|
84
|
+
Field(
|
|
85
|
+
description="Array of preview variants. Each preview corresponds to an input set from the request. If no inputs were provided, returns a single default preview.",
|
|
86
|
+
min_length=1,
|
|
87
|
+
),
|
|
88
|
+
]
|
|
89
|
+
response_type: Annotated[
|
|
90
|
+
Literal["single"],
|
|
91
|
+
Field(description="Discriminator indicating this is a single preview response"),
|
|
92
|
+
]
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
class Preview1(AdCPBaseModel):
|
|
96
|
+
input: Input4
|
|
97
|
+
preview_id: str
|
|
98
|
+
renders: Annotated[
|
|
99
|
+
list[
|
|
100
|
+
preview_render.PreviewRender1
|
|
101
|
+
| preview_render.PreviewRender2
|
|
102
|
+
| preview_render.PreviewRender3
|
|
103
|
+
],
|
|
104
|
+
Field(min_length=1),
|
|
105
|
+
]
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
class Response(AdCPBaseModel):
|
|
109
|
+
expires_at: AwareDatetime
|
|
110
|
+
interactive_url: AnyUrl | None = None
|
|
111
|
+
previews: Annotated[
|
|
112
|
+
list[Preview1],
|
|
113
|
+
Field(description="Array of preview variants for this creative", min_length=1),
|
|
114
|
+
]
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
class Results(AdCPBaseModel):
|
|
118
|
+
error: Annotated[Error | None, Field(description="Error information for failed requests")] = (
|
|
119
|
+
None
|
|
120
|
+
)
|
|
121
|
+
response: Annotated[Response, Field(description="Preview response for successful requests")]
|
|
122
|
+
success: Annotated[Literal[True], Field(description="Whether this preview request succeeded")]
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
Preview2 = Preview1
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
class Response1(AdCPBaseModel):
|
|
129
|
+
expires_at: AwareDatetime
|
|
130
|
+
interactive_url: AnyUrl | None = None
|
|
131
|
+
previews: Annotated[
|
|
132
|
+
list[Preview2],
|
|
133
|
+
Field(description="Array of preview variants for this creative", min_length=1),
|
|
134
|
+
]
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
class Results1(AdCPBaseModel):
|
|
138
|
+
error: Annotated[Error, Field(description="Error information for failed requests")]
|
|
139
|
+
response: Annotated[
|
|
140
|
+
Response1 | None, Field(description="Preview response for successful requests")
|
|
141
|
+
] = None
|
|
142
|
+
success: Annotated[Literal[False], Field(description="Whether this preview request succeeded")]
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
class PreviewCreativeResponse2(AdCPBaseModel):
|
|
146
|
+
model_config = ConfigDict(
|
|
147
|
+
extra="forbid",
|
|
148
|
+
)
|
|
149
|
+
context: Annotated[
|
|
150
|
+
dict[str, Any] | None,
|
|
151
|
+
Field(
|
|
152
|
+
description="Initiator-provided context echoed inside the preview payload. Opaque metadata such as UI/session hints, correlation tokens, or tracking identifiers."
|
|
153
|
+
),
|
|
154
|
+
] = None
|
|
155
|
+
response_type: Annotated[
|
|
156
|
+
Literal["batch"],
|
|
157
|
+
Field(description="Discriminator indicating this is a batch preview response"),
|
|
158
|
+
]
|
|
159
|
+
results: Annotated[
|
|
160
|
+
list[Results | Results1],
|
|
161
|
+
Field(
|
|
162
|
+
description="Array of preview results corresponding to each request in the same order. results[0] is the result for requests[0], results[1] for requests[1], etc. Order is guaranteed even when some requests fail. Each result contains either a successful preview response or an error.",
|
|
163
|
+
min_length=1,
|
|
164
|
+
),
|
|
165
|
+
]
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
class PreviewCreativeResponse(RootModel[PreviewCreativeResponse1 | PreviewCreativeResponse2]):
|
|
169
|
+
root: Annotated[
|
|
170
|
+
PreviewCreativeResponse1 | PreviewCreativeResponse2,
|
|
171
|
+
Field(
|
|
172
|
+
description="Response containing preview links for one or more creatives. Format matches the request: single preview response for single requests, batch results for batch requests.",
|
|
173
|
+
title="Preview Creative Response",
|
|
174
|
+
),
|
|
175
|
+
]
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
# generated by datamodel-codegen:
|
|
2
|
+
# filename: preview-render.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 adcp.types.base import AdCPBaseModel
|
|
10
|
+
from pydantic import AnyUrl, ConfigDict, Field, RootModel
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class Dimensions(AdCPBaseModel):
|
|
14
|
+
height: Annotated[float, Field(ge=0.0)]
|
|
15
|
+
width: Annotated[float, Field(ge=0.0)]
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class Embedding(AdCPBaseModel):
|
|
19
|
+
csp_policy: Annotated[
|
|
20
|
+
str | None, Field(description="Content Security Policy requirements for embedding")
|
|
21
|
+
] = None
|
|
22
|
+
recommended_sandbox: Annotated[
|
|
23
|
+
str | None,
|
|
24
|
+
Field(
|
|
25
|
+
description="Recommended iframe sandbox attribute value (e.g., 'allow-scripts allow-same-origin')"
|
|
26
|
+
),
|
|
27
|
+
] = None
|
|
28
|
+
requires_https: Annotated[
|
|
29
|
+
bool | None, Field(description="Whether this output requires HTTPS for secure embedding")
|
|
30
|
+
] = None
|
|
31
|
+
supports_fullscreen: Annotated[
|
|
32
|
+
bool | None, Field(description="Whether this output supports fullscreen mode")
|
|
33
|
+
] = None
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class PreviewRender1(AdCPBaseModel):
|
|
37
|
+
model_config = ConfigDict(
|
|
38
|
+
extra="forbid",
|
|
39
|
+
)
|
|
40
|
+
dimensions: Annotated[
|
|
41
|
+
Dimensions | None, Field(description="Dimensions for this rendered piece")
|
|
42
|
+
] = None
|
|
43
|
+
embedding: Annotated[
|
|
44
|
+
Embedding | None,
|
|
45
|
+
Field(description="Optional security and embedding metadata for safe iframe integration"),
|
|
46
|
+
] = None
|
|
47
|
+
output_format: Annotated[
|
|
48
|
+
Literal["url"], Field(description="Discriminator indicating preview_url is provided")
|
|
49
|
+
]
|
|
50
|
+
preview_url: Annotated[
|
|
51
|
+
AnyUrl,
|
|
52
|
+
Field(
|
|
53
|
+
description="URL to an HTML page that renders this piece. Can be embedded in an iframe."
|
|
54
|
+
),
|
|
55
|
+
]
|
|
56
|
+
render_id: Annotated[
|
|
57
|
+
str, Field(description="Unique identifier for this rendered piece within the variant")
|
|
58
|
+
]
|
|
59
|
+
role: Annotated[
|
|
60
|
+
str,
|
|
61
|
+
Field(
|
|
62
|
+
description="Semantic role of this rendered piece. Use 'primary' for main content, 'companion' for associated banners, descriptive strings for device variants or custom roles."
|
|
63
|
+
),
|
|
64
|
+
]
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
class PreviewRender2(AdCPBaseModel):
|
|
68
|
+
model_config = ConfigDict(
|
|
69
|
+
extra="forbid",
|
|
70
|
+
)
|
|
71
|
+
dimensions: Annotated[
|
|
72
|
+
Dimensions | None, Field(description="Dimensions for this rendered piece")
|
|
73
|
+
] = None
|
|
74
|
+
embedding: Annotated[
|
|
75
|
+
Embedding | None, Field(description="Optional security and embedding metadata")
|
|
76
|
+
] = None
|
|
77
|
+
output_format: Annotated[
|
|
78
|
+
Literal["html"], Field(description="Discriminator indicating preview_html is provided")
|
|
79
|
+
]
|
|
80
|
+
preview_html: Annotated[
|
|
81
|
+
str,
|
|
82
|
+
Field(
|
|
83
|
+
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."
|
|
84
|
+
),
|
|
85
|
+
]
|
|
86
|
+
render_id: Annotated[
|
|
87
|
+
str, Field(description="Unique identifier for this rendered piece within the variant")
|
|
88
|
+
]
|
|
89
|
+
role: Annotated[
|
|
90
|
+
str,
|
|
91
|
+
Field(
|
|
92
|
+
description="Semantic role of this rendered piece. Use 'primary' for main content, 'companion' for associated banners, descriptive strings for device variants or custom roles."
|
|
93
|
+
),
|
|
94
|
+
]
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
class PreviewRender3(AdCPBaseModel):
|
|
98
|
+
model_config = ConfigDict(
|
|
99
|
+
extra="forbid",
|
|
100
|
+
)
|
|
101
|
+
dimensions: Annotated[
|
|
102
|
+
Dimensions | None, Field(description="Dimensions for this rendered piece")
|
|
103
|
+
] = None
|
|
104
|
+
embedding: Annotated[
|
|
105
|
+
Embedding | None,
|
|
106
|
+
Field(description="Optional security and embedding metadata for safe iframe integration"),
|
|
107
|
+
] = None
|
|
108
|
+
output_format: Annotated[
|
|
109
|
+
Literal["both"],
|
|
110
|
+
Field(
|
|
111
|
+
description="Discriminator indicating both preview_url and preview_html are provided"
|
|
112
|
+
),
|
|
113
|
+
]
|
|
114
|
+
preview_html: Annotated[
|
|
115
|
+
str,
|
|
116
|
+
Field(
|
|
117
|
+
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."
|
|
118
|
+
),
|
|
119
|
+
]
|
|
120
|
+
preview_url: Annotated[
|
|
121
|
+
AnyUrl,
|
|
122
|
+
Field(
|
|
123
|
+
description="URL to an HTML page that renders this piece. Can be embedded in an iframe."
|
|
124
|
+
),
|
|
125
|
+
]
|
|
126
|
+
render_id: Annotated[
|
|
127
|
+
str, Field(description="Unique identifier for this rendered piece within the variant")
|
|
128
|
+
]
|
|
129
|
+
role: Annotated[
|
|
130
|
+
str,
|
|
131
|
+
Field(
|
|
132
|
+
description="Semantic role of this rendered piece. Use 'primary' for main content, 'companion' for associated banners, descriptive strings for device variants or custom roles."
|
|
133
|
+
),
|
|
134
|
+
]
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
class PreviewRender(RootModel[PreviewRender1 | PreviewRender2 | PreviewRender3]):
|
|
138
|
+
root: Annotated[
|
|
139
|
+
PreviewRender1 | PreviewRender2 | PreviewRender3,
|
|
140
|
+
Field(
|
|
141
|
+
description="A single rendered piece of a creative preview with discriminated output format",
|
|
142
|
+
title="Preview Render",
|
|
143
|
+
),
|
|
144
|
+
]
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# generated by datamodel-codegen:
|
|
2
|
+
# filename: pricing-model.json
|
|
3
|
+
# timestamp: 2025-11-15T22:03:55+00:00
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from enum import Enum
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class PricingModel(Enum):
|
|
11
|
+
cpm = "cpm"
|
|
12
|
+
vcpm = "vcpm"
|
|
13
|
+
cpc = "cpc"
|
|
14
|
+
cpcv = "cpcv"
|
|
15
|
+
cpv = "cpv"
|
|
16
|
+
cpp = "cpp"
|
|
17
|
+
flat_rate = "flat_rate"
|