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

from __future__ import annotations

from pydantic import BaseModel, RootModel, confloat, constr


class StringConstraint(RootModel[constr(min_length=1)]):
    root: constr(min_length=1)


class NumberConstraint(RootModel[confloat(ge=0.0)]):
    root: confloat(ge=0.0)


class BaseConfig(BaseModel):
    name: str | None = None
    enabled: bool | None = None


class ExtendedConfig(BaseModel):
    timeout: int | None = None


class Score(RootModel[confloat(ge=0.0, le=100.0)]):
    root: confloat(ge=0.0, le=100.0)


class Config(BaseConfig, ExtendedConfig):
    pass


class Metadata(BaseModel):
    pass


class ProjectedItem(BaseModel):
    id: int | None = None
    code: StringConstraint | None = None
    score: Score | None = None
    config: Config | None = None
    metadata: Metadata | None = None


class Item(ProjectedItem):
    extra: str | None = None
    id: int
    code: StringConstraint
    score: confloat(ge=0.0, le=100.0)
    config: BaseConfig
    metadata: dict[str, str]
