# generated by datamodel-codegen:
#   filename:  discriminator_in_array_snake_case.yaml
#   timestamp: 2023-07-27T00:00:00+00:00

from __future__ import annotations

from enum import StrEnum
from typing import Annotated, Literal

from pydantic import BaseModel, Field


class ObjectType(StrEnum):
    foo = 'FOO'


class FooType(BaseModel):
    object_type: Annotated[Literal['FOO'], Field(alias='objectType')]


class ObjectType1(StrEnum):
    bar = 'BAR'


class BarType(BaseModel):
    object_type: Annotated[Literal['BAR'], Field(alias='objectType')]


class Container(BaseModel):
    items: (
        list[Annotated[FooType | BarType, Field(discriminator='object_type')]] | None
    ) = None
