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

from __future__ import annotations

from typing import Union

from pydantic import BaseModel
from typing_extensions import TypeAliasType


class File(BaseModel):
    path: str


class Folder(BaseModel):
    address: str | None = None
    files: list[File]
    subfolders: list[Folder] | None = None


ElementaryType = TypeAliasType("ElementaryType", bool | str | int | float | None)


JsonType = TypeAliasType(
    "JsonType", Union[ElementaryType, list["JsonType"], dict[str, "JsonType"]]
)


class Space(BaseModel):
    label: str | None = None
    data: JsonType | None = None
    dual: DualSpace | None = None


class DualSpace(BaseModel):
    label: str | None = None
    data: JsonType | None = None
    predual: Space | None = None


Folder.model_rebuild()
Space.model_rebuild()
