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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .alert import Alert
from .drug_safety_check_response_status import DrugSafetyCheckResponseStatus
from .meta import Meta
from .resolved_drug import ResolvedDrug
from .safety_data import SafetyData


class DrugSafetyCheckResponse(UniversalBaseModel):
    status: DrugSafetyCheckResponseStatus = pydantic.Field()
    """
    Always `"success"` for 200 responses
    """

    drugs: typing.List[ResolvedDrug] = pydantic.Field()
    """
    Successfully resolved drugs with full product details
    """

    unresolved: typing.List[str] = pydantic.Field()
    """
    Drug names that could not be resolved to a SafeRx product.
    These are not errors — they simply did not match any product
    with sufficient confidence.
    """

    safety: SafetyData
    alerts: typing.List[Alert] = pydantic.Field()
    """
    High-severity safety issues bubbled up from all domains, sorted
    by severity (CRITICAL first). Use this array for quick triage —
    it contains the most actionable items from the full safety data.
    """

    meta: Meta

    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
