from pydantic import BaseModel, Field from typing import Optional class StateDTO(BaseModel): m3_key: str = Field(..., min_length=1, max_length=3) description: str mex_key: Optional[str] = None ame_key: Optional[str] = None class Config: from_attributes = True