Module adcp.types.domains.core.event
Classes
class Event (**data: Any)-
Expand source code
class Event(AdCPBaseModel): model_config = ConfigDict( extra='allow', ) event_id: Annotated[ str, Field( description='Unique identifier for deduplication (scoped to event_type + event_source_id)', max_length=256, min_length=1, ), ] event_type: Annotated[event_type_1.EventType, Field(description='Standard event type')] event_time: Annotated[ AwareDatetime, Field(description='ISO 8601 timestamp when the event occurred') ] user_match: Annotated[ user_match_1.UserMatch | None, Field(description='User identifiers for attribution matching'), ] = None custom_data: Annotated[ event_custom_data.EventCustomData | None, Field(description='Event-specific data (value, currency, items, etc.)'), ] = None action_source: Annotated[ action_source_1.ActionSource | None, Field(description='Where the event originated') ] = None surface: Annotated[ event_surface.EventSurface | None, Field( description='Optional structured surface context for the event, such as an owned channel, profile, feed, podcast, newsletter list, website, app, or store. Complements `action_source`; use it when optimization-relevant meaning would otherwise live only in platform-specific `ext` metadata.' ), ] = None event_source_url: Annotated[ AnyUrl | None, Field( description="URL where the event occurred (required when action_source is 'website')" ), ] = None custom_event_name: Annotated[ str | None, Field(description="Name for custom events (used when event_type is 'custom')") ] = None ext: ext_1.ExtensionObject | 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
- AdCPBaseModel
- pydantic.main.BaseModel
Class variables
var action_source : ActionSource | Nonevar custom_data : EventCustomData | Nonevar custom_event_name : str | Nonevar event_id : strvar event_source_url : pydantic.networks.AnyUrl | Nonevar event_time : pydantic.types.AwareDatetimevar event_type : EventTypevar ext : ExtensionObject | Nonevar model_configvar surface : EventSurface | Nonevar user_match : UserMatch | None
Inherited members