# Generated by smithplates HTTP codegen. Do not edit.

from __future__ import annotations

from generated.example.stream_completed import StreamCompleted
from generated.example.stream_progress import StreamProgress
from generated.example.stream_started import StreamStarted
from pydantic import BaseModel, TypeAdapter


class ServerEventStarted(BaseModel):
    started: StreamStarted


class ServerEventProgress(BaseModel):
    progress: StreamProgress


class ServerEventCompleted(BaseModel):
    completed: StreamCompleted


ServerEvent = ServerEventStarted | ServerEventProgress | ServerEventCompleted


_ServerEvent_ADAPTER = TypeAdapter(ServerEvent)


def validate_server_event(value: object) -> ServerEvent:
    return _ServerEvent_ADAPTER.validate_python(value)
