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

from __future__ import annotations

from decimal import Decimal
from enum import StrEnum

from pydantic import BaseModel, Field, RootModel, conbytes


class DefaultRecord(BaseModel):
    value: int


class DefaultEnum(StrEnum):
    FOO = 'FOO'
    BAR = 'BAR'


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


class RA(BaseModel):
    a: str


class RB(BaseModel):
    b: str


class EA(StrEnum):
    A = 'A'


class EB(StrEnum):
    B = 'B'


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


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


class ArrayItem(BaseModel):
    label: str


class MapValue(StrEnum):
    ONE = 'ONE'
    TWO = 'TWO'


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


class Understanding(StrEnum):
    YES = 'YES'
    NO = 'NO'


class Name(BaseModel):
    understanding: Understanding
    understandingRef: Understanding


class Array(BaseModel):
    value: str


class SpecMatrix(BaseModel):
    nullDefault: None
    booleanDefault: bool
    intDefault: int
    longDefault: int
    floatDefault: float
    doubleDefault: float
    bytesDefault: bytes
    stringDefault: str
    recordDefault: DefaultRecord
    enumDefault: DefaultEnum
    arrayDefault: list[int]
    mapDefault: dict[str, int]
    fixedDefault: DefaultFixed
    ascendingOrder: str
    descendingOrder: str
    nullableAfterValue: str | None
    sameKindNamedUnion: RA | RB | EA | EB | FA | FB
    arrayOfRecords: list[ArrayItem]
    mapOfEnums: dict[str, MapValue]
    emptyNamespace: EmptyNamespaceFixed
    fullnameIgnoresNamespace: Name
    fullnameReference: Name
    complexTypeNameReuse: Array
    unknownLogicalType: int
    precisionOnlyDecimal: Decimal
