# generated by datamodel-codegen:
#   filename:  <stdin>
#   timestamp: 2023-02-17T08:35:30+00:00

from __future__ import annotations

import uuid
from pydantic import BaseModel, Extra, constr


class MetaItem(BaseModel):
    class Config:
        extra = Extra.allow

    id: uuid.UUID | None = None
    trace: str | None = None
    redirect: constr(regex=r'^[0-9a-zA-Z_-]+$', min_length=1, max_length=200) | None = None
    icon: str | None = None
    tag: list[constr(min_length=2, max_length=20)] | None = None
    tag_by_user: list[constr(min_length=2, max_length=20)] | None = None
    name_by_user: constr(max_length=100) | None = None


class UserItem(BaseModel):
    class Config:
        extra = Extra.forbid

    first_name: str | None = None
    last_name: str | None = None
    phone: str | None = None
    role: str | None = None
    nickname: str | None = None


class Register(BaseModel):
    class Config:
        extra = Extra.forbid

    username: constr(regex=r'^\S+@\S+\.\S+$') | None = None
    new_username: constr(regex=r'^\S+@\S+\.\S+$') | None = None
    password: str | None = None
    new_password: str | None = None
    captcha: str | None = None
    language: str | None = None
    meta:  MetaItem | None = None
    theme: str | None = None
    firebase_token: str | None = None
    user:  UserItem | None = None
