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

from __future__ import annotations

from typing import Annotated, Literal

from pydantic import BaseModel, Field, RootModel


class Model(BaseModel):
    readonly_via_ref: Annotated[Literal['fixed_readonly'], Field(frozen=True)]
    readonly_direct: Annotated[Literal['fixed_readonly'], Field(frozen=True)]
    constrained_via_ref: Annotated[
        Literal['constrained_value'], Field(max_length=100, min_length=1)
    ]
    constrained_direct: Annotated[
        Literal['constrained_value'], Field(max_length=100, min_length=1)
    ]
    default_via_ref: Literal['default_value'] = 'default_value'
    default_direct: Literal['default_value'] = 'default_value'
    nullable_via_ref: Literal['nullable_value']
    nullable_direct: Literal['nullable_value']


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


class ConstrainedString(RootModel[str]):
    root: Annotated[str, Field(max_length=100, min_length=1)]


class DefaultString(RootModel[str]):
    root: str = 'default_value'


class NullableString(RootModel[str | None]):
    root: str | None = None
