Skip to content

Commit 7990017

Browse files
bokelleyclaude
andcommitted
feat: expose BrandManifestReference union type in stable API
Add BrandManifestReference as a union type (BrandManifest | AnyUrl) to properly represent the oneOf schema from brand-manifest-ref.json. This allows users to pass either an inline BrandManifest object or a URL string pointing to a hosted manifest. Changes: - Add BrandManifestReference = BrandManifest1 | AnyUrl in stable.py - Export BrandManifestReference from adcp.types - Restore deprecation warning to generated_poc/__init__.py 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent c6455c1 commit 7990017

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

src/adcp/types/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
# Import stable public API types
3737
from adcp.types.stable import (
3838
BrandManifest,
39+
BrandManifestReference,
3940
Creative,
4041
CreativeStatus,
4142
Error,
@@ -86,6 +87,7 @@
8687
"UrlVastAsset",
8788
# Stable API types (commonly used)
8889
"BrandManifest",
90+
"BrandManifestReference",
8991
"Creative",
9092
"CreativeStatus",
9193
"Error",

src/adcp/types/generated_poc/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# generated by datamodel-codegen:
22
# filename: .schema_temp
3-
# timestamp: 2025-11-18T03:35:10+00:00
3+
# timestamp: 2025-11-18T04:03:30+00:00
44

55
"""Generated AdCP types - INTERNAL USE ONLY.
66

src/adcp/types/stable.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121

2222
from __future__ import annotations
2323

24+
from pydantic import AnyUrl
25+
2426
# Import all generated types
2527
from adcp.types.generated import (
2628
# Core request/response types
@@ -98,6 +100,11 @@
98100
# These provide a clean public API that hides schema evolution details
99101
BrandManifest = BrandManifest1
100102

103+
# Union types for oneOf schemas
104+
# BrandManifestReference represents the union from brand-manifest-ref.json:
105+
# either an inline BrandManifest object OR a URL string pointing to a hosted manifest
106+
BrandManifestReference = BrandManifest1 | AnyUrl
107+
101108
# Re-export all stable types
102109
__all__ = [
103110
# Request/Response types
@@ -133,6 +140,7 @@
133140
"UpdateMediaBuyResponse",
134141
# Domain types
135142
"BrandManifest", # Stable alias for BrandManifest1
143+
"BrandManifestReference", # Union type: BrandManifest | AnyUrl
136144
"Creative",
137145
"CreativeManifest",
138146
"Error",

0 commit comments

Comments
 (0)