Schemas for gateway CRUD and template-sync API payloads.
"""Schemas for gateway CRUD and template-sync API payloads."""
from __future__ import annotations
from datetime import datetime
from uuid import UUID
from pydantic import field_validator
from sqlmodel import Field, SQLModel
RUNTIME_ANNOTATION_TYPES = (datetime, UUID)
class GatewayBase(SQLModel):
"""Shared gateway fields used across create/read payloads."""
name: str
url: str
workspace_root: str
allow_insecure_tls: bool = False
disable_device_pairing: bool = False
class GatewayCreate(GatewayBase):
"""Payload for creating a gateway configuration."""
token: str | None = None
@field_validator("token", mode="before")
@classmethod
def normalize_token(cls, value: object) -> str | None | object:
"""Normalize empty/whitespace tokens to
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search 40K more like it.
Get a free API key