from dataclasses import dataclass
from typing import Optional, List, Any

from ._SchemaPropertyFormatEnum import SchemaPropertyFormatEnum
from ._SchemaPropertyTypeEnum import SchemaPropertyTypeEnum
from ._PropertyModel import PropertyModel


@dataclass
class SchemaPropertyModel(PropertyModel):
    type: SchemaPropertyTypeEnum
    description: Optional[str] = None
    format: Optional[SchemaPropertyFormatEnum] = None
    enum: List[Any] | None = None
    default: Any = None

    def to_dict(self) -> dict:
        return {
            "type": self.type,
            "description": self.description,
            "format": self.format,
            "enum": self.enum,
            "default": self.default,
        }
