Module adcp.types.domains.formats.canonical.video_hosted
Classes
class AssetSource (*args, **kwds)-
Expand source code
class AssetSource(StrEnum): buyer_uploaded = 'buyer_uploaded' publisher_host_recorded = 'publisher_host_recorded' seller_pre_rendered_from_brief = 'seller_pre_rendered_from_brief' seller_human_designed = 'seller_human_designed' agent_synthesized = 'agent_synthesized' publisher_owned_reference = 'publisher_owned_reference'Enum where members are also (and must be) strings
Ancestors
- enum.StrEnum
- builtins.str
- enum.ReprEnum
- enum.Enum
Class variables
var agent_synthesizedvar buyer_uploadedvar publisher_host_recordedvar publisher_owned_referencevar seller_human_designedvar seller_pre_rendered_from_brief
class AudioCodec (*args, **kwds)-
Expand source code
class AudioCodec(StrEnum): aac = 'aac' mp3 = 'mp3' opus = 'opus' pcm = 'pcm'Enum where members are also (and must be) strings
Ancestors
- enum.StrEnum
- builtins.str
- enum.ReprEnum
- enum.Enum
Class variables
var aacvar mp3var opusvar pcm
class BuyerAssetAcceptance (*args, **kwds)-
Expand source code
class BuyerAssetAcceptance(StrEnum): accepted = 'accepted' rejected = 'rejected'Enum where members are also (and must be) strings
Ancestors
- enum.StrEnum
- builtins.str
- enum.ReprEnum
- enum.Enum
Class variables
var acceptedvar rejected
class CanonicalFormatHostedVideo (**data: Any)-
Expand source code
class CanonicalFormatHostedVideo(CanonicalFormatBase): model_config = ConfigDict( extra='allow', ) slots: Annotated[ Any | None, Field( description='Default slots for video_hosted canonical. Buyer ships a video asset (file or hosted URL); optional headline, primary text (long-form caption), CTA (typically constrained via `cta_values`), brand_name (typical for vertical short-form), companion_banner (typical for horizontal instream), and clickthrough URL. Products MAY override or extend the default — e.g., remove `companion_banner` for short-form vertical, narrow `cta` to a value enum, mark `landing_page_url` as required.' ), ] = [ {'asset_group_id': 'video_main', 'asset_type': 'video', 'required': True}, {'asset_group_id': 'headline', 'asset_type': 'text', 'required': False}, {'asset_group_id': 'primary_text', 'asset_type': 'text', 'required': False}, {'asset_group_id': 'cta', 'asset_type': 'text', 'required': False}, {'asset_group_id': 'brand_name', 'asset_type': 'text', 'required': False}, {'asset_group_id': 'companion_banner', 'asset_type': 'image', 'required': False}, {'asset_group_id': 'landing_page_url', 'asset_type': 'url', 'required': False}, ] orientation: Annotated[ Orientation | None, Field( description='Video orientation. Vertical = 9:16 (Reels, Stories, Shorts). Horizontal = 16:9 (instream, CTV). Square = 1:1 (in-feed).' ), ] = None aspect_ratio: Annotated[ str | None, Field( description='Aspect ratio. Inferred from orientation if omitted.', pattern='^[0-9]+(\\.[0-9]+)?:[0-9]+(\\.[0-9]+)?$', ), ] = None min_width: Annotated[SchemaInt | None, Field(ge=1)] = None min_height: Annotated[SchemaInt | None, Field(ge=1)] = None max_width: Annotated[SchemaInt | None, Field(ge=1)] = None max_height: Annotated[SchemaInt | None, Field(ge=1)] = None duration_ms_range: Annotated[ list[DurationMsRange | None] | None, Field( description='[min, max] duration in milliseconds. Either endpoint MAY be null to express an unbounded side: [null, 60000] means up to 60s; [15000, null] means at least 15s. [null, null] is invalid because at least one endpoint must be bounded. **Precedence**: when both `duration_ms_exact` and `duration_ms_range` ship on the same product, `duration_ms_exact` takes precedence — buyers MUST validate against the exact value and ignore the range. SDKs SHOULD lint a warning when both fields ship; producers SHOULD pick one.', max_length=2, min_length=2, ), ] = None duration_ms_exact: Annotated[ SchemaInt | None, Field( description='When set, duration must equal exactly this value. Takes precedence over `duration_ms_range` when both ship (see `duration_ms_range` description).', ge=1, ), ] = None video_codecs: list[VideoCodec] | None = None audio_codecs: list[AudioCodec] | None = None containers: list[Container] | None = None min_bitrate_kbps: Annotated[SchemaInt | None, Field(ge=1)] = None max_bitrate_kbps: Annotated[SchemaInt | None, Field(ge=1)] = None max_file_size_mb: Annotated[ SchemaInt | None, Field(description='Maximum file size, where 1 MB is exactly 1,000,000 bytes.', ge=1), ] = None frame_rates: list[StrictFloat] | None = None captions: Captions | None = None om_sdk_required: StrictBool | None = None headline_max_chars: Annotated[SchemaInt | None, Field(ge=1)] = None primary_text_max_chars: Annotated[SchemaInt | None, Field(ge=1)] = None brand_name_max_chars: Annotated[SchemaInt | None, Field(ge=1)] = None cta_values: list[str] | None = None companion_banner_widths: Annotated[ list[CompanionBannerWidth] | None, Field(description='Permitted companion banner widths (instream video).'), ] = None companion_banner_heights: list[CompanionBannerHeight] | None = None asset_source: Annotated[ AssetSource | None, Field( description='Where the rendered asset bytes come from. Single shared enum across canonicals. See `image.json#asset_source` for the full semantics. `publisher_host_recorded` is audio-specific and has no defined behavior on video. `publisher_owned_reference` is valid when the product accepts an existing post reference via a `published_post` slot instead of uploaded video bytes. Adopters MUST select a value appropriate to the canonical.' ), ] = AssetSource.buyer_uploaded buyer_asset_acceptance: Annotated[ BuyerAssetAcceptance | None, Field( description='Whether the product accepts buyer-uploaded video. When `rejected`, the buyer cannot ship a video asset directly — they must use build_creative, sync_creatives with brief inputs, or sync_creatives with an accepted reference asset so the seller produces or resolves the video.' ), ] = BuyerAssetAcceptance.accepted ctv_ad_experience: Annotated[ ctv_ad_experience_1.CtvAdExperience | None, Field( description='CTV experience this option serves. On `video_hosted` only `screensaver` is valid (ambient looping video the platform plays on idle). Other experiences route per the matrix in docs/creative/ctv-experiences.mdx; linear CTV video declares no experience.' ), ] = NoneBase model for AdCP types with spec-compliant serialization.
Defaults to
extra='ignore'so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas setadditionalProperties: trueoverride this withextra='allow'in their ownmodel_config.Set
ADCP_STRICT_VALIDATION=1in the environment ("1","true","yes","on"are accepted) to flip the default toextra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.Important
The env var is resolved once at module import time. Set it in your shell or CI environment before
import adcpruns — mutatingos.environ["ADCP_STRICT_VALIDATION"]after the firstadcpimport has no effect on already-imported model classes (they captured the policy at class-body evaluation).Consumers who want per-model strict validation can override
model_configon their subclass.Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.Ancestors
- adcp.types.domains.formats.canonical._base.CanonicalFormatBase
- AdCPBaseModel
- pydantic.main.BaseModel
Class variables
var aspect_ratio : str | Nonevar asset_source : AssetSource | Nonevar audio_codecs : list[AudioCodec] | Nonevar brand_name_max_chars : int | Nonevar buyer_asset_acceptance : BuyerAssetAcceptance | Nonevar captions : Captions | Nonevar containers : list[Container] | Nonevar cta_values : list[str] | Nonevar ctv_ad_experience : CtvAdExperience | Nonevar duration_ms_exact : int | Nonevar duration_ms_range : list[DurationMsRange | None] | Nonevar frame_rates : list[float] | Nonevar headline_max_chars : int | Nonevar max_bitrate_kbps : int | Nonevar max_file_size_mb : int | Nonevar max_height : int | Nonevar max_width : int | Nonevar min_bitrate_kbps : int | Nonevar min_height : int | Nonevar min_width : int | Nonevar model_configvar om_sdk_required : bool | Nonevar orientation : Orientation | Nonevar primary_text_max_chars : int | Nonevar slots : typing.Any | Nonevar video_codecs : list[VideoCodec] | None
Inherited members
class Captions (*args, **kwds)-
Expand source code
class Captions(StrEnum): required = 'required' recommended = 'recommended' not_required = 'not_required'Enum where members are also (and must be) strings
Ancestors
- enum.StrEnum
- builtins.str
- enum.ReprEnum
- enum.Enum
Class variables
var not_requiredvar recommendedvar required
class CompanionBannerHeight (value: Any = <object object>, *, root: Any = <object object>)-
Expand source code
class CompanionBannerHeight(CompanionBannerWidth): passAn
intgenerated from a JSON Schema integer root.Validates the way
SchemaIntvalidates an integer field: strict, so"1"andTrueare refused, with a float carrying no fractional part narrowed tointbecause JSON Schema counts it as one.Ancestors
- CompanionBannerWidth
- adcp.types._scalar.ScalarInt
- adcp.types._scalar._ScalarRoot
- builtins.int
class CompanionBannerWidth (value: Any = <object object>, *, root: Any = <object object>)-
Expand source code
class CompanionBannerWidth(ScalarInt): __slots__ = () _constraints = {'ge': 1}An
intgenerated from a JSON Schema integer root.Validates the way
SchemaIntvalidates an integer field: strict, so"1"andTrueare refused, with a float carrying no fractional part narrowed tointbecause JSON Schema counts it as one.Ancestors
- adcp.types._scalar.ScalarInt
- adcp.types._scalar._ScalarRoot
- builtins.int
Subclasses
class Container (*args, **kwds)-
Expand source code
class Container(StrEnum): mp4 = 'mp4' webm = 'webm' mov = 'mov'Enum where members are also (and must be) strings
Ancestors
- enum.StrEnum
- builtins.str
- enum.ReprEnum
- enum.Enum
Class variables
var movvar mp4var webm
class DurationMsRange (value: Any = <object object>, *, root: Any = <object object>)-
Expand source code
class DurationMsRange(ScalarInt): __slots__ = () _constraints = {'ge': 0}An
intgenerated from a JSON Schema integer root.Validates the way
SchemaIntvalidates an integer field: strict, so"1"andTrueare refused, with a float carrying no fractional part narrowed tointbecause JSON Schema counts it as one.Ancestors
- adcp.types._scalar.ScalarInt
- adcp.types._scalar._ScalarRoot
- builtins.int
class Orientation (*args, **kwds)-
Expand source code
class Orientation(StrEnum): vertical = 'vertical' horizontal = 'horizontal' square = 'square'Enum where members are also (and must be) strings
Ancestors
- enum.StrEnum
- builtins.str
- enum.ReprEnum
- enum.Enum
Class variables
var horizontalvar squarevar vertical
class VideoCodec (*args, **kwds)-
Expand source code
class VideoCodec(StrEnum): h264 = 'h264' h265 = 'h265' vp8 = 'vp8' vp9 = 'vp9' av1 = 'av1' prores = 'prores'Enum where members are also (and must be) strings
Ancestors
- enum.StrEnum
- builtins.str
- enum.ReprEnum
- enum.Enum
Class variables
var av1var h264var h265var proresvar vp8var vp9