# 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 .food_conflict import FoodConflict
from .meal_timing import MealTiming


class FoodData(UniversalBaseModel):
    """
    Food-drug interaction data for a single drug
    """

    timing: typing.Optional[MealTiming] = None
    conflicts: typing.Optional[typing.List[FoodConflict]] = pydantic.Field(default=None)
    """
    Specific food-drug conflicts
    """

    conflict_count: typing.Optional[int] = pydantic.Field(default=None)
    """
    Total number of food conflicts (may exceed items in `conflicts` array)
    """

    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
