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

from ..core.unchecked_base_model import UncheckedBaseModel
import typing
from .catalog_item_food_and_beverage_details_dietary_preference_type import (
    CatalogItemFoodAndBeverageDetailsDietaryPreferenceType,
)
import pydantic
from .catalog_item_food_and_beverage_details_dietary_preference_standard_dietary_preference import (
    CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference,
)
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class CatalogItemFoodAndBeverageDetailsDietaryPreference(UncheckedBaseModel):
    """
    Dietary preferences that can be assigned to an `FOOD_AND_BEV` item and its ingredients.
    """

    type: typing.Optional[CatalogItemFoodAndBeverageDetailsDietaryPreferenceType] = pydantic.Field(default=None)
    """
    The dietary preference type. Supported values include `STANDARD` and `CUSTOM` as specified in `FoodAndBeverageDetails.DietaryPreferenceType`.
    See [DietaryPreferenceType](#type-dietarypreferencetype) for possible values
    """

    standard_name: typing.Optional[CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference] = (
        pydantic.Field(default=None)
    )
    """
    The name of the dietary preference from a standard pre-defined list. This should be null if it's a custom dietary preference.
    See [StandardDietaryPreference](#type-standarddietarypreference) for possible values
    """

    custom_name: typing.Optional[str] = pydantic.Field(default=None)
    """
    The name of a user-defined custom dietary preference. This should be null if it's a standard dietary preference.
    """

    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
