# generated by datamodel-codegen:
#   filename:  default_factory_forward_nested_models.json

from __future__ import annotations

from pydantic import BaseModel, Field


class Existing(BaseModel):
    value: str | None = None


class Node(BaseModel):
    child: Node | None = None


class Model(BaseModel):
    existing: Existing | None = Field(default_factory=Existing)
    cycle: CycleA | None = Field(default_factory=lambda: CycleA())
    node: Node | None = Field(default_factory=Node)


class CycleA(BaseModel):
    b: CycleB | None = None


class CycleB(BaseModel):
    a: CycleA | None = None


Node.model_rebuild()
Model.model_rebuild()
CycleA.model_rebuild()
