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

from datetime import date, time, timedelta
from decimal import Decimal
from enum import StrEnum
from uuid import UUID

from pydantic import AwareDatetime, BaseModel, Field, NaiveDatetime, RootModel, conbytes


class Status(StrEnum):
    ACTIVE = 'ACTIVE'
    INACTIVE = 'INACTIVE'


class Address(BaseModel):
    street: str
    zip: str | None


class MD5(RootModel[conbytes(min_length=16, max_length=16)]):
    root: conbytes(min_length=16, max_length=16) = Field(..., title='MD5')


class TraceId(RootModel[UUID]):
    root: UUID = Field(..., title='TraceId')


class TaxDecimal(RootModel[Decimal]):
    root: Decimal = Field(..., title='TaxDecimal')


class Duration(RootModel[timedelta]):
    root: timedelta = Field(..., title='Duration')


class User(BaseModel):
    id: UUID
    """
    Stable identifier
    """
    active: bool
    age: int
    visits: int
    score: float
    rating: float
    payload: bytes
    status: Status
    tags: list[str]
    attributes: dict[str, str]
    address: Address
    previous: User | None
    hash: MD5
    traceId: TraceId
    price: Decimal
    tax: TaxDecimal
    flexibleAmount: Decimal
    birthDate: date
    startTime: time
    endTime: time
    createdAt: AwareDatetime
    updatedAt: AwareDatetime
    processedAt: AwareDatetime
    localCreatedAt: NaiveDatetime
    localUpdatedAt: NaiveDatetime
    localProcessedAt: NaiveDatetime
    duration: Duration
    choice: str | int | None
    rawDecimalText: str


User.model_rebuild()
