# This file was auto-generated by Fern from our API Definition.

from __future__ import annotations
from ...core.pydantic_utilities import UniversalBaseModel
import typing
from ...generated_types.types.relationships import Relationships
from .relationship_info import RelationshipInfo
import pydantic
from ...core.pydantic_utilities import IS_PYDANTIC_V2
from ...core.pydantic_utilities import update_forward_refs


class RelationshipData(UniversalBaseModel):
    target: "EntityDetails"
    types: typing.Dict[Relationships, typing.List[RelationshipInfo]] = pydantic.Field()
    """
    Additional information for each [relationship type](/sayari-library/ontology/relationships).
    """

    dates: typing.List[str]
    first_observed: typing.Optional[str] = None
    former: typing.Optional[bool] = None
    last_observed: typing.Optional[str] = None
    start_date: typing.Optional[str] = None
    end_date: typing.Optional[str] = None

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow


from .entity_details import EntityDetails  # noqa: E402
from .entity_relationships import EntityRelationships  # noqa: E402

update_forward_refs(EntityDetails, RelationshipData=RelationshipData)
update_forward_refs(EntityRelationships, RelationshipData=RelationshipData)
update_forward_refs(RelationshipData)
