adcp 2.7.0__py3-none-any.whl → 2.9.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 +7 -4
- adcp/__main__.py +31 -3
- adcp/client.py +200 -0
- adcp/protocols/a2a.py +12 -0
- adcp/protocols/base.py +15 -0
- adcp/protocols/mcp.py +12 -0
- adcp/types/__init__.py +461 -31
- adcp/types/_generated.py +37 -38
- adcp/types/aliases.py +251 -46
- adcp/types/generated_poc/activate_signal_request.py +3 -3
- adcp/types/generated_poc/activate_signal_response.py +2 -2
- adcp/types/generated_poc/asset_content_type.py +23 -0
- adcp/types/generated_poc/brand_manifest.py +8 -8
- adcp/types/generated_poc/create_media_buy_response.py +16 -21
- adcp/types/generated_poc/deployment.py +6 -6
- adcp/types/generated_poc/destination.py +4 -4
- adcp/types/generated_poc/format.py +5 -30
- adcp/types/generated_poc/format_category.py +17 -0
- adcp/types/generated_poc/get_signals_request.py +4 -4
- adcp/types/generated_poc/get_signals_response.py +2 -2
- adcp/types/generated_poc/list_creative_formats_request.py +4 -22
- adcp/types/generated_poc/update_media_buy_response.py +15 -22
- adcp/types/stable.py +268 -7
- {adcp-2.7.0.dist-info → adcp-2.9.0.dist-info}/METADATA +172 -1
- {adcp-2.7.0.dist-info → adcp-2.9.0.dist-info}/RECORD +29 -28
- adcp/types/generated_poc/asset_type.py +0 -100
- {adcp-2.7.0.dist-info → adcp-2.9.0.dist-info}/WHEEL +0 -0
- {adcp-2.7.0.dist-info → adcp-2.9.0.dist-info}/entry_points.txt +0 -0
- {adcp-2.7.0.dist-info → adcp-2.9.0.dist-info}/licenses/LICENSE +0 -0
- {adcp-2.7.0.dist-info → adcp-2.9.0.dist-info}/top_level.txt +0 -0
adcp/types/_generated.py
CHANGED
|
@@ -10,7 +10,7 @@ Auto-generated by datamodel-code-generator from JSON schemas.
|
|
|
10
10
|
DO NOT EDIT MANUALLY.
|
|
11
11
|
|
|
12
12
|
Generated from: https://github.com/adcontextprotocol/adcp/tree/main/schemas
|
|
13
|
-
Generation date: 2025-11-
|
|
13
|
+
Generation date: 2025-11-20 21:00:13 UTC
|
|
14
14
|
"""
|
|
15
15
|
# ruff: noqa: E501, I001
|
|
16
16
|
from __future__ import annotations
|
|
@@ -20,9 +20,9 @@ from adcp.types.generated_poc.activate_signal_request import ActivateSignalReque
|
|
|
20
20
|
from adcp.types.generated_poc.activate_signal_response import ActivateSignalResponse, ActivateSignalResponse1, ActivateSignalResponse2
|
|
21
21
|
from adcp.types.generated_poc.activation_key import ActivationKey1, ActivationKey2
|
|
22
22
|
from adcp.types.generated_poc.adagents import AuthorizedAgents, AuthorizedAgents1, AuthorizedAgents2, AuthorizedAgents3, AuthorizedSalesAgents, Contact, PropertyId, PropertyTag, Tags
|
|
23
|
-
from adcp.types.generated_poc.
|
|
23
|
+
from adcp.types.generated_poc.asset_content_type import AssetContentType
|
|
24
24
|
from adcp.types.generated_poc.audio_asset import AudioAsset
|
|
25
|
-
from adcp.types.generated_poc.brand_manifest import Asset,
|
|
25
|
+
from adcp.types.generated_poc.brand_manifest import Asset, BrandManifest, Colors, Disclaimer, FeedFormat, Fonts, Logo, Metadata, ProductCatalog, UpdateFrequency
|
|
26
26
|
from adcp.types.generated_poc.build_creative_request import BuildCreativeRequest
|
|
27
27
|
from adcp.types.generated_poc.build_creative_response import BuildCreativeResponse, BuildCreativeResponse1, BuildCreativeResponse2
|
|
28
28
|
from adcp.types.generated_poc.channels import AdvertisingChannels
|
|
@@ -47,7 +47,8 @@ from adcp.types.generated_poc.deployment import Deployment1, Deployment2
|
|
|
47
47
|
from adcp.types.generated_poc.destination import Destination1, Destination2
|
|
48
48
|
from adcp.types.generated_poc.error import Error
|
|
49
49
|
from adcp.types.generated_poc.flat_rate_option import FlatRatePricingOption
|
|
50
|
-
from adcp.types.generated_poc.format import AssetsRequired, AssetsRequired1, Format, FormatCard, FormatCardDetailed, Render, Responsive, Unit
|
|
50
|
+
from adcp.types.generated_poc.format import AssetsRequired, AssetsRequired1, Dimensions, Format, FormatCard, FormatCardDetailed, Render, Responsive, Unit
|
|
51
|
+
from adcp.types.generated_poc.format_category import FormatCategory
|
|
51
52
|
from adcp.types.generated_poc.format_id import FormatId
|
|
52
53
|
from adcp.types.generated_poc.frequency_cap import FrequencyCap
|
|
53
54
|
from adcp.types.generated_poc.frequency_cap_scope import FrequencyCapScope
|
|
@@ -81,7 +82,7 @@ from adcp.types.generated_poc.preview_creative_response import Input4, Preview,
|
|
|
81
82
|
from adcp.types.generated_poc.preview_render import Embedding, PreviewRender, PreviewRender1, PreviewRender2, PreviewRender3
|
|
82
83
|
from adcp.types.generated_poc.pricing_model import PricingModel
|
|
83
84
|
from adcp.types.generated_poc.product import DeliveryMeasurement, Product, ProductCard, ProductCardDetailed
|
|
84
|
-
from adcp.types.generated_poc.promoted_offerings import AssetSelectors, Offering, PromotedOfferings
|
|
85
|
+
from adcp.types.generated_poc.promoted_offerings import AssetSelectors, AssetType, Offering, PromotedOfferings
|
|
85
86
|
from adcp.types.generated_poc.promoted_products import PromotedProducts
|
|
86
87
|
from adcp.types.generated_poc.property import Identifier, Property, PropertyType, Tag
|
|
87
88
|
from adcp.types.generated_poc.protocol_envelope import ProtocolEnvelope
|
|
@@ -100,12 +101,12 @@ from adcp.types.generated_poc.targeting import GeoCountryAnyOfItem, TargetingOve
|
|
|
100
101
|
from adcp.types.generated_poc.task_status import TaskStatus
|
|
101
102
|
from adcp.types.generated_poc.task_type import TaskType
|
|
102
103
|
from adcp.types.generated_poc.tasks_get_request import TasksGetRequest
|
|
103
|
-
from adcp.types.generated_poc.tasks_get_response import Details, Domain, HistoryItem, Progress, TasksGetResponse
|
|
104
|
+
from adcp.types.generated_poc.tasks_get_response import Details, Domain, HistoryItem, Progress, TasksGetResponse, Type
|
|
104
105
|
from adcp.types.generated_poc.tasks_list_request import TasksListRequest
|
|
105
106
|
from adcp.types.generated_poc.tasks_list_response import DomainBreakdown, Task, TasksListResponse
|
|
106
107
|
from adcp.types.generated_poc.text_asset import TextAsset
|
|
107
108
|
from adcp.types.generated_poc.update_media_buy_request import Packages, Packages1, Packages2, Packages3, UpdateMediaBuyRequest, UpdateMediaBuyRequest1, UpdateMediaBuyRequest2
|
|
108
|
-
from adcp.types.generated_poc.update_media_buy_response import
|
|
109
|
+
from adcp.types.generated_poc.update_media_buy_response import UpdateMediaBuyResponse, UpdateMediaBuyResponse1, UpdateMediaBuyResponse2
|
|
109
110
|
from adcp.types.generated_poc.url_asset import UrlAsset, UrlType
|
|
110
111
|
from adcp.types.generated_poc.vast_asset import VastAsset1, VastAsset2, VastVersion
|
|
111
112
|
from adcp.types.generated_poc.vcpm_auction_option import VcpmAuctionPricingOption
|
|
@@ -115,7 +116,6 @@ from adcp.types.generated_poc.webhook_asset import Method, Method1, ResponseType
|
|
|
115
116
|
from adcp.types.generated_poc.webhook_payload import WebhookPayload
|
|
116
117
|
|
|
117
118
|
# Special imports for name collisions (qualified names for types defined in multiple modules)
|
|
118
|
-
from adcp.types.generated_poc.create_media_buy_response import Package as _PackageFromCreateMediaBuyResponse
|
|
119
119
|
from adcp.types.generated_poc.package import Package as _PackageFromPackage
|
|
120
120
|
|
|
121
121
|
# Backward compatibility aliases for renamed types
|
|
@@ -125,24 +125,24 @@ Channels = AdvertisingChannels
|
|
|
125
125
|
__all__ = [
|
|
126
126
|
"Action", "ActivateSignalRequest", "ActivateSignalResponse", "ActivateSignalResponse1",
|
|
127
127
|
"ActivateSignalResponse2", "ActivationKey1", "ActivationKey2", "AdvertisingChannels",
|
|
128
|
-
"
|
|
129
|
-
"
|
|
130
|
-
"
|
|
128
|
+
"AggregatedTotals", "Asset", "AssetContentType", "AssetSelectors", "AssetType",
|
|
129
|
+
"AssetsRequired", "AssetsRequired1", "AssignedPackage", "Assignments", "AudioAsset",
|
|
130
|
+
"Authentication", "AuthorizedAgents", "AuthorizedAgents1", "AuthorizedAgents2",
|
|
131
131
|
"AuthorizedAgents3", "AuthorizedSalesAgents", "AvailableMetric", "AvailableReportingFrequency",
|
|
132
132
|
"BrandManifest", "BuildCreativeRequest", "BuildCreativeResponse", "BuildCreativeResponse1",
|
|
133
133
|
"BuildCreativeResponse2", "ByPackageItem", "Capability", "CatalogType", "Channels",
|
|
134
|
-
"CoBranding", "Colors", "Contact", "
|
|
135
|
-
"
|
|
136
|
-
"
|
|
137
|
-
"
|
|
138
|
-
"
|
|
139
|
-
"
|
|
140
|
-
"
|
|
141
|
-
"
|
|
142
|
-
"DomainBreakdown", "DoohMetrics", "
|
|
143
|
-
"
|
|
144
|
-
"
|
|
145
|
-
"
|
|
134
|
+
"CoBranding", "Colors", "Contact", "Country", "CpcPricingOption", "CpcvPricingOption",
|
|
135
|
+
"CpmAuctionPricingOption", "CpmFixedRatePricingOption", "CppPricingOption", "CpvPricingOption",
|
|
136
|
+
"CreateMediaBuyRequest", "CreateMediaBuyResponse", "CreateMediaBuyResponse1",
|
|
137
|
+
"CreateMediaBuyResponse2", "Creative", "CreativeAgent", "CreativeAsset", "CreativeAssignment",
|
|
138
|
+
"CreativeManifest", "CreativePolicy", "CreativeStatus", "CssAsset", "DaastAsset1",
|
|
139
|
+
"DaastAsset2", "DaastVersion", "DailyBreakdownItem", "DeliverTo", "DeliveryMeasurement",
|
|
140
|
+
"DeliveryMetrics", "DeliveryType", "Deployment1", "Deployment2", "Destination1",
|
|
141
|
+
"Destination2", "Details", "Dimensions", "Direction", "Disclaimer", "Domain",
|
|
142
|
+
"DomainBreakdown", "DoohMetrics", "Embedding", "Error", "FeedFormat", "FeedbackSource",
|
|
143
|
+
"Field1", "FieldModel", "Filters", "FlatRatePricingOption", "Fonts", "Format", "FormatCard",
|
|
144
|
+
"FormatCardDetailed", "FormatCategory", "FormatId", "FormatType", "FrequencyCap",
|
|
145
|
+
"FrequencyCapScope", "GeoCountryAnyOfItem", "GetMediaBuyDeliveryRequest",
|
|
146
146
|
"GetMediaBuyDeliveryResponse", "GetProductsRequest", "GetProductsResponse",
|
|
147
147
|
"GetSignalsRequest", "GetSignalsResponse", "HistoryItem", "HtmlAsset", "Identifier",
|
|
148
148
|
"ImageAsset", "Input", "Input2", "Input4", "JavascriptAsset", "LandingPage",
|
|
@@ -163,19 +163,18 @@ __all__ = [
|
|
|
163
163
|
"ProvidePerformanceFeedbackResponse", "ProvidePerformanceFeedbackResponse1",
|
|
164
164
|
"ProvidePerformanceFeedbackResponse2", "PublisherDomain", "PublisherIdentifierTypes",
|
|
165
165
|
"PublisherPropertySelector1", "PublisherPropertySelector2", "PublisherPropertySelector3",
|
|
166
|
-
"PushNotificationConfig", "
|
|
167
|
-
"
|
|
168
|
-
"
|
|
169
|
-
"
|
|
170
|
-
"
|
|
171
|
-
"
|
|
172
|
-
"
|
|
173
|
-
"
|
|
174
|
-
"
|
|
175
|
-
"
|
|
176
|
-
"
|
|
177
|
-
"
|
|
178
|
-
"
|
|
179
|
-
"
|
|
180
|
-
"_PackageFromCreateMediaBuyResponse", "_PackageFromPackage"
|
|
166
|
+
"PushNotificationConfig", "QuartileData", "QuerySummary", "Render", "ReportingCapabilities",
|
|
167
|
+
"ReportingFrequency", "ReportingPeriod", "ReportingWebhook", "Request", "RequestedMetric",
|
|
168
|
+
"Response", "Response1", "ResponseType", "Responsive", "Results", "Results1", "Scheme",
|
|
169
|
+
"Security", "Signal", "SignalType", "Sort", "SortApplied", "StandardFormatIds", "Status",
|
|
170
|
+
"StatusFilter", "StatusFilterEnum", "StatusSummary", "SubAsset1", "SubAsset2",
|
|
171
|
+
"SyncCreativesRequest", "SyncCreativesResponse", "SyncCreativesResponse1",
|
|
172
|
+
"SyncCreativesResponse2", "Tag", "Tags", "TargetingOverlay", "Task", "TaskStatus", "TaskType",
|
|
173
|
+
"TasksGetRequest", "TasksGetResponse", "TasksListRequest", "TasksListResponse", "TextAsset",
|
|
174
|
+
"Totals", "TrackingEvent", "Type", "Unit", "UpdateFrequency", "UpdateMediaBuyRequest",
|
|
175
|
+
"UpdateMediaBuyRequest1", "UpdateMediaBuyRequest2", "UpdateMediaBuyResponse",
|
|
176
|
+
"UpdateMediaBuyResponse1", "UpdateMediaBuyResponse2", "UrlAsset", "UrlType", "ValidationMode",
|
|
177
|
+
"VastAsset1", "VastAsset2", "VastVersion", "VcpmAuctionPricingOption",
|
|
178
|
+
"VcpmFixedRatePricingOption", "VenueBreakdownItem", "VideoAsset", "ViewThreshold",
|
|
179
|
+
"ViewThreshold1", "WebhookAsset", "WebhookPayload", "_PackageFromPackage"
|
|
181
180
|
]
|
adcp/types/aliases.py
CHANGED
|
@@ -38,6 +38,11 @@ from adcp.types._generated import (
|
|
|
38
38
|
# Activation keys
|
|
39
39
|
ActivationKey1,
|
|
40
40
|
ActivationKey2,
|
|
41
|
+
# Authorized agents
|
|
42
|
+
AuthorizedAgents,
|
|
43
|
+
AuthorizedAgents1,
|
|
44
|
+
AuthorizedAgents2,
|
|
45
|
+
AuthorizedAgents3,
|
|
41
46
|
# Build creative responses
|
|
42
47
|
BuildCreativeResponse1,
|
|
43
48
|
BuildCreativeResponse2,
|
|
@@ -95,14 +100,11 @@ from adcp.types._generated import (
|
|
|
95
100
|
PublisherPropertySelector3 as PublisherPropertiesByTagInternal,
|
|
96
101
|
)
|
|
97
102
|
|
|
98
|
-
#
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
from adcp.types._generated import (
|
|
104
|
-
_PackageFromPackage as FullPackageInternal,
|
|
105
|
-
)
|
|
103
|
+
# Note: Package collision resolved by PR #223
|
|
104
|
+
# Both create_media_buy and update_media_buy now return full Package objects
|
|
105
|
+
# No more separate reference type needed
|
|
106
|
+
# Import Package from _generated (still uses qualified name for internal reasons)
|
|
107
|
+
from adcp.types._generated import _PackageFromPackage as Package
|
|
106
108
|
|
|
107
109
|
# ============================================================================
|
|
108
110
|
# RESPONSE TYPE ALIASES - Success/Error Discriminated Unions
|
|
@@ -237,40 +239,11 @@ TextSubAsset = SubAsset2
|
|
|
237
239
|
# - Used in MediaBuy, update operations, and package management
|
|
238
240
|
# - Has 12+ fields for full package configuration
|
|
239
241
|
#
|
|
240
|
-
#
|
|
241
|
-
#
|
|
242
|
-
#
|
|
243
|
-
#
|
|
244
|
-
#
|
|
245
|
-
# The code generator's "first wins" collision handling exports the Created Package
|
|
246
|
-
# as "Package", shadowing the Full Package. These semantic aliases provide clear,
|
|
247
|
-
# unambiguous names for both types.
|
|
248
|
-
|
|
249
|
-
Package = FullPackageInternal
|
|
250
|
-
"""Complete package configuration with all operational fields.
|
|
251
|
-
|
|
252
|
-
This is the canonical Package type used throughout AdCP for package management.
|
|
253
|
-
|
|
254
|
-
Used in:
|
|
255
|
-
- MediaBuy.packages (list of full package details)
|
|
256
|
-
- Update operations (modifying existing packages)
|
|
257
|
-
- Package management (creating/configuring packages)
|
|
258
|
-
|
|
259
|
-
Fields include: budget, pricing_option_id, product_id, status, bid_price,
|
|
260
|
-
creative_assignments, format_ids_to_provide, impressions, pacing, targeting_overlay
|
|
261
|
-
"""
|
|
262
|
-
|
|
263
|
-
CreatedPackageReference = CreatedPackageInternal
|
|
264
|
-
"""Minimal package reference with only IDs returned after creation.
|
|
265
|
-
|
|
266
|
-
This is NOT the full Package type - it's a lightweight reference returned
|
|
267
|
-
in CreateMediaBuySuccessResponse to indicate which packages were created.
|
|
268
|
-
|
|
269
|
-
Used in:
|
|
270
|
-
- CreateMediaBuySuccessResponse.packages (list of created package references)
|
|
271
|
-
|
|
272
|
-
Fields: buyer_ref, package_id only
|
|
273
|
-
"""
|
|
242
|
+
# Package collision resolved by PR #223:
|
|
243
|
+
# - create-media-buy-response.json now returns full Package objects (not minimal refs)
|
|
244
|
+
# - update-media-buy-response.json already returned full Package objects
|
|
245
|
+
# - Both operations return identical Package structures
|
|
246
|
+
# - Single Package type imported above, no aliases needed
|
|
274
247
|
|
|
275
248
|
# ============================================================================
|
|
276
249
|
# PUBLISHER PROPERTIES ALIASES - Selection Type Discriminated Unions
|
|
@@ -479,6 +452,226 @@ Example:
|
|
|
479
452
|
```
|
|
480
453
|
"""
|
|
481
454
|
|
|
455
|
+
# ============================================================================
|
|
456
|
+
# AUTHORIZED AGENTS ALIASES - Authorization Type Discriminated Unions
|
|
457
|
+
# ============================================================================
|
|
458
|
+
# The AdCP adagents.json schema defines AuthorizedAgents as a discriminated
|
|
459
|
+
# union with four variants based on the `authorization_type` field:
|
|
460
|
+
#
|
|
461
|
+
# 1. Property IDs (authorization_type='property_ids'):
|
|
462
|
+
# - Agent authorized for specific property IDs
|
|
463
|
+
# - Requires property_ids array
|
|
464
|
+
#
|
|
465
|
+
# 2. Property Tags (authorization_type='property_tags'):
|
|
466
|
+
# - Agent authorized for properties matching tags
|
|
467
|
+
# - Requires property_tags array
|
|
468
|
+
#
|
|
469
|
+
# 3. Inline Properties (authorization_type='inline_properties'):
|
|
470
|
+
# - Agent authorized with inline property definitions
|
|
471
|
+
# - Requires properties array with full Property objects
|
|
472
|
+
#
|
|
473
|
+
# 4. Publisher Properties (authorization_type='publisher_properties'):
|
|
474
|
+
# - Agent authorized for properties from other publisher domains
|
|
475
|
+
# - Requires publisher_properties array
|
|
476
|
+
#
|
|
477
|
+
# These define which sales agents are authorized to sell inventory and which
|
|
478
|
+
# properties they can access.
|
|
479
|
+
|
|
480
|
+
AuthorizedAgentsByPropertyId = AuthorizedAgents
|
|
481
|
+
"""Authorized agent with specific property IDs.
|
|
482
|
+
|
|
483
|
+
This variant uses authorization_type='property_ids' for agents authorized
|
|
484
|
+
to sell specific properties identified by their IDs.
|
|
485
|
+
|
|
486
|
+
Fields:
|
|
487
|
+
- authorization_type: Literal['property_ids']
|
|
488
|
+
- authorized_for: Human-readable description
|
|
489
|
+
- property_ids: List of PropertyId (non-empty)
|
|
490
|
+
- url: Agent's API endpoint URL
|
|
491
|
+
|
|
492
|
+
Example:
|
|
493
|
+
```python
|
|
494
|
+
from adcp.types.aliases import AuthorizedAgentsByPropertyId, PropertyId
|
|
495
|
+
|
|
496
|
+
agent = AuthorizedAgentsByPropertyId(
|
|
497
|
+
authorization_type="property_ids",
|
|
498
|
+
authorized_for="Premium display inventory",
|
|
499
|
+
property_ids=[PropertyId("homepage"), PropertyId("sports")],
|
|
500
|
+
url="https://agent.example.com"
|
|
501
|
+
)
|
|
502
|
+
```
|
|
503
|
+
"""
|
|
504
|
+
|
|
505
|
+
AuthorizedAgentsByPropertyTag = AuthorizedAgents1
|
|
506
|
+
"""Authorized agent with property tags.
|
|
507
|
+
|
|
508
|
+
This variant uses authorization_type='property_tags' for agents authorized
|
|
509
|
+
to sell properties identified by matching tags.
|
|
510
|
+
|
|
511
|
+
Fields:
|
|
512
|
+
- authorization_type: Literal['property_tags']
|
|
513
|
+
- authorized_for: Human-readable description
|
|
514
|
+
- property_tags: List of PropertyTag (non-empty)
|
|
515
|
+
- url: Agent's API endpoint URL
|
|
516
|
+
|
|
517
|
+
Example:
|
|
518
|
+
```python
|
|
519
|
+
from adcp.types.aliases import AuthorizedAgentsByPropertyTag, PropertyTag
|
|
520
|
+
|
|
521
|
+
agent = AuthorizedAgentsByPropertyTag(
|
|
522
|
+
authorization_type="property_tags",
|
|
523
|
+
authorized_for="Video inventory",
|
|
524
|
+
property_tags=[PropertyTag("video"), PropertyTag("premium")],
|
|
525
|
+
url="https://agent.example.com"
|
|
526
|
+
)
|
|
527
|
+
```
|
|
528
|
+
"""
|
|
529
|
+
|
|
530
|
+
AuthorizedAgentsByInlineProperties = AuthorizedAgents2
|
|
531
|
+
"""Authorized agent with inline property definitions.
|
|
532
|
+
|
|
533
|
+
This variant uses authorization_type='inline_properties' for agents with
|
|
534
|
+
inline Property objects rather than references to the top-level properties array.
|
|
535
|
+
|
|
536
|
+
Fields:
|
|
537
|
+
- authorization_type: Literal['inline_properties']
|
|
538
|
+
- authorized_for: Human-readable description
|
|
539
|
+
- properties: List of Property objects (non-empty)
|
|
540
|
+
- url: Agent's API endpoint URL
|
|
541
|
+
|
|
542
|
+
Example:
|
|
543
|
+
```python
|
|
544
|
+
from adcp.types.aliases import AuthorizedAgentsByInlineProperties
|
|
545
|
+
from adcp.types.stable import Property
|
|
546
|
+
|
|
547
|
+
agent = AuthorizedAgentsByInlineProperties(
|
|
548
|
+
authorization_type="inline_properties",
|
|
549
|
+
authorized_for="Custom inventory bundle",
|
|
550
|
+
properties=[...], # Full Property objects
|
|
551
|
+
url="https://agent.example.com"
|
|
552
|
+
)
|
|
553
|
+
```
|
|
554
|
+
"""
|
|
555
|
+
|
|
556
|
+
AuthorizedAgentsByPublisherProperties = AuthorizedAgents3
|
|
557
|
+
"""Authorized agent for properties from other publishers.
|
|
558
|
+
|
|
559
|
+
This variant uses authorization_type='publisher_properties' for agents
|
|
560
|
+
authorized to sell inventory from other publisher domains.
|
|
561
|
+
|
|
562
|
+
Fields:
|
|
563
|
+
- authorization_type: Literal['publisher_properties']
|
|
564
|
+
- authorized_for: Human-readable description
|
|
565
|
+
- publisher_properties: List of PublisherPropertySelector variants (non-empty)
|
|
566
|
+
- url: Agent's API endpoint URL
|
|
567
|
+
|
|
568
|
+
Example:
|
|
569
|
+
```python
|
|
570
|
+
from adcp.types.aliases import (
|
|
571
|
+
AuthorizedAgentsByPublisherProperties,
|
|
572
|
+
PublisherPropertiesAll
|
|
573
|
+
)
|
|
574
|
+
|
|
575
|
+
agent = AuthorizedAgentsByPublisherProperties(
|
|
576
|
+
authorization_type="publisher_properties",
|
|
577
|
+
authorized_for="Network inventory across publishers",
|
|
578
|
+
publisher_properties=[
|
|
579
|
+
PublisherPropertiesAll(
|
|
580
|
+
publisher_domain="publisher1.com",
|
|
581
|
+
selection_type="all"
|
|
582
|
+
)
|
|
583
|
+
],
|
|
584
|
+
url="https://agent.example.com"
|
|
585
|
+
)
|
|
586
|
+
```
|
|
587
|
+
"""
|
|
588
|
+
|
|
589
|
+
# ============================================================================
|
|
590
|
+
# UNION TYPE ALIASES - For Type Hints and Pattern Matching
|
|
591
|
+
# ============================================================================
|
|
592
|
+
# These union aliases provide convenient types for function signatures,
|
|
593
|
+
# type hints, and pattern matching without having to manually construct
|
|
594
|
+
# the union each time.
|
|
595
|
+
|
|
596
|
+
# Deployment union (for signals)
|
|
597
|
+
Deployment = PlatformDeployment | AgentDeployment
|
|
598
|
+
"""Union type for all deployment variants.
|
|
599
|
+
|
|
600
|
+
Use this for type hints when a function accepts any deployment type:
|
|
601
|
+
|
|
602
|
+
Example:
|
|
603
|
+
```python
|
|
604
|
+
def process_deployment(deployment: Deployment) -> None:
|
|
605
|
+
if isinstance(deployment, PlatformDeployment):
|
|
606
|
+
print(f"Platform: {deployment.platform}")
|
|
607
|
+
elif isinstance(deployment, AgentDeployment):
|
|
608
|
+
print(f"Agent: {deployment.agent_url}")
|
|
609
|
+
```
|
|
610
|
+
"""
|
|
611
|
+
|
|
612
|
+
# Destination union (for signals)
|
|
613
|
+
Destination = PlatformDestination | AgentDestination
|
|
614
|
+
"""Union type for all destination variants.
|
|
615
|
+
|
|
616
|
+
Use this for type hints when a function accepts any destination type:
|
|
617
|
+
|
|
618
|
+
Example:
|
|
619
|
+
```python
|
|
620
|
+
def format_destination(dest: Destination) -> str:
|
|
621
|
+
if isinstance(dest, PlatformDestination):
|
|
622
|
+
return f"Platform: {dest.platform}"
|
|
623
|
+
elif isinstance(dest, AgentDestination):
|
|
624
|
+
return f"Agent: {dest.agent_url}"
|
|
625
|
+
```
|
|
626
|
+
"""
|
|
627
|
+
|
|
628
|
+
# Authorized agent union (for adagents.json)
|
|
629
|
+
AuthorizedAgent = (
|
|
630
|
+
AuthorizedAgentsByPropertyId
|
|
631
|
+
| AuthorizedAgentsByPropertyTag
|
|
632
|
+
| AuthorizedAgentsByInlineProperties
|
|
633
|
+
| AuthorizedAgentsByPublisherProperties
|
|
634
|
+
)
|
|
635
|
+
"""Union type for all authorized agent variants.
|
|
636
|
+
|
|
637
|
+
Use this for type hints when processing agents from adagents.json:
|
|
638
|
+
|
|
639
|
+
Example:
|
|
640
|
+
```python
|
|
641
|
+
def validate_agent(agent: AuthorizedAgent) -> bool:
|
|
642
|
+
match agent.authorization_type:
|
|
643
|
+
case "property_ids":
|
|
644
|
+
return len(agent.property_ids) > 0
|
|
645
|
+
case "property_tags":
|
|
646
|
+
return len(agent.property_tags) > 0
|
|
647
|
+
case "inline_properties":
|
|
648
|
+
return len(agent.properties) > 0
|
|
649
|
+
case "publisher_properties":
|
|
650
|
+
return len(agent.publisher_properties) > 0
|
|
651
|
+
```
|
|
652
|
+
"""
|
|
653
|
+
|
|
654
|
+
# Publisher properties union (for product requests)
|
|
655
|
+
PublisherProperties = (
|
|
656
|
+
PublisherPropertiesAll | PublisherPropertiesById | PublisherPropertiesByTag
|
|
657
|
+
)
|
|
658
|
+
"""Union type for all publisher properties variants.
|
|
659
|
+
|
|
660
|
+
Use this for type hints in product filtering:
|
|
661
|
+
|
|
662
|
+
Example:
|
|
663
|
+
```python
|
|
664
|
+
def filter_products(props: PublisherProperties) -> None:
|
|
665
|
+
match props.selection_type:
|
|
666
|
+
case "all":
|
|
667
|
+
print("All properties from publisher")
|
|
668
|
+
case "by_id":
|
|
669
|
+
print(f"Properties: {props.property_ids}")
|
|
670
|
+
case "by_tag":
|
|
671
|
+
print(f"Tags: {props.property_tags}")
|
|
672
|
+
```
|
|
673
|
+
"""
|
|
674
|
+
|
|
482
675
|
# ============================================================================
|
|
483
676
|
# EXPORTS
|
|
484
677
|
# ============================================================================
|
|
@@ -500,6 +693,13 @@ __all__ = [
|
|
|
500
693
|
"UrlDaastAsset",
|
|
501
694
|
"UrlPreviewRender",
|
|
502
695
|
"UrlVastAsset",
|
|
696
|
+
# Authorized agent variants
|
|
697
|
+
"AuthorizedAgentsByPropertyId",
|
|
698
|
+
"AuthorizedAgentsByPropertyTag",
|
|
699
|
+
"AuthorizedAgentsByInlineProperties",
|
|
700
|
+
"AuthorizedAgentsByPublisherProperties",
|
|
701
|
+
# Authorized agent union
|
|
702
|
+
"AuthorizedAgent",
|
|
503
703
|
# Build creative responses
|
|
504
704
|
"BuildCreativeSuccessResponse",
|
|
505
705
|
"BuildCreativeErrorResponse",
|
|
@@ -525,19 +725,24 @@ __all__ = [
|
|
|
525
725
|
"UpdateMediaBuySuccessResponse",
|
|
526
726
|
"UpdateMediaBuyErrorResponse",
|
|
527
727
|
# Package type aliases
|
|
528
|
-
"CreatedPackageReference",
|
|
529
728
|
"Package",
|
|
530
729
|
# Publisher properties types
|
|
531
730
|
"PropertyId",
|
|
532
731
|
"PropertyTag",
|
|
533
|
-
# Publisher properties
|
|
732
|
+
# Publisher properties variants
|
|
534
733
|
"PublisherPropertiesAll",
|
|
535
734
|
"PublisherPropertiesById",
|
|
536
735
|
"PublisherPropertiesByTag",
|
|
537
|
-
#
|
|
736
|
+
# Publisher properties union
|
|
737
|
+
"PublisherProperties",
|
|
738
|
+
# Deployment variants
|
|
538
739
|
"PlatformDeployment",
|
|
539
740
|
"AgentDeployment",
|
|
540
|
-
#
|
|
741
|
+
# Deployment union
|
|
742
|
+
"Deployment",
|
|
743
|
+
# Destination variants
|
|
541
744
|
"PlatformDestination",
|
|
542
745
|
"AgentDestination",
|
|
746
|
+
# Destination union
|
|
747
|
+
"Destination",
|
|
543
748
|
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# generated by datamodel-codegen:
|
|
2
2
|
# filename: activate-signal-request.json
|
|
3
|
-
# timestamp: 2025-11-
|
|
3
|
+
# timestamp: 2025-11-20T20:44:40+00:00
|
|
4
4
|
|
|
5
5
|
from __future__ import annotations
|
|
6
6
|
|
|
@@ -22,10 +22,10 @@ class ActivateSignalRequest(AdCPBaseModel):
|
|
|
22
22
|
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.'
|
|
23
23
|
),
|
|
24
24
|
] = None
|
|
25
|
-
|
|
25
|
+
deployments: Annotated[
|
|
26
26
|
list[destination.Destination1 | destination.Destination2],
|
|
27
27
|
Field(
|
|
28
|
-
description='Target
|
|
28
|
+
description='Target deployment(s) for activation. If the authenticated caller matches one of these deployment targets, activation keys will be included in the response.',
|
|
29
29
|
min_length=1,
|
|
30
30
|
),
|
|
31
31
|
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# generated by datamodel-codegen:
|
|
2
2
|
# filename: activate-signal-response.json
|
|
3
|
-
# timestamp: 2025-11-
|
|
3
|
+
# timestamp: 2025-11-20T20:44:40+00:00
|
|
4
4
|
|
|
5
5
|
from __future__ import annotations
|
|
6
6
|
|
|
@@ -24,7 +24,7 @@ class ActivateSignalResponse1(AdCPBaseModel):
|
|
|
24
24
|
] = None
|
|
25
25
|
deployments: Annotated[
|
|
26
26
|
list[deployment.Deployment1 | deployment.Deployment2],
|
|
27
|
-
Field(description='Array of deployment results for each
|
|
27
|
+
Field(description='Array of deployment results for each deployment target'),
|
|
28
28
|
]
|
|
29
29
|
|
|
30
30
|
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# generated by datamodel-codegen:
|
|
2
|
+
# filename: asset-content-type.json
|
|
3
|
+
# timestamp: 2025-11-20T11:58:34+00:00
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from enum import Enum
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class AssetContentType(Enum):
|
|
11
|
+
image = 'image'
|
|
12
|
+
video = 'video'
|
|
13
|
+
audio = 'audio'
|
|
14
|
+
text = 'text'
|
|
15
|
+
markdown = 'markdown'
|
|
16
|
+
html = 'html'
|
|
17
|
+
css = 'css'
|
|
18
|
+
javascript = 'javascript'
|
|
19
|
+
vast = 'vast'
|
|
20
|
+
daast = 'daast'
|
|
21
|
+
promoted_offerings = 'promoted_offerings'
|
|
22
|
+
url = 'url'
|
|
23
|
+
webhook = 'webhook'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# generated by datamodel-codegen:
|
|
2
2
|
# filename: brand-manifest.json
|
|
3
|
-
# timestamp: 2025-11-
|
|
3
|
+
# timestamp: 2025-11-20T11:58:34+00:00
|
|
4
4
|
|
|
5
5
|
from __future__ import annotations
|
|
6
6
|
|
|
@@ -10,12 +10,7 @@ from typing import Annotated, Any
|
|
|
10
10
|
from adcp.types.base import AdCPBaseModel
|
|
11
11
|
from pydantic import AnyUrl, AwareDatetime, ConfigDict, EmailStr, Field
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
class AssetType(Enum):
|
|
15
|
-
image = 'image'
|
|
16
|
-
video = 'video'
|
|
17
|
-
audio = 'audio'
|
|
18
|
-
text = 'text'
|
|
13
|
+
from . import asset_content_type
|
|
19
14
|
|
|
20
15
|
|
|
21
16
|
class Asset(AdCPBaseModel):
|
|
@@ -23,7 +18,12 @@ class Asset(AdCPBaseModel):
|
|
|
23
18
|
extra='forbid',
|
|
24
19
|
)
|
|
25
20
|
asset_id: Annotated[str, Field(description='Unique identifier for this asset')]
|
|
26
|
-
asset_type: Annotated[
|
|
21
|
+
asset_type: Annotated[
|
|
22
|
+
asset_content_type.AssetContentType,
|
|
23
|
+
Field(
|
|
24
|
+
description='Type of asset. Note: Brand manifests typically contain basic media assets (image, video, audio, text). Code assets (html, javascript, css) and ad markup (vast, daast) are usually not part of brand asset libraries.'
|
|
25
|
+
),
|
|
26
|
+
]
|
|
27
27
|
description: Annotated[str | None, Field(description='Asset description or usage notes')] = None
|
|
28
28
|
duration_seconds: Annotated[
|
|
29
29
|
float | None, Field(description='Video/audio duration in seconds')
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# generated by datamodel-codegen:
|
|
2
2
|
# filename: create-media-buy-response.json
|
|
3
|
-
# timestamp: 2025-11-
|
|
3
|
+
# timestamp: 2025-11-20T11:58:34+00:00
|
|
4
4
|
|
|
5
5
|
from __future__ import annotations
|
|
6
6
|
|
|
@@ -9,15 +9,23 @@ from typing import Annotated, Any
|
|
|
9
9
|
from adcp.types.base import AdCPBaseModel
|
|
10
10
|
from pydantic import AwareDatetime, ConfigDict, Field, RootModel
|
|
11
11
|
|
|
12
|
-
from . import error
|
|
12
|
+
from . import error, package
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
class
|
|
15
|
+
class CreateMediaBuyResponse2(AdCPBaseModel):
|
|
16
16
|
model_config = ConfigDict(
|
|
17
17
|
extra='forbid',
|
|
18
18
|
)
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
context: Annotated[
|
|
20
|
+
dict[str, Any] | None,
|
|
21
|
+
Field(
|
|
22
|
+
description='Initiator-provided context echoed inside the task payload. Opaque metadata such as UI/session hints, correlation tokens, or tracking identifiers.'
|
|
23
|
+
),
|
|
24
|
+
] = None
|
|
25
|
+
errors: Annotated[
|
|
26
|
+
list[error.Error],
|
|
27
|
+
Field(description='Array of errors explaining why the operation failed', min_length=1),
|
|
28
|
+
]
|
|
21
29
|
|
|
22
30
|
|
|
23
31
|
class CreateMediaBuyResponse1(AdCPBaseModel):
|
|
@@ -37,22 +45,9 @@ class CreateMediaBuyResponse1(AdCPBaseModel):
|
|
|
37
45
|
media_buy_id: Annotated[
|
|
38
46
|
str, Field(description="Publisher's unique identifier for the created media buy")
|
|
39
47
|
]
|
|
40
|
-
packages: Annotated[
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
class CreateMediaBuyResponse2(AdCPBaseModel):
|
|
44
|
-
model_config = ConfigDict(
|
|
45
|
-
extra='forbid',
|
|
46
|
-
)
|
|
47
|
-
context: Annotated[
|
|
48
|
-
dict[str, Any] | None,
|
|
49
|
-
Field(
|
|
50
|
-
description='Initiator-provided context echoed inside the task payload. Opaque metadata such as UI/session hints, correlation tokens, or tracking identifiers.'
|
|
51
|
-
),
|
|
52
|
-
] = None
|
|
53
|
-
errors: Annotated[
|
|
54
|
-
list[error.Error],
|
|
55
|
-
Field(description='Array of errors explaining why the operation failed', min_length=1),
|
|
48
|
+
packages: Annotated[
|
|
49
|
+
list[package.Package],
|
|
50
|
+
Field(description='Array of created packages with complete state information'),
|
|
56
51
|
]
|
|
57
52
|
|
|
58
53
|
|