Module adcp.types.domains.formats.canonical.video_vast

Classes

class CanonicalFormatVastVideo (**data: Any)
Expand source code
class CanonicalFormatVastVideo(CanonicalFormatBase):
    model_config = ConfigDict(
        extra='allow',
    )
    slots: Annotated[
        Any | None,
        Field(
            description="Default slots for video_vast canonical. Buyer ships a VAST tag (URL or inline XML, VAST 2.x-4.x) plus an optional clickthrough URL (which falls back to the VAST `ClickThrough` element when omitted). Tracking events are inherent to VAST and don't require explicit slots."
        ),
    ] = [
        {'asset_group_id': 'vast_tag', 'asset_type': 'vast', 'required': True},
        {'asset_group_id': 'landing_page_url', 'asset_type': 'url', 'required': False},
    ]
    orientation: Orientation | None = None
    aspect_ratio: Annotated[
        str | None, Field(pattern='^[0-9]+(\\.[0-9]+)?:[0-9]+(\\.[0-9]+)?$')
    ] = None
    vast_versions: Annotated[
        list[vast_version_1.VastVersion] | None,
        Field(
            description='VAST versions accepted by this product format option. The asset still declares exactly one `vast_version`; compatibility requires membership in this set and the seller-wide execution set.',
            min_length=1,
        ),
    ] = None
    vast_version: Annotated[
        vast_version_1.VastVersion | None,
        Field(
            deprecated=True,
            description='Deprecated one-element alias for `vast_versions`. Producers use either the singular legacy alias or the plural 3.2 field, never both.',
        ),
    ] = None
    media_file_requirements: Annotated[
        vast_media_file_requirements.VastMediafileRequirements | None,
        Field(
            description='Technical acceptance constraints for alternative VAST MediaFile renditions. Each applicable resolved InLine linear creative needs at least one MediaFile satisfying all declared constraints.'
        ),
    ] = None
    vpaid_enabled: Annotated[
        StrictBool | None,
        Field(
            description='Whether VPAID interactivity is supported. When true, the VAST tag may carry VPAID JS/Flash payloads.'
        ),
    ] = None
    vpaid_version: VpaidVersion | None = None
    simid_supported: Annotated[
        StrictBool | None,
        Field(
            description='Whether the seller accepts IAB SIMID through `<InteractiveCreativeFile apiFramework="SIMID">` on a Linear VAST creative. SIMID is not a generic VAST extension and cannot be serialized under NonLinearAds; every `ctv_ad_experience` profile therefore forbids `true`.'
        ),
    ] = None
    duration_ms_range: Annotated[
        list[DurationMsRangeItem] | None,
        Field(
            description='[min, max] duration in milliseconds. **Precedence**: `duration_ms_exact` takes precedence when both ship. SDKs SHOULD lint a warning when both fields ship.',
            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.',
            ge=1,
        ),
    ] = None
    min_width: Annotated[
        SchemaInt | None,
        Field(
            description='Minimum placement/player width in pixels. MediaFile rendition dimensions are declared in `media_file_requirements`.',
            ge=1,
        ),
    ] = None
    max_width: Annotated[
        SchemaInt | None,
        Field(
            description='Maximum placement/player width in pixels. MediaFile rendition dimensions are declared in `media_file_requirements`.',
            ge=1,
        ),
    ] = None
    min_height: Annotated[
        SchemaInt | None,
        Field(
            description='Minimum placement/player height in pixels. MediaFile rendition dimensions are declared in `media_file_requirements`.',
            ge=1,
        ),
    ] = None
    max_height: Annotated[
        SchemaInt | None,
        Field(
            description='Maximum placement/player height in pixels. MediaFile rendition dimensions are declared in `media_file_requirements`.',
            ge=1,
        ),
    ] = None
    creative_type: Annotated[
        CreativeType | None,
        Field(
            description='Required VAST creative class: `linear` (in-stream Linear), `nonlinear` (NonLinearAds overlay-class), or `either`. Supersedes `linear_required`; when both are present `creative_type` wins, and validators treat `linear_required: true` with no `creative_type` as `linear`.'
        ),
    ] = None
    ctv_ad_experience: Annotated[
        ctv_ad_experience_1.CtvAdExperience | None,
        Field(
            description='CTV experience this option is eligible to serve. On video_vast only `pause`, `screensaver`, `overlay`, `squeezeback`, and `in_scene` are valid (`menu` routes to native_in_feed or sponsored_placement), and `creative_type` MUST be `nonlinear`. Because VAST places `<InteractiveCreativeFile>` only under Linear `<MediaFiles>`, `simid_supported` MUST NOT be true on any of these NonLinear profiles. Per-experience floors: `overlay` and `squeezeback` require a 10s minimum duration; `in_scene` requires a 3s minimum brand-exposure duration and forbids interactivity (`vpaid_enabled` MUST NOT be true); `pause` has no duration floor and ends on viewer or device action.'
        ),
    ] = None
    motion_level: Annotated[
        motion_level_1.CreativeMotionLevel | None,
        Field(description='Accepted motion class for the rendered creative (AdCOM attrs 21-23).'),
    ] = None
    activation_methods: Annotated[
        list[activation_method.CreativeActivationMethod] | None,
        Field(
            description='Viewer activation mechanisms this option offers. Activations are engagement events, not impressions.'
        ),
    ] = None
    linear_required: Annotated[
        StrictBool | None,
        Field(
            description='Whether the VAST creative must be linear (non-skippable in-stream). Superseded by `creative_type`; retained for pre-3.2 declarations.'
        ),
    ] = None
    skippable_after_ms: Annotated[
        SchemaInt | None,
        Field(
            description='When skippable, the buyer-side skip threshold in milliseconds (e.g., 5000 for 5-second skippable pre-roll).',
            ge=0,
        ),
    ] = None
    max_wrapper_depth: Annotated[
        SchemaInt | None, Field(description='Maximum VAST wrapper redirect depth permitted.', ge=0)
    ] = None
    ssl_required: StrictBool | None = 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 activation_methods : list[CreativeActivationMethod] | None
var aspect_ratio : str | None
var creative_type : CreativeType | None
var ctv_ad_experience : CtvAdExperience | None
var duration_ms_exact : int | None
var duration_ms_range : list[DurationMsRangeItem] | None
var linear_required : bool | None
var max_height : int | None
var max_width : int | None
var max_wrapper_depth : int | None
var media_file_requirements : VastMediafileRequirements | None
var min_height : int | None
var min_width : int | None
var model_config
var motion_level : CreativeMotionLevel | None
var orientation : Orientation | None
var simid_supported : bool | None
var skippable_after_ms : int | None
var slots : typing.Any | None
var ssl_required : bool | None
var vast_version : VastVersion | None
var vast_versions : list[VastVersion] | None
var vpaid_enabled : bool | None
var vpaid_version : VpaidVersion | None

Inherited members

class CreativeType (*args, **kwds)
Expand source code
class CreativeType(StrEnum):
    linear = 'linear'
    nonlinear = 'nonlinear'
    either = 'either'

Enum where members are also (and must be) strings

Ancestors

  • enum.StrEnum
  • builtins.str
  • enum.ReprEnum
  • enum.Enum

Class variables

var either
var linear
var nonlinear
class DurationMsRangeItem (value: Any = <object object>, *, root: Any = <object object>)
Expand source code
class DurationMsRangeItem(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 VpaidVersion (*args, **kwds)
Expand source code
class VpaidVersion(StrEnum):
    field_1_0 = '1.0'
    field_2_0 = '2.0'

Enum where members are also (and must be) strings

Ancestors

  • enum.StrEnum
  • builtins.str
  • enum.ReprEnum
  • enum.Enum

Class variables

var field_1_0
var field_2_0