Module adcp.types.domains.formats.canonical.html5
Classes
class CanonicalFormatHtml5Banner (**data: Any)-
Expand source code
class CanonicalFormatHtml5Banner(CanonicalFormatBase): model_config = ConfigDict( extra='allow', ) slots: Annotated[ Any | None, Field( description="Default slots for html5 canonical. Buyer ships a zip bundle plus optional backup image (required when `backup_image_required: true`) and clickthrough URL. The zip's entry point is typically `index.html`; click handling uses the `clickTag` (or `clickTAG`) macro substituted by the seller at serve time." ), ] = [ {'asset_group_id': 'html5_bundle', 'asset_type': 'zip', 'required': True}, {'asset_group_id': 'backup_image', 'asset_type': 'image', 'required': False}, {'asset_group_id': 'landing_page_url', 'asset_type': 'url', 'required': False}, ] width: Annotated[ SchemaInt | None, Field( description='Required banner width in pixels — use for fixed-size slots. For multi-size flexible slots use `sizes[]`; for responsive use `min_width`/`max_width`/`min_height`/`max_height`. Exactly one of `(width, height)`, `sizes[]`, or `min/max_width` + `min/max_height` ranges MUST be set.', ge=1, ), ] = None height: Annotated[ SchemaInt | None, Field( description='Required banner height in pixels. See `width` for size-mode mutual exclusion.', ge=1, ), ] = None sizes: Annotated[ list[Size] | None, Field( description='List of accepted (width, height) pairs for a multi-size flexible slot (publisher banner that accepts 300×250 OR 728×90 OR 970×250). Mirrors OpenRTB `banner.format[]`. Mutually exclusive with `(width, height)` and with responsive ranges.', min_length=1, ), ] = None min_width: Annotated[ SchemaInt | None, Field( description='Minimum accepted width for responsive HTML5 banners that adapt within a range. Pair with `max_width`. Mutually exclusive with `(width, height)` and `sizes[]`.', ge=1, ), ] = None max_width: Annotated[ SchemaInt | None, Field( description='Maximum accepted width for responsive HTML5 banners. Pair with `min_width`.', ge=1, ), ] = None min_height: Annotated[ SchemaInt | None, Field( description='Minimum accepted height for responsive HTML5 banners. Pair with `max_height`.', ge=1, ), ] = None max_height: Annotated[ SchemaInt | None, Field( description='Maximum accepted height for responsive HTML5 banners. Pair with `min_height`.', ge=1, ), ] = None max_initial_load_kb: Annotated[ SchemaInt | None, Field( description='Maximum initial-load file size (zip + above-the-fold assets) in kilobytes. IAB display standards: 200 KB for fixed sizes, 100 KB for mobile.', ge=1, ), ] = None max_polite_load_kb: Annotated[ SchemaInt | None, Field( description='Maximum polite-load file size after host-initiated subload, in kilobytes. IAB display standards: 500 KB for fixed sizes.', ge=1, ), ] = None host_initiated_subload: Annotated[ StrictBool | None, Field( description='Whether the host page must initiate the polite-load phase. IAB-compliant banners require true.' ), ] = None max_animation_duration_ms: Annotated[ SchemaInt | None, Field( description='Maximum total animation duration in milliseconds. IAB standard: 30000 (30 seconds).', ge=0, ), ] = None max_cpu_load_percent: Annotated[ SchemaInt | None, Field(description='Maximum CPU load percentage during render.', ge=1, le=100), ] = None mraid_required: Annotated[ StrictBool | None, Field(description='Whether MRAID compatibility is required (mobile in-app).'), ] = None mraid_version: Annotated[ MraidVersion | None, Field(description='Required MRAID version when mraid_required is true.'), ] = None om_sdk_required: Annotated[ StrictBool | None, Field(description='Whether IAB Open Measurement SDK integration is required.'), ] = None clicktag_macro: Annotated[ ClicktagMacro | None, Field(description='Name of the click-tag macro the bundle must use.') ] = None backup_image_required: Annotated[ StrictBool | None, Field( description='Whether a backup image must accompany the zip for non-HTML5 environments.' ), ] = None backup_image_max_size_kb: Annotated[ SchemaInt | None, Field(description='Maximum backup image file size in kilobytes.', ge=1) ] = None ssl_required: StrictBool | None = 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 backup_image_max_size_kb : int | Nonevar backup_image_required : bool | Nonevar clicktag_macro : ClicktagMacro | Nonevar height : int | Nonevar host_initiated_subload : bool | Nonevar max_animation_duration_ms : int | Nonevar max_cpu_load_percent : int | Nonevar max_height : int | Nonevar max_initial_load_kb : int | Nonevar max_polite_load_kb : int | Nonevar max_width : int | Nonevar min_height : int | Nonevar min_width : int | Nonevar model_configvar mraid_required : bool | Nonevar mraid_version : MraidVersion | Nonevar om_sdk_required : bool | Nonevar sizes : list[Size] | Nonevar slots : typing.Any | Nonevar ssl_required : bool | Nonevar width : int | None
Inherited members
class ClicktagMacro (*args, **kwds)-
Expand source code
class ClicktagMacro(StrEnum): clickTag = 'clickTag' clickTAG = 'clickTAG'Enum where members are also (and must be) strings
Ancestors
- enum.StrEnum
- builtins.str
- enum.ReprEnum
- enum.Enum
Class variables
var clickTAGvar clickTag
class MraidVersion (*args, **kwds)-
Expand source code
class MraidVersion(StrEnum): field_2_0 = '2.0' field_3_0 = '3.0'Enum where members are also (and must be) strings
Ancestors
- enum.StrEnum
- builtins.str
- enum.ReprEnum
- enum.Enum
Class variables
var field_2_0var field_3_0
class Size (**data: Any)-
Expand source code
class Size(AdCPBaseModel): model_config = ConfigDict( extra='forbid', ) width: Annotated[SchemaInt, Field(ge=1)] height: Annotated[SchemaInt, Field(ge=1)]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 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
- AdCPBaseModel
- pydantic.main.BaseModel
Class variables
var height : intvar model_configvar width : int
Inherited members