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

from ...core.pydantic_utilities import UniversalBaseModel
from .resolution_response_fields import ResolutionResponseFields
import typing
from .resolution_result import ResolutionResult
from ...core.pydantic_utilities import IS_PYDANTIC_V2
import pydantic


class ResolutionResponse(UniversalBaseModel):
    """
    Examples
    --------
    from sayari.resolution import (
        MatchExplanation,
        MatchStrength,
        ResolutionResponse,
        ResolutionResponseFields,
        ResolutionResult,
    )

    ResolutionResponse(
        fields=ResolutionResponseFields(
            name=["victoria beckham limited"],
        ),
        data=[
            ResolutionResult(
                profile="corporate",
                score=491.08936,
                entity_id="ds5rQ3rMIeoN3xZUzVyVNQ",
                label="VICTORIA BECKHAM",
                type="person",
                identifiers=[],
                addresses=[
                    "C/O LEE & THOMPSON LLP, 4 GEE'S COURT, ST-CHRISTOPHER'S PLACE"
                ],
                countries=["GBR", "MEX"],
                sources=["b9d809b02049993ba8dc2e4c5f7cceca"],
                typed_matched_queries=[
                    "name|0",
                    "name|100phrase|0",
                    "name|100match|0",
                    "looseName|0",
                ],
                matched_queries=["name"],
                highlight={"name": ["<em>VICTORIA</em> <em>BECKHAM</em>"]},
                explanation={
                    "name": [
                        MatchExplanation(
                            matched="<em>VICTORIA</em> <em>BECKHAM</em>",
                            uploaded="victoria beckham limited",
                            name_custom_tf_idf_score=0.5416772821044128,
                            high_quality_match_name=True,
                            is_deletion_recommended=False,
                            n_common_term_matches=1,
                            n_uncommon_term_matches=1,
                        )
                    ]
                },
                match_strength=MatchStrength(
                    value="weak",
                ),
            )
        ],
    )
    """

    fields: ResolutionResponseFields
    data: typing.List[ResolutionResult]

    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
