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

import typing

import pydantic
from ........core.pydantic_utilities import IS_PYDANTIC_V2
from .....common.types.base_model import BaseModel
from .....common.types.coverage_id import CoverageId
from .eligibility_recommendation_patient_info import EligibilityRecommendationPatientInfo
from .eligibility_recommendation_payload import EligibilityRecommendationPayload
from .vote import Vote


class EligibilityRecommendation(BaseModel):
    """
    An eligibility recommendation object that contains an EligibilityRecommendationType and a payload of data denoting the recommendation.
    """

    id: str = pydantic.Field()
    """
    The unique UUID identifier for an EligibilityRecommendation.
    """

    eligibility_check_id: str
    recommendation: EligibilityRecommendationPayload
    coverage_id: typing.Optional[CoverageId] = None
    patient: EligibilityRecommendationPatientInfo
    votes: typing.Optional[typing.List[Vote]] = pydantic.Field(default=None)
    """
    Array of votes for this recommendation
    """

    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
