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

from __future__ import annotations

from enum import Enum

from pydantic import BaseModel, Field, RootModel


class Pet1(BaseModel):
    name: str | None = None
    age: int | None = None


class Pet(RootModel[list[Pet1] | Pet1]):
    root: list[Pet1] | Pet1 = Field(..., title='Pet')


class CombinedEnum1(Enum):
    green = 'green'
    red = 'red'


class CombinedEnumField(Enum):
    green = 'green'
    red = 'red'


class CombinedObjectField1(BaseModel):
    color: str | None = None


class CombinedSelf1(BaseModel):
    color: str | None = None


class CombinedSelf(RootModel[list[CombinedSelf1] | CombinedSelf1]):
    root: list[CombinedSelf1] | CombinedSelf1


class CombinedSelfEnum1(BaseModel):
    color: str | None = None


class CombinedSelfEnum2(Enum):
    green = 'green'
    red = 'red'


class CombinedSelfEnum(
    RootModel[
        list[CombinedSelfEnum1 | CombinedSelfEnum2]
        | CombinedSelfEnum1
        | CombinedSelfEnum2
    ]
):
    root: list[
        CombinedSelfEnum1 | CombinedSelfEnum2
    ] | CombinedSelfEnum1 | CombinedSelfEnum2


class CombinedSelfAllOf2(Enum):
    green = 'green'
    red = 'red'


class Kind(BaseModel):
    description: str | None = None


class Id(BaseModel):
    id: int | None = None


class CustomRootModel(RootModel[str]):
    root: str


class CombinedEnum(RootModel[list[Kind] | CombinedEnum1]):
    root: list[Kind] | CombinedEnum1


class CombinedAllOf1(Kind, Id):
    pass


class CombinedAllOf(RootModel[list[Kind] | CombinedAllOf1]):
    root: list[Kind] | CombinedAllOf1


class CombinedAllOfField(Kind, Id):
    pass


class CombinedAllOfObjectField(Kind, Id):
    color: str | None = None


class CombinedObjectField(BaseModel):
    CombinedEnumField_1: list[Kind] | CombinedEnumField | None = Field(
        None, alias='CombinedEnumField'
    )
    CombinedAllOfField_1: list[Kind] | CombinedAllOfField | None = Field(
        None, alias='CombinedAllOfField'
    )
    CombinedObjectField: list[Kind] | CombinedObjectField1 | None = None
    CombinedAllOfObjectField_1: list[Kind] | CombinedAllOfObjectField | None = Field(
        None, alias='CombinedAllOfObjectField'
    )


class CombinedSelfAllOf1(Kind, Id):
    color: str | None = None


class CombinedSelfAllOf(
    RootModel[
        list[CombinedSelfAllOf1 | CombinedSelfAllOf2]
        | CombinedSelfAllOf1
        | CombinedSelfAllOf2
    ]
):
    root: list[
        CombinedSelfAllOf1 | CombinedSelfAllOf2
    ] | CombinedSelfAllOf1 | CombinedSelfAllOf2
