Module adcp.types.domains.formats.canonical.audio_daast

Classes

class CanonicalFormatDaastAudio (**data: Any)
Expand source code
class CanonicalFormatDaastAudio(CanonicalFormatBase):
    model_config = ConfigDict(
        extra='allow',
    )
    slots: Annotated[
        Any | None,
        Field(
            description="Default slots for audio_daast canonical. Buyer ships a DAAST tag (URL or inline XML, 1.0 or 1.1) plus an optional clickthrough URL. Tracking events are inherent to DAAST and don't require explicit slots."
        ),
    ] = [
        {'asset_group_id': 'daast_tag', 'asset_type': 'daast', 'required': True},
        {'asset_group_id': 'landing_page_url', 'asset_type': 'url', 'required': False},
    ]
    daast_version: Annotated[
        daast_version_1.DaastVersion | None,
        Field(
            deprecated=True,
            description='Deprecated one-element alias for `daast_versions`. Producers use either the singular legacy alias or the plural 3.2 field, never both.',
        ),
    ] = None
    daast_versions: Annotated[
        daast_tracker_constraints.DaastVersions | None,
        Field(
            description="Accepted DAAST versions for this format option. A tracker execution selector's daast_versions must be a nonempty subset of this set."
        ),
    ] = 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
    linear_required: StrictBool | None = None
    max_wrapper_depth: Annotated[SchemaInt | None, Field(ge=0)] = None
    ssl_required: StrictBool | None = None
    companion_image_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 companion_image_required : bool | None
var daast_version : DaastVersion | None
var daast_versions : DaastVersions | None
var duration_ms_exact : int | None
var duration_ms_range : list[DurationMsRangeItem] | None
var linear_required : bool | None
var max_wrapper_depth : int | None
var model_config
var slots : typing.Any | None
var ssl_required : bool | None

Inherited members

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