# AUTOGENERATED FILE


from __future__ import annotations

from typing import List, Literal, Optional, Union

from miniappi.core.models.content import BaseContent
from pydantic import ConfigDict, Field, RootModel


class DatePicker(BaseContent):
    model_config = ConfigDict(
        extra='allow',
    )
    groupId: Optional[str] = None
    label: str
    name: str
    required: Optional[bool] = None
    type: Literal['DatePicker'] = 'DatePicker'


class Email(BaseContent):
    model_config = ConfigDict(
        extra='allow',
    )
    groupId: Optional[str] = None
    label: str
    name: str
    required: Optional[bool] = None
    type: Literal['email'] = 'email'


class InputNumber(BaseContent):
    model_config = ConfigDict(
        extra='allow',
    )
    groupId: Optional[str] = None
    label: str
    name: str
    required: Optional[bool] = None
    type: Literal['InputNumber'] = 'InputNumber'


class InputText(BaseContent):
    model_config = ConfigDict(
        extra='allow',
    )
    groupId: Optional[str] = None
    label: str
    name: str
    required: Optional[bool] = None
    type: Literal['InputText'] = 'InputText'


class Password(BaseContent):
    model_config = ConfigDict(
        extra='allow',
    )
    groupId: Optional[str] = None
    label: str
    name: str
    required: Optional[bool] = None
    type: Literal['password'] = 'password'


class Rating(BaseContent):
    model_config = ConfigDict(
        extra='allow',
    )
    groupId: Optional[str] = None
    label: str
    name: str
    required: Optional[bool] = None
    stars: Optional[float] = None
    type: Literal['Rating'] = 'Rating'


class Props(BaseContent):
    model_config = ConfigDict(
        extra='allow',
    )
    fields: List[Union[Email, Password, InputText, InputNumber, Rating, DatePicker]]
    id: str = Field(..., description='ID of the component')
    legend: Optional[str] = None
    contentType: Literal['v0/forms/DynamicForm.vue'] = 'v0/forms/DynamicForm.vue'


class Root(RootModel[Props]):
    root: Props
