# [DEF:ConfigModels:Module] # @SEMANTICS: config, models, pydantic # @PURPOSE: Defines the data models for application configuration using Pydantic. # @LAYER: Core # @RELATION: READS_FROM -> config.json # @RELATION: USED_BY -> ConfigManager from pydantic import BaseModel, Field from typing import List, Optional # [DEF:Environment:DataClass] # @PURPOSE: Represents a Superset environment configuration. class Environment(BaseModel): id: str name: str url: str username: str password: str # Will be masked in UI is_default: bool = False # [/DEF:Environment] # [DEF:GlobalSettings:DataClass] # @PURPOSE: Represents global application settings. class GlobalSettings(BaseModel): backup_path: str default_environment_id: Optional[str] = None # [/DEF:GlobalSettings] # [DEF:AppConfig:DataClass] # @PURPOSE: The root configuration model containing all application settings. class AppConfig(BaseModel): environments: List[Environment] = [] settings: GlobalSettings # [/DEF:AppConfig] # [/DEF:ConfigModels]