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

from __future__ import annotations

from enum import Enum
from typing import Any

from pydantic import BaseModel, RootModel, conint


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


class StatusEnum(Enum):
    active = 'active'
    inactive = 'inactive'


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


class AllofNestedAnyof(RootModel[str | int]):
    root: str | int


class AllofConstraintOnly(RootModel[Any]):
    root: Any


class AllofMaxConstraints(RootModel[conint(le=50)]):
    root: conint(le=50)


class AllofUniqueItems(RootModel[list[str]]):
    root: list[str]


class ObjectWithoutAdditional(BaseModel):
    nested: str | None = None


class MultipleAdditionalProps(BaseModel):
    pass


class L3(BaseModel):
    l4: str | None = None


class L2(BaseModel):
    l3: L3 | None = None


class L1(BaseModel):
    l2: L2 | None = None


class DepthLimitTest(BaseModel):
    l1: L1 | None = None


class ProjectedEdgeCases(BaseModel):
    single_allof_primitive: SingleAllofPrimitive | None = None
    single_allof_ref: BaseRef | None = None
    allof_with_enum: StatusEnum | None = None
    allof_nested_anyof: AllofNestedAnyof | None = None
    allof_constraint_only: AllofConstraintOnly | None = None
    allof_max_constraints: AllofMaxConstraints | None = None
    allof_unique_items: AllofUniqueItems | None = None
    object_without_additional: ObjectWithoutAdditional | None = None
    object_only_type: dict[str, Any] | None = None
    multiple_additional_props: MultipleAdditionalProps | None = None
    depth_limit_test: DepthLimitTest | None = None
    cycle_detection: BaseRef | None = None
    type_list_field: str | int | None = None
    allof_multiple_refs_only: BaseRef | None = None


class EdgeCases(ProjectedEdgeCases):
    extra: str | None = None
    single_allof_primitive: str
    single_allof_ref: BaseRef
    allof_with_enum: StatusEnum
    allof_nested_anyof: str | int
    allof_constraint_only: Any
    allof_max_constraints: conint(le=50)
    allof_unique_items: list[str]
    object_without_additional: dict[str, Any]
    object_only_type: dict[str, Any]
    multiple_additional_props: dict[str, BaseRef]
    depth_limit_test: dict[str, Any]
    cycle_detection: BaseRef
    type_list_field: str | int
    allof_multiple_refs_only: BaseRef
