Files
remnawave-bedolaga-telegram…/app/webapi/schemas/config.py
c0mrade 9a2aea038a chore: add uv package manager and ruff linter configuration
- Add pyproject.toml with uv and ruff configuration
- Pin Python version to 3.13 via .python-version
- Add Makefile commands: lint, format, fix
- Apply ruff formatting to entire codebase
- Remove unused imports (base64 in yookassa/simple_subscription)
- Update .gitignore for new config files
2026-01-24 17:45:27 +03:00

60 lines
1.4 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from __future__ import annotations
from typing import Any
from pydantic import BaseModel, ConfigDict, Field
class SettingCategorySummary(BaseModel):
"""Краткое описание категории настройки."""
key: str
label: str
items: int
model_config = ConfigDict(extra='forbid')
class SettingCategoryRef(BaseModel):
"""Ссылка на категорию, к которой относится настройка."""
key: str
label: str
model_config = ConfigDict(extra='forbid')
class SettingChoice(BaseModel):
"""Вариант значения для настройки с выбором."""
value: Any
label: str
description: str | None = None
model_config = ConfigDict(extra='forbid')
class SettingDefinition(BaseModel):
"""Полное описание настройки и её текущего состояния."""
key: str
name: str
category: SettingCategoryRef
type: str
is_optional: bool
current: Any | None = Field(default=None)
original: Any | None = Field(default=None)
has_override: bool
read_only: bool = Field(default=False)
choices: list[SettingChoice] = Field(default_factory=list)
model_config = ConfigDict(extra='forbid')
class SettingUpdateRequest(BaseModel):
"""Запрос на обновление значения настройки."""
value: Any
model_config = ConfigDict(extra='forbid')