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

from __future__ import annotations

from enum import IntEnum
from typing import Literal

from pydantic import BaseModel, Field, RootModel


class Kind(IntEnum):
    integer_1 = 1


class Foo(BaseModel):
    kind: Literal[1]


class Kind1(IntEnum):
    integer_2 = 2
    integer_3 = 3


class Bar(BaseModel):
    kind: Literal[2, 3]


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