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

from __future__ import annotations

from pydantic import EmailStr, Field, confloat, conint, constr
from pydantic.dataclasses import dataclass


@dataclass
class User:
    username: constr(pattern=r'^[a-zA-Z0-9_]+$', min_length=3, max_length=20)
    email: EmailStr
    age: conint(ge=0, le=150) | None = None
    score: confloat(lt=100.0, gt=0.0) | None = None
    tags: list[str] | None = Field(None, max_length=10, min_length=1)
