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

from __future__ import annotations

from typing import Any

from myapp.validators import validate_name_wrap
from pydantic import (
    BaseModel,
    EmailStr,
    ValidationInfo,
    ValidatorFunctionWrapHandler,
    conint,
    field_validator,
)


class User(BaseModel):
    name: str
    email: EmailStr
    age: conint(ge=0) | None = None

    @field_validator('name', mode='wrap')
    @classmethod
    def validate_name_wrap_validator(
        cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo
    ) -> Any:
        return validate_name_wrap(v, handler, info)
