from typing import Optional
from uuid import UUID

from ecoindex.models import Result
from sqlmodel import Field


class ApiEcoindex(Result, table=True):
    id: Optional[UUID] = Field(
        default=None, description="Analysis ID of type `UUID`", primary_key=True
    )
    host: str = Field(
        default=..., title="Web page host", description="Host name of the web page"
    )
    version: int = Field(
        default=1,
        title="API version",
        description="Version number of the API used to run the test",
    )

sqlmodel.Field
[((179, 258), 'sqlmodel.Field', 'Field', ([], {'default': 'None', 'description': '"""Analysis ID of type `UUID`"""', 'primary_key': '(True)'}), "(default=None, description='Analysis ID of type `UUID`', primary_key=True)\n", (184, 258), False, 'from sqlmodel import Field\n'), ((289, 376), 'sqlmodel.Field', 'Field', ([], {'default': '...', 'title': '"""Web page host"""', 'description': '"""Host name of the web page"""'}), "(default=..., title='Web page host', description=\n    'Host name of the web page')\n", (294, 376), False, 'from sqlmodel import Field\n'), ((405, 509), 'sqlmodel.Field', 'Field', ([], {'default': '(1)', 'title': '"""API version"""', 'description': '"""Version number of the API used to run the test"""'}), "(default=1, title='API version', description=\n    'Version number of the API used to run the test')\n", (410, 509), False, 'from sqlmodel import Field\n')]