wrap_event

wrap_event(event_cls: type[BaseEvent]) -> type[BaseModel]
Wrap a event class with a type field to be used in a union type This is needed for proper serialization and deserialization of events in a union type.
Parameters:
NameDescription
event_clsEvent class to wrap

Type: type[BaseEvent]