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

from ...core.pydantic_utilities import UniversalBaseModel
import typing
import pydantic
from ...generated_types.types.both_identifier_types import BothIdentifierTypes
from ...generated_types.types.country import Country
from ...generated_types.types.entities import Entities
from .profile_enum import ProfileEnum
from ...core.pydantic_utilities import IS_PYDANTIC_V2


class ResolutionBody(UniversalBaseModel):
    name: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Entity name
    """

    identifier: typing.Optional[typing.List[BothIdentifierTypes]] = pydantic.Field(default=None)
    """
    Entity identifier. Can be from either the [Identifier Type](/sayari-library/ontology/enumerated-types#identifier-type) or [Weak Identifier Type](/sayari-library/ontology/enumerated-types#weak-identifier-type) enums.
    """

    address: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Entity address
    """

    city: typing.Optional[str] = pydantic.Field(default=None)
    """
    Entity city that contains the provided city name.
    """

    state: typing.Optional[str] = pydantic.Field(default=None)
    """
    Entity state that contains the provided state name.
    """

    country: typing.Optional[typing.List[Country]] = pydantic.Field(default=None)
    """
    Entity country - must be ISO (3166) Trigram i.e., `USA`. See complete list [here](/sayari-library/ontology/enumerated-types#country)
    """

    date_of_birth: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Entity date of birth
    """

    contact: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Entity contact
    """

    type: typing.Optional[typing.List[Entities]] = pydantic.Field(default=None)
    """
    [Entity type](/sayari-library/ontology/entities). If multiple values are passed for any field, the endpoint will match entities with ANY of the values.
    """

    profile: typing.Optional[ProfileEnum] = pydantic.Field(default=None)
    """
    Profile can be used to switch between search algorithms. The default profile `corporate` is optimized for accurate entity attribute matching and is ideal for business verification and matching entities with corporate data. The `suppliers` profile is optimized for matching entities with extensive trade data. Ideal for supply chain and trade-related use cases.
    """

    name_min_percentage: typing.Optional[int] = pydantic.Field(default=None)
    """
    Adding this param enables an alternative matching logic. It will set a minimum percentage of tokens needed to match with user input to be considered a "hit". Accepts integers from 0 to 100 inclusive.
    """

    name_min_tokens: typing.Optional[int] = pydantic.Field(default=None)
    """
    Adding this param enables an alternative matching logic. It sets the minimum number of matching tokens the resolved hits need to have in common with the user input to be considered a "hit". Accepts non-negative integers.
    """

    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
