# This file was auto-generated by Fern from our API Definition.

from __future__ import annotations

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .categorical_feedback_detail_create import CategoricalFeedbackDetailCreate
from .numerical_feedback_detail_create import NumericalFeedbackDetailCreate


class Base(UniversalBaseModel):
    id: typing.Optional[str] = None
    name: str

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow


class FeedbackCreate_Numerical(Base):
    type: typing.Literal["numerical"] = "numerical"
    details: typing.Optional[NumericalFeedbackDetailCreate] = None

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow


class FeedbackCreate_Categorical(Base):
    type: typing.Literal["categorical"] = "categorical"
    details: typing.Optional[CategoricalFeedbackDetailCreate] = None

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow


FeedbackCreate = typing.Union[FeedbackCreate_Numerical, FeedbackCreate_Categorical]
