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

from ...core.pydantic_utilities import UniversalBaseModel
from .get_ontology_response_data import GetOntologyResponseData
from ...core.pydantic_utilities import IS_PYDANTIC_V2
import typing
import pydantic


class GetOntologyResponse(UniversalBaseModel):
    """
    Examples
    --------
    import datetime

    from sayari.ontology import (
        GetOntologyResponse,
        GetOntologyResponseData,
        OntologyAttribute,
        OntologyAttributeField,
        OntologyCountry,
        OntologyCurrency,
        OntologyEntityType,
        OntologyEnum,
        OntologyEnumSymbol,
        OntologyIdentifier,
        OntologyLanguage,
        OntologyRegion,
        OntologyRelationship,
        OntologyRelationshipBetween,
        OntologyRiskFactor,
        OntologySource,
        OntologySourceType,
    )

    GetOntologyResponse(
        data=GetOntologyResponseData(
            attributes=[
                OntologyAttribute(
                    id="additional_information",
                    label="Additional Information",
                    comment="This is a generic attribute used to hold miscellaneous information not covered by any other attribute.",
                    fields=[
                        OntologyAttributeField(
                            id="value",
                            label="Value",
                            comment="The additional information itself",
                            type=["null", "string"],
                        )
                    ],
                )
            ],
            countries=[
                OntologyCountry(
                    id="USA",
                    label="United States",
                    code=13988,
                )
            ],
            currencies=[
                OntologyCurrency(
                    id="USD",
                    label="US Dollar/840/2",
                )
            ],
            entity_types=[
                OntologyEntityType(
                    id="aircraft",
                    label="Aircraft",
                    comment="An airplane, helicopter, or other vehicle that travels by flight",
                    attribute=[
                        "additional_information",
                        "address",
                        "country",
                        "identifier",
                        "measurement",
                        "monetary_value",
                        "name",
                        "risk_intelligence",
                        "weak_identifier",
                    ],
                    relationship=[
                        "generic",
                        "has_owner",
                        "linked_to",
                        "possibly_same_as",
                    ],
                    field=[
                        "additional_information",
                        "address",
                        "country",
                        "generic",
                        "has_owner",
                        "identifier",
                        "linked_to",
                        "measurement",
                        "monetary_value",
                        "name",
                        "possibly_same_as",
                        "risk_intelligence",
                        "weak_identifier",
                    ],
                )
            ],
            enums=[
                OntologyEnum(
                    id="address_type",
                    label="Address Type",
                    comment="This enumerated type indicates the kind of location an address is referring to.",
                    symbols=[
                        OntologyEnumSymbol(
                            id="arrival",
                            label="Arrival",
                            comment="This enumerated type indicates the kind of location an address is referring to.",
                        )
                    ],
                )
            ],
            identifiers=[
                OntologyIdentifier(
                    id="aer_free_zone_license",
                    label="UAE DAFZ Primary License Number",
                    comment="Primary license number of free zone establishment in Dubai",
                    regex="^\\d+$",
                )
            ],
            languages=[
                OntologyLanguage(
                    id="en",
                    label="English",
                )
            ],
            regions=[
                OntologyRegion(
                    id="usa_&_canada",
                    label="Usa & Canada",
                )
            ],
            relationships=[
                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"],
                )
            ],
            risk_factors=[
                OntologyRiskFactor(
                    id="psa_owner_of_ofac_fto_sanctioned",
                    categories=["sanctions"],
                    label="Owner of Foreign Terrorist Organisation (May Include 'PSA' Path)",
                    description="This entity possibly owns (minority, majority, or wholly) a Foreign Terrorist Organization up to 3 hops away via direct shareholding relationships with 10% or more controlling interest, including beneficial owner, owner, shareholder, partner, subsidiary, or branch. Applicable to entities globally. This network risk path may include ‘Possibly the Same As’ (PSA) relationships—links between companies or persons that have closely matching attributes across datasets, but do not have enough shared information to definitively establish they are the same entity.",
                    doc="This entity possibly owns (minority, majority, or wholly) a Foreign Terrorist Organization up to 3 hops away via direct shareholding relationships with 10% or more controlling interest, including beneficial owner, owner, shareholder, partner, subsidiary, or branch. Applicable to entities globally. This network risk path may include ‘Possibly the Same As’ (PSA) relationships—links between companies or persons that have closely matching attributes across datasets, but do not have enough shared information to definitively establish they are the same entity.",
                    code=1168016564,
                    level="high",
                    risk_type="network",
                    risk_viz="network",
                    visible=True,
                    enabled=True,
                    type="integer",
                    tg=True,
                    do_not_render_metadata=["traversal_path"],
                )
            ],
            sources=[
                OntologySource(
                    id="e85d865943ee6d8369307569d2ad9de0",
                    label="Acuris Risk Intelligence Adverse Media Data",
                    description="Contains PDFs and URLs to adverse media reporting for PEPs, SOEs, sanctioned entities, and entities linked to financial regulatory and law enforcement actions. Available for millions of entities from 'Acuris Risk Intelligence KYC6 (3rd Party Data)' in 'Records' section.",
                    country="XXX",
                    region="international_(multi-region_coverage)",
                    date_added=datetime.date.fromisoformat(
                        "2022-04-11",
                    ),
                    source_type="adverse_media_/_negative_news_data",
                    record_type="adverse_media_record",
                    structure="unstructured",
                    source_url="https://www.acurisriskintelligence.com/",
                    pep=False,
                    watchlist=False,
                )
            ],
            source_types=[
                OntologySourceType(
                    id="adverse_media_/_negative_news_data",
                    label="Adverse Media / Negative News Data",
                )
            ],
        ),
    )
    """

    data: GetOntologyResponseData

    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
