Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /cdswindell_PyTrainApi /src /pytrain_api /response_models.py
| # | |
| # PyTrainApi: a restful API for controlling Lionel Legacy engines, trains, switches, and accessories | |
| # | |
| # Copyright (c) 2024-2026 Dave Swindell <pytraininfo.gmail.com> | |
| # | |
| # SPDX-License-Identifier: LPGL | |
| # | |
| # | |
| from __future__ import annotations | |
| from pydantic import BaseModel, Field | |
| class SuccessResponse(BaseModel): | |
| status: str = Field(..., description="Status message") | |
| def ok_response(status: str) -> SuccessResponse: | |
| return SuccessResponse(status=status) | |
| class ErrorResponse(BaseModel): | |
| detail: str = Field(..., description="Error message") | |
| def err_response(detail: str) -> ErrorResponse: | |
| return ErrorResponse(detail=detail) | |
| StatusResponse = SuccessResponse | ErrorResponse | |
| class VersionResponse(BaseModel): | |
| pytrain: str = Field(..., description="PyTrain version") | |
| pytrain_api: str = Field(..., description="PyTrain API version") | |
Xet Storage Details
- Size:
- 872 Bytes
- Xet hash:
- 6a5dc267f2dcc0df25d0156d679ac251ff2084268f4a859df5065b4762eac70a
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.