# 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 typing import Dict, Optional

from pydantic import BaseModel, confloat, constr


class StringConstraint(BaseModel):
    __root__: constr(min_length=1)


class NumberConstraint(BaseModel):
    __root__: confloat(ge=0.0)


class BaseConfig(BaseModel):
    name: Optional[str] = None
    enabled: Optional[bool] = None


class ExtendedConfig(BaseModel):
    timeout: Optional[int] = None


class Score(BaseModel):
    pass


class Config(BaseConfig, ExtendedConfig):
    pass


class Metadata(BaseModel):
    pass


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


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