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

from ...core.pydantic_utilities import UniversalBaseModel
from .ontology_relationships_filters import OntologyRelationshipsFilters
import typing
from .ontology_relationship import OntologyRelationship
from ...core.pydantic_utilities import IS_PYDANTIC_V2
import pydantic


class GetOntologyRelationshipsResponse(UniversalBaseModel):
    """
    Examples
    --------
    from sayari.ontology import (
        GetOntologyRelationshipsResponse,
        OntologyRelationship,
        OntologyRelationshipBetween,
        OntologyRelationshipsFilters,
    )

    GetOntologyRelationshipsResponse(
        filters=OntologyRelationshipsFilters(
            id=["auditor_of"],
        ),
        data=[
            OntologyRelationship(
                id="auditor_of",
                label="Auditor Of",
                description="Companies audited by this entity",
                comment="The source entity is reported to be the auditor of a company",
                type="forward",
                inverse="has_auditor",
                between=[
                    OntologyRelationshipBetween(
                        from_="person",
                        to="company",
                    ),
                    OntologyRelationshipBetween(
                        from_="company",
                        to="company",
                    ),
                ],
                attributes=["additional_information", "position"],
            )
        ],
        total_count=1234,
    )
    """

    filters: OntologyRelationshipsFilters
    data: typing.List[OntologyRelationship]
    total_count: int

    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
