Files
g0v0-server/app/models/signalr.py
2025-08-22 08:21:52 +00:00

38 lines
826 B
Python

from __future__ import annotations
from dataclasses import dataclass
from typing import ClassVar
from pydantic import (
BaseModel,
Field,
)
@dataclass
class SignalRMeta:
member_ignore: bool = False # implement of IgnoreMember (msgpack) attribute
json_ignore: bool = False # implement of JsonIgnore (json) attribute
use_abbr: bool = True
class SignalRUnionMessage(BaseModel):
union_type: ClassVar[int]
class Transport(BaseModel):
transport: str
transfer_formats: list[str] = Field(default_factory=lambda: ["Binary", "Text"], alias="transferFormats")
class NegotiateResponse(BaseModel):
connectionId: str
connectionToken: str
negotiateVersion: int = 1
availableTransports: list[Transport]
class UserState(BaseModel):
connection_id: str
connection_token: str