# generated by datamodel-codegen:
#   filename:  additional_properties_value_constraints_annotated.json

from __future__ import annotations

from typing import Annotated, Any, Dict

from pydantic import BaseModel, ConfigDict, Field, RootModel, constr
from typing_extensions import TypeAliasType

NestedMapAdditionalProperty = TypeAliasType(
    "NestedMapAdditionalProperty", Annotated[int, Field(ge=1, le=9)]
)


TitledMapAdditionalProperty = TypeAliasType(
    "TitledMapAdditionalProperty", Annotated[int, Field(ge=1, le=9)]
)


class TitledMap(RootModel[dict[str, TitledMapAdditionalProperty]]):
    root: Annotated[dict[str, TitledMapAdditionalProperty], Field(title='TitledMap')]


TitledRefMapAdditionalProperty = TypeAliasType(
    "TitledRefMapAdditionalProperty", Annotated[int, Field(ge=1, le=9)]
)


LocalTitleRefMapAdditionalProperty = TypeAliasType(
    "LocalTitleRefMapAdditionalProperty",
    Annotated[int, Field(ge=1, le=9, title='LocalValue')],
)


NamedMapAdditionalProperty = TypeAliasType(
    "NamedMapAdditionalProperty", Annotated[int, Field(ge=1, le=9)]
)


NullableValueMapAdditionalProperty = TypeAliasType(
    "NullableValueMapAdditionalProperty", Annotated[int | None, Field(ge=1, le=9)]
)


ClosedArrayValueMapAdditionalProperty = TypeAliasType(
    "ClosedArrayValueMapAdditionalProperty", Annotated[list[Any], Field(max_length=0)]
)


class AllOfValueMap(RootModel[int]):
    root: Annotated[int, Field(ge=1, le=9)]


class TitledAllOfValueMap(RootModel[int]):
    root: Annotated[int, Field(ge=1, le=9, title='TitledPositiveInt')]


class NullableAllOfValueMap(RootModel[int | None]):
    root: Annotated[int | None, Field(ge=1, le=9)] = None


class UnionValueMap(RootModel[int]):
    root: Annotated[int, Field(ge=1, le=9)]


class UnionValueMap1(RootModel[str]):
    root: Annotated[str, Field(max_length=4, min_length=2)]


ObjectValueMapAdditionalProperty = TypeAliasType(
    "ObjectValueMapAdditionalProperty", Annotated[dict[str, str], Field(min_length=1)]
)


class ModeledValueMap(BaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    value: Annotated[int, Field(ge=1)]


class NamedValue(RootModel[int]):
    root: Annotated[int, Field(ge=1, le=9, title='NamedValue')]


class ModeledIrrelevantConstraintMap(BaseModel):
    value: str


PayloadAdditionalProperty = TypeAliasType(
    "PayloadAdditionalProperty", Annotated[int, Field(ge=1, le=9)]
)


class PositiveInt(RootModel[int]):
    root: Annotated[int, Field(ge=1)]


class TitledPositiveInt(RootModel[int]):
    root: Annotated[int, Field(ge=1, title='TitledPositiveInt')]


class LocalValue(RootModel[str]):
    root: Annotated[str, Field(title='LocalValue')]


RootMapAdditionalProperty = TypeAliasType(
    "RootMapAdditionalProperty", Annotated[int, Field(ge=1, le=9)]
)


class RootMap(RootModel[dict[str, RootMapAdditionalProperty]]):
    root: Annotated[
        dict[str, RootMapAdditionalProperty], Field(max_length=2, min_length=1)
    ]


class Payload(BaseModel):
    model_config = ConfigDict(
        extra='allow',
    )
    __annotations__ = {
        '__pydantic_extra__': Dict[str, PayloadAdditionalProperty],
    }
    existingLocalValue: LocalValue
    nestedMap: dict[str, NestedMapAdditionalProperty]
    titledMap: Annotated[TitledMap, Field(title='TitledMap')]
    titledRefMap: dict[str, TitledRefMapAdditionalProperty]
    localTitleRefMap: dict[str, LocalTitleRefMapAdditionalProperty]
    namedMap: dict[constr(pattern=r'^[a-z]+$'), NamedMapAdditionalProperty]
    rootMap: RootMap
    nullableValueMap: dict[str, NullableValueMapAdditionalProperty]
    closedArrayValueMap: dict[str, ClosedArrayValueMapAdditionalProperty]
    allOfValueMap: dict[str, AllOfValueMap]
    titledAllOfValueMap: dict[str, TitledAllOfValueMap]
    nullableAllOfValueMap: dict[str, NullableAllOfValueMap]
    unionValueMap: dict[str, UnionValueMap | UnionValueMap1]
    objectValueMap: dict[str, ObjectValueMapAdditionalProperty]
    modeledValueMap: dict[str, ModeledValueMap]
    titledValueMap: dict[str, NamedValue]
    modeledIrrelevantConstraintMap: dict[str, ModeledIrrelevantConstraintMap]
    arrayIrrelevantConstraintMap: dict[str, list[int]]
    heterogeneousValueMap: dict[str, int | str]
    booleanIrrelevantConstraintMap: dict[str, bool]
