# 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 import ConfigDict, Field

from oold.model import LinkedBaseModel


class Bar2(LinkedBaseModel):
    model_config = ConfigDict(
        json_schema_extra={"title": "Bar2"},
    )
    id: Optional[str] = None
    type: Optional[List[str]] = ["Bar2"]
    prop1: Optional[str] = None


class Bar(Bar2):
    model_config = ConfigDict(
        json_schema_extra={"title": "Bar"},
    )
    type: Optional[List[str]] = ["Bar"]
    prop2: Optional[str] = None


class Foo(LinkedBaseModel):
    model_config = ConfigDict(
        json_schema_extra={"title": "Foo"},
    )
    id: str
    type: Optional[List[str]] = ["Foo"]
    literal: Optional[str] = None
    b: Optional[Bar] = Field(
        None, json_schema_extra={"range": "Bar.json", "x-oold-required-iri": True}
    )
    b_default: Optional[Bar] = Field(
        default_factory=lambda: Bar.model_validate("ex:b"),
        json_schema_extra={"range": "Bar.json"},
    )
    b_set_later: Optional[Bar] = Field(None, json_schema_extra={"range": "Bar.json"})
    b2: Optional[List[Bar]] = Field(None, json_schema_extra={"range": "Bar.json"})
