"""Server schemas.""" from datetime import datetime from pydantic import BaseModel, ConfigDict, Field from app.models.server import ServerType class ServerCreate(BaseModel): customer_id: int name: str = Field(min_length=1, max_length=255) hostname: str = Field(min_length=1, max_length=255) port: int = 5985 type: ServerType = ServerType.WINDOWS description: str | None = None tags: str | None = None credential_ref: str | None = None class ServerUpdate(BaseModel): name: str | None = None hostname: str | None = None port: int | None = None type: ServerType | None = None description: str | None = None tags: str | None = None credential_ref: str | None = None class ServerRead(BaseModel): model_config = ConfigDict(from_attributes=True) id: int customer_id: int name: str hostname: str port: int type: ServerType description: str | None tags: str | None credential_ref: str | None last_health_at: datetime | None last_health_ok: bool | None last_health_message: str | None discovered_by_scan: bool created_at: datetime updated_at: datetime