Module adcp.types.domains.core.overlay
Classes
class Bounds (**data: Any)-
Expand source code
class Bounds(AdCPBaseModel): model_config = ConfigDict( extra='forbid', ) x: Annotated[StrictFloat, Field(description="Horizontal offset from the asset's left edge")] y: Annotated[StrictFloat, Field(description="Vertical offset from the asset's top edge")] width: Annotated[StrictFloat, Field(description='Width of the overlay', ge=0.0)] height: Annotated[StrictFloat, Field(description='Height of the overlay', ge=0.0)] unit: Annotated[ Unit, Field( description="'px' = absolute pixels from asset top-left. 'fraction' = proportional to asset dimensions (0.0 = edge, 1.0 = opposite edge). 'inches', 'cm', 'mm', 'pt' (1/72 inch) = physical units for print overlays, measured from asset top-left." ), ]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 : floatvar model_configvar unit : Unitvar width : floatvar x : floatvar y : float
Inherited members
class Overlay (**data: Any)-
Expand source code
class Overlay(AdCPBaseModel): model_config = ConfigDict( extra='forbid', ) id: Annotated[ str, Field( description="Identifier for this overlay (e.g., 'play_pause', 'volume', 'publisher_logo', 'carousel_prev', 'carousel_next')" ), ] description: Annotated[ str | None, Field( description='Human-readable explanation of what this overlay is and how buyers should account for it' ), ] = None visual: Annotated[ Visual | None, Field( description='Optional visual reference for this overlay element. Useful for creative agents compositing previews and for buyers understanding what will appear over their content. Must include at least one of: url, light, or dark.' ), ] = None bounds: Annotated[ Bounds, Field( description="Position and size of the overlay relative to the asset's own top-left corner. See 'unit' for coordinate interpretation." ), ]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 bounds : Boundsvar description : str | Nonevar id : strvar model_configvar visual : Visual | None
Inherited members
class Unit (*args, **kwds)-
Expand source code
class Unit(StrEnum): px = 'px' fraction = 'fraction' inches = 'inches' cm = 'cm' mm = 'mm' pt = 'pt'Enum where members are also (and must be) strings
Ancestors
- enum.StrEnum
- builtins.str
- enum.ReprEnum
- enum.Enum
Class variables
var cmvar fractionvar inchesvar mmvar ptvar px
class Visual (**data: Any)-
Expand source code
class Visual(AdCPBaseModel): model_config = ConfigDict( extra='forbid', ) url: Annotated[ AnyUrl | None, Field( description='URL to a theme-neutral overlay graphic (SVG or PNG). Use when a single file works for all backgrounds, e.g. an SVG using CSS custom properties or currentColor.' ), ] = None light: Annotated[ AnyUrl | None, Field( description='URL to the overlay graphic for use on light/bright backgrounds (SVG or PNG)' ), ] = None dark: Annotated[ AnyUrl | None, Field(description='URL to the overlay graphic for use on dark backgrounds (SVG or PNG)'), ] = 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
- AdCPBaseModel
- pydantic.main.BaseModel
Class variables
var dark : pydantic.networks.AnyUrl | Nonevar light : pydantic.networks.AnyUrl | Nonevar model_configvar url : pydantic.networks.AnyUrl | None
Inherited members