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

from __future__ import annotations

from pydantic import BaseModel, Field, RootModel


class Shared(BaseModel):
    short_code: str = Field(
        ..., alias='shortCode', max_length=8, min_length=0, title='ShortCode'
    )


class RecordA(Shared):
    timestamp: str = Field(..., title='Timestamp')


class RecordB(Shared):
    created: str = Field(..., title='Timestamp')
    label: str = Field(..., title='LongText')


class ReproBugs(RootModel[RecordA | RecordB]):
    root: RecordA | RecordB = Field(
        ...,
        description='Minimal schema to reproduce reuse_model + collapse_root_models bugs in datamodel-code-generator 0.55.0',
        title='ReproBugs',
    )
