from dataclasses import dataclass

from ._SchemaModel import SchemaModel
from ._SchemaPropertyTypeEnum import SchemaPropertyTypeEnum


@dataclass
class SchemaArrayPropertyModel(SchemaModel):
    items: SchemaModel

    def get_schema_name(self) -> str:
        return f"ArrayOf{self.items.get_schema_name()}"

    def to_dict(self) -> dict:
        return {
            "type": SchemaPropertyTypeEnum.array,
            **super().to_dict(),
        }
