# generated by datamodel-codegen:
#   filename:  Foo.json
#   timestamp: 2025-06-16T05:00:41+00:00

from __future__ import annotations

from typing import List, Optional

from pydantic.v1 import Field

from oold.model.v1 import LinkedBaseModel


class Bar2(LinkedBaseModel):
    class Config:
        schema_extra = {"title": "Bar2"}

    id: Optional[str] = None
    type: Optional[List[str]] = ["Bar2"]
    prop1: Optional[str] = None


class Bar(Bar2):
    class Config:
        schema_extra = {"title": "Bar"}

    type: Optional[List[str]] = ["Bar"]
    prop2: Optional[str] = None


class Foo(LinkedBaseModel):
    class Config:
        schema_extra = {"title": "Foo"}

    id: str
    type: Optional[List[str]] = ["Foo"]
    literal: Optional[str] = None
    b: Optional[Bar] = Field(None, range="Bar.json", x_oold_required_iri=True)
    b_default: Optional[Bar] = Field(
        default_factory=lambda: Bar.parse_obj("ex:b"), range="Bar.json"
    )
    b_set_later: Optional[Bar] = Field(None, range="Bar.json")
    b2: Optional[List[Bar]] = Field(None, range="Bar.json")
