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

from __future__ import annotations

from typing import Any, Literal

from pydantic import BaseModel, RootModel, confloat, conint, constr


class ConstraintOnlyBase(BaseModel):
    field_with_constraints: Any | None = None


class MultipleField(RootModel[conint(multiple_of=10)]):
    root: conint(multiple_of=10)


class DecimalMultipleField(RootModel[confloat(multiple_of=0.6)]):
    root: confloat(multiple_of=0.6)


class MultipleOfBase(BaseModel):
    multiple_field: MultipleField | None = None
    decimal_multiple_field: DecimalMultipleField | None = None


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


class NestedAnyOfWithRef(BaseModel):
    nested_anyof: SimpleString | int | None = None


class CyclicNested1(BaseModel):
    pass


class L4(BaseModel):
    l5: str | None = None


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


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


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


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


class DeepNestedArray(BaseModel):
    deep_array: list[DeepArrayItem] | None = None


class OneOfBase(BaseModel):
    oneof_field: str | int | None = None


class SingleOneOf(BaseModel):
    single_oneof: str | None = None


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


class L21(BaseModel):
    l3: L31 | None = None


class L11(BaseModel):
    l2: L21 | None = None


class DeepDict(BaseModel):
    l1: L11 | None = None


class AdditionalPropsDeep(BaseModel):
    deep_dict: dict[str, DeepDict] | None = None


class ObjectAllof(BaseModel):
    a: str | None = None
    b: int | None = None


class ObjectOnlyAllOf(BaseModel):
    object_allof: ObjectAllof | None = None


class LargeUnion(BaseModel):
    large_union: str | int | bool | float | list[str] | dict[str, Any] | None = None


class BaseWithNoProperties(BaseModel):
    pass


class BaseWithBooleanProperty(BaseModel):
    bool_prop: bool | None = None


class ChildOfNoProps(BaseWithNoProperties):
    extra: str | None = None
    some_field: Any


class NestedAllofRef(RootModel[SimpleString]):
    root: SimpleString


class NestedAllOfRef(BaseModel):
    nested_allof_ref: NestedAllofRef | None = None


class NestedIndirect(RootModel[SimpleString]):
    root: SimpleString


class NestedAllOfWithoutDirectRef(BaseModel):
    nested_indirect: NestedIndirect | None = None


class EnumField(RootModel[Literal['a', 'b', 'c']]):
    root: Literal['a', 'b', 'c']


class EnumInAllOf(BaseModel):
    enum_field: EnumField | None = None


class ObjectWithMetadataAllOf(BaseModel):
    kept_field: str | None = None


class NestedObject1(BaseModel):
    label: str | None = None


class NestedObject2(BaseModel):
    pass


class NestedObject3(NestedObject1, NestedObject2):
    pass


class NestedObject(RootModel[NestedObject3]):
    root: NestedObject3


class NestedCombinatorObjectAllOf(BaseModel):
    nested_object: NestedObject | None = None


class NestedAllofObject(BaseModel):
    label: str | None = None


class NestedAllOfObjectAllOf(BaseModel):
    nested_allof_object: NestedAllofObject | None = None


class NestedOneofObject1(BaseModel):
    label: str | None = None


class NestedOneofObject2(BaseModel):
    pass


class NestedOneofObject3(NestedOneofObject1, NestedOneofObject2):
    pass


class NestedOneofObject(RootModel[NestedOneofObject3]):
    root: NestedOneofObject3


class NestedOneOfObjectAllOf(BaseModel):
    nested_oneof_object: NestedOneofObject | None = None


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


class TrueOnlyAllOf(BaseModel):
    true_only: TrueOnly | None = None


class ParentConstrained(RootModel[constr(min_length=2, max_length=5)]):
    root: constr(min_length=2, max_length=5)


class ParentConstrainedAllOf(BaseModel):
    parent_constrained: ParentConstrained | None = None


class RefWithPrimitiveBase(BaseModel):
    ref_and_primitive: SimpleString | None = None


class EdgeCasesCoverage(
    ConstraintOnlyBase,
    MultipleOfBase,
    RefWithPrimitiveBase,
    NestedAnyOfWithRef,
    DeepNestedArray,
    OneOfBase,
    SingleOneOf,
    AdditionalPropsDeep,
    ObjectOnlyAllOf,
    LargeUnion,
    NestedAllOfRef,
    NestedAllOfWithoutDirectRef,
    EnumInAllOf,
):
    local_field: str | None = None
    field_with_constraints: Any
    multiple_field: conint(multiple_of=10)
    ref_and_primitive: SimpleString
    nested_anyof: SimpleString | int
    deep_array: list[dict[str, Any]]
    oneof_field: str | int
    single_oneof: str
    deep_dict: dict[str, dict[str, Any]]
    object_allof: dict[str, Any]
    large_union: Any
    nested_allof_ref: SimpleString
    nested_indirect: SimpleString
    enum_field: Literal['a', 'b', 'c']


class CyclicAliasA(RootModel["CyclicAliasB"]):
    root: "CyclicAliasB"


class CyclicAliasB(RootModel[CyclicAliasA]):
    root: CyclicAliasA


class NestedCombinatorWithCyclicRef(BaseModel):
    cyclic_nested: CyclicNested | None = None


class CyclicNested(RootModel["CyclicNested2"]):
    root: "CyclicNested2"


class CyclicNested2(CyclicNested1):
    pass


CyclicAliasA.model_rebuild()
NestedCombinatorWithCyclicRef.model_rebuild()
CyclicNested.model_rebuild()
