# Generated by smithplates HTTP codegen. Do not edit.

from __future__ import annotations

from generated.example.join_room import JoinRoom
from generated.example.leave_room import LeaveRoom
from generated.example.ping import Ping
from pydantic import BaseModel, TypeAdapter


class ClientMessageJoin(BaseModel):
    join: JoinRoom


class ClientMessageLeave(BaseModel):
    leave: LeaveRoom


class ClientMessagePing(BaseModel):
    ping: Ping


ClientMessage = ClientMessageJoin | ClientMessageLeave | ClientMessagePing


_ClientMessage_ADAPTER = TypeAdapter(ClientMessage)


def validate_client_message(value: object) -> ClientMessage:
    return _ClientMessage_ADAPTER.validate_python(value)
