# generated by datamodel-codegen:
#   filename:  discriminator_float_mapping.yaml
#   timestamp: 2019-07-26T00:00:00+00:00

from __future__ import annotations

from enum import Enum
from typing import Literal

from pydantic import BaseModel, Field, RootModel


class Kind(Enum):
    number_1_5 = 1.5
    number_2_5 = 2.5


class Foo(BaseModel):
    kind: Literal['1.5']


class Kind1(Enum):
    number_3_5 = 3.5
    number_4_5 = 4.5


class Bar(BaseModel):
    kind: Literal['3.5']


class Base(RootModel[Foo | Bar]):
    root: Foo | Bar = Field(..., discriminator='kind')
