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

from __future__ import annotations

from typing import Any

from myapp.validators import validate_contact
from pydantic import BaseModel, EmailStr, ValidationInfo, conint, field_validator


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

    @field_validator('name', 'email', mode='after')
    @classmethod
    def validate_contact_validator(cls, v: Any, info: ValidationInfo) -> Any:
        return validate_contact(v, info)
