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_synthesized
var buyer_uploaded
var publisher_host_recorded
var publisher_owned_reference
var seller_human_designed
var 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 aac
var mp3
var opus
var 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 accepted
var 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.'
        ),
    ] = None

Base 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 set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='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 adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import 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_config on 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.

self is explicitly positional-only to allow self as a field name.

Ancestors

  • adcp.types.domains.formats.canonical._base.CanonicalFormatBase
  • AdCPBaseModel
  • pydantic.main.BaseModel

Class variables

var aspect_ratio : str | None
var asset_source : AssetSource | None
var audio_codecs : list[AudioCodec] | None
var brand_name_max_chars : int | None
var buyer_asset_acceptance : BuyerAssetAcceptance | None
var captions : Captions | None
var companion_banner_heights : list[CompanionBannerHeight] | None
var companion_banner_widths : list[CompanionBannerWidth] | None
var containers : list[Container] | None
var cta_values : list[str] | None
var ctv_ad_experience : CtvAdExperience | None
var duration_ms_exact : int | None
var duration_ms_range : list[DurationMsRange | None] | None
var frame_rates : list[float] | None
var headline_max_chars : int | None
var max_bitrate_kbps : int | None
var max_file_size_mb : int | None
var max_height : int | None
var max_width : int | None
var min_bitrate_kbps : int | None
var min_height : int | None
var min_width : int | None
var model_config
var om_sdk_required : bool | None
var orientation : Orientation | None
var primary_text_max_chars : int | None
var slots : typing.Any | None
var 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_required
var recommended
var required
class CompanionBannerHeight (value: Any = <object object>, *, root: Any = <object object>)
Expand source code
class CompanionBannerHeight(CompanionBannerWidth):
    pass

An int generated from a JSON Schema integer root.

Validates the way SchemaInt validates an integer field: strict, so "1" and True are refused, with a float carrying no fractional part narrowed to int because JSON Schema counts it as one.

Ancestors

class CompanionBannerWidth (value: Any = <object object>, *, root: Any = <object object>)
Expand source code
class CompanionBannerWidth(ScalarInt):
    __slots__ = ()
    _constraints = {'ge': 1}

An int generated from a JSON Schema integer root.

Validates the way SchemaInt validates an integer field: strict, so "1" and True are refused, with a float carrying no fractional part narrowed to int because 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 mov
var mp4
var webm
class DurationMsRange (value: Any = <object object>, *, root: Any = <object object>)
Expand source code
class DurationMsRange(ScalarInt):
    __slots__ = ()
    _constraints = {'ge': 0}

An int generated from a JSON Schema integer root.

Validates the way SchemaInt validates an integer field: strict, so "1" and True are refused, with a float carrying no fractional part narrowed to int because 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 horizontal
var square
var 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 av1
var h264
var h265
var prores
var vp8
var vp9