# generated by datamodel-codegen:
#   filename:  openapi.yaml

from __future__ import annotations

from enum import Enum
from typing import Literal

from pydantic import BaseModel, Field


class Item(BaseModel):
    kind: str


class Kind(Enum):
    foo = 'foo'


class Foo(BaseModel):
    kind: Literal['foo']
    value: str


class Kind1(Enum):
    bar = 'bar'


class Bar(BaseModel):
    kind: Literal['bar']
    count: int


class Wrapper(BaseModel):
    item: Foo | Bar | None = Field(None, discriminator='kind')
