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

from __future__ import annotations

from enum import Enum

from pydantic import BaseModel, ConfigDict, Field, RootModel


class Field1(Enum):
    response_1 = 'response_1'


class Field2(Enum):
    response_a = 'response_a'


class V2Test1(BaseModel):
    model_config = ConfigDict(
        extra='allow',
    )
    field_1: Field1
    field_2: Field2


class Field11(Enum):
    response_2 = 'response_2'


class Field21(Enum):
    response_b = 'response_b'


class V2Test2(BaseModel):
    model_config = ConfigDict(
        extra='allow',
    )
    field_1: Field11
    field_2: Field21


class Field22(Enum):
    response_c = 'response_c'


class V2Test3(BaseModel):
    model_config = ConfigDict(
        extra='allow',
    )
    field_1: Field11
    field_2: Field22


class V2Test(RootModel[V2Test1 | V2Test2 | V2Test3]):
    root: V2Test1 | V2Test2 | V2Test3 = Field(..., title='v2_test')
