# 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[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)
    """
    Specifies the search algorithm to use. `corporate` (default) is optimized for accurate entity attribute matching, ideal for business verification. `suppliers` is tailored for matching entities with trade data, suitable for supply chain use cases. `search` mimics /search/entity behavior, best for name-only matches.
    """

    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.
    """

    minimum_score_threshold: typing.Optional[int] = pydantic.Field(default=None)
    """
    Specifies the minimum score required to pass, which controls the strictness of the matching threshold. The default value is 77, and tuned for general use-case accuracy. Increase the value for stricter matching, reduce to loosen.
    """

    search_fallback: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Enables a name search fallback when either the corporate or supplier profiles fails to find a match. When invoked, the fallback will make a call similar to /search/entity on name only. By default set to false.
    """

    cutoff_threshold: typing.Optional[int] = pydantic.Field(default=None)
    """
    Specifies the window of similar results returned in the match group. Increase for fewer multiple matches, decrease to open the aperture and allow for more matches. Default is .8
    """

    skip_post_process: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Bypasses the post-processing setps and re-ranking. Useful for debugging. By default set to false, set to true to enable.
    """

    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
