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

from __future__ import annotations

from typing import Literal

from pydantic import BaseModel, Field


class BaseItem(BaseModel):
    itemType: str


class FooItem(BaseModel):
    fooValue: str | None = None
    itemType: Literal['foo']


class BarItem(BaseModel):
    barValue: int | None = None
    itemType: Literal['bar']


class ItemContainer(BaseModel):
    item: FooItem | BarItem = Field(..., discriminator='itemType')
