Add schemas and router for global variables with CRUD operations and admin-only access controls for create/update/delete. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
34 lines
744 B
Python
34 lines
744 B
Python
from pydantic import BaseModel
|
|
from typing import Optional
|
|
from uuid import UUID
|
|
from datetime import datetime
|
|
|
|
|
|
class GlobalVariableCreate(BaseModel):
|
|
key: str
|
|
value: Optional[str] = None
|
|
value_type: str = "string"
|
|
description: Optional[str] = None
|
|
is_secret: bool = False
|
|
|
|
|
|
class GlobalVariableUpdate(BaseModel):
|
|
value: Optional[str] = None
|
|
value_type: Optional[str] = None
|
|
description: Optional[str] = None
|
|
is_secret: Optional[bool] = None
|
|
|
|
|
|
class GlobalVariableResponse(BaseModel):
|
|
id: UUID
|
|
key: str
|
|
value: Optional[str]
|
|
value_type: str
|
|
description: Optional[str]
|
|
is_secret: bool
|
|
created_at: datetime
|
|
updated_at: datetime
|
|
|
|
class Config:
|
|
from_attributes = True
|