// Generated by smithplates HTTP codegen. Do not edit.
import { Pong } from "generated/example/pong";
import { RoomJoined } from "generated/example/roomJoined";
import { ServerError } from "generated/example/serverError";
import { Welcome } from "generated/example/welcome";

export interface ServerMessageWelcome {
  welcome: Welcome;
}

export interface ServerMessageRoomJoined {
  roomJoined: RoomJoined;
}

export interface ServerMessagePong {
  pong: Pong;
}

export interface ServerMessageError {
  error: ServerError;
}

export type ServerMessage = ServerMessageWelcome | ServerMessageRoomJoined | ServerMessagePong | ServerMessageError;

export function parseServerMessage(value: unknown): ServerMessage {
  return value as ServerMessage;
}

export function serializeServerMessage(value: ServerMessage): Record<string, unknown> {
  return { ...value };
}
